simple_teams 0.1.2 → 0.1.4
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/app/controllers/simple_teams/accept_invitations_controller.rb +3 -4
- 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 +1 -1
- data/app/controllers/simple_teams/leave_teams_controller.rb +2 -2
- data/app/controllers/simple_teams/memberships_controller.rb +1 -1
- data/app/controllers/simple_teams/related_members_controller.rb +2 -2
- data/app/controllers/simple_teams/teams_controller.rb +1 -1
- data/app/service_objects/simple_teams/accept_invitation_service.rb +1 -1
- data/config/routes.rb +2 -2
- data/lib/simple_teams/version.rb +1 -1
- metadata +3 -2
- /data/app/views/simple_teams/{teams_mailer → mailer}/invitation_notification.html.erb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea436fc244351fbe757513bc528932e72825f362859ce81edf4036a2b353bfc1
|
4
|
+
data.tar.gz: 636891c0d6281d29494eef2231b7a76245b062c04c506af26cc969136e48fc51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8953835540518f246b25150d052553e8fce1de4bdbf70f8bb9045b918323b28d6d57a6b9ef18be6e998be6014816a23d5636de917cc30b1c7f235c5e397db25
|
7
|
+
data.tar.gz: 596cc17142a92d83a48393dc75e299941bde02cfedf5374db8be52526c2a870e3aac796259753500aa4dcc4818e5083671b5ab25a25d8dfa59fdef1fb3c15f70
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module SimpleTeams
|
2
|
-
class AcceptInvitationsController <
|
3
|
-
skip_before_action :authenticate_user!
|
2
|
+
class AcceptInvitationsController < BaseController
|
4
3
|
before_action :set_invitation
|
5
4
|
before_action :ensure_invitation_token_is_valid
|
6
5
|
before_action :set_team
|
@@ -12,7 +11,7 @@ module SimpleTeams
|
|
12
11
|
def create
|
13
12
|
if params[:commit] == "Decline"
|
14
13
|
@invitation.declined!
|
15
|
-
redirect_to root_path, :notice => "You have declined the invitation to the '#{@team.name}' #{@team.teamable.class.model_name.human}."
|
14
|
+
redirect_to main_app.root_path, :notice => "You have declined the invitation to the '#{@team.name}' #{@team.teamable.class.model_name.human}."
|
16
15
|
else
|
17
16
|
if @service_object.valid?
|
18
17
|
@service_object.perform
|
@@ -26,7 +25,7 @@ module SimpleTeams
|
|
26
25
|
:user_name => current_user.full_name
|
27
26
|
).deliver_later(@team.members)
|
28
27
|
|
29
|
-
redirect_to url_for(@team.teamable), :notice => "You have accepted the invitation to the '#{@team.name}' #{@team.teamable.class.model_name.human}."
|
28
|
+
redirect_to main_app.url_for(@team.teamable), :notice => "You have accepted the invitation to the '#{@team.name}' #{@team.teamable.class.model_name.human}."
|
30
29
|
else
|
31
30
|
render :new
|
32
31
|
end
|
@@ -1,13 +1,6 @@
|
|
1
1
|
module SimpleTeams
|
2
|
-
class ApplicationController <
|
2
|
+
class ApplicationController < ActionController::Base
|
3
3
|
before_action :authenticate_user!
|
4
4
|
|
5
|
-
layout SimpleTeams.layout
|
6
|
-
|
7
|
-
def current_ability
|
8
|
-
SimpleTeams::Ability.new(current_user)
|
9
|
-
end
|
10
|
-
helper_method :current_ability
|
11
|
-
|
12
5
|
end
|
13
6
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module SimpleTeams
|
2
|
-
class LeaveTeamsController <
|
2
|
+
class LeaveTeamsController < BaseController
|
3
3
|
before_action :set_team
|
4
4
|
before_action :set_service_object
|
5
5
|
|
6
6
|
def destroy
|
7
7
|
if @service_object.valid? and @service_object.perform
|
8
|
-
redirect_to
|
8
|
+
redirect_to main_app.url_for(@team.teamable.class), :notice => "You have successfully left the #{@team.name} #{@team.teamable.class.model_name.human}."
|
9
9
|
else
|
10
10
|
redirect_to team_path(@team), :notice => @service_object.errors[:user_id].first
|
11
11
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
module SimpleTeams
|
2
|
-
class
|
2
|
+
class RelatedMembersController < BaseController
|
3
3
|
|
4
4
|
def index
|
5
5
|
if params[:term].present?
|
6
6
|
@members = SimpleTeams.member_class
|
7
7
|
.joins(:team_memberships, :teams)
|
8
|
-
.where("
|
8
|
+
.where("simple_teams_teams.id" => current_user.teams.pluck(:id))
|
9
9
|
.where("email ilike ?", "%#{params[:term]}%")
|
10
10
|
.order("#{SimpleTeams.member_class.table_name}.first_name")
|
11
11
|
.uniq
|
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/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Laney Stroup
|
@@ -44,6 +44,7 @@ files:
|
|
44
44
|
- app/controllers/simple_teams/admin/memberships_controller.rb
|
45
45
|
- app/controllers/simple_teams/admin/teams_controller.rb
|
46
46
|
- app/controllers/simple_teams/application_controller.rb
|
47
|
+
- app/controllers/simple_teams/base_controller.rb
|
47
48
|
- app/controllers/simple_teams/invitations_controller.rb
|
48
49
|
- app/controllers/simple_teams/leave_teams_controller.rb
|
49
50
|
- app/controllers/simple_teams/memberships_controller.rb
|
@@ -112,6 +113,7 @@ files:
|
|
112
113
|
- app/views/simple_teams/invitations/edit.html.erb
|
113
114
|
- app/views/simple_teams/invitations/new.html.erb
|
114
115
|
- app/views/simple_teams/leave_teams/edit.html.erb
|
116
|
+
- app/views/simple_teams/mailer/invitation_notification.html.erb
|
115
117
|
- app/views/simple_teams/memberships/_form.html.erb
|
116
118
|
- app/views/simple_teams/memberships/_membership.html.erb
|
117
119
|
- app/views/simple_teams/memberships/edit.html.erb
|
@@ -120,7 +122,6 @@ files:
|
|
120
122
|
- app/views/simple_teams/teams/_add_member_link.html.erb
|
121
123
|
- app/views/simple_teams/teams/_members_table.html.erb
|
122
124
|
- app/views/simple_teams/teams/show.html.erb
|
123
|
-
- app/views/simple_teams/teams_mailer/invitation_notification.html.erb
|
124
125
|
- config/locales/simple_teams.en.yml
|
125
126
|
- config/routes.rb
|
126
127
|
- db/migrate/20240311052758_create_simple_teams_teams.rb
|
File without changes
|