rails_crm 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +33 -0
  4. data/Rakefile +32 -0
  5. data/app/controllers/crm/admin/base_controller.rb +20 -0
  6. data/app/controllers/crm/admin/maintain_logs_controller.rb +65 -0
  7. data/app/controllers/crm/admin/maintain_source_templates_controller.rb +52 -0
  8. data/app/controllers/crm/admin/maintain_sources_controller.rb +62 -0
  9. data/app/controllers/crm/admin/maintain_tag_templates_controller.rb +56 -0
  10. data/app/controllers/crm/admin/maintain_tags_controller.rb +66 -0
  11. data/app/controllers/crm/admin/maintains_controller.rb +289 -0
  12. data/app/controllers/crm/my/base_controller.rb +4 -0
  13. data/app/models/crm/application_record.rb +5 -0
  14. data/app/models/crm/maintain.rb +6 -0
  15. data/app/models/crm/maintain_log.rb +5 -0
  16. data/app/models/crm/maintain_source.rb +5 -0
  17. data/app/models/crm/maintain_source_template.rb +5 -0
  18. data/app/models/crm/maintain_tag.rb +5 -0
  19. data/app/models/crm/maintain_tag_template.rb +5 -0
  20. data/app/models/crm/model/agency.rb +18 -0
  21. data/app/models/crm/model/maintain.rb +91 -0
  22. data/app/models/crm/model/maintain_log.rb +18 -0
  23. data/app/models/crm/model/maintain_source.rb +19 -0
  24. data/app/models/crm/model/maintain_source_template.rb +12 -0
  25. data/app/models/crm/model/maintain_tag.rb +44 -0
  26. data/app/models/crm/model/maintain_tag_template.rb +17 -0
  27. data/app/models/crm/model/member.rb +11 -0
  28. data/app/models/crm/model/order.rb +10 -0
  29. data/app/models/crm/model/organ.rb +15 -0
  30. data/app/models/crm.rb +11 -0
  31. data/app/views/admin/_crm_nav.html.erb +13 -0
  32. data/app/views/crm/admin/maintain_logs/_breadcrumb.html.erb +6 -0
  33. data/app/views/crm/admin/maintain_logs/_filter_form.html.erb +8 -0
  34. data/app/views/crm/admin/maintain_logs/_form.html.erb +6 -0
  35. data/app/views/crm/admin/maintain_logs/_index_tbody.html.erb +8 -0
  36. data/app/views/crm/admin/maintain_logs/_index_thead.html.erb +14 -0
  37. data/app/views/crm/admin/maintain_logs/_maintain_log.json.jbuilder +11 -0
  38. data/app/views/crm/admin/maintain_logs/_show.json.jbuilder +1 -0
  39. data/app/views/crm/admin/maintain_logs/_show_table.html.erb +16 -0
  40. data/app/views/crm/admin/maintain_logs/index.json.jbuilder +2 -0
  41. data/app/views/crm/admin/maintain_source_templates/_edit_form.html.erb +4 -0
  42. data/app/views/crm/admin/maintain_source_templates/_filter_form.html.erb +8 -0
  43. data/app/views/crm/admin/maintain_source_templates/_form.html.erb +2 -0
  44. data/app/views/crm/admin/maintain_source_templates/_index_tbody.html.erb +14 -0
  45. data/app/views/crm/admin/maintain_source_templates/_index_thead.html.erb +2 -0
  46. data/app/views/crm/admin/maintain_source_templates/_maintain_source.json.jbuilder +7 -0
  47. data/app/views/crm/admin/maintain_source_templates/_new_form.html.erb +4 -0
  48. data/app/views/crm/admin/maintain_source_templates/_show.json.jbuilder +1 -0
  49. data/app/views/crm/admin/maintain_source_templates/_show_table.html.erb +8 -0
  50. data/app/views/crm/admin/maintain_source_templates/index.json.jbuilder +1 -0
  51. data/app/views/crm/admin/maintain_sources/_breadcrumb.html.erb +6 -0
  52. data/app/views/crm/admin/maintain_sources/_edit_form.html.erb +4 -0
  53. data/app/views/crm/admin/maintain_sources/_filter_form.html.erb +9 -0
  54. data/app/views/crm/admin/maintain_sources/_form.html.erb +2 -0
  55. data/app/views/crm/admin/maintain_sources/_index_tbody.html.erb +12 -0
  56. data/app/views/crm/admin/maintain_sources/_index_thead.html.erb +3 -0
  57. data/app/views/crm/admin/maintain_sources/_maintain_source.json.jbuilder +6 -0
  58. data/app/views/crm/admin/maintain_sources/_new_form.html.erb +4 -0
  59. data/app/views/crm/admin/maintain_sources/_show.json.jbuilder +1 -0
  60. data/app/views/crm/admin/maintain_sources/_show_table.html.erb +8 -0
  61. data/app/views/crm/admin/maintain_sources/index.json.jbuilder +1 -0
  62. data/app/views/crm/admin/maintain_sources/templates.html.erb +18 -0
  63. data/app/views/crm/admin/maintain_tag_templates/_edit_form.html.erb +4 -0
  64. data/app/views/crm/admin/maintain_tag_templates/_filter_form.html.erb +8 -0
  65. data/app/views/crm/admin/maintain_tag_templates/_form.html.erb +7 -0
  66. data/app/views/crm/admin/maintain_tag_templates/_index_tbody.html.erb +8 -0
  67. data/app/views/crm/admin/maintain_tag_templates/_index_thead.html.erb +7 -0
  68. data/app/views/crm/admin/maintain_tag_templates/_maintain_tag_template.json.jbuilder +11 -0
  69. data/app/views/crm/admin/maintain_tag_templates/_new_form.html.erb +4 -0
  70. data/app/views/crm/admin/maintain_tag_templates/_show.json.jbuilder +1 -0
  71. data/app/views/crm/admin/maintain_tag_templates/_show_table.html.erb +20 -0
  72. data/app/views/crm/admin/maintain_tag_templates/index.json.jbuilder +1 -0
  73. data/app/views/crm/admin/maintain_tags/_breadcrumb.html.erb +6 -0
  74. data/app/views/crm/admin/maintain_tags/_edit_form.html.erb +4 -0
  75. data/app/views/crm/admin/maintain_tags/_filter_form.html.erb +9 -0
  76. data/app/views/crm/admin/maintain_tags/_form.html.erb +5 -0
  77. data/app/views/crm/admin/maintain_tags/_index_tbody.html.erb +7 -0
  78. data/app/views/crm/admin/maintain_tags/_index_thead.html.erb +6 -0
  79. data/app/views/crm/admin/maintain_tags/_maintain_tag.json.jbuilder +9 -0
  80. data/app/views/crm/admin/maintain_tags/_new_form.html.erb +4 -0
  81. data/app/views/crm/admin/maintain_tags/_show.json.jbuilder +1 -0
  82. data/app/views/crm/admin/maintain_tags/_show_table.html.erb +24 -0
  83. data/app/views/crm/admin/maintain_tags/index.json.jbuilder +1 -0
  84. data/app/views/crm/admin/maintain_tags/templates.html.erb +22 -0
  85. data/app/views/crm/admin/maintains/_button.html.erb +3 -0
  86. data/app/views/crm/admin/maintains/_create_detect.html.erb +23 -0
  87. data/app/views/crm/admin/maintains/_edit_assign.html.erb +21 -0
  88. data/app/views/crm/admin/maintains/_edit_form.html.erb +4 -0
  89. data/app/views/crm/admin/maintains/_edit_order.html.erb +5 -0
  90. data/app/views/crm/admin/maintains/_edit_transfer.html.erb +19 -0
  91. data/app/views/crm/admin/maintains/_filter_form.html.erb +12 -0
  92. data/app/views/crm/admin/maintains/_filter_table.html.erb +54 -0
  93. data/app/views/crm/admin/maintains/_form.html.erb +37 -0
  94. data/app/views/crm/admin/maintains/_index_thead.html.erb +40 -0
  95. data/app/views/crm/admin/maintains/_index_tr.html.erb +36 -0
  96. data/app/views/crm/admin/maintains/_maintain.json.jbuilder +24 -0
  97. data/app/views/crm/admin/maintains/_new_batch_assign.html.erb +13 -0
  98. data/app/views/crm/admin/maintains/_new_detect.html.erb +15 -0
  99. data/app/views/crm/admin/maintains/_new_form.html.erb +4 -0
  100. data/app/views/crm/admin/maintains/_show.json.jbuilder +1 -0
  101. data/app/views/crm/admin/maintains/_show_table.html.erb +54 -0
  102. data/app/views/crm/admin/maintains/create_detect.js.erb +3 -0
  103. data/app/views/crm/admin/maintains/edit_assign.js +8 -0
  104. data/app/views/crm/admin/maintains/edit_assign.js.erb +3 -0
  105. data/app/views/crm/admin/maintains/edit_order.js.erb +12 -0
  106. data/app/views/crm/admin/maintains/edit_transfer.js +8 -0
  107. data/app/views/crm/admin/maintains/edit_transfer.js.erb +3 -0
  108. data/app/views/crm/admin/maintains/index.html.erb +26 -0
  109. data/app/views/crm/admin/maintains/index.json.jbuilder +2 -0
  110. data/app/views/crm/admin/maintains/new.json.jbuilder +5 -0
  111. data/app/views/crm/admin/maintains/new_batch_assign.js.erb +3 -0
  112. data/app/views/crm/admin/maintains/new_detect.js.erb +1 -0
  113. data/app/views/crm/admin/maintains/orders.html.erb +54 -0
  114. data/app/views/crm/admin/maintains/public.html.erb +83 -0
  115. data/app/views/crm/admin/maintains/public.json.jbuilder +2 -0
  116. data/config/locales/zh.attributes.yml +33 -0
  117. data/config/locales/zh.controller.yml +35 -0
  118. data/config/locales/zh.enum.yml +10 -0
  119. data/config/routes.rb +41 -0
  120. data/lib/rails_crm/config.rb +9 -0
  121. data/lib/rails_crm/engine.rb +16 -0
  122. data/lib/rails_crm.rb +2 -0
  123. metadata +178 -0
@@ -0,0 +1,2 @@
1
+ json.maintain_logs @maintain_logs, partial: 'maintain_log', as: :maintain_log
2
+ json.partial! 'shared/pagination', items: @maintain_logs
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @maintain_source_template, url: { action: 'update' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%= form_with theme: 'search', model: MaintainSource.new do |f| %>
2
+ <div class="field-body">
3
+ <%= f.text_field :name %>
4
+ <div class="field is-narrow">
5
+ <%= f.submit %>
6
+ </div>
7
+ </div>
8
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <%= render 'shared/error_messages', target: f.object %>
2
+ <%= f.text_field :name %>
@@ -0,0 +1,14 @@
1
+ <tr>
2
+ <td><%= maintain_source_template.name %></td>
3
+ <td>
4
+ <%= link_to({ action: 'show', id: maintain_source_template.id }, aria: { label: t('.show') }, class: 'button is-small is-rounded is-light') do %>
5
+ <i class="fas fa-info"></i>
6
+ <% end %>
7
+ <%= link_to({ action: 'edit', id: maintain_source_template.id }, aria: { label: t('.edit') }, class: 'button is-small is-rounded is-light') do %>
8
+ <i class="fas fa-pencil-alt"></i>
9
+ <% end %>
10
+ <%= link_to({ action: 'destroy', id: maintain_source_template.id }, method: :delete, aria: { label: t('.destroy') }, data: { confirm: t('.confirm') }, class: 'button is-small is-rounded is-light') do %>
11
+ <i class="fas fa-trash-alt"></i>
12
+ <% end %>
13
+ </td>
14
+ </tr>
@@ -0,0 +1,2 @@
1
+ <th><%= MaintainSourceTemplate.human_attribute_name(:name) %></th>
2
+ <th></th>
@@ -0,0 +1,7 @@
1
+ json.extract!(
2
+ maintain_source,
3
+ :id,
4
+ :name,
5
+ :maintains_count,
6
+ :created_at
7
+ )
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @maintain_source_template, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1 @@
1
+ json.partial! 'maintain_source', maintain_source: @maintain_source
@@ -0,0 +1,8 @@
1
+ <tr>
2
+ <td class="has-text-right"><%= MaintainSource.human_attribute_name(:name) %></td>
3
+ <td><%= @maintain_source.name %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= MaintainSource.human_attribute_name(:maintains_count) %></td>
7
+ <td><%= @maintain_source.maintains_count %></td>
8
+ </tr>
@@ -0,0 +1 @@
1
+ json.array! @maintain_sources, partial: 'maintain_source', as: :maintain_source
@@ -0,0 +1,6 @@
1
+ <div class="breadcrumb has-succeeds-separator">
2
+ <ul>
3
+ <li><%= link_to t('crm.admin.maintains.index.title'), { controller: 'maintains' } %></li>
4
+ <li class="is-active"><%= t('crm.admin.maintain_sources.index.title') %></li>
5
+ </ul>
6
+ </div>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @maintain_source, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%= form_with theme: 'search', model: MaintainSource.new(params.permit(:name)) do |f| %>
2
+ <div class="field-body">
3
+ <%= f.text_field :name %>
4
+ <div class="field is-narrow">
5
+ <%= f.submit %>
6
+ <%= link_to t('.clear'), filter_params(except: [:name]), class: 'button is-light' %>
7
+ </div>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <%= render 'shared/error_messages', target: f.object %>
2
+ <%= f.text_field :name %>
@@ -0,0 +1,12 @@
1
+ <tr>
2
+ <td><%= maintain_source.name %></td>
3
+ <td><%= maintain_source.maintains_count %></td>
4
+ <td>
5
+ <%= link_to({ action: 'edit', id: maintain_source.id }, aria: { label: t('.edit') }, class: 'button is-small is-rounded is-light') do %>
6
+ <i class="fas fa-pencil-alt"></i>
7
+ <% end %>
8
+ <%= link_to({ action: 'destroy', id: maintain_source.id }, method: :delete, aria: { label: t('.destroy') }, data: { confirm: t('.confirm') }, class: 'button is-small is-rounded is-light') do %>
9
+ <i class="fas fa-trash-alt"></i>
10
+ <% end %>
11
+ </td>
12
+ </tr>
@@ -0,0 +1,3 @@
1
+ <th><%= MaintainSource.human_attribute_name(:name) %></th>
2
+ <th><%= MaintainSource.human_attribute_name(:maintains_count) %></th>
3
+ <th></th>
@@ -0,0 +1,6 @@
1
+ json.extract!(
2
+ maintain_source,
3
+ :id,
4
+ :name,
5
+ :maintains_count
6
+ )
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @maintain_source, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1 @@
1
+ json.partial! 'maintain_source', maintain_source: @maintain_source
@@ -0,0 +1,8 @@
1
+ <tr>
2
+ <td class="has-text-right"><%= MaintainSource.human_attribute_name(:name) %></td>
3
+ <td><%= @maintain_source.name %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= MaintainSource.human_attribute_name(:maintains_count) %></td>
7
+ <td><%= @maintain_source.maintains_count %></td>
8
+ </tr>
@@ -0,0 +1 @@
1
+ json.maintain_sources @maintain_sources, partial: 'maintain_source', as: :maintain_source
@@ -0,0 +1,18 @@
1
+
2
+ <% @maintain_source_templates.each do |maintain_source_template| %>
3
+ <% maintain_source = @selected_maintain_sources.find { |i| i.maintain_source_template_id == maintain_source_template.id } %>
4
+ <tr>
5
+ <td><%= maintain_source_template.name %></td>
6
+ <td><%= maintain_source.maintains_count if maintain_source %></td>
7
+ <td>
8
+ <div class="ui toggle checkbox">
9
+ <% if maintain_source %>
10
+ <%= check_box_tag '', nil, true, data: { method: :delete, url: admin_maintain_source_path(maintain_source), submit: true }, id: nil %>
11
+ <% end %>
12
+ <% unless maintain_source %>
13
+ <%= check_box_tag '[maintain_source]maintain_source_template_id', maintain_source_template.id, false, data: { method: :post, url: admin_maintain_sources_path, submit: true }, id: nil %>
14
+ <% end %>
15
+ </div>
16
+ </td>
17
+ </tr>
18
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @maintain_tag_template, url: { action: 'update' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%= form_with theme: 'search', model: MaintainTagTemplate.new do |f| %>
2
+ <div class="field-body">
3
+ <%= f.text_field :name %>
4
+ <div class="field is-narrow">
5
+ <%= f.submit %>
6
+ </div>
7
+ </div>
8
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= render 'shared/error_messages', target: f.object %>
2
+ <%= f.text_field :name %>
3
+ <%= f.text_field :logged_type %>
4
+ <%= f.text_field :entity_column %>
5
+ <%= f.text_field :entity_value %>
6
+ <%= f.text_field :sequence %>
7
+ <%= f.color_field :color %>
@@ -0,0 +1,8 @@
1
+ <td><%= model.name %></td>
2
+ <td><%= model.logged_type %></td>
3
+ <td><%= model.entity_column %></td>
4
+ <td><%= model.entity_value %></td>
5
+ <td><%= model.sequence %></td>
6
+ <td>
7
+ <span class="tag" style="background-color: <%= model.color %>"><%= model.color %></span>
8
+ </td>
@@ -0,0 +1,7 @@
1
+ <th><%= MaintainTagTemplate.human_attribute_name(:name) %></th>
2
+ <th><%= MaintainTagTemplate.human_attribute_name(:logged_type) %></th>
3
+ <th><%= MaintainTagTemplate.human_attribute_name(:entity_column) %></th>
4
+ <th><%= MaintainTagTemplate.human_attribute_name(:entity_value) %></th>
5
+ <th><%= MaintainTagTemplate.human_attribute_name(:sequence) %></th>
6
+ <th><%= MaintainTagTemplate.human_attribute_name(:color) %></th>
7
+ <th></th>
@@ -0,0 +1,11 @@
1
+ json.extract!(
2
+ maintain_tag_template,
3
+ :id,
4
+ :name,
5
+ :logged_type,
6
+ :entity_column,
7
+ :entity_value,
8
+ :sequence,
9
+ :created_at,
10
+ :updated_at
11
+ )
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @maintain_tag_template, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1 @@
1
+ json.partial! 'maintain_tag_template', maintain_tag_template: @maintain_tag_template
@@ -0,0 +1,20 @@
1
+ <tr>
2
+ <td class="has-text-right"><%= MaintainTagTemplate.human_attribute_name(:name) %></td>
3
+ <td><%= @maintain_tag_template.name %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= MaintainTagTemplate.human_attribute_name(:logged_type) %></td>
7
+ <td><%= @maintain_tag_template.logged_type %></td>
8
+ </tr>
9
+ <tr>
10
+ <td class="has-text-right"><%= MaintainTagTemplate.human_attribute_name(:entity_column) %></td>
11
+ <td><%= @maintain_tag_template.entity_column %></td>
12
+ </tr>
13
+ <tr>
14
+ <td class="has-text-right"><%= MaintainTagTemplate.human_attribute_name(:entity_value) %></td>
15
+ <td><%= @maintain_tag_template.entity_value %></td>
16
+ </tr>
17
+ <tr>
18
+ <td class="has-text-right"><%= MaintainTagTemplate.human_attribute_name(:sequence) %></td>
19
+ <td><%= @maintain_tag_template.sequence %></td>
20
+ </tr>
@@ -0,0 +1 @@
1
+ json.array! @maintain_tag_templates, partial: 'maintain_tag_template', as: :maintain_tag_template
@@ -0,0 +1,6 @@
1
+ <div class="breadcrumb has-succeeds-separator">
2
+ <ul>
3
+ <li><%= link_to t('crm.admin.maintains.index.title'), { controller: 'maintains' } %></li>
4
+ <li class="is-active"><%= t('crm.admin.maintain_tags.index.title') %></li>
5
+ </ul>
6
+ </div>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @maintain_tag, url: { action: 'update' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%= form_with theme: 'search', model: MaintainTag.new(params.permit(:name)) do |f| %>
2
+ <div class="field-body">
3
+ <%= f.text_field :name %>
4
+ <div class="field is-narrow">
5
+ <%= f.submit %>
6
+ <%= link_to t('.clear'), filter_params(except: [:name]), class: 'button is-light' %>
7
+ </div>
8
+ </div>
9
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render 'shared/error_messages', target: f.object %>
2
+ <%= f.text_field :name %>
3
+ <%= f.text_field :sequence %>
4
+ <%= f.color_field :color %>
5
+ <%= f.select :logged_type, options_for_select(MaintainTag.options_i18n(:logged_type), f.object.logged_type), include_blank: true %>
@@ -0,0 +1,7 @@
1
+ <td><%= model.name %></td>
2
+ <td><%= model.logged_type_i18n %></td>
3
+ <td><%= model.sequence %></td>
4
+ <td>
5
+ <span class="tag" style="background-color: <%= model.color %>"><%= model.color %></span>
6
+ </td>
7
+ <td><%= model.maintain_logs_count %></td>
@@ -0,0 +1,6 @@
1
+ <th><%= MaintainTag.human_attribute_name(:name) %></th>
2
+ <th><%= MaintainTag.human_attribute_name(:logged_type) %></th>
3
+ <th><%= MaintainTag.human_attribute_name(:sequence) %></th>
4
+ <th><%= MaintainTag.human_attribute_name(:color) %></th>
5
+ <th><%= MaintainTag.human_attribute_name(:maintain_logs_count) %></th>
6
+ <th></th>
@@ -0,0 +1,9 @@
1
+ json.extract!(
2
+ maintain_tag,
3
+ :id,
4
+ :name,
5
+ :sequence,
6
+ :manual,
7
+ :color,
8
+ :created_at
9
+ )
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @maintain_tag, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1 @@
1
+ json.partial! 'maintain_tag', maintain_tag: @maintain_tag
@@ -0,0 +1,24 @@
1
+ <tr>
2
+ <td class="has-text-right"><%= MaintainTag.human_attribute_name(:name) %></td>
3
+ <td><%= @maintain_tag.name %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= MaintainTag.human_attribute_name(:logged_type) %></td>
7
+ <td><%= @maintain_tag.logged_type %></td>
8
+ </tr>
9
+ <tr>
10
+ <td class="has-text-right"><%= MaintainTag.human_attribute_name(:entity_column) %></td>
11
+ <td><%= @maintain_tag.entity_column %></td>
12
+ </tr>
13
+ <tr>
14
+ <td class="has-text-right"><%= MaintainTag.human_attribute_name(:entity_value) %></td>
15
+ <td><%= @maintain_tag.entity_value %></td>
16
+ </tr>
17
+ <tr>
18
+ <td class="has-text-right"><%= MaintainTag.human_attribute_name(:sequence) %></td>
19
+ <td><%= @maintain_tag.sequence %></td>
20
+ </tr>
21
+ <tr>
22
+ <td class="has-text-right"><%= MaintainTag.human_attribute_name(:maintain_logs_count) %></td>
23
+ <td><%= @maintain_tag.maintain_logs_count %></td>
24
+ </tr>
@@ -0,0 +1 @@
1
+ json.maintain_tags @maintain_tags, partial: 'maintain_tag', as: :maintain_tag
@@ -0,0 +1,22 @@
1
+ <% @maintain_tag_templates.each do |maintain_tag_template| %>
2
+ <% maintain_tag = @selected_maintain_tags.find { |i| i.maintain_tag_template_id == maintain_tag_template.id } %>
3
+ <tr>
4
+ <td><%= maintain_tag_template.name %></td>
5
+ <td><%= maintain_tag_template.logged_type_i18n %></td>
6
+ <td><%= maintain_tag.sequence if maintain_tag %></td>
7
+ <td>
8
+ <span class="button" style="background-color: <%= maintain_tag.color %>;"><%= maintain_tag_template.color %></span>
9
+ </td>
10
+ <td><%= maintain_tag.maintain_logs_count if maintain_tag %></td>
11
+ <td>
12
+ <div data-controller="input">
13
+ <% if maintain_tag %>
14
+ <%= check_box_tag '', nil, true, data: { method: :delete, url: admin_maintain_tag_path(maintain_tag), submit: true }, id: nil %>
15
+ <% end %>
16
+ <% unless maintain_tag %>
17
+ <%= check_box_tag '[maintain_tag]maintain_tag_template_id', maintain_tag_template.id, false, data: { method: :post, url: admin_maintain_tags_path, submit: true }, id: nil %>
18
+ <% end %>
19
+ </div>
20
+ </td>
21
+ </tr>
22
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= link_to detect_admin_maintains_path, class: 'button is-link is-small' do %>
2
+ <i class="fas fa-plus"></i><%= t('.new') %>
3
+ <% end %>
@@ -0,0 +1,23 @@
1
+ <div class="ui modal" id="modal">
2
+ <i class="fas fa-times close"></i>
3
+ <div class="ui header blue">
4
+ <%= t('.new') %>
5
+ </div>
6
+
7
+ <div class="content">
8
+ <%= form_with url: new_admin_maintain_url, method: :get do |f| %>
9
+ <div class="inline fields">
10
+ <%= f.hidden_field :agent_id, value: @agent.id %>
11
+ <%= f.collection_select :agency_id, @agencies, :id, :name, label: '选择现有', can: { wrap_all: false } %>
12
+ <%= f.submit '下一步', can: { wrap_all: false, offset: false } %>
13
+ </div>
14
+ <% end %>
15
+ <div class="ui horizontal divider">或</div>
16
+ <div class="ui center aligned basic segment">
17
+ <%= link_to new_admin_maintain_path(agent_id: @agent.id), class: 'button is-link is-small' do %>
18
+ <i class="fas fa-plus"></i>
19
+ <span>新增</span>
20
+ <% end %>
21
+ </div>
22
+ </div>
23
+ </div>
@@ -0,0 +1,21 @@
1
+ <div class="ui modal" id="modal">
2
+ <i class="fas fa-times close"></i>
3
+ <div class="ui header">
4
+ <%= t('.edit') %>
5
+ </div>
6
+
7
+ <div class="content">
8
+ <%= form_with scope: :maintain, url: assign_admin_maintain_path(@maintain), method: :patch do |f| %>
9
+ <% unless @maintain.pipeline_id %>
10
+ <div class="inline fields">
11
+ <%= f.collection_select :pipeline_id, @pipelines, :id, :name, include_blank: true, can: { wrap_all: false } %>
12
+ <%= link_to new_admin_pipeline_path, aria: { label: '来源设置' }, target: '_blank' do %>
13
+ <i class="fas fa-cog"></i>
14
+ <% end %>
15
+ </div>
16
+ <% end %>
17
+ <%= f.collection_select :member_id, @members, :id, :name, can: { wrap_input_id: true } %>
18
+ <%= f.submit %>
19
+ <% end %>
20
+ </div>
21
+ </div>