Fix bugs.

This commit is contained in:
BoHung Chiu 2021-01-03 15:47:20 +08:00
parent 10ed7db4a6
commit 9eaf2447a6
4 changed files with 4 additions and 3 deletions

View File

@ -148,7 +148,7 @@ class Admin::VenueManagementBillsController < Admin::VenueAdminController
@venue_management = VenueManagementMain.find(@venue_management_bill.venue_management_main_id)
end
def copy
@venue_management_bill_to_copy = VenueManagementBill.find(params[:id])
@venue_management_bill_to_copy = VenueManagementBill.find(params[:bill_id])
attributes = @venue_management_bill_to_copy.attributes.except("_id","updated_at","created_at")
VenueManagementBill.fields.each do |k,v|
if v.options[:localize]

View File

@ -26,6 +26,7 @@
margin: 0;
}
</style>
<h3 style="padding-left: 1.25em;"><%= t('venue_management.title') %> : <%= @venue_management_bill.venue_management_main.title %></h3>
<!-- Input Area -->
<div class="input-area">
<% new_record = @venue_management_bill.new_record? && params["action"] != "copy" %>

View File

@ -29,7 +29,7 @@
<ul class="nav nav-pills">
<% if can_edit_or_delete?(@venue_management || bill.venue_management_main) %>
<li><%= link_to t(:edit), edit_admin_venue_management_bill_path(bill.id) %></li>
<li><%= link_to t(:copy), copy_admin_venue_management_bills_path(:id=>bill.id) %></li>
<li><%= link_to t(:copy), copy_admin_venue_management_bills_path(:id=>bill.venue_management_main_id,:bill_id=>bill.id) %></li>
<li><a href="#" class="delete text-error" rel="/admin/venue_management_bills/<%=bill.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %>
</ul>

View File

@ -456,7 +456,7 @@
<label class="control-label muted"><%= t("venue_management.#{area}") %></label>
<div class="controls">
<div class="textarea">
<%= f.fields_for :area_translations do |f| %>
<%= f.fields_for "#{area}_translations" do |f| %>
<%= f.text_field locale, class: "input-block-level", :value => (@venue_management.send("#{area}_translations")[locale] rescue nil),placeholder: t("venue_management.#{area}") %>
<% end %>
</div>