rails_growth 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +32 -0
  5. data/app/controllers/growth/admin/aim_entities_controller.rb +30 -0
  6. data/app/controllers/growth/admin/aim_logs_controller.rb +21 -0
  7. data/app/controllers/growth/admin/aim_users_controller.rb +30 -0
  8. data/app/controllers/growth/admin/aims_controller.rb +73 -0
  9. data/app/controllers/growth/admin/base_controller.rb +4 -0
  10. data/app/controllers/growth/admin/praise_incomes_controller.rb +61 -0
  11. data/app/controllers/growth/admin/reward_expenses_controller.rb +63 -0
  12. data/app/controllers/growth/admin/reward_incomes_controller.rb +59 -0
  13. data/app/controllers/growth/admin/rewards_controller.rb +65 -0
  14. data/app/controllers/growth/controller/application.rb +77 -0
  15. data/app/controllers/growth/my/aim_logs_controller.rb +45 -0
  16. data/app/controllers/growth/my/aim_users_controller.rb +25 -0
  17. data/app/controllers/growth/my/aims_controller.rb +44 -0
  18. data/app/controllers/growth/my/base_controller.rb +4 -0
  19. data/app/controllers/growth/my/gifts_controller.rb +27 -0
  20. data/app/controllers/growth/my/rewards_controller.rb +28 -0
  21. data/app/models/growth/aim.rb +5 -0
  22. data/app/models/growth/aim_code.rb +5 -0
  23. data/app/models/growth/aim_entity.rb +5 -0
  24. data/app/models/growth/aim_log.rb +5 -0
  25. data/app/models/growth/aim_user.rb +5 -0
  26. data/app/models/growth/model/aim.rb +52 -0
  27. data/app/models/growth/model/aim_code.rb +40 -0
  28. data/app/models/growth/model/aim_entity.rb +74 -0
  29. data/app/models/growth/model/aim_log.rb +79 -0
  30. data/app/models/growth/model/aim_user.rb +60 -0
  31. data/app/models/growth/model/card.rb +25 -0
  32. data/app/models/growth/model/cash.rb +17 -0
  33. data/app/models/growth/model/entity.rb +74 -0
  34. data/app/models/growth/model/praise_compute.rb +70 -0
  35. data/app/models/growth/model/praise_income.rb +82 -0
  36. data/app/models/growth/model/praise_user.rb +47 -0
  37. data/app/models/growth/model/promote.rb +30 -0
  38. data/app/models/growth/model/reward.rb +67 -0
  39. data/app/models/growth/model/reward_expense.rb +98 -0
  40. data/app/models/growth/model/reward_income.rb +35 -0
  41. data/app/models/growth/model/royalty_compute.rb +72 -0
  42. data/app/models/growth/model/user.rb +21 -0
  43. data/app/models/growth/praise_income.rb +7 -0
  44. data/app/models/growth/praise_user.rb +5 -0
  45. data/app/models/growth/reward.rb +5 -0
  46. data/app/models/growth/reward_expense.rb +5 -0
  47. data/app/models/growth/reward_income.rb +5 -0
  48. data/app/models/growth.rb +11 -0
  49. data/app/views/application/_growth_nav.html.erb +12 -0
  50. data/app/views/growth/admin/aim_entities/_filter.html.erb +10 -0
  51. data/app/views/growth/admin/aim_entities/index.html.erb +68 -0
  52. data/app/views/growth/admin/aim_entities/show.html.erb +22 -0
  53. data/app/views/growth/admin/aim_logs/_filter.html.erb +9 -0
  54. data/app/views/growth/admin/aim_logs/index.html.erb +62 -0
  55. data/app/views/growth/admin/aim_logs/show.html.erb +14 -0
  56. data/app/views/growth/admin/aim_users/_filter.html.erb +7 -0
  57. data/app/views/growth/admin/aim_users/index.html.erb +63 -0
  58. data/app/views/growth/admin/aim_users/show.html.erb +30 -0
  59. data/app/views/growth/admin/aims/_filter.html.erb +8 -0
  60. data/app/views/growth/admin/aims/_form.html.erb +14 -0
  61. data/app/views/growth/admin/aims/_item_field.html.erb +3 -0
  62. data/app/views/growth/admin/aims/_item_form.html.erb +24 -0
  63. data/app/views/growth/admin/aims/add_item.js.erb +9 -0
  64. data/app/views/growth/admin/aims/index.html.erb +54 -0
  65. data/app/views/growth/admin/aims/remove_item.js.erb +1 -0
  66. data/app/views/growth/admin/aims/show.html.erb +38 -0
  67. data/app/views/growth/admin/managers/_edit.html.erb +13 -0
  68. data/app/views/growth/admin/managers/_form.html.erb +34 -0
  69. data/app/views/growth/admin/managers/_new.html.erb +13 -0
  70. data/app/views/growth/admin/managers/_search_form.html.erb +8 -0
  71. data/app/views/growth/admin/managers/edit.js.erb +8 -0
  72. data/app/views/growth/admin/managers/index.html.erb +68 -0
  73. data/app/views/growth/admin/managers/new.js.erb +8 -0
  74. data/app/views/growth/admin/managers/show.html.erb +0 -0
  75. data/app/views/growth/admin/managers/update.js.erb +1 -0
  76. data/app/views/growth/admin/praise_incomes/_filter.html.erb +5 -0
  77. data/app/views/growth/admin/praise_incomes/_form.html.erb +3 -0
  78. data/app/views/growth/admin/praise_incomes/edit.html.erb +11 -0
  79. data/app/views/growth/admin/praise_incomes/index.html.erb +59 -0
  80. data/app/views/growth/admin/praise_incomes/new.html.erb +11 -0
  81. data/app/views/growth/admin/praise_incomes/show.html.erb +18 -0
  82. data/app/views/growth/admin/reward_expenses/_filter.html.erb +5 -0
  83. data/app/views/growth/admin/reward_expenses/_form.html.erb +7 -0
  84. data/app/views/growth/admin/reward_expenses/index.html.erb +49 -0
  85. data/app/views/growth/admin/reward_expenses/show.html.erb +26 -0
  86. data/app/views/growth/admin/reward_incomes/_filter.html.erb +10 -0
  87. data/app/views/growth/admin/reward_incomes/_form.html.erb +3 -0
  88. data/app/views/growth/admin/reward_incomes/edit.html.erb +11 -0
  89. data/app/views/growth/admin/reward_incomes/index.html.erb +49 -0
  90. data/app/views/growth/admin/reward_incomes/new.html.erb +11 -0
  91. data/app/views/growth/admin/reward_incomes/show.html.erb +18 -0
  92. data/app/views/growth/admin/rewards/_filter.html.erb +14 -0
  93. data/app/views/growth/admin/rewards/_form.html.erb +27 -0
  94. data/app/views/growth/admin/rewards/index.html.erb +84 -0
  95. data/app/views/growth/admin/rewards/show.html.erb +26 -0
  96. data/app/views/growth/my/aims/_aim.json.jbuilder +6 -0
  97. data/app/views/growth/my/aims/index.json.jbuilder +3 -0
  98. data/app/views/growth/my/aims/show.json.jbuilder +1 -0
  99. data/app/views/growth/my/gifts/_gift.json.jbuilder +1 -0
  100. data/app/views/growth/my/gifts/_praise_income.json.jbuilder +8 -0
  101. data/app/views/growth/my/gifts/give.json.jbuilder +8 -0
  102. data/app/views/growth/my/gifts/index.json.jbuilder +9 -0
  103. data/app/views/growth/my/rewards/_praise_user.json.jbuilder +2 -0
  104. data/app/views/growth/my/rewards/top.json.jbuilder +6 -0
  105. data/config/locales/en.notify.yml +7 -0
  106. data/config/locales/en.yml +29 -0
  107. data/config/locales/zh.controller.yml +24 -0
  108. data/config/locales/zh.notify.yml +7 -0
  109. data/config/locales/zh.yml +11 -0
  110. data/config/routes.rb +57 -0
  111. data/lib/rails_growth/config.rb +13 -0
  112. data/lib/rails_growth/engine.rb +19 -0
  113. data/lib/rails_growth/serial_number_helper.rb +28 -0
  114. data/lib/rails_growth.rb +4 -0
  115. metadata +170 -0
@@ -0,0 +1,68 @@
1
+ <div class="ui segment breadcrumb">
2
+ <%= link_to 'Back', admin_aims_path, class: 'section' %>
3
+ <div class="divider">/</div>
4
+ <div class="section"><%= @aim.name %>(<%= @aim.repeat_type_i18n %>)</div>
5
+ <div class="divider">/</div>
6
+ <%= link_to 'Users', admin_aim_aim_users_path(@aim), class: 'section' %>
7
+ <div class="divider">/</div>
8
+ <div class="action section">Entities</div>
9
+ </div>
10
+
11
+ <div class="ui top attached borderless menu">
12
+ <div class="header item">Admin Aim Users</div>
13
+ </div>
14
+
15
+ <div class="ui attached segment">
16
+ <%= render 'filter' %>
17
+ </div>
18
+
19
+ <table class="table is-hoverable is-fullwidth">
20
+ <thead>
21
+ <tr>
22
+ <th><%= AimEntity.human_attribute_name(:id) %></th>
23
+ <th><%= AimEntity.human_attribute_name(:user) %>/<%= AimEntity.human_attribute_name(:ip) %></th>
24
+ <th><%= AimEntity.human_attribute_name(:aim_logs_count) %></th>
25
+ <th><%= AimEntity.human_attribute_name(:serial_number) %></th>
26
+ <th>
27
+ <p><%= AimEntity.human_attribute_name(:entity_type) %></p>
28
+ <p><%= AimEntity.human_attribute_name(:entity_id) %></p>
29
+ </th>
30
+ <th><%= AimEntity.human_attribute_name(:state) %></th>
31
+ <th><%= AimEntity.human_attribute_name(:reward_amount) %></th>
32
+ <th><%= AimEntity.human_attribute_name(:created_at) %></th>
33
+ <th>Actions</th>
34
+ </tr>
35
+ </thead>
36
+ <tbody>
37
+ <% @aim_entities.each do |aim_entity| %>
38
+ <tr>
39
+ <td><%= aim_entity.id %></td>
40
+ <td>
41
+ <% if aim_entity.user_id %>
42
+ <%= link_to aim_entity.user_name, admin_user_path(aim_entity.user_id) %>
43
+ <% end %>
44
+ <span class="grey text"><%= aim_entity.ip %></span>
45
+ </td>
46
+ <td><%= aim_entity.aim_logs_count %></td>
47
+ <td><%= aim_entity.serial_number %></td>
48
+ <td>
49
+ <p><%= aim_entity.entity_type %></p>
50
+ <p><%= aim_entity.entity_id %></p>
51
+ </td>
52
+ <td><%= aim_entity.state_i18n %></td>
53
+ <td><%= aim_entity.reward_amount %></td>
54
+ <td><time><%= aim_entity.created_at.to_s(:rfc822) %></time></td>
55
+ <td class="ui labels">
56
+ <%= link_to admin_aim_entity_aim_logs_path(aim_entity), aria: { label: t('.show') }, class: 'ui blue mini icon button' do %>
57
+ <i class="location arrow icon"></i>
58
+ <% end %>
59
+ <%= link_to admin_aim_entity_path(aim_entity), method: :delete, aria: { label: t('.destroy') }, data: { confrim: t('.confirm') }, class: 'ui red mini icon button' do %>
60
+ <i class="times icon"></i>
61
+ <% end %>
62
+ </td>
63
+ </tr>
64
+ <% end %>
65
+ </tbody>
66
+ </table>
67
+
68
+ <%= paginate @aim_entities %>
@@ -0,0 +1,22 @@
1
+ <div class="ui segment breadcrumb">
2
+ <%= link_to 'Back', admin_aim_users_path, class: 'section' %>
3
+ <div class="divider"> / </div>
4
+ <div class="active section">Show</div>
5
+ </div>
6
+
7
+ <table class="table is-hoverable is-fullwidth">
8
+ <tbody>
9
+ <tr>
10
+ <td class="has-text-right"><%= AimUser.human_attribute_name(:user) %></td>
11
+ <td><%= @aim_user.user %></td>
12
+ </tr>
13
+ <tr>
14
+ <td class="has-text-right"><%= AimUser.human_attribute_name(:present_point) %></td>
15
+ <td><%= @aim_user.present_point %></td>
16
+ </tr>
17
+ <tr>
18
+ <td class="has-text-right"><%= AimUser.human_attribute_name(:day) %></td>
19
+ <td><%= @aim_user.day %></td>
20
+ </tr>
21
+ </tbody>
22
+ </table>
@@ -0,0 +1,9 @@
1
+ <%= form_with theme: 'search', model: AimLog.new do |f| %>
2
+ <div class="fields">
3
+ <%= f.text_field :entity_type %>
4
+ <%= f.text_field :entity_id %>
5
+ <%= f.submit 'Search' %>
6
+ </div>
7
+ <% end %>
8
+
9
+
@@ -0,0 +1,62 @@
1
+ <div class="ui segment breadcrumb">
2
+ <%= link_to 'Back', admin_aims_path, class: 'section' %>
3
+ <div class="divider">/</div>
4
+ <div class="section"><%= @aim_entity.aim.name %>(<%= @aim_entity.aim.repeat_type_i18n %>)</div>
5
+ <div class="divider">/</div>
6
+ <%= link_to 'Users', admin_aim_aim_users_path(@aim_entity.aim_id), class: 'section' %>
7
+ <div class="divider">/</div>
8
+ <%= link_to 'Entities', admin_aim_aim_entities_path(@aim_entity.aim_id), class: 'section' %>
9
+ <div class="divider">/</div>
10
+ <div class="action section">Logs</div>
11
+ </div>
12
+
13
+ <div class="ui top attached borderless menu">
14
+ <div class="header item">Admin Aim Logs</div>
15
+ </div>
16
+
17
+ <div class="ui attached segment">
18
+ <%= render 'filter' %>
19
+ </div>
20
+
21
+ <table class="table is-hoverable is-fullwidth">
22
+ <thead>
23
+ <tr>
24
+ <th><%= AimLog.human_attribute_name(:id) %></th>
25
+ <th><%= AimLog.human_attribute_name(:user) %></th>
26
+ <th><%= AimLog.human_attribute_name(:ip) %></th>
27
+ <th><%= AimLog.human_attribute_name(:code) %></th>
28
+ <th>
29
+ <p><%= AimLog.human_attribute_name(:entity_type) %></p>
30
+ <p><%= AimLog.human_attribute_name(:entity_id) %></p>
31
+ </th>
32
+ <th><%= AimLog.human_attribute_name(:created_at) %></th>
33
+ <th>Actions</th>
34
+ </tr>
35
+ </thead>
36
+ <tbody>
37
+ <% @aim_logs.each do |aim_log| %>
38
+ <tr>
39
+ <td><%= aim_log.id %></td>
40
+ <td>
41
+ <% if aim_log.user_id %>
42
+ <%= link_to aim_log.user.name, admin_user_path(aim_log.user_id) %>
43
+ <% end %>
44
+ </td>
45
+ <td class="grey text"><%= aim_log.ip %></td>
46
+ <td><%= aim_log.code %></td>
47
+ <td>
48
+ <p><%= aim_log.entity_type %></p>
49
+ <p><%= aim_log.entity_id %></p>
50
+ </td>
51
+ <td><%= aim_log.created_at %></td>
52
+ <td class="ui labels">
53
+ <%= link_to admin_aim_log_path(aim_log, aim_user_id: params[:aim_user_id]), method: :delete, aria: { label: t('.destroy') }, data: { confrim: t('.confirm') }, class: 'ui red mini icon button' do %>
54
+ <i class="times icon"></i>
55
+ <% end %>
56
+ </td>
57
+ </tr>
58
+ <% end %>
59
+ </tbody>
60
+ </table>
61
+
62
+ <%= paginate @aim_logs %>
@@ -0,0 +1,14 @@
1
+ <div class="ui segment breadcrumb">
2
+ <%= link_to 'Back', admin_aim_logs_path, class: 'section' %>
3
+ <div class="divider"> / </div>
4
+ <div class="active section">Show</div>
5
+ </div>
6
+
7
+ <table class="table is-hoverable is-fullwidth">
8
+ <tbody>
9
+ <tr>
10
+ <td class="has-text-right"><%= AimLog.human_attribute_name(:created_at) %></td>
11
+ <td><%= @aim_log.created_at %></td>
12
+ </tr>
13
+ </tbody>
14
+ </table>
@@ -0,0 +1,7 @@
1
+ <%= form_with theme: 'search', model: AimUser.new do |f| %>
2
+ <div class="fields">
3
+ <%= f.text_field :user_id %>
4
+ <%= f.text_field :ip %>
5
+ <%= f.submit 'Search' %>
6
+ </div>
7
+ <% end %>
@@ -0,0 +1,63 @@
1
+ <div class="ui segment breadcrumb">
2
+ <%= link_to 'Back', admin_aims_path, class: 'section' %>
3
+ <div class="divider">/</div>
4
+ <div class="section"><%= @aim.name %>(<%= @aim.repeat_type_i18n %>)</div>
5
+ <div class="divider">/</div>
6
+ <div class="action section">Users</div>
7
+ </div>
8
+
9
+ <div class="ui top attached borderless menu">
10
+ <div class="header item">Aim Statistics</div>
11
+ </div>
12
+
13
+ <div class="ui attached segment">
14
+ <%= render 'filter' %>
15
+ </div>
16
+
17
+ <table class="table is-hoverable is-fullwidth">
18
+ <thead>
19
+ <tr>
20
+ <th><%= AimUser.human_attribute_name(:id) %></th>
21
+ <th><%= AimUser.human_attribute_name(:user) %></th>
22
+ <th><%= AimUser.human_attribute_name(:serial_number) %></th>
23
+ <th><%= AimUser.human_attribute_name(:state) %></th>
24
+ <th><%= AimUser.human_attribute_name(:reward_amount) %></th>
25
+ <th><%= AimUser.human_attribute_name(:aim_entities_count) %></th>
26
+ <th><%= AimUser.human_attribute_name(:created_at) %></th>
27
+ <th>Actions</th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>
31
+ <% @aim_users.each do |aim_user| %>
32
+ <tr>
33
+ <td><%= aim_user.id %></td>
34
+ <td>
35
+ <% if aim_user.user_id %>
36
+ <%= link_to aim_user.user.name, admin_user_path(aim_user.user_id) %>
37
+ <% end %>
38
+ </td>
39
+ <td><%= aim_user.serial_number %></td>
40
+ <td><%= aim_user.state_i18n %></td>
41
+ <td><%= aim_user.reward_amount %></td>
42
+ <td><%= aim_user.aim_entities_count %></td>
43
+ <td><time><%= aim_user.created_at.to_s(:rfc822) %></time></td>
44
+ <td class="ui labels">
45
+ <% if aim_user.user_id %>
46
+ <%= link_to admin_aim_aim_entities_path(user_id: aim_user.user_id), aria: { label: t('.show') }, class: 'ui blue mini icon button' do %>
47
+ <i class="location arrow icon"></i>
48
+ <% end %>
49
+ <% else %>
50
+ <%= link_to admin_aim_aim_entities_path(ip: aim_user.ip), aria: { label: t('.show') }, class: 'ui blue mini icon button' do %>
51
+ <i class="location arrow icon"></i>
52
+ <% end %>
53
+ <% end %>
54
+ <%= link_to admin_aim_user_path(aim_user), method: :delete, aria: { label: t('.destroy') }, data: { confrim: t('.confirm') }, class: 'ui red mini icon button' do %>
55
+ <i class="times icon"></i>
56
+ <% end %>
57
+ </td>
58
+ </tr>
59
+ <% end %>
60
+ </tbody>
61
+ </table>
62
+
63
+ <%= paginate @aim_users %>
@@ -0,0 +1,30 @@
1
+ <div class="ui segment breadcrumb">
2
+ <%= link_to 'Back', admin_aim_statistics_path, class: 'section' %>
3
+ <div class="divider">/</div>
4
+ <div class="active section">Show</div>
5
+ </div>
6
+
7
+ <table class="table is-hoverable is-fullwidth">
8
+ <tbody>
9
+ <tr>
10
+ <td class="has-text-right"><%= AimStatistic.human_attribute_name(:user) %></td>
11
+ <td><%= @aim_statistic.user %></td>
12
+ </tr>
13
+ <tr>
14
+ <td class="has-text-right"><%= AimStatistic.human_attribute_name(:ip) %></td>
15
+ <td><%= @aim_statistic.ip %></td>
16
+ </tr>
17
+ <tr>
18
+ <td class="has-text-right"><%= AimStatistic.human_attribute_name(:serial_number) %></td>
19
+ <td><%= @aim_statistic.serial_number %></td>
20
+ </tr>
21
+ <tr>
22
+ <td class="has-text-right"><%= AimStatistic.human_attribute_name(:state) %></td>
23
+ <td><%= @aim_statistic.state %></td>
24
+ </tr>
25
+ <tr>
26
+ <td class="has-text-right"><%= AimStatistic.human_attribute_name(:aim_users_count) %></td>
27
+ <td><%= @aim_statistic.aim_users_count %></td>
28
+ </tr>
29
+ </tbody>
30
+ </table>
@@ -0,0 +1,8 @@
1
+ <%= form_with theme: 'search', model: Aim.new do |f| %>
2
+ <div class="fields">
3
+ <%= f.text_field :name %>
4
+ <%= f.submit 'Search' %>
5
+ </div>
6
+ <% end %>
7
+
8
+
@@ -0,0 +1,14 @@
1
+ <%= form_with model: [:admin, @aim], local: true do |f| %>
2
+ <%= render 'error_messages', target: @aim %>
3
+ <%= f.text_field :name %>
4
+ <%= f.number_field :task_point %>
5
+ <%= f.number_field :reward_point %>
6
+ <%= f.text_field :unit %>
7
+ <%= f.number_field :rate %>
8
+ <%= f.number_field :reward_amount %>
9
+ <%= f.select :repeat_type, options_for_select(Aim.options_i18n(:repeat_type), @aim.repeat_type) %>
10
+ <%= f.fields :aim_codes, on: { wrap_all: false, label: false, placeholder: true }, css: { wrap_input: 'two wide field' } do |ef| %>
11
+ <%= render partial: 'item_form', locals: { ef: ef } %>
12
+ <% end %>
13
+ <%= f.submit %>
14
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= f.fields :aim_codes, child_index: index, on: { wrapper_all: false, label: false, placeholder: true }, css: { wrapper_input: 'two wide field' } do |ef| %>
2
+ <%= render partial: 'item_form', locals: { ef: ef } %>
3
+ <% end %>
@@ -0,0 +1,24 @@
1
+ <div class="inline fields" id="aim_aim_codes_<%= ef.index %>" data-title="aim_aim_codes">
2
+ <% if ef.index == 0 %>
3
+ <%= ef.options[:parent_builder].label :aim_codes %>
4
+ <% else %>
5
+ <label class="six wide field"></label>
6
+ <% end %>
7
+
8
+ <%= ef.text_field :controller_path, css: { wrapper_input: 'three wide field' } %>
9
+ <%= ef.text_field :action_name %>
10
+ <%= ef.text_field :code, css: { wrapper_input: 'three wide field' } %>
11
+
12
+ <div class="field">
13
+ <%= link_to add_item_admin_aims_path('item', index: ef.index), data: { title: 'add_item' }, remote: true do %>
14
+ <i class="plus circle icon"></i>
15
+ <% end %>
16
+ <% if ef.object.id %>
17
+ <%= ef.check_box :_destroy, { on: { offset: false }, css: { wrapper_checkbox: 'ui checkbox' }, checked: true }, 0, 1 %>
18
+ <% else %>
19
+ <%= link_to remove_item_admin_aims_path('item', index: ef.index), remote: true do %>
20
+ <i class="minus circle icon"></i>
21
+ <% end %>
22
+ <% end %>
23
+ </div>
24
+ </div>
@@ -0,0 +1,9 @@
1
+ <% form_object = default_form_object(@aim, can: { wrap_id: true }) %>
2
+
3
+ var template = '<%= j(render partial: 'item_field', locals: { f: form_object, index: UidHelper.sec_uuid }) %>'
4
+
5
+ $('#aim_aim_codes_<%= params[:index] %>').after(template);
6
+
7
+ $('[data-title="aim_aim_code"]').dropdown({
8
+ placeholder: true
9
+ });
@@ -0,0 +1,54 @@
1
+ <div class="ui attached segment">
2
+ <%= render 'filter' %>
3
+ </div>
4
+
5
+ <table class="table is-hoverable is-fullwidth">
6
+ <thead>
7
+ <tr>
8
+ <th><%= Aim.human_attribute_name(:id) %></th>
9
+ <th><%= Aim.human_attribute_name(:name) %></th>
10
+ <th><%= Aim.human_attribute_name(:repeat_type) %></th>
11
+ <th><%= Aim.human_attribute_name(:task_point) %></th>
12
+ <th><%= Aim.human_attribute_name(:reward_point) %></th>
13
+ <th><%= Aim.human_attribute_name(:unit) %></th>
14
+ <th><%= Aim.human_attribute_name(:reward_amount) %></th>
15
+ <th><%= Aim.human_attribute_name(:rate) %></th>
16
+ <th><%= Aim.human_attribute_name(:code) %></th>
17
+ <th>
18
+ <%= link_to new_admin_aim_path, aria: { label: t('.new') }, remote: true, class: 'ui teal button' do %>
19
+ <i class="fas fa-plus"></i>
20
+ <% end %>
21
+ </th>
22
+ </tr>
23
+ </thead>
24
+ <tbody>
25
+ <% @aims.each do |aim| %>
26
+ <tr>
27
+ <td><%= aim.id %></td>
28
+ <td><%= aim.name %></td>
29
+ <td><%= aim.repeat_type %></td>
30
+ <td><%= aim.task_point %></td>
31
+ <td><%= aim.reward_point %></td>
32
+ <td><%= aim.unit %></td>
33
+ <td><%= aim.reward_amount %></td>
34
+ <td><%= aim.rate %></td>
35
+ <td>
36
+ <%= simple_format aim.aim_codes.pluck(:code) %>
37
+ </td>
38
+ <td class="ui labels">
39
+ <%= link_to admin_aim_aim_users_path(aim_id: aim.id), aria: { label: t('.show') }, class: 'ui blue mini icon button' do %>
40
+ <i class="location arrow icon"></i>
41
+ <% end %>
42
+ <%= link_to edit_admin_aim_path(aim), aria: { label: t('.edit') }, class: 'ui pink mini icon button' do %>
43
+ <i class="pencil alternate icon"></i>
44
+ <% end %>
45
+ <%= link_to admin_aim_path(aim), method: :delete, aria: { label: t('.destroy') }, data: { confrim: t('.confirm') }, class: 'ui red mini icon button' do %>
46
+ <i class="times icon"></i>
47
+ <% end %>
48
+ </td>
49
+ </tr>
50
+ <% end %>
51
+ </tbody>
52
+ </table>
53
+
54
+ <%= paginate @aims %>
@@ -0,0 +1 @@
1
+ $('#aim_aim_codes_<%= params[:index] %>').remove();
@@ -0,0 +1,38 @@
1
+ <div class="ui segment breadcrumb">
2
+ <%= link_to 'Back', admin_aims_path, class: 'section' %>
3
+ <div class="divider"> / </div>
4
+ <div class="active section">Show</div>
5
+ </div>
6
+
7
+ <table class="table is-hoverable is-fullwidth">
8
+ <tbody>
9
+ <tr>
10
+ <td class="has-text-right"><%= Aim.human_attribute_name(:name) %></td>
11
+ <td><%= @aim.name %></td>
12
+ </tr>
13
+ <tr>
14
+ <td class="has-text-right"><%= Aim.human_attribute_name(:wanted_point) %></td>
15
+ <td><%= @aim.wanted_point %></td>
16
+ </tr>
17
+ <tr>
18
+ <td class="has-text-right"><%= Aim.human_attribute_name(:present_point) %></td>
19
+ <td><%= @aim.present_point %></td>
20
+ </tr>
21
+ <tr>
22
+ <td class="has-text-right"><%= Aim.human_attribute_name(:unit) %></td>
23
+ <td><%= @aim.unit %></td>
24
+ </tr>
25
+ <tr>
26
+ <td class="has-text-right"><%= Aim.human_attribute_name(:score) %></td>
27
+ <td><%= @aim.score %></td>
28
+ </tr>
29
+ <tr>
30
+ <td class="has-text-right"><%= Aim.human_attribute_name(:code_type) %></td>
31
+ <td><%= @aim.code_type %></td>
32
+ </tr>
33
+ <tr>
34
+ <td class="has-text-right"><%= Aim.human_attribute_name(:code) %></td>
35
+ <td><%= @aim.code %></td>
36
+ </tr>
37
+ </tbody>
38
+ </table>