bullet_train-super_scaffolding 1.6.10 → 1.6.11
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/models/scaffolding/absolutely_abstract/creative_concept.rb +0 -18
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_creative_concept.html.erb +0 -1
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_index.html.erb +0 -1
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/show.html.erb +0 -31
- data/config/locales/en/scaffolding/absolutely_abstract/creative_concepts.en.yml +0 -8
- data/config/routes.rb +2 -18
- data/lib/bullet_train/super_scaffolding/version.rb +1 -1
- data/lib/scaffolding/script.rb +2 -0
- data/lib/scaffolding/transformer.rb +1 -1
- metadata +2 -13
- data/app/controllers/account/scaffolding/absolutely_abstract/creative_concepts/collaborators_controller.rb +0 -81
- data/app/models/scaffolding/absolutely_abstract/creative_concepts/collaborator.rb +0 -39
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_breadcrumbs.html.erb +0 -8
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_form.html.erb +0 -19
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_index.html.erb +0 -64
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_menu_item.html.erb +0 -10
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/edit.html.erb +0 -7
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/index.html.erb +0 -4
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/new.html.erb +0 -7
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/show.html.erb +0 -29
- data/config/locales/en/scaffolding/absolutely_abstract/creative_concepts/collaborators.en.yml +0 -98
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: deaf8ea96df90b0a99c72b3bd577ff05c2f41e13f111c60f596d73fdae10d3fd
|
4
|
+
data.tar.gz: 9142c1f14dc4b8fdab16ea68a5c8f11da7f0ae798ba1d6338e594347e5c25813
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c1ba6932a9db1a870e8174f9aae58d011a600c030e0afd9f1beae3afd9a24ccd0a4c0060aa604f3ca5264b43decb8deecbde2585d951d6ae8077f0aa5e1f7eb
|
7
|
+
data.tar.gz: f1497afc9332d2db0eef6c0979cdc1065c8bf337dcc002a18203ded498c5cb7f50dfdd7ebc86111c4a8f0bdfe31426fad5fa84ae59392561bd04def404faa09e
|
@@ -7,8 +7,6 @@ class Scaffolding::AbsolutelyAbstract::CreativeConcept < ApplicationRecord
|
|
7
7
|
# TODO: We shouldn't have to explicitly set the order here, so we need to find out why these records
|
8
8
|
# are being returned in descending order when calling @creative_concept.completely_concrete_tangible_things.
|
9
9
|
has_many :completely_concrete_tangible_things, -> { order(:id) }, class_name: "Scaffolding::CompletelyConcrete::TangibleThing", foreign_key: :absolutely_abstract_creative_concept_id, dependent: :destroy
|
10
|
-
has_many :collaborators, class_name: "Scaffolding::AbsolutelyAbstract::CreativeConcepts::Collaborator", dependent: :destroy, foreign_key: :creative_concept_id
|
11
|
-
has_many :memberships, through: :collaborators
|
12
10
|
# 🚅 add has_many associations above.
|
13
11
|
|
14
12
|
# 🚅 add oauth providers above.
|
@@ -24,21 +22,5 @@ class Scaffolding::AbsolutelyAbstract::CreativeConcept < ApplicationRecord
|
|
24
22
|
|
25
23
|
# 🚅 add delegations above.
|
26
24
|
|
27
|
-
def admins
|
28
|
-
collaborators.admins.map(&:membership)
|
29
|
-
end
|
30
|
-
|
31
|
-
def editors
|
32
|
-
collaborators.editors.map(&:membership)
|
33
|
-
end
|
34
|
-
|
35
|
-
def viewers
|
36
|
-
collaborators.viewers.map(&:membership)
|
37
|
-
end
|
38
|
-
|
39
|
-
def all_collaborators
|
40
|
-
team.admins.or(Membership.where(id: memberships.pluck(:id)))
|
41
|
-
end
|
42
|
-
|
43
25
|
# 🚅 add methods above.
|
44
26
|
end
|
data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_creative_concept.html.erb
CHANGED
@@ -5,7 +5,6 @@
|
|
5
5
|
<% with_attribute_settings object: creative_concept do %>
|
6
6
|
<tr data-id="<%= creative_concept.id %>">
|
7
7
|
<td><%= render 'shared/attributes/text', attribute: :name, url: [:account, creative_concept] %></td>
|
8
|
-
<td><%= render 'account/shared/memberships/photos', memberships: creative_concept.all_collaborators.excluding_platform_agents, size: 9, align: :center %></td>
|
9
8
|
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
10
9
|
<td><%= display_date_and_time(creative_concept.created_at) %></td>
|
11
10
|
<td class="buttons">
|
@@ -20,7 +20,6 @@
|
|
20
20
|
<thead>
|
21
21
|
<tr>
|
22
22
|
<th><%= t('.fields.name.heading') %></th>
|
23
|
-
<th class="text-center"><%= t('.fields.all_collaborators.heading') %></th>
|
24
23
|
<%# 🚅 super scaffolding will insert new field headers above this line. %>
|
25
24
|
<th><%= t('.fields.created_at.heading') %></th>
|
26
25
|
<th></th>
|
@@ -9,33 +9,6 @@
|
|
9
9
|
<%= render 'shared/attributes/text', attribute: :name %>
|
10
10
|
<%= render 'shared/attributes/text', attribute: :description %>
|
11
11
|
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
12
|
-
|
13
|
-
<div class="grid grid-cols-1 gap-y gap-x sm:grid-cols-3">
|
14
|
-
<div class="sm:col-span-1">
|
15
|
-
<%= render 'shared/attributes/base' do |p| %>
|
16
|
-
<% p.heading t(".fields.admins.heading") %>
|
17
|
-
<% p.body.render 'account/shared/memberships/photos', memberships: (@team.admins.reject(&:platform_agent?) + @creative_concept.admins.reject(&:platform_agent?)).uniq %>
|
18
|
-
<% end %>
|
19
|
-
</div>
|
20
|
-
|
21
|
-
<% if @creative_concept.editors.any? %>
|
22
|
-
<div class="sm:col-span-1">
|
23
|
-
<%= render 'shared/attributes/base' do |p| %>
|
24
|
-
<% p.heading t(".fields.editors.heading") %>
|
25
|
-
<% p.body.render 'account/shared/memberships/photos', memberships: @creative_concept.editors.reject(&:platform_agent?) %>
|
26
|
-
<% end %>
|
27
|
-
</div>
|
28
|
-
<% end %>
|
29
|
-
|
30
|
-
<% if @creative_concept.viewers.any? %>
|
31
|
-
<div class="sm:col-span-1">
|
32
|
-
<%= render 'shared/attributes/base' do |p| %>
|
33
|
-
<% p.heading t(".fields.viewers.heading") %>
|
34
|
-
<% p.body.render 'account/shared/memberships/photos', memberships: @creative_concept.viewers.reject(&:platform_agent?) %>
|
35
|
-
<% end %>
|
36
|
-
</div>
|
37
|
-
<% end %>
|
38
|
-
</div>
|
39
12
|
<% end %>
|
40
13
|
<% end %>
|
41
14
|
|
@@ -49,10 +22,6 @@
|
|
49
22
|
|
50
23
|
<%= render 'account/scaffolding/completely_concrete/tangible_things/index', tangible_things: @creative_concept.completely_concrete_tangible_things, hide_back: true %>
|
51
24
|
|
52
|
-
<% if can? :read, Scaffolding::AbsolutelyAbstract::CreativeConcepts::Collaborator.new(creative_concept: @creative_concept) %>
|
53
|
-
<%= render 'account/scaffolding/absolutely_abstract/creative_concepts/collaborators/index', collaborators: @creative_concept.collaborators, hide_back: true %>
|
54
|
-
<% end %>
|
55
|
-
|
56
25
|
<%# 🚅 super scaffolding will insert new children above this line. %>
|
57
26
|
<% end %>
|
58
27
|
<% end %>
|
@@ -31,14 +31,6 @@ en:
|
|
31
31
|
name: &description Description
|
32
32
|
label: *description
|
33
33
|
heading: *description
|
34
|
-
all_collaborators:
|
35
|
-
heading: Collaborators
|
36
|
-
admins:
|
37
|
-
heading: Administrators
|
38
|
-
editors:
|
39
|
-
heading: Editors
|
40
|
-
viewers:
|
41
|
-
heading: Viewers
|
42
34
|
# 🚅 super scaffolding will insert new fields above this line.
|
43
35
|
created_at:
|
44
36
|
name: &created_at Added
|
data/config/routes.rb
CHANGED
@@ -10,15 +10,7 @@ Rails.application.routes.draw do
|
|
10
10
|
unless scaffolding_things_disabled?
|
11
11
|
namespace :scaffolding do
|
12
12
|
namespace :absolutely_abstract do
|
13
|
-
resources :creative_concepts
|
14
|
-
scope module: "creative_concepts" do
|
15
|
-
resources :collaborators, only: collection_actions
|
16
|
-
end
|
17
|
-
|
18
|
-
namespace :creative_concepts do
|
19
|
-
resources :collaborators, except: collection_actions
|
20
|
-
end
|
21
|
-
end
|
13
|
+
resources :creative_concepts
|
22
14
|
end
|
23
15
|
resources :absolutely_abstract_creative_concepts, path: "absolutely_abstract/creative_concepts" do
|
24
16
|
namespace :completely_concrete do
|
@@ -38,15 +30,7 @@ Rails.application.routes.draw do
|
|
38
30
|
unless scaffolding_things_disabled?
|
39
31
|
namespace :scaffolding do
|
40
32
|
namespace :absolutely_abstract do
|
41
|
-
resources :creative_concepts
|
42
|
-
scope module: "creative_concepts" do
|
43
|
-
resources :collaborators, only: collection_actions
|
44
|
-
end
|
45
|
-
|
46
|
-
namespace :creative_concepts do
|
47
|
-
resources :collaborators, except: collection_actions
|
48
|
-
end
|
49
|
-
end
|
33
|
+
resources :creative_concepts
|
50
34
|
end
|
51
35
|
resources :absolutely_abstract_creative_concepts, path: "absolutely_abstract/creative_concepts" do
|
52
36
|
namespace :completely_concrete do
|
data/lib/scaffolding/script.rb
CHANGED
@@ -237,6 +237,8 @@ scaffolding_type = argv.shift
|
|
237
237
|
if BulletTrain::SuperScaffolding.scaffolders.include?(scaffolding_type)
|
238
238
|
scaffolder = BulletTrain::SuperScaffolding.scaffolders[scaffolding_type].constantize
|
239
239
|
scaffolder.new(argv, @options).run
|
240
|
+
elsif argv.empty? || !BulletTrain::SuperScaffolding.scaffolders.include?(scaffolding_type)
|
241
|
+
show_usage
|
240
242
|
elsif argv.count > 1
|
241
243
|
puts ""
|
242
244
|
puts "👋"
|
@@ -396,7 +396,7 @@ class Scaffolding::Transformer
|
|
396
396
|
transformed_content_to_replace = transform_string(content_to_replace)
|
397
397
|
content_replacement_transformed = content_to_replace != transformed_content_to_replace
|
398
398
|
options = {suppress_could_not_find: suppress_could_not_find, content_replacement_transformed: content_replacement_transformed}
|
399
|
-
Scaffolding::FileManipulator.replace_line_in_file(file, content, transformed_content_to_replace,
|
399
|
+
Scaffolding::FileManipulator.replace_line_in_file(file, content, transformed_content_to_replace, options)
|
400
400
|
end
|
401
401
|
|
402
402
|
# if class_name isn't specified, we use `child`.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train-super_scaffolding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.11
|
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-11-
|
11
|
+
date: 2023-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -92,7 +92,6 @@ files:
|
|
92
92
|
- README.md
|
93
93
|
- Rakefile
|
94
94
|
- app/assets/config/bullet_train_super_scaffolding_manifest.js
|
95
|
-
- app/controllers/account/scaffolding/absolutely_abstract/creative_concepts/collaborators_controller.rb
|
96
95
|
- app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb
|
97
96
|
- app/controllers/account/scaffolding/completely_concrete/tangible_things_controller.rb
|
98
97
|
- app/controllers/api.rb
|
@@ -108,7 +107,6 @@ files:
|
|
108
107
|
- app/models/scaffolding/absolutely_abstract.rb
|
109
108
|
- app/models/scaffolding/absolutely_abstract/creative_concept.rb
|
110
109
|
- app/models/scaffolding/absolutely_abstract/creative_concepts.rb
|
111
|
-
- app/models/scaffolding/absolutely_abstract/creative_concepts/collaborator.rb
|
112
110
|
- app/models/scaffolding/completely_concrete.rb
|
113
111
|
- app/models/scaffolding/completely_concrete/tangible_thing.rb
|
114
112
|
- app/models/scaffolding/completely_concrete/tangible_things.rb
|
@@ -118,14 +116,6 @@ files:
|
|
118
116
|
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/_form.html.erb
|
119
117
|
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/_index.html.erb
|
120
118
|
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/_menu_item.html.erb
|
121
|
-
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_breadcrumbs.html.erb
|
122
|
-
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_form.html.erb
|
123
|
-
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_index.html.erb
|
124
|
-
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_menu_item.html.erb
|
125
|
-
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/edit.html.erb
|
126
|
-
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/index.html.erb
|
127
|
-
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/new.html.erb
|
128
|
-
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/show.html.erb
|
129
119
|
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/edit.html.erb
|
130
120
|
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/index.html.erb
|
131
121
|
- app/views/account/scaffolding/absolutely_abstract/creative_concepts/new.html.erb
|
@@ -149,7 +139,6 @@ files:
|
|
149
139
|
- app/views/shared/tables/_checkbox.html.erb
|
150
140
|
- app/views/shared/tables/_select_all.html.erb
|
151
141
|
- config/locales/en/scaffolding/absolutely_abstract/creative_concepts.en.yml
|
152
|
-
- config/locales/en/scaffolding/absolutely_abstract/creative_concepts/collaborators.en.yml
|
153
142
|
- config/locales/en/scaffolding/completely_concrete/tangible_things.en.yml
|
154
143
|
- config/routes.rb
|
155
144
|
- db/migrate/20190124040656_add_csv_import_to_scaffolding_things.rb
|
@@ -1,81 +0,0 @@
|
|
1
|
-
class Account::Scaffolding::AbsolutelyAbstract::CreativeConcepts::CollaboratorsController < Account::ApplicationController
|
2
|
-
account_load_and_authorize_resource :collaborator, through: :creative_concept, through_association: :collaborators
|
3
|
-
|
4
|
-
# GET /account/scaffolding/absolutely_abstract/creative_concepts/:creative_concept_id/collaborators
|
5
|
-
# GET /account/scaffolding/absolutely_abstract/creative_concepts/:creative_concept_id/collaborators.json
|
6
|
-
def index
|
7
|
-
redirect_to [:account, @creative_concept]
|
8
|
-
end
|
9
|
-
|
10
|
-
# GET /account/scaffolding/absolutely_abstract/creative_concepts/collaborators/:id
|
11
|
-
# GET /account/scaffolding/absolutely_abstract/creative_concepts/collaborators/:id.json
|
12
|
-
def show
|
13
|
-
redirect_to [:account, @creative_concept]
|
14
|
-
end
|
15
|
-
|
16
|
-
# GET /account/scaffolding/absolutely_abstract/creative_concepts/:creative_concept_id/collaborators/new
|
17
|
-
def new
|
18
|
-
end
|
19
|
-
|
20
|
-
# GET /account/scaffolding/absolutely_abstract/creative_concepts/collaborators/:id/edit
|
21
|
-
def edit
|
22
|
-
end
|
23
|
-
|
24
|
-
# POST /account/scaffolding/absolutely_abstract/creative_concepts/:creative_concept_id/collaborators
|
25
|
-
# POST /account/scaffolding/absolutely_abstract/creative_concepts/:creative_concept_id/collaborators.json
|
26
|
-
def create
|
27
|
-
respond_to do |format|
|
28
|
-
if @collaborator.save
|
29
|
-
format.html { redirect_to [:account, @creative_concept, :collaborators], notice: I18n.t("scaffolding/absolutely_abstract/creative_concepts/collaborators.notifications.created") }
|
30
|
-
format.json { render :show, status: :created, location: [:account, @collaborator] }
|
31
|
-
else
|
32
|
-
format.html { render :new, status: :unprocessable_entity }
|
33
|
-
format.json { render json: @collaborator.errors, status: :unprocessable_entity }
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
# PATCH/PUT /account/scaffolding/absolutely_abstract/creative_concepts/collaborators/:id
|
39
|
-
# PATCH/PUT /account/scaffolding/absolutely_abstract/creative_concepts/collaborators/:id.json
|
40
|
-
def update
|
41
|
-
respond_to do |format|
|
42
|
-
if @collaborator.update(collaborator_params)
|
43
|
-
format.html { redirect_to [:account, @collaborator], notice: I18n.t("scaffolding/absolutely_abstract/creative_concepts/collaborators.notifications.updated") }
|
44
|
-
format.json { render :show, status: :ok, location: [:account, @collaborator] }
|
45
|
-
else
|
46
|
-
format.html { render :edit, status: :unprocessable_entity }
|
47
|
-
format.json { render json: @collaborator.errors, status: :unprocessable_entity }
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
# DELETE /account/scaffolding/absolutely_abstract/creative_concepts/collaborators/:id
|
53
|
-
# DELETE /account/scaffolding/absolutely_abstract/creative_concepts/collaborators/:id.json
|
54
|
-
def destroy
|
55
|
-
@collaborator.destroy
|
56
|
-
respond_to do |format|
|
57
|
-
format.html { redirect_to [:account, @creative_concept, :collaborators], notice: I18n.t("scaffolding/absolutely_abstract/creative_concepts/collaborators.notifications.destroyed") }
|
58
|
-
format.json { head :no_content }
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
private
|
63
|
-
|
64
|
-
# Only allow a list of trusted parameters through.
|
65
|
-
def collaborator_params
|
66
|
-
role_ids = params.dig(:scaffolding_absolutely_abstract_creative_concepts_collaborator, :role_ids)
|
67
|
-
role_ids = [role_ids] unless role_ids.is_a?(Array)
|
68
|
-
params[:scaffolding_absolutely_abstract_creative_concepts_collaborator][:role_ids] = role_ids
|
69
|
-
strong_params = params.require(:scaffolding_absolutely_abstract_creative_concepts_collaborator).permit(
|
70
|
-
:membership_id,
|
71
|
-
# 🚅 super scaffolding will insert new fields above this line.
|
72
|
-
role_ids: []
|
73
|
-
# 🚅 super scaffolding will insert new arrays above this line.
|
74
|
-
)
|
75
|
-
|
76
|
-
assign_checkboxes(strong_params, :roles)
|
77
|
-
# 🚅 super scaffolding will insert processing for new fields above this line.
|
78
|
-
|
79
|
-
strong_params
|
80
|
-
end
|
81
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
class Scaffolding::AbsolutelyAbstract::CreativeConcepts::Collaborator < ApplicationRecord
|
2
|
-
include Roles::Support
|
3
|
-
# 🚅 add concerns above.
|
4
|
-
|
5
|
-
belongs_to :creative_concept
|
6
|
-
belongs_to :membership
|
7
|
-
# 🚅 add belongs_to associations above.
|
8
|
-
|
9
|
-
# 🚅 add has_many associations above.
|
10
|
-
|
11
|
-
has_one :team, through: :creative_concept
|
12
|
-
has_one :user, through: :membership
|
13
|
-
# 🚅 add has_one associations above.
|
14
|
-
|
15
|
-
# 🚅 add scopes above.
|
16
|
-
|
17
|
-
validates :membership_id, presence: true
|
18
|
-
validate :validate_membership
|
19
|
-
# 🚅 add validations above.
|
20
|
-
|
21
|
-
# 🚅 add callbacks above.
|
22
|
-
|
23
|
-
# 🚅 add delegations above.
|
24
|
-
|
25
|
-
def valid_memberships
|
26
|
-
team.memberships.current_and_invited
|
27
|
-
end
|
28
|
-
|
29
|
-
def validate_membership
|
30
|
-
if membership_id.present?
|
31
|
-
# don't allow users to assign the ids of other teams' or users' resources to this attribute.
|
32
|
-
unless valid_memberships.ids.include?(membership_id)
|
33
|
-
errors.add(:membership_id, :invalid)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
# 🚅 add methods above.
|
39
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<% collaborator ||= @collaborator %>
|
2
|
-
<% creative_concept ||= @creative_concept || collaborator&.creative_concept %>
|
3
|
-
<%= render 'account/scaffolding/absolutely_abstract/creative_concepts/breadcrumbs', creative_concept: creative_concept %>
|
4
|
-
<%= render 'account/shared/breadcrumb', label: t('.label'), url: [:account, creative_concept, :collaborators] %>
|
5
|
-
<% if collaborator&.persisted? %>
|
6
|
-
<%= render 'account/shared/breadcrumb', label: collaborator.label_string, url: [:account, collaborator] %>
|
7
|
-
<% end %>
|
8
|
-
<%= render 'account/shared/breadcrumbs/actions', only_for: 'scaffolding/absolutely_abstract/creative_concepts/collaborators' %>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<%= form_with model: collaborator, url: (collaborator.persisted? ? [:account, collaborator] : [:account, @creative_concept, :collaborators]), local: true, class: 'form' do |form| %>
|
2
|
-
<%= render 'account/shared/forms/errors', form: form %>
|
3
|
-
|
4
|
-
<%= render 'shared/fields/super_select', form: form, method: :membership_id, options: {autofocus: true, include_blank: t('.fields.membership_id.placeholder')},
|
5
|
-
choices_url: url_for([:search, :account, @team, :memberships]), other_options: {search: true} %>
|
6
|
-
|
7
|
-
<%= render 'shared/fields/buttons', form: form, method: :role_ids, multiple: false, options: role_options_for(collaborator) %>
|
8
|
-
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
9
|
-
|
10
|
-
<div class="buttons">
|
11
|
-
<%= form.submit (form.object.persisted? ? t('.buttons.update') : t('.buttons.create')), class: "button" %>
|
12
|
-
<% if form.object.persisted? %>
|
13
|
-
<%= link_to t('global.buttons.cancel'), [:account, collaborator], class: "button-secondary" %>
|
14
|
-
<% else %>
|
15
|
-
<%= link_to t('global.buttons.cancel'), [:account, @creative_concept, :collaborators], class: "button-secondary" %>
|
16
|
-
<% end %>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<% end %>
|
@@ -1,64 +0,0 @@
|
|
1
|
-
<% creative_concept = @creative_concept %>
|
2
|
-
<% context ||= creative_concept %>
|
3
|
-
<% collection ||= :collaborators %>
|
4
|
-
<% hide_actions ||= false %>
|
5
|
-
<% hide_back ||= false %>
|
6
|
-
|
7
|
-
<%= render 'account/shared/box' do |box| %>
|
8
|
-
<% box.title t(".contexts.#{context.class.name.underscore}.header") %>
|
9
|
-
<% box.description t(".contexts.#{context.class.name.underscore}.description") %>
|
10
|
-
|
11
|
-
<% box.table do %>
|
12
|
-
<% if collaborators.any? %>
|
13
|
-
<table class="table">
|
14
|
-
<thead>
|
15
|
-
<tr>
|
16
|
-
<th><%= t('.fields.membership_id.heading') %></th>
|
17
|
-
<th><%= t('.fields.role_ids.heading') %></th>
|
18
|
-
<%# 🚅 super scaffolding will insert new field headers above this line. %>
|
19
|
-
<th class="text-right"></th>
|
20
|
-
</tr>
|
21
|
-
</thead>
|
22
|
-
<tbody>
|
23
|
-
<% collaborators.each do |collaborator| %>
|
24
|
-
<tr data-id="<%= collaborator.id %>">
|
25
|
-
<td><%= link_to collaborator.membership.label_string, [:account, collaborator] %></td>
|
26
|
-
<td>
|
27
|
-
<% if collaborator.roles_without_defaults.present? %>
|
28
|
-
<%= collaborator.roles_without_defaults.map { |role| t("#{collaborator.class.to_s.pluralize.underscore}.fields.role_ids.options.#{role.key}.label") }.to_sentence %>
|
29
|
-
<% else %>
|
30
|
-
<%= t(".fields.role_ids.none") %>
|
31
|
-
<% end %>
|
32
|
-
</td>
|
33
|
-
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
34
|
-
<td class="buttons">
|
35
|
-
<% unless hide_actions %>
|
36
|
-
<% if can? :edit, collaborator %>
|
37
|
-
<%= link_to t('.buttons.shorthand.edit'), [:edit, :account, collaborator], class: 'button-secondary button-smaller' %>
|
38
|
-
<% end %>
|
39
|
-
<% if can? :destroy, collaborator %>
|
40
|
-
<%= button_to t('.buttons.shorthand.destroy'), [:account, collaborator], method: :delete, data: { confirm: t('.buttons.confirmations.destroy', model_locales(collaborator)) }, class: 'button-secondary button-smaller' %>
|
41
|
-
<% end %>
|
42
|
-
<% end %>
|
43
|
-
</td>
|
44
|
-
</tr>
|
45
|
-
<% end %>
|
46
|
-
</tbody>
|
47
|
-
</table>
|
48
|
-
<% end %>
|
49
|
-
<% end %>
|
50
|
-
|
51
|
-
<% box.actions do %>
|
52
|
-
<% unless hide_actions %>
|
53
|
-
<% if context == creative_concept %>
|
54
|
-
<% if can? :create, Scaffolding::AbsolutelyAbstract::CreativeConcepts::Collaborator.new(creative_concept: creative_concept) %>
|
55
|
-
<%= link_to t('.buttons.new'), [:new, :account, creative_concept, :collaborator], class: 'button' %>
|
56
|
-
<% end %>
|
57
|
-
<% end %>
|
58
|
-
|
59
|
-
<% unless hide_back %>
|
60
|
-
<%= link_to t('global.buttons.back'), [:account, context], class: 'button-secondary' %>
|
61
|
-
<% end %>
|
62
|
-
<% end %>
|
63
|
-
<% end %>
|
64
|
-
<% end %>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<% if can? :read, Scaffolding::AbsolutelyAbstract::CreativeConcepts::Collaborator.new(team: current_team) %>
|
2
|
-
<%= render 'account/shared/menu/item', {
|
3
|
-
url: main_app.polymorphic_path([:account, current_team, :scaffolding_absolutely_abstract_creative_concepts_collaborators]),
|
4
|
-
label: t('scaffolding/absolutely_abstract/creative_concepts/collaborators.navigation.label'),
|
5
|
-
} do |p| %>
|
6
|
-
<% p.icon do %>
|
7
|
-
<i class="<%= t('scaffolding/absolutely_abstract/creative_concepts/collaborators.navigation.icon') %>"></i>
|
8
|
-
<% end %>
|
9
|
-
<% end %>
|
10
|
-
<% end %>
|
data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/edit.html.erb
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
<%= render 'account/shared/page' do |page| %>
|
2
|
-
<% page.title t('.section') %>
|
3
|
-
<% page.body.render 'account/shared/box', divider: true do |box| %>
|
4
|
-
<% box.t :description, title: '.header' %>
|
5
|
-
<% box.body.render 'form', collaborator: @collaborator %>
|
6
|
-
<% end %>
|
7
|
-
<% end %>
|
data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/new.html.erb
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
<%= render 'account/shared/page' do |page| %>
|
2
|
-
<% page.title t('.section') %>
|
3
|
-
<% page.body.render 'account/shared/box', divider: true do |box| %>
|
4
|
-
<% box.t :description, title: '.header' %>
|
5
|
-
<% box.body.render 'form', collaborator: @collaborator %>
|
6
|
-
<% end %>
|
7
|
-
<% end %>
|
data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/show.html.erb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
<%= render 'account/shared/page' do |page| %>
|
2
|
-
<% page.title t('.section') %>
|
3
|
-
<% page.body do %>
|
4
|
-
<%= render 'account/shared/box', divider: true do |box| %>
|
5
|
-
<% box.t :description, title: '.header' %>
|
6
|
-
|
7
|
-
<% box.body do %>
|
8
|
-
<%= render 'shared/attributes/belongs_to', object: @collaborator, attribute: :membership %>
|
9
|
-
<%= render 'shared/attributes/attribute', object: @collaborator, attribute: :roles do %>
|
10
|
-
<% if @collaborator.roles.present? %>
|
11
|
-
<%= @collaborator.roles.map { |role| t(".fields.roles.options.#{role}") }.to_sentence %>
|
12
|
-
<% else %>
|
13
|
-
<%= t(".fields.roles.none") %>
|
14
|
-
<% end %>
|
15
|
-
<% end %>
|
16
|
-
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
17
|
-
<% end %>
|
18
|
-
|
19
|
-
<% box.actions do %>
|
20
|
-
<%= link_to t('.buttons.edit'), [:edit, :account, @collaborator], class: first_button_primary if can? :edit, @collaborator %>
|
21
|
-
<%= button_to t('.buttons.destroy'), [:account, @collaborator], method: :delete, class: first_button_primary, data: { confirm: t('.buttons.confirmations.destroy', model_locales(@collaborator)) } if can? :destroy, @collaborator %>
|
22
|
-
<%= link_to t('global.buttons.back'), [:account, @creative_concept, :collaborators], class: first_button_primary %>
|
23
|
-
<% end %>
|
24
|
-
<% end %>
|
25
|
-
|
26
|
-
<%# 🚅 super scaffolding will insert new children above this line. %>
|
27
|
-
|
28
|
-
<% end %>
|
29
|
-
<% end %>
|
data/config/locales/en/scaffolding/absolutely_abstract/creative_concepts/collaborators.en.yml
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
en:
|
2
|
-
scaffolding/absolutely_abstract/creative_concepts/collaborators: &collaborators
|
3
|
-
label: &label Collaborators
|
4
|
-
breadcrumbs:
|
5
|
-
label: *label
|
6
|
-
navigation:
|
7
|
-
label: *label
|
8
|
-
icon: fal fa-puzzle-piece
|
9
|
-
buttons: &buttons
|
10
|
-
new: Add New Collaborator
|
11
|
-
create: Create Collaborator
|
12
|
-
edit: Edit Collaborator
|
13
|
-
update: Update Collaborator
|
14
|
-
destroy: Remove Collaborator
|
15
|
-
shorthand:
|
16
|
-
edit: Edit
|
17
|
-
destroy: Delete
|
18
|
-
confirmations:
|
19
|
-
# TODO customize for your use-case.
|
20
|
-
destroy: Are you sure you want to remove %{collaborator_name}? This will also remove it's associated data. This can't be undone.
|
21
|
-
fields: &fields
|
22
|
-
membership_id: &membership
|
23
|
-
name: &membership_id Membership
|
24
|
-
label: *membership_id
|
25
|
-
heading: *membership_id
|
26
|
-
placeholder: Select a Membership
|
27
|
-
|
28
|
-
membership: *membership
|
29
|
-
|
30
|
-
role_ids:
|
31
|
-
name: &roles Privileges
|
32
|
-
label: *roles
|
33
|
-
heading: *roles
|
34
|
-
options:
|
35
|
-
default:
|
36
|
-
label: Observer
|
37
|
-
description: Can view all data
|
38
|
-
editor:
|
39
|
-
label: Editor
|
40
|
-
description: Can edit but not delete this object
|
41
|
-
admin:
|
42
|
-
label: Admin
|
43
|
-
description: Can manage all data
|
44
|
-
none: Observer
|
45
|
-
|
46
|
-
# 🚅 super scaffolding will insert new fields above this line.
|
47
|
-
created_at:
|
48
|
-
name: &created_at Added
|
49
|
-
label: *created_at
|
50
|
-
heading: *created_at
|
51
|
-
updated_at:
|
52
|
-
name: &updated_at Updated
|
53
|
-
label: *updated_at
|
54
|
-
heading: *updated_at
|
55
|
-
index:
|
56
|
-
section: "%{creative_concepts_possessive} Collaborators"
|
57
|
-
contexts:
|
58
|
-
scaffolding/absolutely_abstract/creative_concept:
|
59
|
-
header: Additional Collaborators
|
60
|
-
description: All %{team_name} Administrators can collaborate on %{creative_concept_name} by default. Below is a list of additional Collaborators that have been added for %{creative_concept_name}. Only %{team_name} and %{creative_concept_name} Administrators can manage Collaborators below.
|
61
|
-
fields: *fields
|
62
|
-
buttons: *buttons
|
63
|
-
show:
|
64
|
-
section: "%{collaborator_name}"
|
65
|
-
header: Collaborator Details
|
66
|
-
description: Below are the details we have for %{collaborator_name}. You'll also find options for updating these details or removing %{collaborator_name} from %{creative_concept_name} entirely.
|
67
|
-
fields: *fields
|
68
|
-
buttons: *buttons
|
69
|
-
form: &form
|
70
|
-
buttons: *buttons
|
71
|
-
fields: *fields
|
72
|
-
new:
|
73
|
-
section: "New Collaborator for %{creative_concept_name}"
|
74
|
-
header: New Collaborator Details
|
75
|
-
description: Please provide the details of the new Collaborator you'd like to add to %{creative_concept_name}.
|
76
|
-
form: *form
|
77
|
-
edit:
|
78
|
-
section: "%{collaborator_name}"
|
79
|
-
header: Edit Collaborator Details
|
80
|
-
description: You can update the details or settings for %{collaborator_name} below.
|
81
|
-
form: *form
|
82
|
-
notifications:
|
83
|
-
created: Collaborator was successfully created.
|
84
|
-
updated: Collaborator was successfully updated.
|
85
|
-
destroyed: Collaborator was successfully destroyed.
|
86
|
-
account:
|
87
|
-
scaffolding:
|
88
|
-
absolutely_abstract:
|
89
|
-
creative_concepts:
|
90
|
-
collaborators: *collaborators
|
91
|
-
activerecord:
|
92
|
-
attributes:
|
93
|
-
scaffolding/absolutely_abstract/creative_concepts/collaborator:
|
94
|
-
membership_id: *membership_id
|
95
|
-
roles: *roles
|
96
|
-
# 🚅 super scaffolding will insert new activerecord attributes above this line.
|
97
|
-
created_at: *created_at
|
98
|
-
updated_at: *updated_at
|