This commit is contained in:
sw 2014-10-21 16:56:32 +08:00
commit 34c7b47580
8 changed files with 35 additions and 11 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

@ -51,7 +51,7 @@
:class => 'icon icon-edit' %>
<%= delete_link membership_path(member),
:remote => true,
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {}) if member.deletable? %>
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_delete_confirmation)} : {confirm: l(:label_delete_confirm)}) if member.deletable? %>
</td>
<% end %>
<!--end-->
@ -82,7 +82,11 @@
<p style="padding-top: 5px"><%= l(:label_role_plural) %>:
<% roles.each do |role| %>
<label><%= radio_button_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
<% if role.id == 10 %> <!-- 默认学生角色 -->
<label><%= radio_button_tag 'membership[role_ids][]', role.id, true %> <%= h role %></label>
<% else %>
<label><%= radio_button_tag 'membership[role_ids][]', role.id %> <%= h role %></label>
<% end %>
<% end %></p>
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>

View File

@ -36,7 +36,6 @@
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
<%= render_flash_messages %>
</div>
<%= render :partial => 'layouts/base_footer'%>
</div>

View File

@ -1,6 +1,11 @@
<% if @project%>
$('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_members(@project)) %>');
<% elsif @course%>
var checked = $("#principals input:checked").size();
if(checked > 0)
{
alert('翻页或搜索后将丢失当前选择的用户数据!');
}
$('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_course_members(@course)) %>');
<%end%>
var collection=$("#principals_for_new_member").children("#principals").children("label");

View File

@ -178,7 +178,7 @@
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
<%#= submit_tag l(:button_submit) %>
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onclick="submit_message_replay();" >
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onmousemove="regexContent()" onclick="submit_message_replay();" >
<%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
<% end %>
<div id="preview" class="wiki"></div>
@ -188,12 +188,13 @@
<% html_title @topic.subject %>
<script type="text/javascript">
var flag = false
jQuery(document).ready(function($) {
transpotUrl('#content');
});
function submit_message_replay()
{
if(regexContent())
if(flag)
{
$("#message-form").submit();
}
@ -205,13 +206,13 @@
{
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
$("#message_content_span").css('color','#ff0000');
return false;
flag = false;
}
else
{
$("#message_content_span").text("<%= l(:label_field_correct) %>");
$("#message_content_span").css('color','#008000');
return true;
flag = true;
}
}
</script>

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

@ -242,7 +242,7 @@ tags_min_length:
default: 1
tags_max_length:
format: int
default: 30
default: 14
tags_show_search_results:
format: int
default: 5

View File

@ -1820,6 +1820,17 @@ html>body .tabular p {overflow:hidden;}
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;