From 38345c0c689dfeadd279fe77d7f28ffbb7d4ea96 Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 21 Oct 2014 14:27:58 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E4=BF=AE=E6=94=B9=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E8=A7=92=E8=89=B2=E6=9C=89label=E5=AD=97=E6=9C=AA?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=85=A8=E9=97=AE=E9=A2=98=EF=BC=88=E5=89=8D?= =?UTF-8?q?=E6=AC=A1=E4=BF=AE=E6=94=B9=E5=BD=B1=E5=93=8D=E4=BA=86=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E5=9C=B0=E6=96=B9=EF=BC=89=EF=BC=8C=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E5=90=88=E4=BD=9C=E5=8D=95=E4=BD=8D=EF=BC=8C=E5=A1=AB=E5=86=99?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=8D=E6=AD=A3=E7=A1=AE=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E7=94=A8=E6=88=B7=E5=A1=AB=E5=86=99=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/web_footer_companies_controller.rb | 8 ++++++-- app/views/roles/_form.html.erb | 2 +- public/stylesheets/application.css | 13 ++++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/app/controllers/web_footer_companies_controller.rb b/app/controllers/web_footer_companies_controller.rb index b61a58189..0fa076c2f 100644 --- a/app/controllers/web_footer_companies_controller.rb +++ b/app/controllers/web_footer_companies_controller.rb @@ -10,7 +10,7 @@ class WebFooterCompaniesController < ApplicationController end def new - @company = WebFooterCompany.new + @company ||= WebFooterCompany.new end def create @@ -20,7 +20,11 @@ class WebFooterCompaniesController < ApplicationController redirect_to web_footer_companies_url else flash[:error] = "#{l :web_footer_company_create_fail}: #{@company.errors.full_messages[0]}" - render :action => 'new' + respond_to do |format| + format.html { render :action => 'new'} + format.api { render_validation_errors(@company) } + end + end end diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb index 9ed134f1e..36d3ed8e3 100644 --- a/app/views/roles/_form.html.erb +++ b/app/views/roles/_form.html.erb @@ -1,7 +1,7 @@ <%= error_messages_for 'role' %> <% unless @role.anonymous? %> -
+
<% unless @role.builtin? %>

<%= f.text_field :name, :required => true %>

<%= f.check_box :assignable %>

diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 33b4035d6..1f53d9903 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1814,12 +1814,23 @@ html>body .tabular p {overflow:hidden;} float: left; text-align: right; /* width of left column */ - margin-left: -150px; + margin-left: -180px; /* width of labels. Should be smaller than left column to create some right margin */ width: 175px; font-size: 12px; } +.role label{ + font-weight: bold; + float: left; + text-align: right; + /* width of left column */ + margin-left: -60px; + /* width of labels. Should be smaller than left column to create some right margin */ + width: 175px; + font-size: 12px; +} + .tabular label.floating{ font-weight: normal; margin-left: 0px;