From ceb60e3afc891b1c32aa7846bc2082f2addaf967 Mon Sep 17 00:00:00 2001 From: Bohung Date: Wed, 8 Sep 2021 11:29:20 +0800 Subject: [PATCH] Fix layout. --- .../admin/property_hires/edit_hire.html.erb | 33 ++++++++++++++++--- app/views/property_hires/hire.html.erb | 10 +++--- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/app/views/admin/property_hires/edit_hire.html.erb b/app/views/admin/property_hires/edit_hire.html.erb index f530be4..6c2c4a2 100644 --- a/app/views/admin/property_hires/edit_hire.html.erb +++ b/app/views/admin/property_hires/edit_hire.html.erb @@ -289,13 +289,38 @@ ul.list-unstyled li { width: 25%; } } - form#new_p_hire .form-group input,form#new_p_hire .form-group select, form#new_p_hire .form-group textarea{ + form#hire_form .form-group input,form#hire_form .form-group select, form#hire_form .form-group textarea{ min-width: 100%; max-width: 300px; } - form#new_p_hire .form-group input[name="_rucaptcha"], form#new_p_hire .form-group input[type="submit"], form#new_p_hire .form-group input[type="radio"], form#new_p_hire .form-group input[type="checkbox"]{ + form#hire_form .form-group input[name="_rucaptcha"], form#hire_form .form-group input[type="submit"], form#hire_form .form-group input[type="radio"], form#hire_form .form-group input[type="checkbox"]{ width: auto; min-width: auto; + position: relative; + margin-left: 0; + } + form#hire_form .form-control { + display: block; + width: 100%; + height: auto; + padding: 0.375em 1.125em; + font-size: 0.875em; + line-height: 1.42857143; + color: #555; + background-color: #fff; + background-image: none; + border: 0.0625em solid #ccc; + border-radius: 0.25em; + -webkit-box-shadow: inset 0 0.0625em 0.0625em rgb(0 0 0 / 8%); + box-shadow: inset 0 0.0625em 0.0625em rgb(0 0 0 / 8%); + -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s; + -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; + transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s; + } + .form-horizontal .form-group { + margin-bottom: 0.9375em; + display: inline-block; + width: 100%; } <% if !property.can_be_hired %> @@ -570,7 +595,7 @@ ul.list-unstyled li { <% end %>
-<%= form_for hire, :url => "/xhr/property_hires/make_booking", html: { class: "form-horizontal" } do |f| %> +<%= form_for hire, :url => "/xhr/property_hires/make_booking", html: { class: "form-horizontal", id: "hire_form" } do |f| %> <% if property.set_availability %>
<%= f.label :date, "*"+t("property_hire.date"), :class => "col-sm-#{label_col} control-label" %> @@ -914,7 +939,7 @@ ul.list-unstyled li { }) - var hireForm = new FormValidator($("#new_p_hire")); + var hireForm = new FormValidator($("#hire_form")); hireForm.validate_functions.checkForDates = function(value,element){ return value == "1"; } diff --git a/app/views/property_hires/hire.html.erb b/app/views/property_hires/hire.html.erb index d804070..47bc575 100644 --- a/app/views/property_hires/hire.html.erb +++ b/app/views/property_hires/hire.html.erb @@ -159,13 +159,15 @@ width: 25%; } } - form#new_p_hire .form-group input,form#new_p_hire .form-group select, form#new_p_hire .form-group textarea{ + form#hire_form .form-group input,form#hire_form .form-group select, form#hire_form .form-group textarea{ min-width: 100%; max-width: 300px; } - form#new_p_hire .form-group input[name="_rucaptcha"], form#new_p_hire .form-group input[type="submit"], form#new_p_hire .form-group input[type="radio"], form#new_p_hire .form-group input[type="checkbox"]{ + form#hire_form .form-group input[name="_rucaptcha"], form#hire_form .form-group input[type="submit"], form#hire_form .form-group input[type="radio"], form#hire_form .form-group input[type="checkbox"]{ width: auto; min-width: auto; + position: relative; + margin-left: 0; } <% if !property.can_be_hired %> @@ -440,7 +442,7 @@ <% end %>
-<%= form_for hire, :url => "/xhr/property_hires/make_booking", html: { class: "form-horizontal" } do |f| %> +<%= form_for hire, :url => "/xhr/property_hires/make_booking", html: { class: "form-horizontal", id: "hire_form" } do |f| %> <% if property.set_availability %>
<%= f.label :date, "*"+t("property_hire.date"), :class => "col-sm-#{label_col} control-label" %> @@ -784,7 +786,7 @@ }) - var hireForm = new FormValidator($("#new_p_hire")); + var hireForm = new FormValidator($("#hire_form")); hireForm.validate_functions.checkForDates = function(value,element){ return value == "1"; }