Merge branch 'szzh' into develop
This commit is contained in:
commit
6f3bed94d9
|
@ -98,6 +98,9 @@ class WelcomeController < ApplicationController
|
|||
end
|
||||
|
||||
def course
|
||||
redirect_to signin_path
|
||||
return
|
||||
|
||||
@course_page = FirstPage.find_by_page_type('course')
|
||||
@school_id = params[:school_id] || User.current.user_extensions.school.try(:id) || 117
|
||||
@logoLink ||= logolink()
|
||||
|
@ -140,6 +143,9 @@ class WelcomeController < ApplicationController
|
|||
|
||||
|
||||
def contest
|
||||
redirect_to signin_path
|
||||
return
|
||||
|
||||
@contest_page = FirstPage.find_by_page_type('contest')
|
||||
@contest_notifications = Contestnotification.order("created_at desc").limit(5)
|
||||
end
|
||||
|
|
|
@ -2254,6 +2254,21 @@ module ApplicationHelper
|
|||
technical_title
|
||||
end
|
||||
|
||||
def get_user_roll user
|
||||
technical_title = ""
|
||||
case user.user_extensions.identity.to_s
|
||||
when "0"
|
||||
technical_title = get_technical_title user
|
||||
when "1"
|
||||
technical_title = l(:label_account_identity_student)
|
||||
when "2"
|
||||
technical_title = l(:label_account_identity_enterprise)
|
||||
when "3"
|
||||
technical_title = l(:label_account_identity_developer)
|
||||
end
|
||||
technical_title
|
||||
end
|
||||
|
||||
|
||||
def ie8?
|
||||
request.env["HTTP_USER_AGENT"] =~ /MSIE 8.0/
|
||||
|
|
|
@ -50,9 +50,11 @@
|
|||
<span class="<%= @user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></span>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<p class="mb20 c_dark f14">
|
||||
<%= get_technical_title @user %>
|
||||
</p>
|
||||
<% if @user.user_extensions && @user.user_extensions.identity %>
|
||||
<p class="mb20 c_dark f14">
|
||||
<%= get_user_roll @user %>
|
||||
</p>
|
||||
<% end%>
|
||||
<div id="watch_user_btn_div">
|
||||
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
|
||||
</div>
|
||||
|
|
|
@ -107,8 +107,8 @@
|
|||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<%# else %>
|
||||
<%#= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_date(reply.created_on) %>
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
function reset_homework(){
|
||||
$("#homework_name").val("");
|
||||
$("#homework_end_time").val("");
|
||||
$("#homework_end_time").val("<%= (Time.now + 3600 * 24).strftime('%Y-%m-%d')%>");
|
||||
$("#course_id").val("");
|
||||
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new })%>");
|
||||
homework_description_editor.html("");
|
||||
|
|
Loading…
Reference in New Issue