rails_profile 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +20 -0
- data/README.md +20 -0
- data/Rakefile +32 -0
- data/app/controllers/profiled/admin/address_organs_controller.rb +27 -0
- data/app/controllers/profiled/admin/addresses_controller.rb +48 -0
- data/app/controllers/profiled/admin/base_controller.rb +4 -0
- data/app/controllers/profiled/admin/profiles_controller.rb +42 -0
- data/app/controllers/profiled/areas_controller.rb +42 -0
- data/app/controllers/profiled/base_controller.rb +4 -0
- data/app/controllers/profiled/me/base_controller.rb +9 -0
- data/app/controllers/profiled/me/profiles_controller.rb +43 -0
- data/app/controllers/profiled/my/address_users_controller.rb +27 -0
- data/app/controllers/profiled/my/addresses_controller.rb +102 -0
- data/app/controllers/profiled/my/base_controller.rb +4 -0
- data/app/controllers/profiled/my/profiles_controller.rb +67 -0
- data/app/controllers/profiled/panel/areas_controller.rb +27 -0
- data/app/controllers/profiled/panel/base_controller.rb +4 -0
- data/app/models/concerns/qq_map_helper.rb +80 -0
- data/app/models/profiled/address.rb +8 -0
- data/app/models/profiled/address_organ.rb +5 -0
- data/app/models/profiled/address_user.rb +5 -0
- data/app/models/profiled/application_record.rb +5 -0
- data/app/models/profiled/area.rb +6 -0
- data/app/models/profiled/ext/organ.rb +11 -0
- data/app/models/profiled/ext/user.rb +17 -0
- data/app/models/profiled/model/account.rb +17 -0
- data/app/models/profiled/model/address.rb +33 -0
- data/app/models/profiled/model/address_organ.rb +23 -0
- data/app/models/profiled/model/address_user.rb +29 -0
- data/app/models/profiled/model/area.rb +120 -0
- data/app/models/profiled/model/profile.rb +43 -0
- data/app/models/profiled/profile.rb +5 -0
- data/app/models/profiled.rb +11 -0
- data/app/views/admin/_profile_nav.html.erb +10 -0
- data/app/views/me/_profile_nav.html.erb +4 -0
- data/app/views/my/_profile_nav.html.erb +5 -0
- data/app/views/panel/_profile_nav.html.erb +10 -0
- data/app/views/profiled/admin/base/_nav.html.erb +4 -0
- data/app/views/profiled/admin/profiles/_edit_form.html.erb +5 -0
- data/app/views/profiled/admin/profiles/_filter_form.html.erb +9 -0
- data/app/views/profiled/admin/profiles/_form.html.erb +6 -0
- data/app/views/profiled/admin/profiles/_index_tbody.html.erb +6 -0
- data/app/views/profiled/admin/profiles/_index_thead.html.erb +7 -0
- data/app/views/profiled/admin/profiles/_new_form.html.erb +5 -0
- data/app/views/profiled/admin/profiles/_profile.json.jbuilder +2 -0
- data/app/views/profiled/admin/profiles/_show_table.html.erb +24 -0
- data/app/views/profiled/admin/profiles/index.html.erb +5 -0
- data/app/views/profiled/admin/profiles/qrcode.json.jbuilder +1 -0
- data/app/views/profiled/areas/_index.html.erb +26 -0
- data/app/views/profiled/areas/follow.turbo_stream.erb +11 -0
- data/app/views/profiled/areas/index.json.jbuilder +2 -0
- data/app/views/profiled/areas/index.turbo_stream+phone.erb +1 -0
- data/app/views/profiled/me/profiles/_edit_form.html.erb +4 -0
- data/app/views/profiled/me/profiles/_form.html.erb +5 -0
- data/app/views/profiled/me/profiles/_profile.json.jbuilder +14 -0
- data/app/views/profiled/me/profiles/_show_table.html.erb +20 -0
- data/app/views/profiled/me/profiles/show.json.jbuilder +1 -0
- data/app/views/profiled/my/address_users/create.turbo_stream.erb +3 -0
- data/app/views/profiled/my/addresses/_filter_form.html.erb +9 -0
- data/app/views/profiled/my/addresses/_form.html+phone.erb +15 -0
- data/app/views/profiled/my/addresses/_form.html.erb +4 -0
- data/app/views/profiled/my/addresses/_index/_address.html.erb +20 -0
- data/app/views/profiled/my/addresses/_index_tbody.html.erb +4 -0
- data/app/views/profiled/my/addresses/_index_thead.html.erb +5 -0
- data/app/views/profiled/my/addresses/_list/_address.html.erb +18 -0
- data/app/views/profiled/my/addresses/_new_form.html+phone.erb +12 -0
- data/app/views/profiled/my/addresses/_new_form.html.erb +4 -0
- data/app/views/profiled/my/addresses/_outer_select.html+phone.erb +14 -0
- data/app/views/profiled/my/addresses/_outer_select.html.erb +17 -0
- data/app/views/profiled/my/addresses/_select.html.erb +10 -0
- data/app/views/profiled/my/addresses/_show_table.html+phone.erb +25 -0
- data/app/views/profiled/my/addresses/_show_table.html.erb +12 -0
- data/app/views/profiled/my/addresses/_wechat_form.html.erb +36 -0
- data/app/views/profiled/my/addresses/create.turbo_stream.erb +5 -0
- data/app/views/profiled/my/addresses/fork.turbo_stream.erb +3 -0
- data/app/views/profiled/my/addresses/index.html+phone.erb +26 -0
- data/app/views/profiled/my/addresses/index.html.erb +7 -0
- data/app/views/profiled/my/addresses/list.html+phone.erb +41 -0
- data/app/views/profiled/my/addresses/select.turbo_stream.erb +1 -0
- data/app/views/profiled/my/addresses/show.html+phone.erb +26 -0
- data/app/views/profiled/my/addresses/update.turbo_stream.erb +7 -0
- data/app/views/profiled/my/addresses/wechat.turbo_stream.erb +3 -0
- data/app/views/profiled/my/profiles/_edit_form.html+phone.erb +15 -0
- data/app/views/profiled/my/profiles/_edit_form.html.erb +4 -0
- data/app/views/profiled/my/profiles/_form.html.erb +6 -0
- data/app/views/profiled/my/profiles/_profile.json.jbuilder +1 -0
- data/app/views/profiled/my/profiles/_show_table.html+phone.erb +24 -0
- data/app/views/profiled/my/profiles/_show_table.html.erb +20 -0
- data/app/views/profiled/my/profiles/index.html+phone.erb +3 -0
- data/app/views/profiled/my/profiles/index.html.erb +31 -0
- data/app/views/profiled/my/profiles/index.json.jbuilder +1 -0
- data/app/views/profiled/my/profiles/show.html+phone.erb +8 -0
- data/app/views/profiled/my/profiles/show.html.erb +1 -0
- data/app/views/profiled/my/profiles/show.json.jbuilder +1 -0
- data/app/views/profiled/panel/addresses/_address.html.erb +24 -0
- data/app/views/profiled/panel/addresses/_edit_form.html.erb +4 -0
- data/app/views/profiled/panel/addresses/_form.html.erb +22 -0
- data/app/views/profiled/panel/addresses/_index_tbody.html.erb +16 -0
- data/app/views/profiled/panel/addresses/_index_thead.html.erb +5 -0
- data/app/views/profiled/panel/addresses/_new_form.html.erb +4 -0
- data/app/views/profiled/panel/addresses/index.html.erb +5 -0
- data/app/views/profiled/panel/areas/_filter_form.html.erb +9 -0
- data/app/views/profiled/panel/areas/_form.html.erb +5 -0
- data/app/views/profiled/panel/areas/_index_tbody.html.erb +17 -0
- data/app/views/profiled/panel/areas/_index_thead.html.erb +8 -0
- data/app/views/profiled/panel/areas/_show_table.html.erb +8 -0
- data/app/views/profiled/panel/areas/index.html.erb +5 -0
- data/app/views/profiled/panel/base/_nav.html.erb +3 -0
- data/config/locales/en.controller.yml +30 -0
- data/config/locales/en.enum.yml +15 -0
- data/config/locales/zh.attributes.yml +28 -0
- data/config/locales/zh.controller.yml +38 -0
- data/config/locales/zh.enum.yml +10 -0
- data/config/routes.rb +45 -0
- data/lib/rails_profile/config.rb +11 -0
- data/lib/rails_profile/engine.rb +21 -0
- data/lib/rails_profile.rb +2 -0
- metadata +174 -0
@@ -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,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,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,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,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,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,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,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,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: 个人资料
|