重新修改编辑角色有label字未显示全问题(前次修改影响了其他地方),新建合作单位,填写字段不正确时不清空用户填写的数据

This commit is contained in:
z9hang 2014-10-21 14:27:58 +08:00
parent a8bc274621
commit 38345c0c68
3 changed files with 19 additions and 4 deletions

View File

@ -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

View File

@ -1,7 +1,7 @@
<%= error_messages_for 'role' %>
<% unless @role.anonymous? %>
<div class="box tabular">
<div class="box role">
<% unless @role.builtin? %>
<p><%= f.text_field :name, :required => true %></p>
<p><%= f.check_box :assignable %></p>

View File

@ -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;