simple_teams 0.1.3 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +62 -7
- data/app/controllers/simple_teams/accept_invitations_controller.rb +4 -5
- data/app/controllers/simple_teams/application_controller.rb +1 -8
- data/app/controllers/simple_teams/base_controller.rb +12 -0
- data/app/controllers/simple_teams/invitations_controller.rb +2 -2
- data/app/controllers/simple_teams/leave_teams_controller.rb +2 -2
- data/app/controllers/simple_teams/memberships_controller.rb +2 -2
- data/app/controllers/simple_teams/related_members_controller.rb +1 -1
- data/app/controllers/simple_teams/teams_controller.rb +1 -1
- data/app/forms/application_form.rb +3 -0
- data/app/forms/simple_teams/invitation_forms/create.rb +1 -1
- data/app/forms/simple_teams/invitation_forms/create_bulk.rb +1 -1
- data/app/forms/simple_teams/invitation_forms/update.rb +1 -1
- data/app/forms/simple_teams/membership_form.rb +1 -1
- data/app/helpers/simple_teams/base_helper.rb +11 -0
- data/app/helpers/simple_teams/teams_helper.rb +7 -0
- data/app/mailers/simple_teams/application_mailer.rb +1 -1
- data/app/models/concerns/simple_teams/member_object.rb +1 -0
- data/app/models/simple_teams/ability.rb +2 -2
- data/app/notifiers/concerns/simple_teams/invitation_notifier.rb +59 -0
- data/app/notifiers/concerns/simple_teams/membership_notifier.rb +63 -0
- data/app/notifiers/simple_teams/application_notifier.rb +6 -0
- data/app/notifiers/simple_teams/bulk_invitations_notifier.rb +52 -0
- data/app/notifiers/simple_teams/invitations/accepted_notifier.rb +16 -0
- data/app/notifiers/simple_teams/invitations/created_notifier.rb +16 -0
- data/app/notifiers/simple_teams/invitations/destroyed_notifier.rb +16 -0
- data/app/notifiers/simple_teams/invitations/updated_notifier.rb +16 -0
- data/app/notifiers/simple_teams/memberships/destroyed_notifier.rb +16 -0
- data/app/notifiers/simple_teams/memberships/left_notifier.rb +20 -0
- data/app/notifiers/simple_teams/memberships/updated_notifier.rb +20 -0
- data/app/service_objects/simple_teams/accept_invitation_service.rb +1 -1
- data/app/service_objects/simple_teams/leave_team_service.rb +1 -1
- data/app/views/simple_teams/_nested_action_breadcrumb.html.erb +8 -0
- data/app/views/simple_teams/_roles_field.html.erb +2 -2
- data/app/views/simple_teams/invitations/_invitation.html.erb +1 -1
- data/app/views/simple_teams/invitations/edit.html.erb +1 -6
- data/app/views/simple_teams/invitations/new.html.erb +1 -6
- data/app/views/simple_teams/memberships/_membership.html.erb +1 -1
- data/app/views/simple_teams/memberships/edit.html.erb +1 -6
- data/app/views/simple_teams/teams/_add_member_link.html.erb +1 -1
- data/app/views/simple_teams/teams/_dropdown_menu.html.erb +13 -0
- data/app/views/simple_teams/teams/_index_breadcrumb.html.erb +7 -0
- data/app/views/simple_teams/teams/_members_table.html.erb +1 -1
- data/app/views/simple_teams/teams/show.html.erb +6 -33
- data/config/locales/simple_teams.en.yml +18 -3
- data/config/routes.rb +2 -2
- data/lib/simple_teams/engine.rb +5 -0
- data/lib/simple_teams/version.rb +1 -1
- metadata +79 -38
- data/app/controllers/simple_teams/admin/invitations_controller.rb +0 -60
- data/app/controllers/simple_teams/admin/memberships_controller.rb +0 -60
- data/app/controllers/simple_teams/admin/teams_controller.rb +0 -60
- data/app/notifications/application_notification.rb +0 -4
- data/app/notifications/simple_teams/bulk_invitations_notification.rb +0 -51
- data/app/notifications/simple_teams/invitation_notification.rb +0 -54
- data/app/notifications/simple_teams/invitations/accepted_notification.rb +0 -13
- data/app/notifications/simple_teams/invitations/created_notification.rb +0 -13
- data/app/notifications/simple_teams/invitations/destroyed_notification.rb +0 -13
- data/app/notifications/simple_teams/invitations/updated_notification.rb +0 -13
- data/app/notifications/simple_teams/membership_notification.rb +0 -58
- data/app/notifications/simple_teams/memberships/destroyed_notification.rb +0 -13
- data/app/notifications/simple_teams/memberships/left_notification.rb +0 -17
- data/app/notifications/simple_teams/memberships/updated_notification.rb +0 -17
- data/app/views/simple_teams/admin/invitations/_form.html.erb +0 -62
- data/app/views/simple_teams/admin/invitations/_invitation.html.erb +0 -47
- data/app/views/simple_teams/admin/invitations/edit.html.erb +0 -10
- data/app/views/simple_teams/admin/invitations/index.html.erb +0 -14
- data/app/views/simple_teams/admin/invitations/new.html.erb +0 -9
- data/app/views/simple_teams/admin/invitations/show.html.erb +0 -10
- data/app/views/simple_teams/admin/memberships/_form.html.erb +0 -32
- data/app/views/simple_teams/admin/memberships/_membership.html.erb +0 -17
- data/app/views/simple_teams/admin/memberships/edit.html.erb +0 -10
- data/app/views/simple_teams/admin/memberships/index.html.erb +0 -14
- data/app/views/simple_teams/admin/memberships/new.html.erb +0 -9
- data/app/views/simple_teams/admin/memberships/show.html.erb +0 -10
- data/app/views/simple_teams/admin/teams/_form.html.erb +0 -22
- data/app/views/simple_teams/admin/teams/_team.html.erb +0 -7
- data/app/views/simple_teams/admin/teams/edit.html.erb +0 -10
- data/app/views/simple_teams/admin/teams/index.html.erb +0 -14
- data/app/views/simple_teams/admin/teams/new.html.erb +0 -9
- data/app/views/simple_teams/admin/teams/show.html.erb +0 -10
@@ -7,8 +7,8 @@
|
|
7
7
|
<%= radio_button_tag "#{prefix}[role]", name, [name].include?(f.object.role), :class => "form-check-input" %>
|
8
8
|
<%= label_tag "#{prefix}_role_#{name}", :class => "form-check-label w-100" do %>
|
9
9
|
<div class="">
|
10
|
-
<div class="col"><b><%= name
|
11
|
-
<div class="col"><%=
|
10
|
+
<div class="col"><b><%= team_based_role_name(@team, name) %></b></div>
|
11
|
+
<div class="col"><%= team_based_role_description(@team, name) %></div>
|
12
12
|
</div>
|
13
13
|
<% end %>
|
14
14
|
</div>
|
@@ -1,10 +1,5 @@
|
|
1
1
|
<div class="centered-content-template">
|
2
|
-
|
3
|
-
<ol class="breadcrumb">
|
4
|
-
<li class="breadcrumb-item"><a href="<%= team_path(@team) %>"><%= @team.name %></a></li>
|
5
|
-
<li class="breadcrumb-item active" aria-current="page">Update Invitation</li>
|
6
|
-
</ol>
|
7
|
-
</nav>
|
2
|
+
<%= render "simple_teams/nested_action_breadcrumb", :current_page_name => "Update Invitation" %>
|
8
3
|
|
9
4
|
<h1>Update Invitation</h1>
|
10
5
|
|
@@ -1,10 +1,5 @@
|
|
1
1
|
<div class="centered-content-template">
|
2
|
-
|
3
|
-
<ol class="breadcrumb">
|
4
|
-
<li class="breadcrumb-item"><a href="<%= team_path(@team) %>"><%= @team.name %></a></li>
|
5
|
-
<li class="breadcrumb-item active" aria-current="page">Invite User</li>
|
6
|
-
</ol>
|
7
|
-
</nav>
|
2
|
+
<%= render "simple_teams/nested_action_breadcrumb", :current_page_name => "Invite Users" %>
|
8
3
|
|
9
4
|
<h1>Invite Users</h1>
|
10
5
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<tr id="<%= dom_id membership %>">
|
2
2
|
<td><%= membership.member.full_name %><%= " (you)" if current_user.membership_for_team(team) == membership %></td>
|
3
|
-
<td><%= membership.role
|
3
|
+
<td><%= team_based_role_name(team, membership.role) %></td>
|
4
4
|
<td>Active</td>
|
5
5
|
<td><%= membership.created_at.to_date %></td>
|
6
6
|
<td>
|
@@ -1,10 +1,5 @@
|
|
1
1
|
<div class="centered-content-template">
|
2
|
-
|
3
|
-
<ol class="breadcrumb">
|
4
|
-
<li class="breadcrumb-item"><a href="<%= team_path(@team) %>"><%= @team.name %></a></li>
|
5
|
-
<li class="breadcrumb-item active" aria-current="page">Edit Member</li>
|
6
|
-
</ol>
|
7
|
-
</nav>
|
2
|
+
<%= render "simple_teams/nested_action_breadcrumb", :current_page_name => "Edit Member" %>
|
8
3
|
|
9
4
|
<h1>Edit Member: <%= @membership.member.full_name %></h1>
|
10
5
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<div class="dropdown mt-2">
|
2
|
+
<button class="btn btn-outline-dark btn-sm dropdown-toggle" type="button" id="<%= @team.id %>-dropdown-menu" data-bs-toggle="dropdown" aria-expanded="false">
|
3
|
+
Actions
|
4
|
+
</button>
|
5
|
+
<ul class="dropdown-menu" aria-labelledby="<%= @team.id %>-dropdown-menu">
|
6
|
+
<%= link_to "Invite Users", new_team_invitation_path(@team), :class => "dropdown-item" %>
|
7
|
+
|
8
|
+
<% if current_user.membership_for_team(@team).present? %>
|
9
|
+
<li><hr class="dropdown-divider"></li>
|
10
|
+
<%= button_to "Leave", team_leave_team_path(@team), :method => :delete, :class => "btn btn-link dropdown-item", :form => { :data => { "turbo-confirm" => "Are you sure you want to leave this #{ @team.teamable.class.model_name.human }?" } } %>
|
11
|
+
<% end %>
|
12
|
+
</ul>
|
13
|
+
</div>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<nav aria-label="breadcrumb">
|
2
|
+
<ol class="breadcrumb">
|
3
|
+
<li class="breadcrumb-item"><%= link_to @team.teamable.class.model_name.human(count: 2), main_app.url_for(@team.teamable.class) %></li>
|
4
|
+
<li class="breadcrumb-item"><%= link_to @team.teamable.name, main_app.url_for(@team.teamable) %></li>
|
5
|
+
<li class="breadcrumb-item active" aria-current="page">Team Members</li>
|
6
|
+
</ol>
|
7
|
+
</nav>
|
@@ -1,38 +1,11 @@
|
|
1
|
-
|
2
|
-
<ol class="breadcrumb">
|
3
|
-
<li class="breadcrumb-item"><%= link_to "Teams", teams_path %></li>
|
4
|
-
<li class="breadcrumb-item active" aria-current="page"><%= @team.name %></li>
|
5
|
-
</ol>
|
6
|
-
</nav>
|
1
|
+
<%= render "index_breadcrumb" %>
|
7
2
|
|
8
|
-
<div class="heading-with-dropdown-menu">
|
9
|
-
<h1><%= @team.name
|
3
|
+
<div class="heading-with-dropdown-menu d-flex justify-content-between">
|
4
|
+
<h1><%= @team.name %>: Team Members</h1>
|
10
5
|
|
11
|
-
|
12
|
-
<% if can? :update, @team %>
|
13
|
-
<button class="btn btn-outline-dark btn-sm dropdown-toggle" type="button" id="<%= @team.id %>-dropdown-menu" data-bs-toggle="dropdown" aria-expanded="false">
|
14
|
-
Actions
|
15
|
-
</button>
|
16
|
-
<ul class="dropdown-menu" aria-labelledby="<%= @team.id %>-dropdown-menu">
|
17
|
-
<%= link_to "Invite User", new_team_invitation_path(@team), :class => "dropdown-item" %>
|
18
|
-
|
19
|
-
<li><hr class="dropdown-divider"></li>
|
20
|
-
<%= link_to "Edit", edit_team_path(@team), :class => "dropdown-item" %>
|
21
|
-
|
22
|
-
<% if current_user.membership_for_team(@team).present? %>
|
23
|
-
<li><hr class="dropdown-divider"></li>
|
24
|
-
<%= button_to "Leave", team_leave_team_path(@team), :method => :delete, :class => "btn btn-link dropdown-item", :form => { :data => { "turbo-confirm" => "Are you sure you want to leave this #{ @team.teamable.class.model_name.human }?" } } %>
|
25
|
-
<% end %>
|
26
|
-
|
27
|
-
<% if can? :destroy, @team %>
|
28
|
-
<li><hr class="dropdown-divider"></li>
|
29
|
-
<%= button_to "Delete", team_path(@team), :method => :delete, :class => "btn btn-link dropdown-item", :form => { :data => { "turbo-confirm" => "Are you sure you want to delete this #{ @team.teamable.class.model_name.human }?" } } %>
|
30
|
-
<% end %>
|
31
|
-
</ul>
|
32
|
-
<% end %>
|
33
|
-
</div>
|
6
|
+
<%= render "dropdown_menu" %>
|
34
7
|
</div>
|
35
8
|
|
36
|
-
<h2 class="mt-5">Members</h2>
|
37
|
-
|
38
9
|
<%= render "members_table" %>
|
10
|
+
|
11
|
+
<%= render "add_member_link" %>
|
@@ -1,9 +1,24 @@
|
|
1
1
|
en:
|
2
2
|
simple_teams:
|
3
3
|
roles:
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
names:
|
5
|
+
member: "Member"
|
6
|
+
administrator: "Administrator"
|
7
|
+
owner: "Owner"
|
8
|
+
descriptions:
|
9
|
+
member: "Can view content"
|
10
|
+
administrator: "Can create and delete content, and invite and remove other members"
|
11
|
+
owner: "Same as administrator, but cannot be removed except by another owner"
|
12
|
+
organizations:
|
13
|
+
roles:
|
14
|
+
names:
|
15
|
+
member: "Member A"
|
16
|
+
administrator: "Member B"
|
17
|
+
owner: "Member C"
|
18
|
+
descriptions:
|
19
|
+
member: "Description A"
|
20
|
+
administrator: "Description B"
|
21
|
+
owner: "Description C"
|
7
22
|
simple_form:
|
8
23
|
labels:
|
9
24
|
invitation_forms_create_combo:
|
data/config/routes.rb
CHANGED
@@ -15,7 +15,7 @@ SimpleTeams::Engine.routes.draw do
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# Team Invitations
|
18
|
-
get "accept_team_invitation/:id", :as => "accept_team_invitation", to: "
|
19
|
-
post "accept_team_invitation/:id", to: "
|
18
|
+
get "accept_team_invitation/:id", :as => "accept_team_invitation", to: "accept_invitations#new"
|
19
|
+
post "accept_team_invitation/:id", to: "accept_invitations#create"
|
20
20
|
|
21
21
|
end
|
data/lib/simple_teams/engine.rb
CHANGED
@@ -7,6 +7,7 @@ module SimpleTeams
|
|
7
7
|
mattr_accessor :parent_controller
|
8
8
|
mattr_accessor :layout
|
9
9
|
mattr_accessor :roles
|
10
|
+
mattr_accessor :from_address
|
10
11
|
|
11
12
|
def self.member_class
|
12
13
|
(@@member_class || "User").constantize
|
@@ -24,4 +25,8 @@ module SimpleTeams
|
|
24
25
|
(@@roles || [:member, :administrator, :owner])
|
25
26
|
end
|
26
27
|
|
28
|
+
def self.from_address
|
29
|
+
(@@from_address || "please-change-me@example.com")
|
30
|
+
end
|
31
|
+
|
27
32
|
end
|
data/lib/simple_teams/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_teams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Laney Stroup
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -24,6 +24,62 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 7.0.7.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: devise
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.8.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.8.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: cancancan
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.5.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.5.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: noticed
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.4.1
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.4.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simple_form
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 5.1.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 5.1.0
|
27
83
|
description: SimpleTeams is an all-in-one solution for implementing teams quickly
|
28
84
|
in a Ruby on Rails (RoR) application. It follows best practices, using the Rails
|
29
85
|
Engine design pattern for easy configurability, CanCan for authorization, and polymorphic
|
@@ -40,15 +96,14 @@ files:
|
|
40
96
|
- app/assets/config/simple_teams_manifest.js
|
41
97
|
- app/assets/stylesheets/simple_teams/application.css
|
42
98
|
- app/controllers/simple_teams/accept_invitations_controller.rb
|
43
|
-
- app/controllers/simple_teams/admin/invitations_controller.rb
|
44
|
-
- app/controllers/simple_teams/admin/memberships_controller.rb
|
45
|
-
- app/controllers/simple_teams/admin/teams_controller.rb
|
46
99
|
- app/controllers/simple_teams/application_controller.rb
|
100
|
+
- app/controllers/simple_teams/base_controller.rb
|
47
101
|
- app/controllers/simple_teams/invitations_controller.rb
|
48
102
|
- app/controllers/simple_teams/leave_teams_controller.rb
|
49
103
|
- app/controllers/simple_teams/memberships_controller.rb
|
50
104
|
- app/controllers/simple_teams/related_members_controller.rb
|
51
105
|
- app/controllers/simple_teams/teams_controller.rb
|
106
|
+
- app/forms/application_form.rb
|
52
107
|
- app/forms/simple_teams/invitation_form.rb
|
53
108
|
- app/forms/simple_teams/invitation_forms/create.rb
|
54
109
|
- app/forms/simple_teams/invitation_forms/create_bulk.rb
|
@@ -56,6 +111,7 @@ files:
|
|
56
111
|
- app/forms/simple_teams/invitation_forms/update.rb
|
57
112
|
- app/forms/simple_teams/membership_form.rb
|
58
113
|
- app/helpers/simple_teams/application_helper.rb
|
114
|
+
- app/helpers/simple_teams/base_helper.rb
|
59
115
|
- app/helpers/simple_teams/invitations_helper.rb
|
60
116
|
- app/helpers/simple_teams/memberships_helper.rb
|
61
117
|
- app/helpers/simple_teams/teams_helper.rb
|
@@ -69,42 +125,25 @@ files:
|
|
69
125
|
- app/models/simple_teams/invitation.rb
|
70
126
|
- app/models/simple_teams/membership.rb
|
71
127
|
- app/models/simple_teams/team.rb
|
72
|
-
- app/
|
73
|
-
- app/
|
74
|
-
- app/
|
75
|
-
- app/
|
76
|
-
- app/
|
77
|
-
- app/
|
78
|
-
- app/
|
79
|
-
- app/
|
80
|
-
- app/
|
81
|
-
- app/
|
82
|
-
- app/
|
128
|
+
- app/notifiers/concerns/simple_teams/invitation_notifier.rb
|
129
|
+
- app/notifiers/concerns/simple_teams/membership_notifier.rb
|
130
|
+
- app/notifiers/simple_teams/application_notifier.rb
|
131
|
+
- app/notifiers/simple_teams/bulk_invitations_notifier.rb
|
132
|
+
- app/notifiers/simple_teams/invitations/accepted_notifier.rb
|
133
|
+
- app/notifiers/simple_teams/invitations/created_notifier.rb
|
134
|
+
- app/notifiers/simple_teams/invitations/destroyed_notifier.rb
|
135
|
+
- app/notifiers/simple_teams/invitations/updated_notifier.rb
|
136
|
+
- app/notifiers/simple_teams/memberships/destroyed_notifier.rb
|
137
|
+
- app/notifiers/simple_teams/memberships/left_notifier.rb
|
138
|
+
- app/notifiers/simple_teams/memberships/updated_notifier.rb
|
83
139
|
- app/service_objects/simple_teams/accept_invitation_service.rb
|
84
140
|
- app/service_objects/simple_teams/initialize_team_service.rb
|
85
141
|
- app/service_objects/simple_teams/leave_team_service.rb
|
86
142
|
- app/views/layouts/simple_teams/application.html.erb
|
143
|
+
- app/views/simple_teams/_nested_action_breadcrumb.html.erb
|
87
144
|
- app/views/simple_teams/_roles_field.html.erb
|
88
145
|
- app/views/simple_teams/accept_invitations/invalid_token.html.erb
|
89
146
|
- app/views/simple_teams/accept_invitations/new.html.erb
|
90
|
-
- app/views/simple_teams/admin/invitations/_form.html.erb
|
91
|
-
- app/views/simple_teams/admin/invitations/_invitation.html.erb
|
92
|
-
- app/views/simple_teams/admin/invitations/edit.html.erb
|
93
|
-
- app/views/simple_teams/admin/invitations/index.html.erb
|
94
|
-
- app/views/simple_teams/admin/invitations/new.html.erb
|
95
|
-
- app/views/simple_teams/admin/invitations/show.html.erb
|
96
|
-
- app/views/simple_teams/admin/memberships/_form.html.erb
|
97
|
-
- app/views/simple_teams/admin/memberships/_membership.html.erb
|
98
|
-
- app/views/simple_teams/admin/memberships/edit.html.erb
|
99
|
-
- app/views/simple_teams/admin/memberships/index.html.erb
|
100
|
-
- app/views/simple_teams/admin/memberships/new.html.erb
|
101
|
-
- app/views/simple_teams/admin/memberships/show.html.erb
|
102
|
-
- app/views/simple_teams/admin/teams/_form.html.erb
|
103
|
-
- app/views/simple_teams/admin/teams/_team.html.erb
|
104
|
-
- app/views/simple_teams/admin/teams/edit.html.erb
|
105
|
-
- app/views/simple_teams/admin/teams/index.html.erb
|
106
|
-
- app/views/simple_teams/admin/teams/new.html.erb
|
107
|
-
- app/views/simple_teams/admin/teams/show.html.erb
|
108
147
|
- app/views/simple_teams/invitations/_bulk_form.html.erb
|
109
148
|
- app/views/simple_teams/invitations/_form.html.erb
|
110
149
|
- app/views/simple_teams/invitations/_invitation.html.erb
|
@@ -119,6 +158,8 @@ files:
|
|
119
158
|
- app/views/simple_teams/related_members/index.json.jbuilder
|
120
159
|
- app/views/simple_teams/related_members/select2.json.jbuilder
|
121
160
|
- app/views/simple_teams/teams/_add_member_link.html.erb
|
161
|
+
- app/views/simple_teams/teams/_dropdown_menu.html.erb
|
162
|
+
- app/views/simple_teams/teams/_index_breadcrumb.html.erb
|
122
163
|
- app/views/simple_teams/teams/_members_table.html.erb
|
123
164
|
- app/views/simple_teams/teams/show.html.erb
|
124
165
|
- config/locales/simple_teams.en.yml
|
@@ -138,7 +179,7 @@ metadata:
|
|
138
179
|
homepage_uri: https://github.com/strouptl/simple_teams
|
139
180
|
source_code_uri: https://github.com/strouptl/simple_teams
|
140
181
|
changelog_uri: https://github.com/strouptl/simple_teams/blob/main/CHANGELOG.md
|
141
|
-
post_install_message:
|
182
|
+
post_install_message:
|
142
183
|
rdoc_options: []
|
143
184
|
require_paths:
|
144
185
|
- lib
|
@@ -153,8 +194,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
194
|
- !ruby/object:Gem::Version
|
154
195
|
version: '0'
|
155
196
|
requirements: []
|
156
|
-
rubygems_version: 3.
|
157
|
-
signing_key:
|
197
|
+
rubygems_version: 3.5.11
|
198
|
+
signing_key:
|
158
199
|
specification_version: 4
|
159
200
|
summary: A simple gem for adding teams to a Ruby on Rails application
|
160
201
|
test_files: []
|
@@ -1,60 +0,0 @@
|
|
1
|
-
module SimpleTeams
|
2
|
-
class InvitationsController < ApplicationController
|
3
|
-
before_action :set_invitation, only: %i[ show edit update destroy ]
|
4
|
-
|
5
|
-
# GET /invitations
|
6
|
-
def index
|
7
|
-
@invitations = Invitation.all
|
8
|
-
end
|
9
|
-
|
10
|
-
# GET /invitations/1
|
11
|
-
def show
|
12
|
-
end
|
13
|
-
|
14
|
-
# GET /invitations/new
|
15
|
-
def new
|
16
|
-
@invitation = Invitation.new
|
17
|
-
end
|
18
|
-
|
19
|
-
# GET /invitations/1/edit
|
20
|
-
def edit
|
21
|
-
end
|
22
|
-
|
23
|
-
# POST /invitations
|
24
|
-
def create
|
25
|
-
@invitation = Invitation.new(invitation_params)
|
26
|
-
|
27
|
-
if @invitation.save
|
28
|
-
redirect_to @invitation, notice: "Invitation was successfully created."
|
29
|
-
else
|
30
|
-
render :new, status: :unprocessable_entity
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
# PATCH/PUT /invitations/1
|
35
|
-
def update
|
36
|
-
if @invitation.update(invitation_params)
|
37
|
-
redirect_to @invitation, notice: "Invitation was successfully updated.", status: :see_other
|
38
|
-
else
|
39
|
-
render :edit, status: :unprocessable_entity
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# DELETE /invitations/1
|
44
|
-
def destroy
|
45
|
-
@invitation.destroy
|
46
|
-
redirect_to invitations_url, notice: "Invitation was successfully destroyed.", status: :see_other
|
47
|
-
end
|
48
|
-
|
49
|
-
private
|
50
|
-
# Use callbacks to share common setup or constraints between actions.
|
51
|
-
def set_invitation
|
52
|
-
@invitation = Invitation.find(params[:id])
|
53
|
-
end
|
54
|
-
|
55
|
-
# Only allow a list of trusted parameters through.
|
56
|
-
def invitation_params
|
57
|
-
params.require(:invitation).permit(:team_id, :inviter_id, :membership_id, :email, :role, :token, :status, :sent_at, :expires_at)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
module SimpleTeams
|
2
|
-
class MembershipsController < ApplicationController
|
3
|
-
before_action :set_membership, only: %i[ show edit update destroy ]
|
4
|
-
|
5
|
-
# GET /memberships
|
6
|
-
def index
|
7
|
-
@memberships = Membership.all
|
8
|
-
end
|
9
|
-
|
10
|
-
# GET /memberships/1
|
11
|
-
def show
|
12
|
-
end
|
13
|
-
|
14
|
-
# GET /memberships/new
|
15
|
-
def new
|
16
|
-
@membership = Membership.new
|
17
|
-
end
|
18
|
-
|
19
|
-
# GET /memberships/1/edit
|
20
|
-
def edit
|
21
|
-
end
|
22
|
-
|
23
|
-
# POST /memberships
|
24
|
-
def create
|
25
|
-
@membership = Membership.new(membership_params)
|
26
|
-
|
27
|
-
if @membership.save
|
28
|
-
redirect_to @membership, notice: "Membership was successfully created."
|
29
|
-
else
|
30
|
-
render :new, status: :unprocessable_entity
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
# PATCH/PUT /memberships/1
|
35
|
-
def update
|
36
|
-
if @membership.update(membership_params)
|
37
|
-
redirect_to @membership, notice: "Membership was successfully updated.", status: :see_other
|
38
|
-
else
|
39
|
-
render :edit, status: :unprocessable_entity
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# DELETE /memberships/1
|
44
|
-
def destroy
|
45
|
-
@membership.destroy
|
46
|
-
redirect_to memberships_url, notice: "Membership was successfully destroyed.", status: :see_other
|
47
|
-
end
|
48
|
-
|
49
|
-
private
|
50
|
-
# Use callbacks to share common setup or constraints between actions.
|
51
|
-
def set_membership
|
52
|
-
@membership = Membership.find(params[:id])
|
53
|
-
end
|
54
|
-
|
55
|
-
# Only allow a list of trusted parameters through.
|
56
|
-
def membership_params
|
57
|
-
params.require(:membership).permit(:team_id, :member_id, :role)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,60 +0,0 @@
|
|
1
|
-
module SimpleTeams
|
2
|
-
class TeamsController < ApplicationController
|
3
|
-
before_action :set_team, only: %i[ show edit update destroy ]
|
4
|
-
|
5
|
-
# GET /teams
|
6
|
-
def index
|
7
|
-
@teams = Team.all
|
8
|
-
end
|
9
|
-
|
10
|
-
# GET /teams/1
|
11
|
-
def show
|
12
|
-
end
|
13
|
-
|
14
|
-
# GET /teams/new
|
15
|
-
def new
|
16
|
-
@team = Team.new
|
17
|
-
end
|
18
|
-
|
19
|
-
# GET /teams/1/edit
|
20
|
-
def edit
|
21
|
-
end
|
22
|
-
|
23
|
-
# POST /teams
|
24
|
-
def create
|
25
|
-
@team = Team.new(team_params)
|
26
|
-
|
27
|
-
if @team.save
|
28
|
-
redirect_to @team, notice: "Team was successfully created."
|
29
|
-
else
|
30
|
-
render :new, status: :unprocessable_entity
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
# PATCH/PUT /teams/1
|
35
|
-
def update
|
36
|
-
if @team.update(team_params)
|
37
|
-
redirect_to @team, notice: "Team was successfully updated.", status: :see_other
|
38
|
-
else
|
39
|
-
render :edit, status: :unprocessable_entity
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# DELETE /teams/1
|
44
|
-
def destroy
|
45
|
-
@team.destroy
|
46
|
-
redirect_to teams_url, notice: "Team was successfully destroyed.", status: :see_other
|
47
|
-
end
|
48
|
-
|
49
|
-
private
|
50
|
-
# Use callbacks to share common setup or constraints between actions.
|
51
|
-
def set_team
|
52
|
-
@team = Team.find(params[:id])
|
53
|
-
end
|
54
|
-
|
55
|
-
# Only allow a list of trusted parameters through.
|
56
|
-
def team_params
|
57
|
-
params.require(:team).permit(:teamable_id, :teamable_type)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
module SimpleTeams
|
2
|
-
class BulkInvitationsNotification < ApplicationNotification
|
3
|
-
|
4
|
-
param :team_id, :user_id, :team_name, :user_name, :invitation_names
|
5
|
-
|
6
|
-
def message
|
7
|
-
"#{user_name} invited #{invitation_names.to_sentence} to #{team_name}."
|
8
|
-
end
|
9
|
-
|
10
|
-
def subject
|
11
|
-
"Users Invited"
|
12
|
-
end
|
13
|
-
|
14
|
-
def url
|
15
|
-
if team.present? and team.members.include? recipient
|
16
|
-
"/teams/#{team.id}"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def link_text
|
21
|
-
"View Invitations"
|
22
|
-
end
|
23
|
-
|
24
|
-
# Objects
|
25
|
-
def team
|
26
|
-
Team.find_by(id: params[:team_id])
|
27
|
-
end
|
28
|
-
|
29
|
-
def user
|
30
|
-
SimpleTeams.member_class.find_by(id: params[:user_id])
|
31
|
-
end
|
32
|
-
|
33
|
-
# Names (fallback)
|
34
|
-
def team_name
|
35
|
-
team.present? ? team.name : params[:team_name]
|
36
|
-
end
|
37
|
-
|
38
|
-
def invitation_names
|
39
|
-
params[:invitation_names]
|
40
|
-
end
|
41
|
-
|
42
|
-
def user_name
|
43
|
-
if recipient.id == params[:user_id]
|
44
|
-
"You"
|
45
|
-
else
|
46
|
-
user.present? ? user.full_name : params[:user_name]
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
end
|