From e86b431bbb7cc838f6aa1c372ee0c89041b93bf5 Mon Sep 17 00:00:00 2001 From: bohung Date: Sat, 22 Oct 2022 16:05:20 +0800 Subject: [PATCH] Fix bug. --- app/controllers/property_hires_controller.rb | 1 + app/helpers/admin/p_hire_field_helper.rb | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/property_hires_controller.rb b/app/controllers/property_hires_controller.rb index a6145a7..61b60d7 100644 --- a/app/controllers/property_hires_controller.rb +++ b/app/controllers/property_hires_controller.rb @@ -1,5 +1,6 @@ class PropertyHiresController < ApplicationController include Admin::PropertyHiresHelper + FrontendMethods = ["hire", "view_calendar", "hire_success"] def index properties = Property.filter_by_categories.filter_by_tags.sort_order data = properties.collect do |property| diff --git a/app/helpers/admin/p_hire_field_helper.rb b/app/helpers/admin/p_hire_field_helper.rb index 33360b8..8a605b3 100644 --- a/app/helpers/admin/p_hire_field_helper.rb +++ b/app/helpers/admin/p_hire_field_helper.rb @@ -460,11 +460,14 @@ protected def form_label if self.markup == "text_area" - plc = typeD["placeholder"][I18n.locale].to_s.blank? ? '' : "(#{typeD["placeholder"][I18n.locale]})" - if plc.present? - plc = tag(:br)+plc + plc = typeD["placeholder"][I18n.locale].to_s.blank? ? nil : "(#{typeD["placeholder"][I18n.locale]})" + label_tag(key, '' , :class=>"col-sm-#{@col} control-label muted") do + concat (!@require.blank? ? '*'+title : title) + if plc + concat tag(:br) + concat plc + end end - label_tag(key,(!@require.blank? ? '*'+title + plc : title + plc),:class=>"col-sm-#{@col} control-label muted") else label_tag(key,(!@require.blank? ? '*'+title : title),:class=>"col-sm-#{@col} control-label muted") end