better lists history
This commit is contained in:
@@ -6,7 +6,6 @@ class UserController < ApplicationController
|
||||
|
||||
def home
|
||||
handle_message_params
|
||||
render layout: 'phone'
|
||||
end
|
||||
|
||||
# POST /user/create_list {table_id: 1234}
|
||||
@@ -52,7 +51,6 @@ class UserController < ApplicationController
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
handle_message_params
|
||||
render layout: 'phone'
|
||||
end
|
||||
format.json do
|
||||
products = list.supplier.products
|
||||
@@ -124,7 +122,6 @@ class UserController < ApplicationController
|
||||
@table = Table.find(params[:table_id])
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render layout: 'phone'
|
||||
end
|
||||
format.json do
|
||||
products = @table.supplier.products
|
||||
@@ -143,7 +140,6 @@ class UserController < ApplicationController
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to(root_path, alert: t('messages.there_is_no_list_active')) and return unless list.present?
|
||||
render layout: 'phone'
|
||||
end
|
||||
format.json do
|
||||
render json: list.with_orders_and_join_requests_as_json.merge(supplier_name: list.supplier.name)
|
||||
@@ -199,7 +195,7 @@ class UserController < ApplicationController
|
||||
# GET /user/list_history
|
||||
def list_history
|
||||
@lists = List.for_user(current_user, page: params[:page], per_page: params[:per_page].presence || 14)
|
||||
render layout: 'phone'
|
||||
@lists.include_relation(:supplier)
|
||||
end
|
||||
|
||||
##
|
||||
@@ -214,7 +210,6 @@ class UserController < ApplicationController
|
||||
redirect_to user_root_path, alert: t('messages.illegal_history_list_attempt') and return unless @list.user_ids.include?(current_user.id)
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
render layout: 'phone'
|
||||
end
|
||||
format.json do
|
||||
render json: @list.with_orders_as_json
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
dl.dl-horizontal
|
||||
dt= List.human_attribute_name(:created_at)
|
||||
dd= l @list.created_at, format: :short
|
||||
dt= Supplier.model_name.human
|
||||
dd= @list.supplier.name
|
||||
.well
|
||||
table#history-list-table.table
|
||||
thead
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
= paginate @lists
|
||||
ul
|
||||
- for list in @lists
|
||||
li= link_to l(list.created_at, format: :short), user_history_list_path(list_id: list.id)
|
||||
li= link_to "#{l(list.created_at, format: :short)} - #{list.supplier.name}", user_history_list_path(list_id: list.id)
|
||||
|
||||
@@ -89,7 +89,7 @@ en:
|
||||
title: Active %{list}
|
||||
needs_payment: Check please!
|
||||
history_list:
|
||||
title: Previous %{list}
|
||||
title: Closed %{list}
|
||||
show_products:
|
||||
# The title gets products: Product.model_name.human_plural that can be used: e.g.: Showing %{products}
|
||||
title: Menu
|
||||
|
||||
Reference in New Issue
Block a user