rails_profile 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +20 -0
  4. data/Rakefile +32 -0
  5. data/app/controllers/profiled/admin/address_organs_controller.rb +27 -0
  6. data/app/controllers/profiled/admin/addresses_controller.rb +48 -0
  7. data/app/controllers/profiled/admin/base_controller.rb +4 -0
  8. data/app/controllers/profiled/admin/profiles_controller.rb +42 -0
  9. data/app/controllers/profiled/areas_controller.rb +42 -0
  10. data/app/controllers/profiled/base_controller.rb +4 -0
  11. data/app/controllers/profiled/me/base_controller.rb +9 -0
  12. data/app/controllers/profiled/me/profiles_controller.rb +43 -0
  13. data/app/controllers/profiled/my/address_users_controller.rb +27 -0
  14. data/app/controllers/profiled/my/addresses_controller.rb +102 -0
  15. data/app/controllers/profiled/my/base_controller.rb +4 -0
  16. data/app/controllers/profiled/my/profiles_controller.rb +67 -0
  17. data/app/controllers/profiled/panel/areas_controller.rb +27 -0
  18. data/app/controllers/profiled/panel/base_controller.rb +4 -0
  19. data/app/models/concerns/qq_map_helper.rb +80 -0
  20. data/app/models/profiled/address.rb +8 -0
  21. data/app/models/profiled/address_organ.rb +5 -0
  22. data/app/models/profiled/address_user.rb +5 -0
  23. data/app/models/profiled/application_record.rb +5 -0
  24. data/app/models/profiled/area.rb +6 -0
  25. data/app/models/profiled/ext/organ.rb +11 -0
  26. data/app/models/profiled/ext/user.rb +17 -0
  27. data/app/models/profiled/model/account.rb +17 -0
  28. data/app/models/profiled/model/address.rb +33 -0
  29. data/app/models/profiled/model/address_organ.rb +23 -0
  30. data/app/models/profiled/model/address_user.rb +29 -0
  31. data/app/models/profiled/model/area.rb +120 -0
  32. data/app/models/profiled/model/profile.rb +43 -0
  33. data/app/models/profiled/profile.rb +5 -0
  34. data/app/models/profiled.rb +11 -0
  35. data/app/views/admin/_profile_nav.html.erb +10 -0
  36. data/app/views/me/_profile_nav.html.erb +4 -0
  37. data/app/views/my/_profile_nav.html.erb +5 -0
  38. data/app/views/panel/_profile_nav.html.erb +10 -0
  39. data/app/views/profiled/admin/base/_nav.html.erb +4 -0
  40. data/app/views/profiled/admin/profiles/_edit_form.html.erb +5 -0
  41. data/app/views/profiled/admin/profiles/_filter_form.html.erb +9 -0
  42. data/app/views/profiled/admin/profiles/_form.html.erb +6 -0
  43. data/app/views/profiled/admin/profiles/_index_tbody.html.erb +6 -0
  44. data/app/views/profiled/admin/profiles/_index_thead.html.erb +7 -0
  45. data/app/views/profiled/admin/profiles/_new_form.html.erb +5 -0
  46. data/app/views/profiled/admin/profiles/_profile.json.jbuilder +2 -0
  47. data/app/views/profiled/admin/profiles/_show_table.html.erb +24 -0
  48. data/app/views/profiled/admin/profiles/index.html.erb +5 -0
  49. data/app/views/profiled/admin/profiles/qrcode.json.jbuilder +1 -0
  50. data/app/views/profiled/areas/_index.html.erb +26 -0
  51. data/app/views/profiled/areas/follow.turbo_stream.erb +11 -0
  52. data/app/views/profiled/areas/index.json.jbuilder +2 -0
  53. data/app/views/profiled/areas/index.turbo_stream+phone.erb +1 -0
  54. data/app/views/profiled/me/profiles/_edit_form.html.erb +4 -0
  55. data/app/views/profiled/me/profiles/_form.html.erb +5 -0
  56. data/app/views/profiled/me/profiles/_profile.json.jbuilder +14 -0
  57. data/app/views/profiled/me/profiles/_show_table.html.erb +20 -0
  58. data/app/views/profiled/me/profiles/show.json.jbuilder +1 -0
  59. data/app/views/profiled/my/address_users/create.turbo_stream.erb +3 -0
  60. data/app/views/profiled/my/addresses/_filter_form.html.erb +9 -0
  61. data/app/views/profiled/my/addresses/_form.html+phone.erb +15 -0
  62. data/app/views/profiled/my/addresses/_form.html.erb +4 -0
  63. data/app/views/profiled/my/addresses/_index/_address.html.erb +20 -0
  64. data/app/views/profiled/my/addresses/_index_tbody.html.erb +4 -0
  65. data/app/views/profiled/my/addresses/_index_thead.html.erb +5 -0
  66. data/app/views/profiled/my/addresses/_list/_address.html.erb +18 -0
  67. data/app/views/profiled/my/addresses/_new_form.html+phone.erb +12 -0
  68. data/app/views/profiled/my/addresses/_new_form.html.erb +4 -0
  69. data/app/views/profiled/my/addresses/_outer_select.html+phone.erb +14 -0
  70. data/app/views/profiled/my/addresses/_outer_select.html.erb +17 -0
  71. data/app/views/profiled/my/addresses/_select.html.erb +10 -0
  72. data/app/views/profiled/my/addresses/_show_table.html+phone.erb +25 -0
  73. data/app/views/profiled/my/addresses/_show_table.html.erb +12 -0
  74. data/app/views/profiled/my/addresses/_wechat_form.html.erb +36 -0
  75. data/app/views/profiled/my/addresses/create.turbo_stream.erb +5 -0
  76. data/app/views/profiled/my/addresses/fork.turbo_stream.erb +3 -0
  77. data/app/views/profiled/my/addresses/index.html+phone.erb +26 -0
  78. data/app/views/profiled/my/addresses/index.html.erb +7 -0
  79. data/app/views/profiled/my/addresses/list.html+phone.erb +41 -0
  80. data/app/views/profiled/my/addresses/select.turbo_stream.erb +1 -0
  81. data/app/views/profiled/my/addresses/show.html+phone.erb +26 -0
  82. data/app/views/profiled/my/addresses/update.turbo_stream.erb +7 -0
  83. data/app/views/profiled/my/addresses/wechat.turbo_stream.erb +3 -0
  84. data/app/views/profiled/my/profiles/_edit_form.html+phone.erb +15 -0
  85. data/app/views/profiled/my/profiles/_edit_form.html.erb +4 -0
  86. data/app/views/profiled/my/profiles/_form.html.erb +6 -0
  87. data/app/views/profiled/my/profiles/_profile.json.jbuilder +1 -0
  88. data/app/views/profiled/my/profiles/_show_table.html+phone.erb +24 -0
  89. data/app/views/profiled/my/profiles/_show_table.html.erb +20 -0
  90. data/app/views/profiled/my/profiles/index.html+phone.erb +3 -0
  91. data/app/views/profiled/my/profiles/index.html.erb +31 -0
  92. data/app/views/profiled/my/profiles/index.json.jbuilder +1 -0
  93. data/app/views/profiled/my/profiles/show.html+phone.erb +8 -0
  94. data/app/views/profiled/my/profiles/show.html.erb +1 -0
  95. data/app/views/profiled/my/profiles/show.json.jbuilder +1 -0
  96. data/app/views/profiled/panel/addresses/_address.html.erb +24 -0
  97. data/app/views/profiled/panel/addresses/_edit_form.html.erb +4 -0
  98. data/app/views/profiled/panel/addresses/_form.html.erb +22 -0
  99. data/app/views/profiled/panel/addresses/_index_tbody.html.erb +16 -0
  100. data/app/views/profiled/panel/addresses/_index_thead.html.erb +5 -0
  101. data/app/views/profiled/panel/addresses/_new_form.html.erb +4 -0
  102. data/app/views/profiled/panel/addresses/index.html.erb +5 -0
  103. data/app/views/profiled/panel/areas/_filter_form.html.erb +9 -0
  104. data/app/views/profiled/panel/areas/_form.html.erb +5 -0
  105. data/app/views/profiled/panel/areas/_index_tbody.html.erb +17 -0
  106. data/app/views/profiled/panel/areas/_index_thead.html.erb +8 -0
  107. data/app/views/profiled/panel/areas/_show_table.html.erb +8 -0
  108. data/app/views/profiled/panel/areas/index.html.erb +5 -0
  109. data/app/views/profiled/panel/base/_nav.html.erb +3 -0
  110. data/config/locales/en.controller.yml +30 -0
  111. data/config/locales/en.enum.yml +15 -0
  112. data/config/locales/zh.attributes.yml +28 -0
  113. data/config/locales/zh.controller.yml +38 -0
  114. data/config/locales/zh.enum.yml +10 -0
  115. data/config/routes.rb +45 -0
  116. data/lib/rails_profile/config.rb +11 -0
  117. data/lib/rails_profile/engine.rb +21 -0
  118. data/lib/rails_profile.rb +2 -0
  119. metadata +174 -0
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @address, url: { controller: 'profiled/my/addresses', action: 'create' } do |f| %>
2
+ <%= render partial: 'profiled/my/addresses/form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <div class="weui-cell weui-cell_active">
2
+ <div class="weui-cell__hd">
3
+ <%= f.label "#{outer}_id", class: 'weui-label' %>
4
+ </div>
5
+ <div class="weui-cell__bd is-flex">
6
+ <% if node&.ancestors.present? %>
7
+ <% node.ancestors.reverse_each do |node| %>
8
+ <%= render partial: 'com/nodes/outer_options', locals: { f: f, node: node, depth: node.depth, outer: outer } %>
9
+ <% end %>
10
+ <% else %>
11
+ <%= render partial: 'com/nodes/outer_options', locals: { f: f, node: node, depth: 0, outer: outer } %>
12
+ <% end %>
13
+ </div>
14
+ </div>
@@ -0,0 +1,17 @@
1
+ <div class="field is-horizontal">
2
+ <%= f.label "#{outer}_id" %>
3
+ <div class="field-body">
4
+ <% if node&.ancestors.present? %>
5
+ <% node.ancestors.reverse_each do |node| %>
6
+ <%= render partial: 'com/nodes/outer_options', locals: { f: f, node: node, depth: node.depth, outer: outer } %>
7
+ <% end %>
8
+ <% else %>
9
+ <%= render partial: 'com/nodes/outer_options', locals: { f: f, node: node, depth: 0, outer: outer } %>
10
+ <% end %>
11
+ <div class="field has-addons has-addons-middle">
12
+ <%= link_to({ action: 'select' }, data: { controller: 'common', action: 'common#link' }) do %>
13
+ <i class="fa-light fa-map-marker-alt"></i><span>获取定位</span>
14
+ <% end %>
15
+ </div>
16
+ </div>
17
+ </div>
@@ -0,0 +1,10 @@
1
+ <iframe
2
+ class="as-top"
3
+ id="qq-map"
4
+ src="https://apis.map.qq.com/tools/locpicker?type=1&key=<%= SETTING.dig(:qq_map, :ws) %>&referer=work_design"
5
+ data-controller="qq-map"
6
+ data-action="message@window->qq-map#selected"
7
+ data-qq-map-name-value="line_locations_attributes"
8
+ data-qq-map-index-value="<%= params[:index] %>"
9
+ >
10
+ </iframe>
@@ -0,0 +1,25 @@
1
+ <div class="weui-form-preview">
2
+ <div class="weui-form-preview__hd">
3
+ <div class="weui-form-preview__item">
4
+ <label class="weui-form-preview__label"><%= @address.contact %></label>
5
+ <em class="weui-form-preview__value"><%= @address.tel %></em>
6
+ </div>
7
+ </div>
8
+ <div class="weui-form-preview__bd">
9
+ <div class="weui-form-preview__item">
10
+ <label class="weui-form-preview__label"><%= Address.human_attribute_name(:area) %></label>
11
+ <span class="weui-form-preview__value"><%= @address.area.full_name %></span>
12
+ </div>
13
+ <div class="weui-form-preview__item">
14
+ <label class="weui-form-preview__label"><%= Address.human_attribute_name(:detail) %></label>
15
+ <span class="weui-form-preview__value"><%= @address.detail %></span>
16
+ </div>
17
+ <div class="weui-form-preview__item">
18
+ <label class="weui-form-preview__label"><%= Address.human_attribute_name(:post_code) %></label>
19
+ <span class="weui-form-preview__value"><%= @address.post_code %></span>
20
+ </div>
21
+ </div>
22
+ <div class="weui-form-preview__ft">
23
+ <a class="weui-form-preview__btn weui-form-preview__btn_primary">操作</a>
24
+ </div>
25
+ </div>
@@ -0,0 +1,12 @@
1
+ <tr>
2
+ <td class="has-text-right"><%= Profiled::Address.human_attribute_name(:contact) %></td>
3
+ <td><%= @address.contact %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= Profiled::Address.human_attribute_name(:detail) %></td>
7
+ <td><%= @address.detail %></td>
8
+ </tr>
9
+ <tr>
10
+ <td class="has-text-right"><%= Profiled::Address.human_attribute_name(:area_id) %></td>
11
+ <td><%= @address.area_id %></td>
12
+ </tr>
@@ -0,0 +1,36 @@
1
+ <div data-controller="weui-dialog" id="dialog">
2
+ <div class="weui-half-screen-dialog weui-half-screen-dialog_show" data-weui-dialog-target="dialog">
3
+ <div class="weui-half-screen-dialog__hd">
4
+ <div class="weui-half-screen-dialog__hd__side">
5
+ <button class="weui-btn weui-btn_mini weui-btn_warn">返回</button>
6
+ </div>
7
+ <div class="weui-half-screen-dialog__hd__main">
8
+ <div class="weui-half-screen-dialog__title">选择</div>
9
+ </div>
10
+ <div class="weui-half-screen-dialog__hd__side">
11
+ <button class="weui-btn weui-btn_mini weui-btn_primary" data-action="weui-dialog#close">关闭</button>
12
+ </div>
13
+ </div>
14
+ <div class="weui-half-screen-dialog__bd">
15
+ <%= form_with theme: 'weui', model: @address, url: { action: 'wechat' }, data: { controller: 'wechat_address' } do |f| %>
16
+ <%= f.text_field :contact %>
17
+ <%= f.text_field :tel %>
18
+ <div class="weui-cell weui-cell_active weui-cell_readonly">
19
+ <div class="weui-cell__hd">
20
+ <label class="weui-label"><%= Profiled::Address.human_attribute_name(:area_id) %></label>
21
+ </div>
22
+ <div class="weui-cell__bd is-flex">
23
+ <%= text_field_tag :provinceName, params[:provinceName], class: 'weui-input', readonly: true %>
24
+ <%= text_field_tag :cityName, params[:cityName], class: 'weui-input', readonly: true %>
25
+ <%= text_field_tag :countyName, params[:countyName], class: 'weui-input', readonly: true %>
26
+ </div>
27
+ </div>
28
+ <%= f.text_area :detail %>
29
+ <%= f.text_field :post_code %>
30
+ <%= hidden_field_tag :return_to, params[:return_to] %>
31
+ <%= f.submit nil, wrap: { all: nil } %>
32
+ <% end %>
33
+ </div>
34
+ <div class="weui-half-screen-dialog__ft"></div>
35
+ </div>
36
+ </div>
@@ -0,0 +1,5 @@
1
+ <% if request.headers['Turbo-Frame'] == 'modal' %>
2
+ <%= turbo_stream.append 'body' do %>
3
+ <div data-controller="visit"></div>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= turbo_stream.after 'wechat_panel' do %>
2
+ <%= render 'wechat_form' %>
3
+ <% end %>
@@ -0,0 +1,26 @@
1
+ <%= content_for(:wechat_js) do %>
2
+ <%= wechat_config_js debug: false, apis: ['openAddress', 'getLocation', 'openLocation', 'scanQRCode'] -%>
3
+ <meta name="turbo-visit-control" content="reload">
4
+ <% end %>
5
+
6
+ <div class="weui-panel" id="wechat_panel">
7
+ <div class="weui-panel__hd level is-flex mb-0">
8
+ <div class="level-left"><%= t('.title') %></div>
9
+ <div class="level-right mt-0">
10
+ <%= link_to '选择', { action: 'list' } %>
11
+ </div>
12
+ </div>
13
+ <div class="weui-panel__bd">
14
+ <%= render partial: 'address', collection: @addresses, as: :model %>
15
+ </div>
16
+ <div class="weui-panel__ft" data-controller="wechat" data-wechat-address-value="/pages/profiled/my/addresses/index?url=<%= url_for(action: 'program', only_path: false) %>" data-wechat-url-value="<%= url_for(action: 'fork', only_path: false) %>" id="wechat_address">
17
+ <div class="weui-cell weui-cell_access weui-cell_link" data-action="click->wechat#openAddress">
18
+ <div class="weui-cell__bd"><%= t('.new') %></div>
19
+ <span class="weui-cell__ft"></span>
20
+ </div>
21
+ <%= link_to({ action: 'new' }, class: 'weui-cell weui-cell_access weui-cell_link') do %>
22
+ <div class="weui-cell__bd">手动添加</div>
23
+ <span class="weui-cell__ft"></span>
24
+ <% end %>
25
+ </div>
26
+ </div>
@@ -0,0 +1,7 @@
1
+ <%= turbo_frame_tagged 'modal' do %>
2
+ <%= render layout: 'index_table', locals: { cache_key: Profiled::Address.column_names.hash } do %>
3
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @addresses, as: :model %>
4
+ <% end %>
5
+
6
+ <%= paginate @addresses %>
7
+ <% end %>
@@ -0,0 +1,41 @@
1
+ <%= content_for(:wechat_js) do %>
2
+ <%= wechat_config_js debug: false, apis: ['openAddress', 'getLocation', 'openLocation', 'scanQRCode'] -%>
3
+ <meta name="turbo-visit-control" content="reload">
4
+ <% end %>
5
+
6
+ <% if current_cart.member %>
7
+ <div class="weui-panel">
8
+ <div class="weui-panel__hd"><%= current_cart.member.organ.name %></div>
9
+ <div class="weui-panel__bd">
10
+ <div class="weui-cells weui-cells_radio">
11
+ <% if current_cart.member.organ.addresses.blank? %>
12
+ <div class="weui-cell has-text-grey">暂无地址,请联系企业负责人添加</div>
13
+ <% else %>
14
+ <%= render partial: 'address', collection: current_cart.member.organ.addresses, as: :model %>
15
+ <% end %>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ <% end %>
20
+
21
+ <div class="weui-panel" id="wechat_panel">
22
+ <div class="weui-panel__hd level is-flex mb-0">
23
+ <div class="level-lfet"><%= t('.title') %></div>
24
+ <div class="level-right mt-0">
25
+ <%= link_to '管理', { action: 'index' } %>
26
+ </div>
27
+ </div>
28
+ <div class="weui-panel__bd">
29
+ <div class="weui-cells weui-cells_radio">
30
+ <%= render partial: 'address', collection: @current_user.addresses, as: :model %>
31
+ </div>
32
+ </div>
33
+ <div class="weui-panel__ft" data-controller="wechat" data-wechat-address-value="/pages/profiled/my/addresses/index?url=<%= url_for(action: 'program', only_path: false) %>" data-wechat-url-value="<%= url_for(action: 'fork', only_path: false) %>" id="wechat_address">
34
+ <div class="weui-cells">
35
+ <div class="weui-cell weui-cell_access weui-cell_link" data-action="click->wechat#openAddress">
36
+ <div class="weui-cell__bd"><%= t('.new') %></div>
37
+ <span class="weui-cell__ft"></span>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
@@ -0,0 +1 @@
1
+ <%= turbo_stream.after 'modal', partial: 'select' %>
@@ -0,0 +1,26 @@
1
+ <%= content_for(:wechat_js) do %>
2
+ <%= wechat_config_js debug: false, apis: ['updateAppMessageShareData', 'updateTimelineShareData'] -%>
3
+ <% end %>
4
+
5
+ <%= render 'show_table' %>
6
+
7
+ <script>
8
+ wx.ready(function() {
9
+ wx.updateAppMessageShareData({
10
+ title: 'dddd',
11
+ desc: 'ssss',
12
+ link: '<%= join_my_address_url(@address.id, invited_code: current_user.id) %>',
13
+ imgUrl: '',
14
+ success: function() {
15
+ }
16
+ })
17
+ wx.updateTimelineShareData({
18
+ title: '',
19
+ link: '<%= join_my_address_url(@address.id, invited_code: current_user.id) %>',
20
+ imgUrl: '',
21
+ success: function() {
22
+
23
+ }
24
+ })
25
+ })
26
+ </script>
@@ -0,0 +1,7 @@
1
+ <%= turbo_stream.append 'body' do %>
2
+ <% if request.headers['Turbo-Frame'] == 'modal' && request.headers['Redirect'] %>
3
+ <div data-controller="visit" data-visit-frame-value="modal" data-visit-url-value="<%= request.headers['Redirect'] %>"></div>
4
+ <% else %>
5
+ <div data-controller="visit" data-visit-url-value="<%= url_for(action: 'index') %>"></div>
6
+ <% end %>
7
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= turbo_stream.append 'body' do %>
2
+ <div data-controller="visit" data-visit-url-value="<%= return_to %>"></div>
3
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <%= form_with theme: 'weui', model: @profile, url: { action: 'update' } do |f| %>
2
+ <div class="weui-form__control-area">
3
+ <div class="weui-cells__group weui-cells__group_form">
4
+ <div class="weui-cells__title">个人信息</div>
5
+ <div class="weui-cells weui-cells_form">
6
+ <%= f.text_field :real_name %>
7
+ <%= f.text_field :nick_name %>
8
+ <%= f.select :gender, options_for_select(Profiled::Profile.options_i18n(:gender), @profile.gender) %>
9
+ <%= f.select :birthday_type, options_for_select(Profiled::Profile.options_i18n(:birthday_type)) %>
10
+ <%= f.date_field :birthday %>
11
+ </div>
12
+ </div>
13
+ </div>
14
+ <%= f.submit nil, wrap: { all: nil } %>
15
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @profile, url: { action: 'update' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <%= f.text_field :real_name %>
2
+ <%= f.text_field :nick_name %>
3
+ <%= f.select :gender, options_for_select(Profiled::Profile.options_i18n(:gender), @profile.gender) %>
4
+ <%= f.select :birthday_type, options_for_select(Profiled::Profile.options_i18n(:birthday_type)) %>
5
+ <%= f.date_field :birthday %>
6
+ <%= f.select :identity, options_for_select(@accounts.pluck(:identity, :identity)) %>
@@ -0,0 +1 @@
1
+ json.extract! profile, :id, :real_name, :nick_name, :age, :birthday_type, :birthday, :address, :extra, :avatar_url
@@ -0,0 +1,24 @@
1
+ <div class="weui-form-preview__item">
2
+ <label class="weui-form-preview__label"><%= Profiled::Profile.human_attribute_name(:real_name) %></label>
3
+ <span class="weui-form-preview__value"><%= @profile.real_name %></span>
4
+ </div>
5
+ <div class="weui-form-preview__item">
6
+ <label class="weui-form-preview__label"><%= Profiled::Profile.human_attribute_name(:nick_name) %></label>
7
+ <span class="weui-form-preview__value"><%= @profile.nick_name %></span>
8
+ </div>
9
+ <div class="weui-form-preview__item">
10
+ <label class="weui-form-preview__label"><%= Profiled::Profile.human_attribute_name(:gender) %></label>
11
+ <span class="weui-form-preview__value"><%= @profile.gender_i18n %></span>
12
+ </div>
13
+ <div class="weui-form-preview__item">
14
+ <label class="weui-form-preview__label"><%= Profiled::Profile.human_attribute_name(:birthday_type) %></label>
15
+ <span class="weui-form-preview__value"><%= @profile.birthday_type_i18n %></span>
16
+ </div>
17
+ <div class="weui-form-preview__item">
18
+ <label class="weui-form-preview__label"><%= Profiled::Profile.human_attribute_name(:birthday) %></label>
19
+ <span class="weui-form-preview__value"><%= @profile.birthday %></span>
20
+ </div>
21
+ <div class="weui-form-preview__item">
22
+ <label class="weui-form-preview__label"><%= Profiled::Profile.human_attribute_name(:age) %></label>
23
+ <span class="weui-form-preview__value"><%= @profile.age %></span>
24
+ </div>
@@ -0,0 +1,20 @@
1
+ <tr>
2
+ <td class="has-text-right"><%= Profiled::Profile.human_attribute_name(:real_name) %></td>
3
+ <td><%= @profile.real_name %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= Profiled::Profile.human_attribute_name(:nick_name) %></td>
7
+ <td><%= @profile.nick_name %></td>
8
+ </tr>
9
+ <tr>
10
+ <td class="has-text-right"><%= Profiled::Profile.human_attribute_name(:gender) %></td>
11
+ <td><%= @profile.gender_i18n %></td>
12
+ </tr>
13
+ <tr>
14
+ <td class="has-text-right"><%= Profiled::Profile.human_attribute_name(:birthday_type) %></td>
15
+ <td><%= @profile.birthday_type_i18n %></td>
16
+ </tr>
17
+ <tr>
18
+ <td class="has-text-right"><%= Profiled::Profile.human_attribute_name(:birthday) %></td>
19
+ <td><%= @profile.birthday %></td>
20
+ </tr>
@@ -0,0 +1,3 @@
1
+ <%= content_for(:wechat_js) do %>
2
+ <%= wechat_config_js debug: false, apis: ['getLocation', 'openLocation'] -%>
3
+ <% end %>
@@ -0,0 +1,31 @@
1
+ <div class="ui four cards">
2
+ <% @profiles.each do |profile| %>
3
+ <div class="card">
4
+ <div class="ui small circular image">
5
+ <%= image_tag profile.avatar if profile.avatar.present? %>
6
+ </div>
7
+ <div class="content">
8
+ <div>
9
+ <i class="fa-light fa-user"></i>
10
+ <span class="ui grey text"><%= profile.real_name %></span>
11
+ <span class="ui green text"><%= profile.identity %></span>
12
+ <%= link_to({ action: 'edit' }, aria: { label: t('.edit') }) do %>
13
+ <i class="fa-light fa-pencil"></i>
14
+ <% end %>
15
+ </div>
16
+ </div>
17
+ <div class="extra content">
18
+ <p>
19
+ <span><%= profile.address %></span>
20
+ </p>
21
+ </div>
22
+ </div>
23
+ <% end %>
24
+ <div class="card">
25
+ <div class="content">
26
+ <%= link_to({ action: 'new' }, aria: { label: t('profile.my.profiles.new.title') }) do %>
27
+ <i class="fa-light fa-plus"></i>
28
+ <% end %>
29
+ </div>
30
+ </div>
31
+ </div>
@@ -0,0 +1 @@
1
+ json.profiles @profiles, partial: 'profile', as: :profile
@@ -0,0 +1,8 @@
1
+ <div class="weui-form-preview">
2
+ <div class="weui-form-preview__bd">
3
+ <%= render 'show_table' %>
4
+ </div>
5
+ <div class="weui-form-preview__ft">
6
+ <%= link_to t('.edit'), { action: 'edit' }, class: 'weui-form-preview__btn weui-form-preview__btn_primary' %>
7
+ </div>
8
+ </div>
@@ -0,0 +1 @@
1
+ <%= render 'show' %>
@@ -0,0 +1 @@
1
+ json.profile @profile, partial: 'profile', as: :profile
@@ -0,0 +1,24 @@
1
+ <tr id="address_<%= address.id %>">
2
+ <td>
3
+ <div class="ui radio checkbox">
4
+ <% if address.kind == 'invoice' %>
5
+ <%= radio_button_tag :'order[invoice_address_id]', address.id, true, form: 'new_order' %><label></label>
6
+ <% else %>
7
+ <%= radio_button_tag :'order[address_id]', address.id, true, form: 'new_order' %><label></label>
8
+ <% end %>
9
+ </div>
10
+ </td>
11
+ <td><%= address.contact_person %></td>
12
+ <td><%= address.tel %></td>
13
+ <td>
14
+ <%= address.area.nation %>
15
+ <%= address.area.province %>
16
+ <%= address.area.city %>
17
+ </td>
18
+ <td><%= address.address %></td>
19
+ <td>
20
+ <%= link_to 'Edit', edit_admin_address_path(address) %>
21
+ <%= link_to 'Destroy', admin_address_path(address), method: :delete, data: { confirm: 'Are you sure?' } %>
22
+ </td>
23
+ </tr>
24
+
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @address, url: { action: 'update' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <div class="fields">
2
+ <div class="field">
3
+ <%= label :nation, 'Nation' %>
4
+ <%= f.select :nation, options_for_select(Area.all_nations, @address.area&.nation), { can: { wrap_all: false, wrap_input: false }, label: false }, { class: 'ui search selection dropdown' } %>
5
+ </div>
6
+ <div class="field">
7
+ <%= label :province, 'Province' %>
8
+ <%= f.select :province, options_for_select([@address.area&.province], @address.area&.province), { can: { wrap_all: false, wrap_input: false }, label: false }, { class: 'ui search selection dropdown' } %>
9
+ </div>
10
+ <div class="field">
11
+ <%= label :city, 'City' %>
12
+ <%= f.select :city, options_for_select([@address.area&.city], @address.area&.city), { on: { wrap_all: false, wrap_input: false }, label: false }, { class: 'ui search selection dropdown' } %>
13
+ </div>
14
+ </div>
15
+ <%= f.hidden_field :area_id %>
16
+ <%= f.hidden_field :user_id %>
17
+ <%= f.select :kind, options_for_select(Address.options_i18n(:kind)) %>
18
+ <%= f.select :proxy_shipment, options_for_select(Address.options_i18n(:proxy_shipment)) %>
19
+ <%= f.text_field :contact_person %>
20
+ <%= f.text_field :tel %>
21
+ <%= f.text_field :address %>
22
+ <%= f.text_field :postcode %>
@@ -0,0 +1,16 @@
1
+ <tr>
2
+ <td><%= address.kind_i18n %></td>
3
+ <td><%= address.contact_person %></td>
4
+ <td><%= address.tel %></td>
5
+ <td>
6
+ <%= address.area.nation %>
7
+ <%= address.area.province %>
8
+ <%= address.area.city %>
9
+ </td>
10
+ <td><%= address.address %></td>
11
+ <td>
12
+ <%= link_to 'Show', address_path(address) %>
13
+ <%= link_to 'Edit', edit_admin_address_path(address) %>
14
+ <%= link_to 'Destroy', admin_address_path(address), method: :delete, data: { confirm: t('.confirm') } %>
15
+ </td>
16
+ </tr>
@@ -0,0 +1,5 @@
1
+ <th>Kind</th>
2
+ <th>联系人</th>
3
+ <th>联系方式</th>
4
+ <th></th>
5
+ <th></th>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @address, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render layout: 'index_table', locals: { cache_key: Address.column_names.hash } do %>
2
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @addresses, as: :address %>
3
+ <% end %>
4
+
5
+ <%= paginate @addresses %>
@@ -0,0 +1,9 @@
1
+ <%= form_with theme: 'search', model: Profiled::Area.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 'error_messages', target: f.object %>
2
+ <%= render partial: 'com/nodes/siblings_select', locals: { f: f, node: Profiled::Area.new } %>
3
+ <%= f.text_field :name %>
4
+ <%= f.check_box :popular %>
5
+ <%= f.check_box :published %>
@@ -0,0 +1,17 @@
1
+ <td><%= model.full_name %></td>
2
+ <td>
3
+ <p><%= model.name %></p>
4
+ <p><%= model.full %></p>
5
+ </td>
6
+ <td>
7
+ <%= form_with theme: nil, model: model, url: { action: 'update', id: model.id }, data: { controller: 'input' } do |f| %>
8
+ <%= f.check_box :popular, data: { input_target: 'checkbox' }, id: nil, class: 'switch is-rounded' %>
9
+ <label data-action="click->input#check"></label>
10
+ <% end %>
11
+ </td>
12
+ <td>
13
+ <%= form_with theme: nil, model: model, url: { action: 'update', id: model.id }, data: { controller: 'input' } do |f| %>
14
+ <%= f.check_box :published, data: { input_target: 'checkbox' }, id: nil, class: 'switch is-rounded' %>
15
+ <label data-action="click->input#check"></label>
16
+ <% end %>
17
+ </td>
@@ -0,0 +1,8 @@
1
+ <th><%= Profiled::Area.human_attribute_name(:names) %></th>
2
+ <th>
3
+ <p><%= Profiled::Area.human_attribute_name(:name) %></p>
4
+ <p><%= Profiled::Area.human_attribute_name(:full) %></p>
5
+ </th>
6
+ <th><%= Profiled::Area.human_attribute_name(:popular) %></th>
7
+ <th><%= Profiled::Area.human_attribute_name(:published) %></th>
8
+ <th></th>
@@ -0,0 +1,8 @@
1
+ <tr>
2
+ <td class="has-text-right"><%= Profiled::Area.human_attribute_name(:name) %></td>
3
+ <td><%= @area.name %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= Profiled::Area.human_attribute_name(:names) %></td>
7
+ <td><%= @area.names %></td>
8
+ </tr>
@@ -0,0 +1,5 @@
1
+ <%= render layout: 'index_table', locals: { cache_key: Profiled::Area.column_names.hash } do %>
2
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @areas, as: :model %>
3
+ <% end %>
4
+
5
+ <%= paginate @areas %>
@@ -0,0 +1,3 @@
1
+ <aside class="menu is-light" style="height: 100%">
2
+ <%= render 'profile_nav' %>
3
+ </aside>
@@ -0,0 +1,30 @@
1
+ en:
2
+ profiled:
3
+ title: Profile
4
+ panel:
5
+ title: 区域管理
6
+ areas:
7
+ index:
8
+ title: 地区
9
+ agencies:
10
+ index:
11
+ title: 会员列表
12
+ my:
13
+ title: Settings
14
+ profiles:
15
+ index:
16
+ title: Profile
17
+ show:
18
+ title: Profile
19
+ new:
20
+ title: 添加个人资料
21
+ addresses:
22
+ index:
23
+ title: Addresses
24
+ new: Add
25
+ add: 地图选择
26
+ me:
27
+ title: 个人中心
28
+ profiles:
29
+ show:
30
+ title: 个人资料
@@ -0,0 +1,15 @@
1
+ en:
2
+ activerecord:
3
+ enum:
4
+ profiled/address:
5
+ kind:
6
+ transport: Transport
7
+ forwarder: Forwarder
8
+ invoice: Invoice
9
+ profiled/profile:
10
+ birthday_type:
11
+ solar: Gregorian
12
+ lunar: Lunar
13
+ gender:
14
+ male: Male
15
+ female: Female