From af5a5ed8d3eca4ef6e4e5b6b3a6afa61b2afda5d Mon Sep 17 00:00:00 2001 From: bohung Date: Sun, 9 Aug 2020 21:47:41 +0800 Subject: [PATCH] Change a lot things include frontend and backend pages. --- .../venue_management_contracts_controller.rb | 7 +- .../venue_management_invitings_controller.rb | 12 +- ...enue_management_memorabilias_controller.rb | 1 + .../admin/venue_managements_controller.rb | 31 ++- .../venue_managements_controller.rb | 12 +- app/models/venue_management_contract.rb | 12 +- app/models/venue_management_inviting.rb | 2 +- app/models/venue_management_main.rb | 41 +++- app/models/venue_management_memorabilia.rb | 2 +- .../venue_management_contracts/_form.html.erb | 42 +++- .../_index.html.erb | 8 +- .../venue_management_invitings/_form.html.erb | 2 +- .../_index.html.erb | 5 +- .../_index.html.erb | 2 +- .../admin/venue_managements/_form.html.erb | 226 +++++++++++------- .../admin/venue_managements/_index.html.erb | 9 +- app/views/venue_managements/index.html.erb | 39 ++- .../venue_managements/show_contract.html.erb | 16 +- .../venue_managements/show_data.html.erb | 157 +++++++++++- .../venue_managements/show_inviting.html.erb | 8 +- .../show_memorabilia.html.erb | 47 ++++ config/locales/en.yml | 5 + config/locales/zh_tw.yml | 7 +- 23 files changed, 525 insertions(+), 168 deletions(-) create mode 100644 app/views/venue_managements/show_memorabilia.html.erb diff --git a/app/controllers/admin/venue_management_contracts_controller.rb b/app/controllers/admin/venue_management_contracts_controller.rb index 6e8d568..67e9121 100644 --- a/app/controllers/admin/venue_management_contracts_controller.rb +++ b/app/controllers/admin/venue_management_contracts_controller.rb @@ -24,7 +24,10 @@ class Admin::VenueManagementContractsController < Admin::VenueAdminController @table_fields = [ 'venue_management.title', 'vm_contract.case_no', + 'vm_inviting.type', 'vm_contract.vendor', + 'vm_inviting.rents', + 'vm_inviting.royalty', 'vm_contract.start_end', 'vm_contract.renewal_permission', 'vm_contract.note', @@ -68,6 +71,8 @@ class Admin::VenueManagementContractsController < Admin::VenueAdminController end def venue_management_contract_params - params.require(:venue_management_contract).permit! + contract_params = params.require(:venue_management_contract).permit! + contract_params["contractor_ids"] = [] if contract_params["contractor_ids"].nil? + return contract_params end end diff --git a/app/controllers/admin/venue_management_invitings_controller.rb b/app/controllers/admin/venue_management_invitings_controller.rb index 8424a3f..db9bc69 100644 --- a/app/controllers/admin/venue_management_invitings_controller.rb +++ b/app/controllers/admin/venue_management_invitings_controller.rb @@ -14,18 +14,20 @@ class Admin::VenueManagementInvitingsController < Admin::VenueAdminController @table_fields = [ 'venue_management.title', 'vm_inviting.case_no', + 'vm_inviting.type', 'vm_inviting.publish_times', + 'vm_inviting.start_end', 'vm_inviting.rents', 'vm_inviting.royalty', - 'vm_inviting.house_tax_payer', - 'vm_inviting.land_tax_payer', + 'vm_inviting.house_land_tax_payer', 'vm_inviting.contractor_manager', 'vm_inviting.bid_result', ] @tags = @module_app.tags @filter_fields = {} @filter_fields['vm_inviting.type'] = @tags.map{|t| {:title => t.name,:id => t.id} } - @invitings = VenueManagementInviting.with_tags(filters("tag")).order(updated_at: :desc).page(params[:page]).per(10) + filter_tags = params[:filters]["type"].to_a rescue [] + @invitings = VenueManagementInviting.with_tags(filter_tags).order(updated_at: :desc).page(params[:page]).per(10) @venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue "" if request.xhr? render :partial => 'index' @@ -68,6 +70,8 @@ class Admin::VenueManagementInvitingsController < Admin::VenueAdminController end def venue_management_inviting_params - params.require(:venue_management_inviting).permit! + inviting_params = params.require(:venue_management_inviting).permit! + inviting_params["tags"] = [] if inviting_params["tags"].nil? + return inviting_params end end diff --git a/app/controllers/admin/venue_management_memorabilias_controller.rb b/app/controllers/admin/venue_management_memorabilias_controller.rb index 5a1410f..39a1d72 100644 --- a/app/controllers/admin/venue_management_memorabilias_controller.rb +++ b/app/controllers/admin/venue_management_memorabilias_controller.rb @@ -16,6 +16,7 @@ class Admin::VenueManagementMemorabiliasController < Admin::VenueAdminController 'vm_memorabilia.details', ] @memorabilias = VenueManagementMemorabilia.order(updated_at: :desc).page(params[:page]).per(10) + @venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue "" end def new diff --git a/app/controllers/admin/venue_managements_controller.rb b/app/controllers/admin/venue_managements_controller.rb index 30c8bfe..17fa1b9 100644 --- a/app/controllers/admin/venue_managements_controller.rb +++ b/app/controllers/admin/venue_managements_controller.rb @@ -21,7 +21,9 @@ class Admin::VenueManagementsController < Admin::VenueAdminController @categories = @module_app.categories.enabled @filter_fields = filter_fields(@categories) @table_fields = [ :category, + 'vm_inviting.type', 'venue_management.title', + "venue_management.contractor", 'venue_management.event_during', 'venue_management.signup_during', 'venue_management.contract_history', @@ -29,7 +31,7 @@ class Admin::VenueManagementsController < Admin::VenueAdminController 'venue_management.memorabilia', 'venue_management.export' ] - + @filter_fields["vm_inviting.type"] = @module_app.tags.map{|t| {:title => t.name,:id => t.id} } if !params[:sort].blank? if params[:sort] == 'event_during' sort = {:venue_management_start_date.to_sym=>params[:order]} @@ -41,10 +43,17 @@ class Admin::VenueManagementsController < Admin::VenueAdminController else sort = {:signup_start_date=>"desc"} end - - @venue_managements = VenueManagementMain.all.order_by(sort).with_categories(filters("category")) - - @venue_managements = search_data(@venue_managements,[:title]).page(params[:page]).per(10) + filter_tags = params[:filters][:type].to_a rescue [] + if filter_tags.empty? + @venue_managements = VenueManagementMain.all.order_by(sort).with_categories(filters("category")) + @venue_managements = search_data(@venue_managements,[:title]).page(params[:page]).per(10) + else + @venue_managements = VenueManagementMain.all.order_by(sort).with_categories(filters("category")) + @venue_managements = search_data(@venue_managements,[:title]) + @venue_management_inviting_ids = @venue_managements.map{|v| v.venue_management_invitings.desc(:id).first.id rescue ""} + @venue_management_ids = VenueManagementInviting.where(:id.in=>@venue_management_inviting_ids).with_tags(filter_tags).map{|v| v.venue_management_main_id} + @venue_managements = VenueManagementMain.where(:id.in=>@venue_management_ids).page(params[:page]).per(10) + end if request.xhr? render :partial => "index" @@ -253,15 +262,17 @@ class Admin::VenueManagementsController < Admin::VenueAdminController def venue_management_invitings @table_fields = [ 'vm_inviting.case_no', + 'vm_inviting.type', 'vm_inviting.publish_times', + 'vm_inviting.start_end', 'vm_inviting.rents', 'vm_inviting.royalty', - 'vm_inviting.house_tax_payer', - 'vm_inviting.land_tax_payer', + 'vm_inviting.house_land_tax_payer', 'vm_inviting.contractor_manager', 'vm_inviting.bid_result', ] - @invitings = @venue_management.venue_management_invitings.with_tags(filters("tag")).page(params[:page]).per(10) + filter_tags = params[:filters]["type"].to_a rescue [] + @invitings = @venue_management.venue_management_invitings.with_tags(filter_tags).page(params[:page]).per(10) @tags = @module_app.tags @filter_fields = {} @filter_fields['vm_inviting.type'] = @tags.map{|t| {:title => t.name,:id => t.id} } @@ -278,12 +289,16 @@ class Admin::VenueManagementsController < Admin::VenueAdminController 'vm_memorabilia.details', ] @memorabilias = @venue_management.venue_management_memorabilias.page(params[:page]).per(10) + @venue_management_page_url = Page.where(:module =>"venue_management").last.url rescue "" end def venue_management_contracts @table_fields = [ 'vm_contract.case_no', + 'vm_inviting.type', 'vm_contract.vendor', + 'vm_inviting.rents', + 'vm_inviting.royalty', 'vm_contract.start_end', 'vm_contract.renewal_permission', 'vm_contract.note', diff --git a/app/controllers/venue_managements_controller.rb b/app/controllers/venue_managements_controller.rb index e988270..c789ea8 100644 --- a/app/controllers/venue_managements_controller.rb +++ b/app/controllers/venue_managements_controller.rb @@ -70,8 +70,8 @@ class VenueManagementsController < ApplicationController 'contribute_action' => contribute_action, 'time_now' => time_now, 'contribute_time_range' => VenueManagementMain.time_range(venue_management.contribute_start_date, venue_management.contribute_end_date), - 'sign_up_time_range' => VenueManagementMain.time_range(venue_management.signup_start_date, venue_management.signup_end_date), - 'venue_management_time_range' => VenueManagementMain.time_range(venue_management.venue_management_start_date, venue_management.venue_management_end_date), + 'sign_up_time_range' => venue_management.display_signup_during, + 'venue_management_time_range' => venue_management.display_event_during, 'params' => params } @@ -84,6 +84,14 @@ class VenueManagementsController < ApplicationController 'params' => params } end + def show_memorabilia + params = OrbitHelper.params + venue_management_memorabilia = VenueManagementMemorabilia.find(params[:uid]) rescue nil + { + 'venue_management_memorabilia' => venue_management_memorabilia, + 'params' => params + } + end def show_contract params = OrbitHelper.params venue_management_contract = VenueManagementContract.find(params[:uid]) rescue nil diff --git a/app/models/venue_management_contract.rb b/app/models/venue_management_contract.rb index fc6cbf1..c8e2b26 100644 --- a/app/models/venue_management_contract.rb +++ b/app/models/venue_management_contract.rb @@ -14,6 +14,7 @@ class VenueManagementContract field :renewal_permission, type: Boolean,default: false field :renewal_deadline, type: Date field :case_no, type: String + field :contractor_ids, type: Array,default: [] field :publish_times, type: Integer field :start_date, type: Date, default: Time.now field :end_date, type: Date @@ -22,7 +23,7 @@ class VenueManagementContract field :evaluation_date, type: Date field :early_rent, type: Integer field :operation_rent, type: Integer - field :royalty, type: Integer + field :royalty, type: String field :contractor_manager # save user_id enum :house_tax_payer, PAYERS enum :land_tax_payer, PAYERS @@ -79,6 +80,15 @@ class VenueManagementContract self.save end end + def contractors + return( MemberProfile.where(:id.in=>self.contractor_ids).to_a rescue []) + end + def display_contractors + return self.contractors.map{|m| m.name}.join(" , ") + end + def display_tags + self.venue_management_inviting.tags.map{|t| t.name}.join(" , ") rescue "" + end before_save do org_contract = VenueManagementContract.find(self.id) rescue nil inviting = VenueManagementInviting.find(self.venue_management_inviting_id) rescue nil diff --git a/app/models/venue_management_inviting.rb b/app/models/venue_management_inviting.rb index b7f2acc..4394c29 100644 --- a/app/models/venue_management_inviting.rb +++ b/app/models/venue_management_inviting.rb @@ -19,7 +19,7 @@ class VenueManagementInviting field :evaluation_date, type: Date field :early_rent, type: Integer field :operation_rent, type: Integer - field :royalty, type: Integer + field :royalty, type: String field :contractor_manager # save user_id enum :house_tax_payer, PAYERS enum :land_tax_payer, PAYERS diff --git a/app/models/venue_management_main.rb b/app/models/venue_management_main.rb index f8b930f..ff8ace9 100644 --- a/app/models/venue_management_main.rb +++ b/app/models/venue_management_main.rb @@ -57,25 +57,48 @@ class VenueManagementMain accepts_nested_attributes_for :venue_management_email_sets, :allow_destroy => true accepts_nested_attributes_for :venue_management_signup_field_customs, :allow_destroy => true include VenueLinkFile - def manager_emails - MemberProfile.where(:id.in => self.manager_ids).collect{|v| v.email} - end def self.time_range(date1 = null, date2 = null) - if !date1.blank? - r = "#{date1.strftime('%Y-%m-%d')}" - if date2 r += " - #{date2.strftime('%Y-%m-%d')}" else r += " - #{I18n.t(:no_deadline)}" end - r - end - + end + def contractors + last_contract = self.venue_management_contracts.desc(:id).first + last_contract.contractors rescue [] + end + def display_contractors + last_contract = self.venue_management_contracts.desc(:id).first + contractors = last_contract.contractors rescue [] + contractors.map{|m| m.name}.join(" , ") + end + def display_tags + last_inviting = self.venue_management_invitings.desc(:id).first + last_inviting.tags.map{|t| t.name}.join(" , ") rescue "" + end + def display_event_during + last_contract = self.venue_management_contracts.desc(:id).first + if last_contract.nil? + "" #self.class.time_range(self.venue_management_start_date, self.venue_management_end_date) + else + self.class.time_range(last_contract.contract_start_date, last_contract.contract_end_date) + end + end + def display_signup_during + last_inviting = self.venue_management_invitings.desc(:id).first + if last_inviting.nil? + "" #self.class.time_range(self.signup_start_date, self.signup_end_date) + else + self.class.time_range(last_inviting.start_date, last_inviting.end_date) + end + end + def manager_emails + MemberProfile.where(:id.in => self.manager_ids).collect{|v| v.email} end def get_attribute_value(attribute_field, signup_id) diff --git a/app/models/venue_management_memorabilia.rb b/app/models/venue_management_memorabilia.rb index 901adc1..bd3fd22 100644 --- a/app/models/venue_management_memorabilia.rb +++ b/app/models/venue_management_memorabilia.rb @@ -10,7 +10,7 @@ class VenueManagementMemorabilia if !inviting.nil? inviting.case_no else - nil + I18n.t("empty") end end belongs_to :venue_management_inviting diff --git a/app/views/admin/venue_management_contracts/_form.html.erb b/app/views/admin/venue_management_contracts/_form.html.erb index 54194db..9e3e86d 100644 --- a/app/views/admin/venue_management_contracts/_form.html.erb +++ b/app/views/admin/venue_management_contracts/_form.html.erb @@ -24,6 +24,18 @@ <%= f.select :venue_management_inviting_id, @venue_management.venue_management_invitings.map { |i| [ i.case_no, i.id ] }, :include_blank => true %> +
+ +
+
<%= @venue_management_contract.venue_management_inviting.tags.map{|t| t.name}.join(" , ") rescue "" %>
+
+
+
+ +
+ <%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'venue_management_contract[contractor_ids][]', email_members:Array(@venue_management_contract.contractors), index:'2',select_name:'contractors'} %> +
+
@@ -39,7 +51,7 @@
- <%= f.number_field :royalty %> + <%= f.text_field :royalty %>
@@ -135,7 +147,9 @@
- <%= f.text_field :deposit_type %> + <% select_fields = ["現金(支票)","設定質權之金融機構定期存款單","銀行書面連帶保證","其他(可填入資料)"] %> + <%= f.select :deposit_type, options_for_select(select_fields,(select_fields.include?(@venue_management_contract.deposit_type) ? @venue_management_contract.deposit_type : "其他(可填入資料)")) %> + <%= f.text_field :deposit_type , :value => (select_fields.include?(@venue_management_contract.deposit_type) ? "" : @venue_management_contract.deposit_type) ,:style => (select_fields.include?(@venue_management_contract.deposit_type) ? "display:none" : "") , :id => 'venue_management_contract_deposit_type_text' %>
@@ -241,5 +255,29 @@ } }) }) + var venue_management_inviting_tags_relations = JSON.parse('<%=VenueManagementInviting.all.select{|v| !v.case_no.blank?}.map{|v| [v.id.to_s,(v.tags.map{|t| t.name}.join(" , ") rescue "")]}.to_h.to_json.html_safe %>'); + $('[name="venue_management_contract[venue_management_inviting_id]"]').click(function(){ + var tag_names = venue_management_inviting_tags_relations[$(this).val()]; + if(tag_names != undefined){ + $("#vm_inviting_type").html(tag_names); + }else{ + $("#vm_inviting_type").html(""); + } + }) + $('select[name="venue_management_contract[deposit_type]"]').click(function(){ + var select_index = $(this).find('option[value="'+$(this).val()+'"]').index(); + if(select_index == $(this).find("option").eq(-1).index()){ + $("#venue_management_contract_deposit_type_text").css("display",''); + }else{ + $("#venue_management_contract_deposit_type_text").css("display",'none'); + } + }) + $(".wrap-inner form").submit(function(){ + var $select = $('select[name="venue_management_contract[deposit_type]"]'); + var select_index = $select.find('option[value="'+$select.val()+'"]').index(); + if(select_index != $select.find("option").eq(-1).index()){ + $("#venue_management_contract_deposit_type_text").remove(); + } + }) }) \ No newline at end of file diff --git a/app/views/admin/venue_management_contracts/_index.html.erb b/app/views/admin/venue_management_contracts/_index.html.erb index e6ab6c7..c53e4e7 100644 --- a/app/views/admin/venue_management_contracts/_index.html.erb +++ b/app/views/admin/venue_management_contracts/_index.html.erb @@ -30,7 +30,13 @@
- <%= contract.vendor %> + <%= contract.display_tags %> + <%= contract.display_contractors %> + + <%= "#{contract.early_rent} / #{contract.operation_rent}" %> + + <%= contract.royalty %> + <%= "#{contract.contract_start_date} / #{contract.contract_end_date}" %> <%= contract.renewal_permission.present? ? t("vm_contract.renewal.#{contract.renewal_permission}") : t("vm_contract.renewal.false") %> <%= contract.note %> diff --git a/app/views/admin/venue_management_invitings/_form.html.erb b/app/views/admin/venue_management_invitings/_form.html.erb index 62be368..1eeee0d 100644 --- a/app/views/admin/venue_management_invitings/_form.html.erb +++ b/app/views/admin/venue_management_invitings/_form.html.erb @@ -80,7 +80,7 @@
- <%= f.number_field :royalty %> + <%= f.text_field :royalty %>
diff --git a/app/views/admin/venue_management_invitings/_index.html.erb b/app/views/admin/venue_management_invitings/_index.html.erb index bddbc60..3a69cd5 100644 --- a/app/views/admin/venue_management_invitings/_index.html.erb +++ b/app/views/admin/venue_management_invitings/_index.html.erb @@ -30,11 +30,12 @@
+ <%= inviting.tags.map{|t| t.name}.join(" , ") rescue "" %> <%= inviting.publish_times %> + <%= inviting.start_date.to_s + "/" + inviting.end_date.to_s %> <%= "#{inviting.early_rent} / #{inviting.operation_rent}" %> <%= inviting.royalty %> - <%= t("vm_inviting.enums.#{inviting.house_tax_payer}") %> - <%= t("vm_inviting.enums.#{inviting.land_tax_payer}") %> + <%= t("vm_inviting.enums.#{inviting.house_tax_payer}") + "/" + t("vm_inviting.enums.#{inviting.land_tax_payer}") %> <%= inviting.contractor_manager %> <%= t("vm_inviting.enums.bid_result.#{inviting.bid_result}") %> diff --git a/app/views/admin/venue_management_memorabilias/_index.html.erb b/app/views/admin/venue_management_memorabilias/_index.html.erb index 0624cde..4fe15df 100644 --- a/app/views/admin/venue_management_memorabilias/_index.html.erb +++ b/app/views/admin/venue_management_memorabilias/_index.html.erb @@ -19,7 +19,7 @@ <%= memorabilia.venue_management_main.title %> <% end %> - <%= link_to memorabilia.case_no, admin_venue_management_memorabilia_path(memorabilia.id), :target => '_blank' %> + <%= link_to (memorabilia.case_no.blank? ? t("empty") : @venue_management_page_url.blank? ? "" : memorabilia.case_no), ("/#{I18n.locale}"+@venue_management_page_url+"/#{memorabilia.case_no.to_s.strip}-#{memorabilia.id}?method=show_memorabilia") , :target => '_blank' %>
- <%= VenueManagementMain.time_range(venue_management.venue_management_start_date, venue_management.venue_management_end_date) %> - <%= VenueManagementMain.time_range(venue_management.signup_start_date, venue_management.signup_end_date) %> + <%= venue_management.display_contractors %> + <%= venue_management.display_event_during %> + <%= venue_management.display_signup_during %> <%= link_to venue_management.venue_management_contracts.count, venue_management_contracts_admin_venue_management_path(venue_management.id) %> diff --git a/app/views/venue_managements/index.html.erb b/app/views/venue_managements/index.html.erb index 21da889..7e92504 100644 --- a/app/views/venue_managements/index.html.erb +++ b/app/views/venue_managements/index.html.erb @@ -13,10 +13,11 @@ <%= t(:category) %> + <%= t('vm_inviting.type') %> <%= t('venue_management.title') %> - <%= t('venue_management_signup.time') %> - <%= t('venue_management_signup.place') %> - <%= t('venue_management.signup') %> + <%= t('venue_management.contractor') %> + <%= t('venue_management.event_during') %> + <%= t('venue_management.signup_during') %> @@ -34,28 +35,16 @@ end %> - <%= venue_management.category.title %> - <%= ('' + venue_management.title + '').html_safe %> - <%= VenueManagementMain.time_range(venue_management.venue_management_start_date, venue_management.venue_management_end_date) %> - <%= venue_management.act_place %> - - <%= sign_up %>
- - <%= - if !venue_management.registration_status.blank? and venue_management.registration_status.include?('C') and venue_management.contribute_start_date <= @time_now and ( venue_management.contribute_end_date.nil? or venue_management.contribute_end_date+1 >= @time_now ) - if !session[:venue_management_signup_id].blank? - if session[:venue_management_main_id] == venue_management.id - ('' + t('venue_management_signup.uploads') + '').html_safe - else - ('' + t('venue_management_signup.con_login') + '').html_safe - end - else - ('' + t('venue_management_signup.con_login') + '').html_safe - end - end - %> - - + + <%= venue_management.category.title %> + <%= venue_management.display_tags %> + + <%= venue_management.title %> + + <%= venue_management.display_contractors %> + <%= venue_management.display_event_during %> + <%= venue_management.display_signup_during %> + <% end %> diff --git a/app/views/venue_managements/show_contract.html.erb b/app/views/venue_managements/show_contract.html.erb index 641491c..014471f 100644 --- a/app/views/venue_managements/show_contract.html.erb +++ b/app/views/venue_managements/show_contract.html.erb @@ -13,6 +13,14 @@ <%= t('vm_contract.case_no') %> <%= @venue_management_contract.venue_management_inviting.case_no %> + + <%= t('vm_inviting.type') %> + <%= @venue_management_contract.display_tags %> + + + <%= t('venue_management.contractor') %> + <%= @venue_management_contract.display_contractors %> + <%= t('vm_inviting.rents') %> <%= "#{@venue_management_contract.early_rent} / #{@venue_management_contract.operation_rent}" %> @@ -23,12 +31,8 @@ - <%= t('vm_inviting.house_tax_payer') %> - <%= t("vm_inviting.enums.#{@venue_management_contract.house_tax_payer}") %> - - - <%= t('vm_inviting.land_tax_payer') %> - <%= t("vm_inviting.enums.#{@venue_management_contract.land_tax_payer}") %> + <%= t('vm_inviting.house_land_tax_payer') %> + <%= t("vm_inviting.enums.#{@venue_management_contract.house_tax_payer}")+"/"+t("vm_inviting.enums.#{@venue_management_contract.land_tax_payer}") %> <%= t('vm_contract.renewal_permission') %> diff --git a/app/views/venue_managements/show_data.html.erb b/app/views/venue_managements/show_data.html.erb index 7ce2ba0..4c9f4f4 100644 --- a/app/views/venue_managements/show_data.html.erb +++ b/app/views/venue_managements/show_data.html.erb @@ -85,16 +85,126 @@ <%= item_content.content.html_safe %> <% end %> + + <% @venue_management_contract = @venue_management.venue_management_contracts.desc(:id).first %> + <% if !@venue_management_contract.nil? %> + + <%= t('vm_contract.case_no') %> + <%= @venue_management_contract.venue_management_inviting.case_no %> + + + <%= t('vm_inviting.type') %> + <%= @venue_management_contract.display_tags %> + + + <%= t('venue_management.contractor') %> + <%= @venue_management_contract.display_contractors %> + + + <%= t('vm_inviting.rents') %> + <%= "#{@venue_management_contract.early_rent} / #{@venue_management_contract.operation_rent}" %> + + + <%= t('vm_inviting.royalty') %> + <%= @venue_management_contract.royalty %> + + + + <%= t('vm_inviting.house_land_tax_payer') %> + <%= t("vm_inviting.enums.#{@venue_management_contract.house_tax_payer}")+"/"+t("vm_inviting.enums.#{@venue_management_contract.land_tax_payer}") %> + + + <%= t('vm_contract.renewal_permission') %> + <%= @venue_management_contract.renewal_permission.present? ? t("vm_contract.renewal.#{@venue_management_contract.renewal_permission}") : t("vm_contract.renewal.false") %> + + + <%= t('vm_contract.start_end') %> + <%= "#{@venue_management_contract.contract_start_date} ~ #{@venue_management_contract.contract_end_date}" %> + + + <%= t('vm_contract.construction_start_end') %> + <%= "#{@venue_management_contract.construction_start_date} ~ #{@venue_management_contract.construction_end_date}" %> + + + <%= t('vm_contract.operation_start_end') %> + <%= "#{@venue_management_contract.operation_start_date} ~ #{@venue_management_contract.operation_end_date}" %> + + + <%= t('vm_contract.free_period_start_end') %> + <%= "#{@venue_management_contract.free_period_start_date} ~ #{@venue_management_contract.free_period_end_date}" %> + + + <%= t('vm_contract.sign_date') %> + <%= @venue_management_contract.sign_date %> + + + <%= t('vm_contract.handover_date') %> + <%= @venue_management_contract.handover_date %> + + + <%= t('vm_contract.deposit_payment_date') %> + <%= @venue_management_contract.deposit_payment_date %> + + + <%= t('vm_contract.deposit_type') %> + <%= @venue_management_contract.deposit_type %> + + + <%= t('vm_contract.deposit_exp_date') %> + <%= @venue_management_contract.deposit_exp_date %> + + + <%= t('vm_contract.insurance_type') %> + <%= @venue_management_contract.insurance_type %> + + + <%= t('vm_contract.insurance_payment_deadline') %> + <%= @venue_management_contract.insurance_payment_deadline %> + + + <%= t('vm_contract.insurance_payment_date') %> + <%= @venue_management_contract.insurance_payment_date %> + + + <%= t('vm_contract.other_commitment') %> + <%= @venue_management_contract.other_commitment %> + + + <%= t('vm_contract.note') %> + <%= @venue_management_contract.note %> + + <% if !@venue_management_contract.venue_management_files.blank? %> + + <%= t(:file_) %> + + <% @venue_management_contract.venue_management_files.map do |file| %> + <%= link_to (file.title.blank? ? File.basename(file.file.path) : file.title) , file.file.url, {:target => '_blank', :title => file.description} if file.file.file %> + <% end %> + + + <% end %> + <% if !@venue_management_contract.venue_management_links.blank? %> + + <%= t(:link) %> + + <% @venue_management_contract.venue_management_links.map do |link| %> + <%= link_to (link.title.blank? ? link.url : link.title), link.url, :target => '_blank' %> + <% end %> + + + <% end %> + <% end %>
-
+
@@ -121,7 +231,7 @@ <%= link_to contract.case_no, "/#{I18n.locale}"+@params[:url]+"/#{contract.case_no.strip}-#{contract.id}?method=show_contract" , :target => '_blank' %> - <%= contract.vendor %> + <%= contract.display_contractors %> <%= "#{contract.contract_start_date} / #{contract.contract_end_date}" %> <%= contract.renewal_permission.present? ? t("vm_contract.renewal.#{contract.renewal_permission}") : t("vm_contract.renewal.false") %> <%= contract.note %> @@ -130,6 +240,41 @@ +
+
+ +
+ +
+ <% + @table_fields = [ + 'vm_memorabilia.case_no', + 'vm_memorabilia.event_date', + 'vm_memorabilia.details' + ] + @memorabilias = @venue_management.venue_management_memorabilias.to_a + %> + + + + <% @table_fields.each do |th| %> + + <% end %> + + + + <% @memorabilias.each do |memorabilia| %> + + + + + + <% end %> + +
<%=t(th)%>
+ <%= link_to memorabilia.case_no, "/#{I18n.locale}"+@params[:url]+"/#{memorabilia.case_no.to_s.strip}-#{memorabilia.id}?method=show_memorabilia", :target => '_blank' %> + <%= memorabilia.event_date %><%= memorabilia.details %>
+
@@ -142,8 +287,7 @@ 'vm_inviting.publish_times', 'vm_inviting.rents', 'vm_inviting.royalty', - 'vm_inviting.house_tax_payer', - 'vm_inviting.land_tax_payer', + 'vm_inviting.house_land_tax_payer', 'vm_inviting.contractor_manager', 'vm_inviting.bid_result', ] @@ -166,8 +310,7 @@ <%= inviting.publish_times %> <%= "#{inviting.early_rent} / #{inviting.operation_rent}" %> <%= inviting.royalty %> - <%= t("vm_inviting.enums.#{inviting.house_tax_payer}") %> - <%= t("vm_inviting.enums.#{inviting.land_tax_payer}") %> + <%= t("vm_inviting.enums.#{inviting.house_tax_payer}") + "/" + t("vm_inviting.enums.#{inviting.land_tax_payer}") %> <%= inviting.contractor_manager %> <%= t("vm_inviting.enums.bid_result.#{inviting.bid_result}") %> diff --git a/app/views/venue_managements/show_inviting.html.erb b/app/views/venue_managements/show_inviting.html.erb index 1436843..f7a7b5e 100644 --- a/app/views/venue_managements/show_inviting.html.erb +++ b/app/views/venue_managements/show_inviting.html.erb @@ -30,12 +30,8 @@ <%= @venue_management_inviting.royalty %> - <%= t('vm_inviting.house_tax_payer') %> - <%= t("vm_inviting.enums.#{@venue_management_inviting.house_tax_payer}") %> - - - <%= t('vm_inviting.land_tax_payer') %> - <%= t("vm_inviting.enums.#{@venue_management_inviting.land_tax_payer}") %> + <%= t('vm_inviting.house_land_tax_payer') %> + <%= t("vm_inviting.enums.#{@venue_management_inviting.house_tax_payer}")+"/"+t("vm_inviting.enums.#{@venue_management_inviting.land_tax_payer}") %> <%= t('vm_inviting.contractor_manager') %> diff --git a/app/views/venue_managements/show_memorabilia.html.erb b/app/views/venue_managements/show_memorabilia.html.erb new file mode 100644 index 0000000..8e63ed5 --- /dev/null +++ b/app/views/venue_managements/show_memorabilia.html.erb @@ -0,0 +1,47 @@ +<% # encoding: utf-8 %> +<% @@session = session %> +<%= yield %> +<% + data = action_data + @venue_management_memorabilia = data["venue_management_memorabilia"] + @params = data['params'] +%> + + + + + + + + + + + + + + + <% if !@venue_management_memorabilia.venue_management_files.blank? %> + + + + + <% end %> + <% if !@venue_management_memorabilia.venue_management_links.blank? %> + + + + + <% end %> + +
<%= t('vm_memorabilia.case_no') %><%= @venue_management_memorabilia.case_no %>
<%= t('vm_memorabilia.event_date') %><%= @venue_management_memorabilia.event_date %>
<%= t('vm_memorabilia.details') %><%= @venue_management_memorabilia.details %>
<%= t(:file_) %> + <% @venue_management_memorabilia.venue_management_files.map do |file| %> + <%= link_to (file.title.blank? ? File.basename(file.file.path) : file.title) , file.file.url, {:target => '_blank', :title => file.description} if file.file.file %> + <% end %> +
<%= t(:link) %> + <% @venue_management_memorabilia.venue_management_links.map do |link| %> + <%= link_to (link.title.blank? ? link.url : link.title), link.url, :target => '_blank' %> + <% end %> +
+ +
+<%= link_to t(:close), 'javascript:window.close();', :class => 'btn btn-primary' %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 06f0281..bc70c71 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -9,6 +9,9 @@ en: venue_management_submission_field: VenueManagement Submission Field venue_management_signup_field: VenueManagement Signup Field venue_management_signup: Signup Analyze + venue_management_memorabilias: Memorabilia + venue_management_invitings: Inviting History + venue_management_contracts: Contract History module_name: venue_management: Outsourced Venue Management #場地管理系統 @@ -160,6 +163,8 @@ en: royalty: Royalty house_tax_payer: House Tax Payer land_tax_payer: Land Tax Payer + house_land_tax_payer: House Tax/Land Tax Payer + start_end: Start/End Date contractor_manager: Contractor Manager bid_result: Bid Result details: Details diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index f1c178d..aadf6ae 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -9,6 +9,9 @@ zh_tw: venue_management_submission_field: 上傳介面欄位 venue_management_signup_field: 報名欄位 venue_management_signup: 報名統計 + venue_management_memorabilias: 大事記 + venue_management_invitings: 招商公告 + venue_management_contracts: 履約記錄 module_name: venue_management: 場地管理系統 @@ -160,6 +163,8 @@ zh_tw: royalty: 權利金 house_tax_payer: 房屋稅負擔方 land_tax_payer: 地價稅負擔方 + house_land_tax_payer: 房屋稅/地價稅負擔方 + start_end: 公告開始/結束日期 contractor_manager: 招商承辦人 bid_result: 開標結果 details: 其他說明 @@ -169,7 +174,7 @@ zh_tw: bid_result: failure: 流標 abandoned: 廢標 - qualified: 合格續行評審 + qualified: 決標 vm_memorabilia: case_no: 相關案號 event_date: 事件日期