This commit is contained in:
alanlong9278 2015-05-08 09:55:33 +08:00
commit f9a25373b0
10 changed files with 40 additions and 20 deletions

View File

@ -314,7 +314,7 @@ class AccountController < ApplicationController
#根据home_url生产正则表达式
eval("code = " + "/^" + home_url.gsub(/\//,"\\\/") + "\\\/*(welcome)?\\\/*(\\\/index\\\/*.*)?\$/")
if (code=~params[:back_url] || params[:back_url].to_s.include?('lost_password')) && last_login_on != ''
redirect_to user_activities_path(user)
redirect_to user_activities_path(user,host: Setting.user_domain)
else
if last_login_on == ''
redirect_to my_account_url

View File

@ -797,4 +797,17 @@ module CoursesHelper
end
result
end
def zh_course_role role
if role == "TeachingAsistant"
result = l(:label_TA)
elsif role == "Teacher"
result = l(:label_teacher)
elsif role == "Student"
result = l(:label_student)
elsif role == "Manager"
result = l(:field_admin)
end
result
end
end

View File

@ -37,7 +37,7 @@
<% @roles.each do |role| %>
<li>
<%= radio_button_tag 'membership[role_ids][]', role.id, role.name == "学生" || role.name == "Student" %>
<label ><%= h role %></label>
<label ><%= zh_course_role(h role) %></label>
</li>
<% end %>
</ul>

View File

@ -1,6 +1,7 @@
<div class="st_list">
<div class="st_box">
<a href="javascript:void(0)" class="fr fb mb5" >加入时间</a>
<a href="javascript:void(0)" class="fr fb mb5 mr70" >角色</a>
<div class="cl"></div><!--st_box_top end-->
<% members.each do |member| %>
@ -9,8 +10,9 @@
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= link_to(member.user.name, user_path(member.user),:class => "ml10 c_blue02") %>
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 c_blue02") %>
<span class="fr c_grey"><%= format_date(member.created_on)%></span>
<span class="fr c_grey mr30 w45"><%= zh_course_role(h member.roles.sort.collect(&:to_s).first)%></span>
</div>
<div class="cl"></div>
<% end%>

View File

@ -2,21 +2,21 @@
<li >
<%= link_to_user_header member.principal,true,:class => "w150 c_orange fl" %>
<span class="w150 fl">
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
<%= zh_course_role(h member.roles.sort.collect(&:to_s).join(', ')) %>
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
:method => :put,
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
) do |f| %>
<% @roles.each do |role| %>
<ul style="text-align: left;" class="ml20">
<ul style="text-align: left;" class="ml45">
<%= radio_button_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
<label ><%= h role %></label>
<label ><%= zh_course_role(h role) %></label>
</ul>
<!--<br/>-->
<% end %>
<%= hidden_field_tag 'membership[role_ids][]', '' %>
<div class="ml20">
<div class="ml45">
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
<%= l(:button_change)%>
</a>

View File

@ -21,16 +21,9 @@
function submit_jours(is_teacher)
{
if(!is_teacher&&$("#stars_value").val() == "0"){
if(confirm('是否确定评分为0分?'))
{
}
else
{
return;
}
}
// if(("#stars_value").val() == "0"){
// if(confirm('是否确定评分为0分?')){}else{return;}
// }
if(!is_teacher&&$("#new_form_user_message").val() == ""){alert("您还没有填写评语");return;}
$('#new_form_user_message').parent().submit();
}

View File

@ -11,6 +11,14 @@
for (var i = num; i >= 0; i--) {$("#star0" + i).css("background-position","-24px 0px");}
$("#stars_value").val(num);
}
function ChoseZero()
{
if(confirm('是否确定评分为0分?'))
{
ChoseStars(0);
}
}
</script>
<div id="popbox">
<div class="ping_con">

View File

@ -1,4 +1,4 @@
<a style="float: right;padding-left: 10px;font-weight: normal;cursor: pointer;color: red;" onclick="ChoseStars(0)">零分</a>
<a style="float: right;padding-left: 10px;font-weight: normal;cursor: pointer;color: red;" onclick="ChoseZero();">零分</a>
<span><a href="javascript:" id="star05" onclick="ChoseStars(5)" style="background-position:<%= start_score>=5 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="javascript:" id="star04" onclick="ChoseStars(4)" style="background-position:<%= start_score>=4 ? '-24px 0px;':'-2px 0'%>"></a></span>
<span><a href="javascript:" id="star03" onclick="ChoseStars(3)" style="background-position:<%= start_score>=3 ? '-24px 0px;':'-2px 0'%>"></a></span>

View File

@ -15,8 +15,8 @@ zh:
label_forum_all: 公共贴吧
label_school_all: 中国高校
label_contest_innovate: 创新竞赛
#label_software_user: 软件创客
#label_requirement_enterprise: 软件众包
label_software_user: 软件创客
label_requirement_enterprise: 软件众包
label_stores_index: 资源搜索
label_login: 登录

View File

@ -70,6 +70,9 @@ h4{ font-size:14px; color:#3b3b3b;}
.mr20{ margin-right:20px;}
.mr30{ margin-right:30px;}
.mr40{ margin-right:40px;}
.mr50{margin-right: 50px;}
.mr55{margin-right: 55px;}
.mr70{margin-right: 70px;}
.mt3{ margin-top:3px;}
.mt5{ margin-top:5px;}
.mt8{ margin-top:8px;}
@ -79,6 +82,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;}
.w20{ width:20px;}
.w45{ width: 45px;}
.w60{ width:60px;}
.w70{ width:70px;}
.w90{ width:90px;}