bullet_train-super_scaffolding 1.0.9 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/account/scaffolding/absolutely_abstract/creative_concepts/collaborators_controller.rb +81 -0
- data/app/controllers/account/scaffolding/absolutely_abstract/creative_concepts_controller.rb +82 -0
- data/app/controllers/account/scaffolding/completely_concrete/tangible_things_controller.rb +106 -0
- data/app/controllers/api/v1/scaffolding/absolutely_abstract/creative_concepts_endpoint.rb +103 -0
- data/app/controllers/api/v1/scaffolding/absolutely_abstract.rb +2 -0
- data/app/controllers/api/v1/scaffolding/completely_concrete/tangible_things_endpoint.rb +135 -0
- data/app/controllers/api/v1/scaffolding/completely_concrete.rb +2 -0
- data/app/controllers/api/v1/scaffolding.rb +2 -0
- data/app/controllers/api/v1.rb +2 -0
- data/app/controllers/api.rb +2 -0
- data/app/controllers/concerns/scaffolding/absolutely_abstract/creative_concepts/controller_support.rb +11 -0
- data/app/models/scaffolding/absolutely_abstract/creative_concept.rb +42 -0
- data/app/models/scaffolding/absolutely_abstract/creative_concepts/collaborator.rb +39 -0
- data/app/models/scaffolding/absolutely_abstract/creative_concepts.rb +5 -0
- data/app/models/scaffolding/absolutely_abstract.rb +5 -0
- data/app/models/scaffolding/completely_concrete/tangible_thing.rb +42 -0
- data/app/models/scaffolding/completely_concrete/tangible_things/assignment.rb +22 -0
- data/app/models/scaffolding/completely_concrete/tangible_things.rb +5 -0
- data/app/models/scaffolding/completely_concrete.rb +5 -0
- data/app/models/scaffolding.rb +5 -0
- data/app/serializers/api/v1/scaffolding/absolutely_abstract/creative_concept_serializer.rb +14 -0
- data/app/serializers/api/v1/scaffolding/completely_concrete/tangible_thing_serializer.rb +29 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_breadcrumbs.html.erb +8 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_creative_concept.json.jbuilder +8 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_form.html.erb +18 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_index.html.erb +56 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_menu_item.html.erb +10 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_breadcrumbs.html.erb +8 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_collaborator.json.jbuilder +9 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_form.html.erb +19 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_index.html.erb +69 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/_menu_item.html.erb +10 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/edit.html.erb +12 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/index.html.erb +6 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/index.json.jbuilder +1 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/new.html.erb +12 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/show.html.erb +31 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/show.json.jbuilder +1 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/edit.html.erb +12 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/index.html.erb +6 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/index.json.jbuilder +1 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/new.html.erb +12 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/show.html.erb +65 -0
- data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/show.json.jbuilder +1 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/_breadcrumbs.html.erb +8 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/_form.html.erb +65 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/_index.html.erb +72 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/_menu_item.html.erb +10 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/_tangible_thing.json.jbuilder +22 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/edit.html.erb +12 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/index.html.erb +6 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/index.json.jbuilder +1 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/new.html.erb +12 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/show.html.erb +44 -0
- data/app/views/account/scaffolding/completely_concrete/tangible_things/show.json.jbuilder +1 -0
- data/config/locales/en/scaffolding/absolutely_abstract/creative_concepts/collaborators.en.yml +98 -0
- data/config/locales/en/scaffolding/absolutely_abstract/creative_concepts.en.yml +111 -0
- data/config/locales/en/scaffolding/completely_concrete/tangible_things.en.yml +224 -0
- data/config/routes.rb +28 -0
- data/db/migrate/20190124040656_add_csv_import_to_scaffolding_things.rb +5 -0
- data/db/migrate/20191021215724_add_example_fields_to_scaffolding_things.rb +14 -0
- data/db/migrate/20191021233425_add_ckeditor_value_to_scaffolding_things.rb +5 -0
- data/db/migrate/20191204020251_create_scaffolding_absolutely_abstract_creative_concepts.rb +11 -0
- data/db/migrate/20191204020913_create_scaffolding_completely_concrete_tangible_things.rb +21 -0
- data/db/migrate/20191225224034_add_sort_order_to_scaffolding_completely_concrete_tangible_things.rb +5 -0
- data/db/migrate/20200101203645_drop_scaffolding_things.rb +9 -0
- data/db/migrate/20210101210524_create_scaffolding_absolutely_abstract_creative_concepts_collaborators.rb +10 -0
- data/db/migrate/20210101231429_add_roles_to_scaffolding_absolutely_abstract_creative_concepts_collaborators.rb +5 -0
- data/db/migrate/20210224234445_remove_select_value_from_scaffolding_completely_concrete_tangible_things.rb +5 -0
- data/db/migrate/20210513013030_add_color_value_to_scaffolding_completely_concrete_tangible_things.rb +5 -0
- data/db/migrate/20210602230736_add_option_fields_to_scaffolding_completely_concrete_tangible_things.rb +6 -0
- data/lib/bullet_train/super_scaffolding/engine.rb +11 -0
- data/lib/bullet_train/super_scaffolding/version.rb +1 -1
- metadata +72 -2
@@ -0,0 +1,42 @@
|
|
1
|
+
class Scaffolding::CompletelyConcrete::TangibleThing < ApplicationRecord
|
2
|
+
# 🚅 add concerns above.
|
3
|
+
|
4
|
+
belongs_to :absolutely_abstract_creative_concept, class_name: "Scaffolding::AbsolutelyAbstract::CreativeConcept"
|
5
|
+
# 🚅 add belongs_to associations above.
|
6
|
+
|
7
|
+
has_many :assignments, class_name: "Scaffolding::CompletelyConcrete::TangibleThings::Assignment", dependent: :destroy
|
8
|
+
has_many :memberships, through: :assignments
|
9
|
+
# 🚅 add has_many associations above.
|
10
|
+
|
11
|
+
# 🚅 add oauth providers above.
|
12
|
+
|
13
|
+
has_one_attached :file_field_value
|
14
|
+
has_one :team, through: :absolutely_abstract_creative_concept
|
15
|
+
# 🚅 add has_one associations above.
|
16
|
+
|
17
|
+
# 🚅 add scopes above.
|
18
|
+
|
19
|
+
validates :text_field_value, presence: true
|
20
|
+
# 🚅 add validations above.
|
21
|
+
|
22
|
+
after_validation :remove_file_field_value, if: :file_field_value_removal?
|
23
|
+
# 🚅 add callbacks above.
|
24
|
+
|
25
|
+
# 🚅 add delegations above.
|
26
|
+
|
27
|
+
has_rich_text :action_text_value
|
28
|
+
attr_accessor :file_field_value_removal
|
29
|
+
|
30
|
+
def collection
|
31
|
+
absolutely_abstract_creative_concept.completely_concrete_tangible_things
|
32
|
+
end
|
33
|
+
|
34
|
+
def file_field_value_removal?
|
35
|
+
file_field_value_removal.present?
|
36
|
+
end
|
37
|
+
|
38
|
+
def remove_file_field_value
|
39
|
+
file_field_value.purge
|
40
|
+
end
|
41
|
+
# 🚅 add methods above.
|
42
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Scaffolding::CompletelyConcrete::TangibleThings::Assignment < ApplicationRecord
|
2
|
+
# 🚅 add concerns above.
|
3
|
+
|
4
|
+
belongs_to :tangible_thing, class_name: "Scaffolding::CompletelyConcrete::TangibleThing"
|
5
|
+
belongs_to :membership, class_name: "Membership"
|
6
|
+
# 🚅 add belongs_to associations above.
|
7
|
+
|
8
|
+
# 🚅 add has_many associations above.
|
9
|
+
|
10
|
+
has_one :team, through: :tangible_thing
|
11
|
+
# 🚅 add has_one associations above.
|
12
|
+
|
13
|
+
# 🚅 add scopes above.
|
14
|
+
|
15
|
+
# 🚅 add validations above.
|
16
|
+
|
17
|
+
# 🚅 add callbacks above.
|
18
|
+
|
19
|
+
# 🚅 add delegations above.
|
20
|
+
|
21
|
+
# 🚅 add methods above.
|
22
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Api::V1::Scaffolding::AbsolutelyAbstract::CreativeConceptSerializer < Api::V1::ApplicationSerializer
|
2
|
+
set_type "scaffolding/absolutely_abstract/creative_concept"
|
3
|
+
|
4
|
+
attributes :id,
|
5
|
+
:team_id,
|
6
|
+
:name,
|
7
|
+
:description,
|
8
|
+
# 🚅 super scaffolding will insert new fields above this line.
|
9
|
+
:created_at,
|
10
|
+
:updated_at
|
11
|
+
|
12
|
+
belongs_to :team, serializer: Api::V1::TeamSerializer
|
13
|
+
has_many :completely_concrete_tangible_things, serializer: Api::V1::Scaffolding::CompletelyConcrete::TangibleThingSerializer
|
14
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Api::V1::Scaffolding::CompletelyConcrete::TangibleThingSerializer < Api::V1::ApplicationSerializer
|
2
|
+
set_type "scaffolding/completely_concrete/tangible_thing"
|
3
|
+
|
4
|
+
attributes :id,
|
5
|
+
:absolutely_abstract_creative_concept_id,
|
6
|
+
# 🚅 skip this section when scaffolding.
|
7
|
+
:text_field_value,
|
8
|
+
:button_value,
|
9
|
+
:multiple_button_values,
|
10
|
+
:color_picker_value,
|
11
|
+
:cloudinary_image_value,
|
12
|
+
:date_field_value,
|
13
|
+
:date_and_time_field_value,
|
14
|
+
:email_field_value,
|
15
|
+
:password_field_value,
|
16
|
+
:phone_field_value,
|
17
|
+
:option_value,
|
18
|
+
# :multiple_option_values,
|
19
|
+
:super_select_value,
|
20
|
+
# :multiple_super_select_values,
|
21
|
+
# :text_area_value,
|
22
|
+
# :action_text_value,
|
23
|
+
# 🚅 stop any skipping we're doing now.
|
24
|
+
# 🚅 super scaffolding will insert new fields above this line.
|
25
|
+
:created_at,
|
26
|
+
:updated_at
|
27
|
+
|
28
|
+
belongs_to :absolutely_abstract_creative_concept, serializer: Api::V1::Scaffolding::AbsolutelyAbstract::CreativeConceptSerializer
|
29
|
+
end
|
data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/_breadcrumbs.html.erb
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<% creative_concept ||= @creative_concept %>
|
2
|
+
<% team ||= @team || creative_concept&.team %>
|
3
|
+
<%= render 'account/teams/breadcrumbs', team: team %>
|
4
|
+
<%= render 'account/shared/breadcrumb', label: t('.label'), url: [:account, team, :scaffolding_absolutely_abstract_creative_concepts] %>
|
5
|
+
<% if creative_concept&.persisted? %>
|
6
|
+
<%= render 'account/shared/breadcrumb', label: creative_concept.label_string, url: [:account, creative_concept] %>
|
7
|
+
<% end %>
|
8
|
+
<%= render 'account/shared/breadcrumbs/actions', only_for: 'scaffolding/absolutely_abstract/creative_concepts' %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%= form_with model: [:account, (@team unless creative_concept.persisted?), creative_concept], local: true, class: 'form' do |form| %>
|
2
|
+
<%= render 'account/shared/forms/errors', form: form %>
|
3
|
+
|
4
|
+
<% with_field_settings form: form do %>
|
5
|
+
<%= render 'shared/fields/text_field', method: :name, options: {autofocus: true} %>
|
6
|
+
<%= render 'shared/fields/text_area', method: :description %>
|
7
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
8
|
+
<% end %>
|
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, creative_concept], class: "button-secondary" %>
|
14
|
+
<% else %>
|
15
|
+
<%= link_to t('global.buttons.cancel'), [:account, @team, :scaffolding, :absolutely_abstract, :creative_concepts], class: "button-secondary" %>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
@@ -0,0 +1,56 @@
|
|
1
|
+
<% context ||= @team %>
|
2
|
+
<% hide_actions ||= false %>
|
3
|
+
<% hide_back ||= false %>
|
4
|
+
|
5
|
+
<%= updates_for context, :scaffolding_absolutely_abstract_creative_concepts do %>
|
6
|
+
<%= render 'account/shared/box' do |p| %>
|
7
|
+
<% p.content_for :title, t(".contexts.#{context.class.name.underscore}.header") %>
|
8
|
+
<% p.content_for :description do %>
|
9
|
+
<%= raw t(".contexts.#{context.class.name.underscore}.#{creative_concepts.any? ? 'description' : 'description_empty'}") %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% if creative_concepts.any? %>
|
13
|
+
<% p.content_for :table do %>
|
14
|
+
<table class="table">
|
15
|
+
<thead>
|
16
|
+
<tr>
|
17
|
+
<th><%= t('.fields.name.heading') %></th>
|
18
|
+
<th class="text-center"><%= t('.fields.all_collaborators.heading') %></th>
|
19
|
+
<%# 🚅 super scaffolding will insert new field headers above this line. %>
|
20
|
+
<th><%= t('.fields.created_at.heading') %></th>
|
21
|
+
<th></th>
|
22
|
+
</tr>
|
23
|
+
</thead>
|
24
|
+
<tbody>
|
25
|
+
<% creative_concepts.each do |creative_concept| %>
|
26
|
+
<% with_attribute_settings object: creative_concept do %>
|
27
|
+
<tr data-id="<%= creative_concept.id %>">
|
28
|
+
<td><%= render 'shared/attributes/text', attribute: :name, url: [:account, creative_concept] %></td>
|
29
|
+
<td><%= render 'account/shared/memberships/photos', memberships: creative_concept.all_collaborators, size: 9, align: :center %></td>
|
30
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
31
|
+
<td><%= display_date_and_time(creative_concept.created_at) %></td>
|
32
|
+
<td class="buttons">
|
33
|
+
<% unless hide_actions %>
|
34
|
+
<%= link_to t('.buttons.shorthand.edit'), [:edit, :account, creative_concept], class: 'button-secondary button-smaller' if can? :edit, creative_concept %>
|
35
|
+
<%= button_to t('.buttons.shorthand.destroy'), [:account, creative_concept], method: :delete, data: { confirm: t('.buttons.confirmations.destroy', model_locales(creative_concept)) }, class: 'button-secondary button-smaller' if can? :destroy, creative_concept %>
|
36
|
+
<% end %>
|
37
|
+
</td>
|
38
|
+
</tr>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
41
|
+
</tbody>
|
42
|
+
</table>
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<% p.content_for :actions do %>
|
47
|
+
<% unless hide_actions %>
|
48
|
+
<% if can? :create, Scaffolding::AbsolutelyAbstract::CreativeConcept.new(team: @team) %>
|
49
|
+
<%= link_to t('.buttons.new'), [:new, :account, @team, :scaffolding_absolutely_abstract_creative_concept], class: "#{first_button_primary(:absolutely_abstract_creative_concept)} new" %>
|
50
|
+
<% end %>
|
51
|
+
|
52
|
+
<%= link_to t('global.buttons.back'), [:account, context], class: "#{first_button_primary(:absolutely_abstract_creative_concept)} back" unless hide_back %>
|
53
|
+
<% end %>
|
54
|
+
<% end %>
|
55
|
+
<% end %>
|
56
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% if can? :read, Scaffolding::AbsolutelyAbstract::CreativeConcept.new(team: current_team) %>
|
2
|
+
<%= render 'account/shared/menu/item', {
|
3
|
+
url: main_app.polymorphic_path([:account, current_team, :scaffolding_absolutely_abstract_creative_concepts]),
|
4
|
+
label: t('scaffolding/absolutely_abstract/creative_concepts.navigation.label'),
|
5
|
+
} do |p| %>
|
6
|
+
<% p.content_for :icon do %>
|
7
|
+
<i class="<%= t('scaffolding/absolutely_abstract/creative_concepts.navigation.icon') %>"></i>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
@@ -0,0 +1,8 @@
|
|
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' %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
json.extract! collaborator,
|
2
|
+
:id,
|
3
|
+
:creative_concept_id,
|
4
|
+
:membership_id,
|
5
|
+
:roles,
|
6
|
+
# 🚅 super scaffolding will insert new fields above this line.
|
7
|
+
:created_at,
|
8
|
+
:updated_at
|
9
|
+
json.url account_scaffolding_absolutely_abstract_creative_concepts_collaborator_url(collaborator, format: :json)
|
@@ -0,0 +1,19 @@
|
|
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 %>
|
@@ -0,0 +1,69 @@
|
|
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 |p| %>
|
8
|
+
<% p.content_for :title do %>
|
9
|
+
<%= t(".contexts.#{context.class.name.underscore}.header") %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% p.content_for :description do %>
|
13
|
+
<%= t(".contexts.#{context.class.name.underscore}.description") %>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<% p.content_for :table do %>
|
17
|
+
<% if collaborators.any? %>
|
18
|
+
<table class="table">
|
19
|
+
<thead>
|
20
|
+
<tr>
|
21
|
+
<th><%= t('.fields.membership_id.heading') %></th>
|
22
|
+
<th><%= t('.fields.role_ids.heading') %></th>
|
23
|
+
<%# 🚅 super scaffolding will insert new field headers above this line. %>
|
24
|
+
<th class="text-right"></th>
|
25
|
+
</tr>
|
26
|
+
</thead>
|
27
|
+
<tbody>
|
28
|
+
<% collaborators.each do |collaborator| %>
|
29
|
+
<tr data-id="<%= collaborator.id %>">
|
30
|
+
<td><%= link_to collaborator.membership.label_string, [:account, collaborator] %></td>
|
31
|
+
<td>
|
32
|
+
<% if collaborator.roles_without_defaults.present? %>
|
33
|
+
<%= collaborator.roles_without_defaults.map { |role| t("#{collaborator.class.to_s.pluralize.underscore}.fields.role_ids.options.#{role.key}.label") }.to_sentence %>
|
34
|
+
<% else %>
|
35
|
+
<%= t(".fields.role_ids.none") %>
|
36
|
+
<% end %>
|
37
|
+
</td>
|
38
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
39
|
+
<td class="buttons">
|
40
|
+
<% unless hide_actions %>
|
41
|
+
<% if can? :edit, collaborator %>
|
42
|
+
<%= link_to t('.buttons.shorthand.edit'), [:edit, :account, collaborator], class: 'button-secondary button-smaller' %>
|
43
|
+
<% end %>
|
44
|
+
<% if can? :destroy, collaborator %>
|
45
|
+
<%= button_to t('.buttons.shorthand.destroy'), [:account, collaborator], method: :delete, data: { confirm: t('.buttons.confirmations.destroy', model_locales(collaborator)) }, class: 'button-secondary button-smaller' %>
|
46
|
+
<% end %>
|
47
|
+
<% end %>
|
48
|
+
</td>
|
49
|
+
</tr>
|
50
|
+
<% end %>
|
51
|
+
</tbody>
|
52
|
+
</table>
|
53
|
+
<% end %>
|
54
|
+
<% end %>
|
55
|
+
|
56
|
+
<% p.content_for :actions do %>
|
57
|
+
<% unless hide_actions %>
|
58
|
+
<% if context == creative_concept %>
|
59
|
+
<% if can? :create, Scaffolding::AbsolutelyAbstract::CreativeConcepts::Collaborator.new(creative_concept: creative_concept) %>
|
60
|
+
<%= link_to t('.buttons.new'), [:new, :account, creative_concept, :collaborator], class: 'button' %>
|
61
|
+
<% end %>
|
62
|
+
<% end %>
|
63
|
+
|
64
|
+
<% unless hide_back %>
|
65
|
+
<%= link_to t('global.buttons.back'), [:account, context], class: 'button-secondary' %>
|
66
|
+
<% end %>
|
67
|
+
<% end %>
|
68
|
+
<% end %>
|
69
|
+
<% end %>
|
@@ -0,0 +1,10 @@
|
|
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.content_for :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
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= render 'account/shared/page' do |p| %>
|
2
|
+
<% p.content_for :title, t('.section') %>
|
3
|
+
<% p.content_for :body do %>
|
4
|
+
<%= render 'account/shared/box', divider: true do |p| %>
|
5
|
+
<% p.content_for :title, t('.header') %>
|
6
|
+
<% p.content_for :description, t('.description') %>
|
7
|
+
<% p.content_for :body do %>
|
8
|
+
<%= render 'form', collaborator: @collaborator %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.array! @collaborators, partial: "scaffolding/absolutely_abstract/creative_concepts/collaborators/collaborator", as: :collaborator
|
data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/new.html.erb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= render 'account/shared/page' do |p| %>
|
2
|
+
<% p.content_for :title, t('.section') %>
|
3
|
+
<% p.content_for :body do %>
|
4
|
+
<%= render 'account/shared/box', divider: true do |p| %>
|
5
|
+
<% p.content_for :title, t('.header') %>
|
6
|
+
<% p.content_for :description, t('.description') %>
|
7
|
+
<% p.content_for :body do %>
|
8
|
+
<%= render 'form', collaborator: @collaborator %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
data/app/views/account/scaffolding/absolutely_abstract/creative_concepts/collaborators/show.html.erb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
<%= render 'account/shared/page' do |p| %>
|
2
|
+
<% p.content_for :title, t('.section') %>
|
3
|
+
<% p.content_for :body do %>
|
4
|
+
<%= render 'account/shared/box', divider: true do |p| %>
|
5
|
+
<% p.content_for :title, t('.header') %>
|
6
|
+
<% p.content_for :description, t('.description') %>
|
7
|
+
|
8
|
+
<% p.content_for :body do %>
|
9
|
+
<%= render 'shared/attributes/belongs_to', object: @collaborator, attribute: :membership %>
|
10
|
+
<%= render 'shared/attributes/attribute', object: @collaborator, attribute: :roles do %>
|
11
|
+
<% if @collaborator.roles.present? %>
|
12
|
+
<%= @collaborator.roles.map { |role| t(".fields.roles.options.#{role}") }.to_sentence %>
|
13
|
+
<% else %>
|
14
|
+
<%= t(".fields.roles.none") %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<% p.content_for :actions do %>
|
21
|
+
<%= link_to t('.buttons.edit'), [:edit, :account, @collaborator], class: first_button_primary if can? :edit, @collaborator %>
|
22
|
+
<%= 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 %>
|
23
|
+
<%= link_to t('global.buttons.back'), [:account, @creative_concept, :collaborators], class: first_button_primary %>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<%# 🚅 super scaffolding will insert new children above this line. %>
|
29
|
+
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! "scaffolding/absolutely_abstract/creative_concepts/collaborators/collaborator", collaborator: @collaborator
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= render 'account/shared/page' do |p| %>
|
2
|
+
<% p.content_for :title, t('.section') %>
|
3
|
+
<% p.content_for :body do %>
|
4
|
+
<%= render 'account/shared/box', divider: true do |p| %>
|
5
|
+
<% p.content_for :title, t('.header') %>
|
6
|
+
<% p.content_for :description, t('.description') %>
|
7
|
+
<% p.content_for :body do %>
|
8
|
+
<%= render 'form', creative_concept: @creative_concept %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.array! @creative_concepts, partial: "scaffolding/absolutely_abstract/creative_concepts/creative_concept", as: :creative_concept
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<%= render 'account/shared/page' do |p| %>
|
2
|
+
<% p.content_for :title, t('.section') %>
|
3
|
+
<% p.content_for :body do %>
|
4
|
+
<%= render 'account/shared/box', divider: true do |p| %>
|
5
|
+
<% p.content_for :title, t('.header') %>
|
6
|
+
<% p.content_for :description, t('.description') %>
|
7
|
+
<% p.content_for :body do %>
|
8
|
+
<%= render 'form', creative_concept: @creative_concept %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<%= render 'account/shared/page' do |p| %>
|
2
|
+
<% p.content_for :title, t('.section') %>
|
3
|
+
<% p.content_for :body do %>
|
4
|
+
<%= updates_for @creative_concept do %>
|
5
|
+
<%= render 'account/shared/box', divider: true do |p| %>
|
6
|
+
<% p.content_for :title, t('.header') %>
|
7
|
+
<% p.content_for :description, t('.description') %>
|
8
|
+
<% p.content_for :body do %>
|
9
|
+
<% with_attribute_settings object: @creative_concept, strategy: :label do %>
|
10
|
+
<%= render 'shared/attributes/text', attribute: :name %>
|
11
|
+
<%= render 'shared/attributes/html', attribute: :description %>
|
12
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
13
|
+
|
14
|
+
<div class="grid grid-cols-1 gap-y gap-x sm:grid-cols-3">
|
15
|
+
<div class="sm:col-span-1">
|
16
|
+
<%= render 'shared/attributes/base' do |p| %>
|
17
|
+
<% p.content_for :heading, t(".fields.admins.heading") %>
|
18
|
+
<% p.content_for :body do %>
|
19
|
+
<%= render 'account/shared/memberships/photos', memberships: (@team.admins + @creative_concept.admins).uniq %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<% if @creative_concept.editors.any? %>
|
25
|
+
<div class="sm:col-span-1">
|
26
|
+
<%= render 'shared/attributes/base' do |p| %>
|
27
|
+
<% p.content_for :heading, t(".fields.editors.heading") %>
|
28
|
+
<% p.content_for :body do %>
|
29
|
+
<%= render 'account/shared/memberships/photos', memberships: @creative_concept.editors %>
|
30
|
+
<% end %>
|
31
|
+
<% end %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
|
35
|
+
<% if @creative_concept.viewers.any? %>
|
36
|
+
<div class="sm:col-span-1">
|
37
|
+
<%= render 'shared/attributes/base' do |p| %>
|
38
|
+
<% p.content_for :heading, t(".fields.viewers.heading") %>
|
39
|
+
<% p.content_for :body do %>
|
40
|
+
<%= render 'account/shared/memberships/photos', memberships: @creative_concept.viewers %>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
44
|
+
<% end %>
|
45
|
+
</div>
|
46
|
+
<% end %>
|
47
|
+
<% end %>
|
48
|
+
|
49
|
+
<% p.content_for :actions do %>
|
50
|
+
<%= link_to t('.buttons.edit'), [:edit, :account, @creative_concept], class: first_button_primary if can? :edit, @creative_concept %>
|
51
|
+
<%= button_to t('.buttons.destroy'), [:account, @creative_concept], method: :delete, class: first_button_primary, data: { confirm: t('.buttons.confirmations.destroy', model_locales(@creative_concept)) } if can? :destroy, @creative_concept %>
|
52
|
+
<%= link_to t('global.buttons.back'), [:account, @team, :scaffolding_absolutely_abstract_creative_concepts], class: first_button_primary %>
|
53
|
+
<% end %>
|
54
|
+
<% end %>
|
55
|
+
<% end %>
|
56
|
+
|
57
|
+
<%= render 'account/scaffolding/completely_concrete/tangible_things/index', tangible_things: @creative_concept.completely_concrete_tangible_things.accessible_by(current_ability), hide_back: true %>
|
58
|
+
|
59
|
+
<% if can? :read, Scaffolding::AbsolutelyAbstract::CreativeConcepts::Collaborator.new(creative_concept: @creative_concept) %>
|
60
|
+
<%= render 'account/scaffolding/absolutely_abstract/creative_concepts/collaborators/index', collaborators: @creative_concept.collaborators, hide_back: true %>
|
61
|
+
<% end %>
|
62
|
+
|
63
|
+
<%# 🚅 super scaffolding will insert new children above this line. %>
|
64
|
+
<% end %>
|
65
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
json.partial! "scaffolding/absolutely_abstract/creative_concepts/creative_concept", creative_concept: @creative_concept
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<% tangible_thing ||= @tangible_thing %>
|
2
|
+
<% absolutely_abstract_creative_concept ||= @absolutely_abstract_creative_concept || tangible_thing&.absolutely_abstract_creative_concept %>
|
3
|
+
<%= render 'account/scaffolding/absolutely_abstract/creative_concepts/breadcrumbs', creative_concept: absolutely_abstract_creative_concept %>
|
4
|
+
<%= render 'account/shared/breadcrumb', label: t('.label'), url: [:account, absolutely_abstract_creative_concept, :completely_concrete_tangible_things] %>
|
5
|
+
<% if tangible_thing&.persisted? %>
|
6
|
+
<%= render 'account/shared/breadcrumb', label: tangible_thing.label_string, url: [:account, tangible_thing] %>
|
7
|
+
<% end %>
|
8
|
+
<%= render 'account/shared/breadcrumbs/actions', only_for: 'scaffolding/completely_concrete/tangible_things' %>
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<%= form_with model: tangible_thing, url: (tangible_thing.persisted? ? [:account, tangible_thing] : [:account, @absolutely_abstract_creative_concept, :completely_concrete_tangible_things]), local: true, class: 'form' do |form| %>
|
2
|
+
<%= render 'account/shared/forms/errors', form: form %>
|
3
|
+
|
4
|
+
<% with_field_settings form: form do %>
|
5
|
+
<%# 🚅 skip this section when scaffolding. %>
|
6
|
+
<%= render 'shared/fields/text_field', method: :text_field_value, options: {autofocus: true} %>
|
7
|
+
|
8
|
+
<%= render 'shared/fields/buttons', method: :boolean_button_value %>
|
9
|
+
|
10
|
+
<div class="grid grid-cols-1 gap-y gap-x sm:grid-cols-2">
|
11
|
+
<div class="sm:col-span-1">
|
12
|
+
<%= render 'shared/fields/buttons', method: :button_value %>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="sm:col-span-1">
|
16
|
+
<%= render 'shared/fields/buttons', method: :multiple_button_values, multiple: true %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<%= render 'shared/fields/color_picker', method: :color_picker_value, options: t('scaffolding/completely_concrete/tangible_things.fields.color_picker_value.options') %>
|
21
|
+
<%= render 'shared/fields/cloudinary_image', method: :cloudinary_image_value %>
|
22
|
+
<%= render 'shared/fields/date_field', method: :date_field_value %>
|
23
|
+
<%= render 'shared/fields/date_and_time_field', method: :date_and_time_field_value %>
|
24
|
+
<%= render 'shared/fields/email_field', method: :email_field_value %>
|
25
|
+
<%= render 'shared/fields/file_field', method: :file_field_value %>
|
26
|
+
|
27
|
+
<div class="grid grid-cols-1 gap-y gap-x sm:grid-cols-2">
|
28
|
+
<div class="sm:col-span-1 pr-0 sm:pr-10">
|
29
|
+
<%= render 'shared/fields/options', method: :option_value %>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="sm:col-span-1 pr-0 sm:pr-10">
|
33
|
+
<%= render 'shared/fields/options', method: :multiple_option_values, multiple: true %>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<%= render 'shared/fields/password_field', method: :password_field_value %>
|
38
|
+
<%= render 'shared/fields/phone_field', method: :phone_field_value %>
|
39
|
+
|
40
|
+
<div class="grid grid-cols-1 gap-y gap-x sm:grid-cols-2">
|
41
|
+
<div class="sm:col-span-1">
|
42
|
+
<%= render 'shared/fields/super_select', method: :super_select_value, other_options: {search: true} %>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div class="sm:col-span-1">
|
46
|
+
<%= render 'shared/fields/super_select', method: :multiple_super_select_values, other_options: {search: true}, html_options: {multiple: true} %>
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<%= render 'shared/fields/text_area', method: :text_area_value %>
|
51
|
+
<%= render 'shared/fields/trix_editor', method: :action_text_value %>
|
52
|
+
<%# 🚅 stop any skipping we're doing now. %>
|
53
|
+
<%# 🚅 super scaffolding will insert new fields above this line. %>
|
54
|
+
<% end %>
|
55
|
+
|
56
|
+
<div class="buttons">
|
57
|
+
<%= form.submit (form.object.persisted? ? t('.buttons.update') : t('.buttons.create')), class: "button" %>
|
58
|
+
<% if form.object.persisted? %>
|
59
|
+
<%= link_to t('global.buttons.cancel'), [:account, tangible_thing], class: "button-secondary" %>
|
60
|
+
<% else %>
|
61
|
+
<%= link_to t('global.buttons.cancel'), [:account, @absolutely_abstract_creative_concept, :completely_concrete_tangible_things], class: "button-secondary" %>
|
62
|
+
<% end %>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<% end %>
|