diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 809f78ddc..24cbecb81 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7f93345b4..7b83bb1c2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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/ diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index 32813b58d..20a626c12 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -50,9 +50,11 @@ <% end %>
-

- <%= get_technical_title @user %> -

+ <% if @user.user_extensions && @user.user_extensions.identity %> +

+ <%= get_user_roll @user %> +

+ <% end%>
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index a56a4dd1f..4badcff42 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -107,8 +107,8 @@
<% 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) %> diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index e232579f9..74e4df4f0 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -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("");