rails_ship 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +20 -0
  3. data/README.md +32 -0
  4. data/Rakefile +32 -0
  5. data/app/controllers/ship/admin/addresses_controller.rb +48 -0
  6. data/app/controllers/ship/admin/base_controller.rb +5 -0
  7. data/app/controllers/ship/admin/home_controller.rb +8 -0
  8. data/app/controllers/ship/admin/packages_controller.rb +43 -0
  9. data/app/controllers/ship/admin/trade_items_controller.rb +72 -0
  10. data/app/controllers/ship/driver/base_controller.rb +9 -0
  11. data/app/controllers/ship/driver/favorites_controller.rb +39 -0
  12. data/app/controllers/ship/my/addresses_controller.rb +58 -0
  13. data/app/controllers/ship/my/base_controller.rb +5 -0
  14. data/app/controllers/ship/my/cars_controller.rb +54 -0
  15. data/app/controllers/ship/my/drivers_controller.rb +38 -0
  16. data/app/controllers/ship/my/favorites_controller.rb +40 -0
  17. data/app/controllers/ship/my/lines_controller.rb +71 -0
  18. data/app/controllers/ship/my/locations_controller.rb +60 -0
  19. data/app/controllers/ship/my/packages_controller.rb +53 -0
  20. data/app/controllers/ship/my/principal_addresses_controller.rb +26 -0
  21. data/app/controllers/ship/panel/base_controller.rb +5 -0
  22. data/app/controllers/ship/panel/lines_controller.rb +53 -0
  23. data/app/controllers/ship/panel/similars_controller.rb +61 -0
  24. data/app/jobs/ship/car_ocr_job.rb +11 -0
  25. data/app/jobs/ship/driver_ocr_job.rb +11 -0
  26. data/app/jobs/ship/location_geo_job.rb +10 -0
  27. data/app/models/ship/address.rb +7 -0
  28. data/app/models/ship/car.rb +5 -0
  29. data/app/models/ship/driver.rb +5 -0
  30. data/app/models/ship/ext/order.rb +7 -0
  31. data/app/models/ship/ext/trade_item.rb +11 -0
  32. data/app/models/ship/ext/user.rb +15 -0
  33. data/app/models/ship/favorite.rb +5 -0
  34. data/app/models/ship/line.rb +5 -0
  35. data/app/models/ship/line_similar.rb +5 -0
  36. data/app/models/ship/location.rb +5 -0
  37. data/app/models/ship/model/address.rb +10 -0
  38. data/app/models/ship/model/car.rb +34 -0
  39. data/app/models/ship/model/driver.rb +45 -0
  40. data/app/models/ship/model/favorite.rb +14 -0
  41. data/app/models/ship/model/line.rb +28 -0
  42. data/app/models/ship/model/line_similar.rb +16 -0
  43. data/app/models/ship/model/location.rb +53 -0
  44. data/app/models/ship/model/package.rb +28 -0
  45. data/app/models/ship/model/packaged.rb +29 -0
  46. data/app/models/ship/model/shipment.rb +22 -0
  47. data/app/models/ship/model/shipping.rb +9 -0
  48. data/app/models/ship/package.rb +6 -0
  49. data/app/models/ship/packaged.rb +5 -0
  50. data/app/models/ship/shipment.rb +5 -0
  51. data/app/models/ship.rb +11 -0
  52. data/app/views/admin/_ship_nav.html.erb +11 -0
  53. data/app/views/panel/_ship_nav.html.erb +10 -0
  54. data/app/views/ship/admin/addresses/_address.html.erb +24 -0
  55. data/app/views/ship/admin/addresses/_edit_form.html.erb +3 -0
  56. data/app/views/ship/admin/addresses/_form.html.erb +9 -0
  57. data/app/views/ship/admin/addresses/index.html.erb +36 -0
  58. data/app/views/ship/admin/base/_nav.html.erb +3 -0
  59. data/app/views/ship/admin/home/index.html.erb +0 -0
  60. data/app/views/ship/admin/packages/_button.html.erb +0 -0
  61. data/app/views/ship/admin/packages/_edit_form.html.erb +4 -0
  62. data/app/views/ship/admin/packages/_filter_form.html.erb +9 -0
  63. data/app/views/ship/admin/packages/_form.html.erb +5 -0
  64. data/app/views/ship/admin/packages/_index_tbody.html.erb +8 -0
  65. data/app/views/ship/admin/packages/_index_thead.html.erb +5 -0
  66. data/app/views/ship/admin/packages/_new_form.html.erb +4 -0
  67. data/app/views/ship/admin/packages/_show_table.html.erb +16 -0
  68. data/app/views/ship/admin/packages/index.html.erb +5 -0
  69. data/app/views/ship/admin/rallies/_filter.html.erb +7 -0
  70. data/app/views/ship/admin/rallies/_form.html+phone.erb +17 -0
  71. data/app/views/ship/admin/rallies/_show_table.html+phone.erb +24 -0
  72. data/app/views/ship/admin/rallies/_show_table.html.erb +12 -0
  73. data/app/views/ship/admin/rallies/index.html+phone.erb +26 -0
  74. data/app/views/ship/admin/rallies/show.html.erb +26 -0
  75. data/app/views/ship/admin/trade_items/_filter.html.erb +9 -0
  76. data/app/views/ship/admin/trade_items/_form.html.erb +7 -0
  77. data/app/views/ship/admin/trade_items/_show_table.html.erb +24 -0
  78. data/app/views/ship/admin/trade_items/index.html.erb +51 -0
  79. data/app/views/ship/driver/favorites/_button.html+phone.erb +4 -0
  80. data/app/views/ship/driver/favorites/_edit_form.html.erb +4 -0
  81. data/app/views/ship/driver/favorites/_filter_form.html+phone.erb +14 -0
  82. data/app/views/ship/driver/favorites/_filter_form.html.erb +9 -0
  83. data/app/views/ship/driver/favorites/_form.html.erb +3 -0
  84. data/app/views/ship/driver/favorites/_index_tbody.html.erb +6 -0
  85. data/app/views/ship/driver/favorites/_index_thead.html.erb +3 -0
  86. data/app/views/ship/driver/favorites/_index_tr.html.erb +4 -0
  87. data/app/views/ship/driver/favorites/_new_form.html.erb +4 -0
  88. data/app/views/ship/driver/favorites/_show_table.html.erb +8 -0
  89. data/app/views/ship/driver/favorites/index.html.erb +5 -0
  90. data/app/views/ship/my/addresses/_edit_form.html.erb +21 -0
  91. data/app/views/ship/my/addresses/_form.html.erb +23 -0
  92. data/app/views/ship/my/addresses/index.html.erb +44 -0
  93. data/app/views/ship/my/cars/_edit_form.html.erb +6 -0
  94. data/app/views/ship/my/cars/_filter_form.html.erb +9 -0
  95. data/app/views/ship/my/cars/_index_tbody.html.erb +3 -0
  96. data/app/views/ship/my/cars/_index_thead.html.erb +4 -0
  97. data/app/views/ship/my/cars/_new_form.html.erb +4 -0
  98. data/app/views/ship/my/cars/_show_table.html.erb +16 -0
  99. data/app/views/ship/my/cars/create.turbo_stream.erb +1 -0
  100. data/app/views/ship/my/cars/index.html+phone.erb +19 -0
  101. data/app/views/ship/my/cars/index.html.erb +5 -0
  102. data/app/views/ship/my/cars/new.html.erb +25 -0
  103. data/app/views/ship/my/drivers/_edit_form.html.erb +6 -0
  104. data/app/views/ship/my/drivers/_form.html.erb +4 -0
  105. data/app/views/ship/my/drivers/_index_tbody.html.erb +3 -0
  106. data/app/views/ship/my/drivers/_index_thead.html.erb +4 -0
  107. data/app/views/ship/my/drivers/_new_form.html.erb +4 -0
  108. data/app/views/ship/my/drivers/_show_table.html.erb +12 -0
  109. data/app/views/ship/my/drivers/_uploader.html.erb +22 -0
  110. data/app/views/ship/my/drivers/edit.html.erb +20 -0
  111. data/app/views/ship/my/drivers/show.html.erb +33 -0
  112. data/app/views/ship/my/favorites/_button.html+phone.erb +4 -0
  113. data/app/views/ship/my/favorites/_edit_form.html.erb +4 -0
  114. data/app/views/ship/my/favorites/_filter_form.html+phone.erb +14 -0
  115. data/app/views/ship/my/favorites/_filter_form.html.erb +9 -0
  116. data/app/views/ship/my/favorites/_form.html.erb +3 -0
  117. data/app/views/ship/my/favorites/_index_tbody.html.erb +6 -0
  118. data/app/views/ship/my/favorites/_index_thead.html.erb +3 -0
  119. data/app/views/ship/my/favorites/_new_form.html.erb +4 -0
  120. data/app/views/ship/my/favorites/_show_table.html.erb +8 -0
  121. data/app/views/ship/my/favorites/index.html.erb +5 -0
  122. data/app/views/ship/my/lines/_edit_form.html.erb +4 -0
  123. data/app/views/ship/my/lines/_filter_form.html.erb +1 -0
  124. data/app/views/ship/my/lines/_form.html.erb +3 -0
  125. data/app/views/ship/my/lines/_index_tbody.html.erb +6 -0
  126. data/app/views/ship/my/lines/_index_tr.html.erb +4 -0
  127. data/app/views/ship/my/lines/_item_field.html.erb +8 -0
  128. data/app/views/ship/my/lines/_item_location.html.erb +13 -0
  129. data/app/views/ship/my/lines/_new_form.html.erb +15 -0
  130. data/app/views/ship/my/lines/_select/_tab_bar.html.erb +10 -0
  131. data/app/views/ship/my/lines/_select.html.erb +10 -0
  132. data/app/views/ship/my/lines/_show/_index_tbody.html.erb +6 -0
  133. data/app/views/ship/my/lines/_show/_index_tr.html+phone.erb +6 -0
  134. data/app/views/ship/my/lines/_show_table.html.erb +9 -0
  135. data/app/views/ship/my/lines/add.turbo_stream.erb +1 -0
  136. data/app/views/ship/my/lines/index.html.erb +5 -0
  137. data/app/views/ship/my/lines/new.html.erb +1 -0
  138. data/app/views/ship/my/lines/requirement.html.erb +5 -0
  139. data/app/views/ship/my/lines/select.turbo_stream.erb +1 -0
  140. data/app/views/ship/my/lines/show.html+phone.erb +30 -0
  141. data/app/views/ship/my/locations/_edit_form.html.erb +4 -0
  142. data/app/views/ship/my/locations/_filter_form.html.erb +9 -0
  143. data/app/views/ship/my/locations/_form.html.erb +6 -0
  144. data/app/views/ship/my/locations/_index_tbody.html.erb +5 -0
  145. data/app/views/ship/my/locations/_index_thead.html.erb +6 -0
  146. data/app/views/ship/my/locations/_new_form.html.erb +4 -0
  147. data/app/views/ship/my/locations/_show_table.html.erb +20 -0
  148. data/app/views/ship/my/locations/index.html.erb +5 -0
  149. data/app/views/ship/my/packages/index.html.erb +31 -0
  150. data/app/views/ship/my/principal_addresses/index.html+phone.erb +32 -0
  151. data/app/views/ship/my/principal_addresses/plans.html+phone.erb +23 -0
  152. data/app/views/ship/my/principal_addresses/show.html+phone.erb +27 -0
  153. data/app/views/ship/panel/base/_nav.html.erb +3 -0
  154. data/app/views/ship/panel/lines/_edit_form.html.erb +4 -0
  155. data/app/views/ship/panel/lines/_filter_form.html.erb +9 -0
  156. data/app/views/ship/panel/lines/_form.html.erb +4 -0
  157. data/app/views/ship/panel/lines/_index_tbody.html.erb +4 -0
  158. data/app/views/ship/panel/lines/_index_thead.html.erb +5 -0
  159. data/app/views/ship/panel/lines/_index_tr.html.erb +19 -0
  160. data/app/views/ship/panel/lines/_new_form.html.erb +4 -0
  161. data/app/views/ship/panel/lines/_show_table.html.erb +12 -0
  162. data/app/views/ship/panel/lines/index.html.erb +5 -0
  163. data/app/views/ship/panel/similars/_breadcrumb.html.erb +7 -0
  164. data/app/views/ship/panel/similars/_button.html.erb +3 -0
  165. data/app/views/ship/panel/similars/_edit_form.html.erb +4 -0
  166. data/app/views/ship/panel/similars/_filter_form.html.erb +9 -0
  167. data/app/views/ship/panel/similars/_form.html.erb +4 -0
  168. data/app/views/ship/panel/similars/_index_tbody.html.erb +3 -0
  169. data/app/views/ship/panel/similars/_index_thead.html.erb +4 -0
  170. data/app/views/ship/panel/similars/_new/_button.html.erb +0 -0
  171. data/app/views/ship/panel/similars/_new/_index_tr.html.erb +10 -0
  172. data/app/views/ship/panel/similars/_new/_index_tr_remove.html.erb +10 -0
  173. data/app/views/ship/panel/similars/_new_form.html.erb +4 -0
  174. data/app/views/ship/panel/similars/_show_table.html.erb +12 -0
  175. data/app/views/ship/panel/similars/create.turbo_stream.erb +3 -0
  176. data/app/views/ship/panel/similars/destroy.turbo_stream.erb +3 -0
  177. data/app/views/ship/panel/similars/index.html.erb +5 -0
  178. data/app/views/ship/panel/similars/new.html.erb +16 -0
  179. data/config/locales/zh.attributes.yml +15 -0
  180. data/config/locales/zh.yml +51 -0
  181. data/config/routes.rb +66 -0
  182. data/lib/rails_ship/config.rb +11 -0
  183. data/lib/rails_ship/engine.rb +21 -0
  184. data/lib/rails_ship.rb +2 -0
  185. metadata +240 -0
@@ -0,0 +1,27 @@
1
+ <% @customs.each do |custom| %>
2
+ <div class="weui-form-preview">
3
+ <div class="weui-form-preview__hd">
4
+ <div class="weui-form-preview__item">
5
+ <label class="weui-form-preview__label">付款金额</label>
6
+ <em class="weui-form-preview__value">¥2400.00</em>
7
+ </div>
8
+ </div>
9
+ <div class="weui-form-preview__bd">
10
+ <div class="weui-form-preview__item">
11
+ <label class="weui-form-preview__label">商品</label>
12
+ <span class="weui-form-preview__value">电动打蛋机</span>
13
+ </div>
14
+ <div class="weui-form-preview__item">
15
+ <label class="weui-form-preview__label">标题标题</label>
16
+ <span class="weui-form-preview__value">名字名字名字</span>
17
+ </div>
18
+ <div class="weui-form-preview__item">
19
+ <label class="weui-form-preview__label">标题标题</label>
20
+ <span class="weui-form-preview__value">很长很长的名字很长很长的名字很长很长的名字很长很长的名字很长很长的名字</span>
21
+ </div>
22
+ </div>
23
+ <div class="weui-form-preview__ft">
24
+ <%= link_to '操作', my_principal_address_trade_items_path(@address, good_id: custom.id), class: 'weui-form-preview__btn weui-form-preview__btn_primary' %>
25
+ </div>
26
+ </div>
27
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <aside class="menu is-dark" style="height: 100%">
2
+ <%= render 'ship_nav' %>
3
+ </aside>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @line, 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: Ship::Line.new 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,4 @@
1
+ <%= render 'error_messages', target: f.object %>
2
+ <%= f.text_field :name %>
3
+ <%= f.text_field :start_name %>
4
+ <%= f.text_field :finish_name %>
@@ -0,0 +1,4 @@
1
+ <td><%= model.name %></td>
2
+ <td><%= model.start_name %></td>
3
+ <td><%= model.finish_name %></td>
4
+ <td><%= model.locations_count %></td>
@@ -0,0 +1,5 @@
1
+ <th><%= Ship::Line.human_attribute_name(:name) %></th>
2
+ <th><%= Ship::Line.human_attribute_name(:start_name) %></th>
3
+ <th><%= Ship::Line.human_attribute_name(:finish_name) %></th>
4
+ <th><%= Ship::Line.human_attribute_name(:locations_count) %></th>
5
+ <th></th>
@@ -0,0 +1,19 @@
1
+ <tr id="tr_<%= model.id %>" data-controller="show" data-action="mouseenter->show#show mouseleave->show#hide">
2
+ <%= yield %>
3
+ <td>
4
+ <span data-show-target="item" style="visibility: hidden">
5
+ <%= link_to({ controller: 'similars', line_id: model.id }, aria: { label: t('ship.panel.similars.index.title') }, class: 'button is-small is-rounded is-light') do %>
6
+ <i class="fas fa-map-signs"></i>
7
+ <% end %>
8
+ <%= link_to({ action: 'show', id: model.id }, data: { turbo_frame: 'modal' }, aria: { label: t('.show') }, class: 'button is-small is-rounded is-light') do %>
9
+ <i class="fas fa-info"></i>
10
+ <% end %>
11
+ <%= link_to({ action: 'edit', id: model.id }, data: { turbo_frame: 'modal' }, aria: { label: t('.edit') }, class: 'button is-small is-rounded is-light') do %>
12
+ <i class="fas fa-pencil-alt"></i>
13
+ <% end %>
14
+ <%= button_to({ action: 'destroy', id: model.id }, method: :delete, data: { confirm: t('.confirm') }, aria: { label: t('.destroy') }, class: 'button is-small is-rounded is-light') do %>
15
+ <i class="fas fa-trash-alt"></i>
16
+ <% end %>
17
+ </span>
18
+ </td>
19
+ </tr>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @line, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <tr>
2
+ <td class="has-text-right"><%= Ship::Line.human_attribute_name(:name) %></td>
3
+ <td><%= @line.name %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= Ship::Line.human_attribute_name(:start_name) %></td>
7
+ <td><%= @line.start_name %></td>
8
+ </tr>
9
+ <tr>
10
+ <td class="has-text-right"><%= Ship::Line.human_attribute_name(:finish_name) %></td>
11
+ <td><%= @line.finish_name %></td>
12
+ </tr>
@@ -0,0 +1,5 @@
1
+ <%= render layout: 'index_table', locals: { cache_key: Ship::Line.column_names.hash } do %>
2
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @lines, as: :model %>
3
+ <% end %>
4
+
5
+ <%= paginate @lines %>
@@ -0,0 +1,7 @@
1
+ <div class="breadcrumb has-succeeds-separator">
2
+ <ul>
3
+ <li><%= link_to t('ship.panel.lines.index.title'), { controller: 'lines' } %></li>
4
+ <li><%= link_to @line.name, { controller: 'lines', id: @line.id } %></li>
5
+ <li class="is-active"><%= t('.title') %></li>
6
+ </ul>
7
+ </div>
@@ -0,0 +1,3 @@
1
+ <%= link_to({ action: 'new' }, class: 'button is-link') do %>
2
+ <i class="fas fa-plus"></i><span><%= t('.new') %></span>
3
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @similar, 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: Ship::Line.new 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,4 @@
1
+ <%= render 'error_messages', target: f.object %>
2
+ <%= f.text_field :name %>
3
+ <%= f.text_field :start_name %>
4
+ <%= f.text_field :finish_name %>
@@ -0,0 +1,3 @@
1
+ <td><%= model.name %></td>
2
+ <td><%= model.start_name %></td>
3
+ <td><%= model.finish_name %></td>
@@ -0,0 +1,4 @@
1
+ <th><%= Ship::Line.human_attribute_name(:name) %></th>
2
+ <th><%= Ship::Line.human_attribute_name(:start_name) %></th>
3
+ <th><%= Ship::Line.human_attribute_name(:finish_name) %></th>
4
+ <th></th>
@@ -0,0 +1,10 @@
1
+ <tr id="tr_<%= model.id %>" data-controller="show" data-action="mouseenter->show#show mouseleave->show#hide">
2
+ <%= yield %>
3
+ <td>
4
+ <span data-show-target="item" style="visibility: hidden">
5
+ <%= button_to({ action: 'create' }, params: { similar_id: model.id }, class: 'button is-small is-rounded is-light') do %>
6
+ <i class="fas fa-plus"></i>
7
+ <% end %>
8
+ </span>
9
+ </td>
10
+ </tr>
@@ -0,0 +1,10 @@
1
+ <tr id="tr_<%= model.id %>" data-controller="show" data-action="mouseenter->show#show mouseleave->show#hide">
2
+ <%= yield %>
3
+ <td>
4
+ <span data-show-target="item" style="visibility: hidden">
5
+ <%= button_to({ action: 'destroy', id: model.id }, params: { similar_id: model.id }, method: :delete, data: { confirm: t('.confirm') }, aria: { label: t('.destroy') }, class: 'button is-small is-rounded is-light') do %>
6
+ <i class="fas fa-trash-alt"></i>
7
+ <% end %>
8
+ </span>
9
+ </td>
10
+ </tr>
@@ -0,0 +1,4 @@
1
+ <%= form_with model: @similar, url: { action: 'create' } do |f| %>
2
+ <%= render partial: 'form', locals: { f: f } %>
3
+ <%= f.submit %>
4
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <tr>
2
+ <td class="has-text-right"><%= Ship::Line.human_attribute_name(:name) %></td>
3
+ <td><%= @similar.name %></td>
4
+ </tr>
5
+ <tr>
6
+ <td class="has-text-right"><%= Ship::Line.human_attribute_name(:start_name) %></td>
7
+ <td><%= @similar.start_name %></td>
8
+ </tr>
9
+ <tr>
10
+ <td class="has-text-right"><%= Ship::Line.human_attribute_name(:finish_name) %></td>
11
+ <td><%= @similar.finish_name %></td>
12
+ </tr>
@@ -0,0 +1,3 @@
1
+ <%= turbo_stream.append 'body' do %>
2
+ <div data-controller="visit"></div>
3
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= turbo_stream.append 'body' do %>
2
+ <div data-controller="visit"></div>
3
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= render layout: 'index_table', locals: { cache_key: Ship::Line.column_names.hash } do %>
2
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @similars, as: :model %>
3
+ <% end %>
4
+
5
+ <%= paginate @similars %>
@@ -0,0 +1,16 @@
1
+ <div class="columns">
2
+ <div class="column">
3
+ <%= render layout: 'index_table', locals: { cache_key: Ship::Line.column_names.hash } do %>
4
+ <%= render partial: 'index_tbody', layout: 'index_tr_remove', collection: @similars, as: :model %>
5
+ <% end %>
6
+
7
+ <%= paginate @similars %>
8
+ </div>
9
+ <div class="column">
10
+ <%= render layout: 'index_table', locals: { cache_key: Ship::Line.column_names.hash } do %>
11
+ <%= render partial: 'index_tbody', layout: 'index_tr', collection: @lines, as: :model %>
12
+ <% end %>
13
+
14
+ <%= paginate @lines %>
15
+ </div>
16
+ </div>
@@ -0,0 +1,15 @@
1
+ zh:
2
+ activerecord:
3
+ attributes:
4
+ ship/line:
5
+ start_name: 起点
6
+ finish_name: 终点
7
+ locations_count: 车站数
8
+ ship/driver:
9
+ name: 姓名
10
+ number: 驾驶证号码
11
+ license: 驾驶证
12
+ ship/car:
13
+ registration: 行驶证
14
+ number: 车牌号
15
+ detail: 详情
@@ -0,0 +1,51 @@
1
+ zh:
2
+ ship:
3
+ panel:
4
+ title: 运输管理
5
+ lines:
6
+ index:
7
+ title: 路线
8
+ similars:
9
+ index:
10
+ title: 相似路线
11
+ admin:
12
+ title: 发货管理
13
+ addresses:
14
+ index:
15
+ title: 地址列表
16
+ trade_items:
17
+ index:
18
+ title: 商品列表
19
+ package: 打包
20
+ packages:
21
+ index:
22
+ title: 包裹列表
23
+ my:
24
+ packages:
25
+ index:
26
+ title: 包裹列表
27
+ wait: 叫号
28
+ lines:
29
+ index:
30
+ title: 找车
31
+ new: 添加路线
32
+ requirement:
33
+ title: 找人/找货
34
+ new: 添加路线
35
+ cars:
36
+ index:
37
+ title: 我的车辆
38
+ new: 添加车辆
39
+ drivers:
40
+ show:
41
+ title: 司机认证
42
+ edit:
43
+ title: 司机认证
44
+ show: 返回
45
+ favorites:
46
+ index:
47
+ title: 熟人司机
48
+ driver:
49
+ favorites:
50
+ index:
51
+ title: 熟人乘客
data/config/routes.rb ADDED
@@ -0,0 +1,66 @@
1
+ Rails.application.routes.draw do
2
+
3
+ namespace :ship do
4
+ namespace :panel do
5
+ resources :similars
6
+ end
7
+ end
8
+ namespace :ship do
9
+ namespace :panel do
10
+ resources :lines
11
+ end
12
+ end
13
+ namespace :ship, defaults: { business: 'ship' } do
14
+
15
+ namespace :panel, defaults: { namespace: 'panel' } do
16
+ resources :lines do
17
+ resources :similars
18
+ end
19
+ end
20
+
21
+ namespace :admin, defaults: { namespace: 'admin' } do
22
+ resources :addresses do
23
+ resources :trade_items do
24
+ collection do
25
+ post :package
26
+ end
27
+ end
28
+ end
29
+ resources :packages, except: [:new, :create]
30
+ resources :lines do
31
+ resources :locations
32
+ end
33
+ root 'home#index'
34
+ end
35
+
36
+ namespace :driver, defaults: { namespace: 'driver' } do
37
+ resources :favorites
38
+ end
39
+
40
+ namespace :my, defaults: { namespace: 'my' } do
41
+ resource :driver
42
+ resources :favorites
43
+ resources :cars
44
+ resources :lines do
45
+ collection do
46
+ get :requirement
47
+ post :add
48
+ post :select
49
+ end
50
+ resources :locations
51
+ end
52
+ resources :principal_addresses, only: [:index, :show] do
53
+ member do
54
+ get :plans
55
+ end
56
+ resources :packages do
57
+ member do
58
+ put :wait
59
+ end
60
+ end
61
+ end
62
+ end
63
+
64
+ end
65
+
66
+ end
@@ -0,0 +1,11 @@
1
+ require 'active_support/configurable'
2
+
3
+ module RailsShip #:nodoc:
4
+ include ActiveSupport::Configurable
5
+
6
+ configure do |config|
7
+ end
8
+
9
+ end
10
+
11
+
@@ -0,0 +1,21 @@
1
+ require 'rails_com'
2
+
3
+ module RailsShip
4
+ class Engine < ::Rails::Engine
5
+
6
+ config.generators do |g|
7
+ g.rails = {
8
+ assets: false,
9
+ stylesheets: false,
10
+ helper: false,
11
+ route: false
12
+ }
13
+ g.test_unit = {
14
+ fixture: true,
15
+ fixture_replacement: :factory_girl
16
+ }
17
+ g.templates.unshift File.expand_path('lib/templates', RailsCom::Engine.root)
18
+ end
19
+
20
+ end
21
+ end
data/lib/rails_ship.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'rails_ship/engine'
2
+ require 'rails_ship/config'