bullet_train 1.4.5 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1996b94dbb7fda2db6472e01a23499b91947f4b3faf3a97ac1b5b20630505e3a
4
- data.tar.gz: 608ea60207cb19ff2c4b73d8b9129ed5d1e3fe2a0190645754b55372132f1c72
3
+ metadata.gz: b37d49a851243ce6ee4762eb3939db28bbe9566fc7897f3dde6f46639d41cf6b
4
+ data.tar.gz: 54e743ef8e8859657bd43e0294c96d7c9f9b91eae5b08f49e7f3c5350d189ca4
5
5
  SHA512:
6
- metadata.gz: be8f7010714d24a73dd42ef91530e2d61f20b520bc39ca1444d5cf6881df10869d1836823e2dab378b0b8d12e0bb6a00be201db9c896ddd6242bc067e2522713
7
- data.tar.gz: 3907fad30d953b8f7e693ec1f3e2bf56917de2fcf0bcbb5e8d8306bdeb7664663408bf013158670f8e55da0428a2313a680446e888cc097b622552ccedfc4865
6
+ metadata.gz: 7a694f756dcb9f8defd2f3a731ac981328f22e793937b68b5117600c83f880d60e9fb092714de7da50da03cf9167e11ad4c25ada0776062b165e6976b087a7ea
7
+ data.tar.gz: 38ebed0df0636b49bda73a1d5d11a2f5edf2db7e01a4e9a16882a7efbc4bdee1fbc139bcb4cd7a1f4533ea5d5b55d3f299ac892d35b6f80288186f77d44e65dd
@@ -110,13 +110,20 @@ module Account::Teams::ControllerBase
110
110
 
111
111
  # # DELETE /teams/1
112
112
  # # DELETE /teams/1.json
113
- # def destroy
114
- # @team.destroy
115
- # respond_to do |format|
116
- # format.html { redirect_to account_teams_url, notice: 'Team was successfully destroyed.' }
117
- # format.json { head :no_content }
118
- # end
119
- # end
113
+ def destroy
114
+ if current_user.teams.size == 1
115
+ respond_to do |format|
116
+ format.html { redirect_to edit_account_team_url(@team), alert: t("account.teams.notifications.cannot_delete_last_team") }
117
+ format.json { head :no_content }
118
+ end
119
+ else
120
+ @team.destroy
121
+ respond_to do |format|
122
+ format.html { redirect_to account_teams_url, notice: t("account.teams.notifications.destroyed") }
123
+ format.json { head :no_content }
124
+ end
125
+ end
126
+ end
120
127
 
121
128
  private
122
129
 
@@ -23,7 +23,7 @@
23
23
  <% Membership.assignable_roles.each do |role| %>
24
24
  <% if current_membership.can_manage_role?(role) %>
25
25
  <div class="flex items-top">
26
- <%= fields.check_box :role_ids, {multiple: true, class: "h-4 w-4 text-blue focus:ring-blue-dark border-slate-300 rounded mt-0.5"}, role.id, nil %>
26
+ <%= fields.check_box :role_ids, {multiple: true, class: "h-4 w-4 text-primary-500 focus:ring-primary-500 border-slate-300 rounded mt-0.5"}, role.id, nil %>
27
27
  <label for="invitation_membership_attributes_role_ids_<%= role.id %>" class="ml-2 block select-none">
28
28
  <span><%= t('invitations.form.invite_as', role_key: t("memberships.fields.role_ids.options.#{role.key}.label")) %></span>
29
29
  <div class="mt-0.5 text-slate-400 font-light leading-normal">
@@ -24,7 +24,7 @@
24
24
  <% Membership.assignable_roles.each do |role| %>
25
25
  <% if role.manageable_by?(current_membership.roles) %>
26
26
  <div class="flex items-top">
27
- <%= form.check_box :role_ids, {multiple: true, class: "h-4 w-4 text-blue focus:ring-blue-800 border-slate-300 rounded mt-0.5"}, role.id, nil %>
27
+ <%= form.check_box :role_ids, {multiple: true, class: "h-4 w-4 text-primary-500 focus:ring-primary-500 border-slate-300 rounded mt-0.5"}, role.id, nil %>
28
28
  <label for="membership_role_ids_<%= role.id %>" class="ml-2 block select-none">
29
29
  <%= t('.grant_privileges_of', role_key: t(".fields.role_ids.options.#{role.key}.label")) %>
30
30
  <div class="mt-0.5 text-slate-400 font-light leading-normal">
@@ -17,6 +17,9 @@
17
17
 
18
18
  <div class="buttons">
19
19
  <%= form.submit (form.object.persisted? ? t('.buttons.update') : t('.buttons.create')), class: "button" %>
20
+ <% if controller.action_name == "edit" %>
21
+ <%= link_to t('account.teams.buttons.destroy'), [:account, team], method: :delete, data: { confirm: t('account.teams.buttons.confirmations.destroy') } %>
22
+ <% end %>
20
23
  <%= link_to t('global.buttons.cancel'), form.object.persisted? ? [:account, team] : [:account, :teams], class: "button-secondary" %>
21
24
  </div>
22
25
  <% end %>
@@ -13,6 +13,9 @@ en:
13
13
  create: Create Team
14
14
  edit: Edit Team
15
15
  update: Update Team
16
+ destroy: Delete Team
17
+ confirmations:
18
+ destroy: Are you sure you want to delete this team?
16
19
  index:
17
20
  section: Teams
18
21
  header: Your Teams
@@ -40,7 +43,9 @@ en:
40
43
  notifications:
41
44
  created: Team was successfully created.
42
45
  updated: Team was successfully updated.
46
+ destroyed: Team was successfully destroyed.
43
47
  invitation_only: Creating new teams is currently limited to users who have been invited for early access. If you've received an early access URL, please visit it before trying again.
48
+ cannot_delete_last_team: You cannot delete the last team you belong to.
44
49
  form:
45
50
  buttons: *buttons
46
51
  fields: &fields
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.4.5"
2
+ VERSION = "1.4.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-20 00:00:00.000000000 Z
11
+ date: 2023-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard