From 6c09e41a0995d1ba94ca0298f07ad1e55117a0a1 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 29 Aug 2015 18:09:58 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_message.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 05caa1f91..2c3c34b07 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -11,14 +11,14 @@ <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <% end %> TO - <%= link_to activity.course.name.to_s+" | 课程讨论区", course_path(activity.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%> - <%#= link_to activity.course.name.to_s+"(课程讨论区)", course_path(activity.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%> + <%= link_to activity.board.course.name.to_s+" | 课程讨论区", course_path(activity.board.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%> + <%#= link_to activity.course.name.to_s+"(课程讨论区)", course_path(activity.board.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
<% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %> + <%= link_to activity.subject.to_s.html_safe, course_boards_path(activity.board.course,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %> <% else %> - <%= link_to activity.parent.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%> + <%= link_to activity.parent.subject.to_s.html_safe, course_boards_path(activity.board.course,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%> <% end %>
From ca0c7a4fb0d152768a79beef1423d45ad2741e9c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 29 Aug 2015 18:51:35 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E8=81=8C=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 15 +++++++++++++++ app/views/layouts/new_base_user.html.erb | 8 +++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7f93345b4..b36a6491e 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 identity + technical_title = "" + case identity.to_s + when "0" + technical_title = l(:label_account_identity_teacher) + 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..6fe2a4653 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.user_extensions.identity %> +

+ <% end%>
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
From 09a994f76a49d33f4f6b2c97c97b6eca0f38ce5a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 29 Aug 2015 18:54:34 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=81=8C=E7=A7=B0=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=89=AF=E6=95=99=E6=8E=88=E7=AD=89=E8=81=8C=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 6 +++--- app/views/layouts/new_base_user.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b36a6491e..7b83bb1c2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2254,11 +2254,11 @@ module ApplicationHelper technical_title end - def get_user_roll identity + def get_user_roll user technical_title = "" - case identity.to_s + case user.user_extensions.identity.to_s when "0" - technical_title = l(:label_account_identity_teacher) + technical_title = get_technical_title user when "1" technical_title = l(:label_account_identity_student) when "2" diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index 6fe2a4653..20a626c12 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -52,7 +52,7 @@
<% if @user.user_extensions && @user.user_extensions.identity %>

- <%= get_user_roll @user.user_extensions.identity %> + <%= get_user_roll @user %>

<% end%>
From 96021bee73f8916869407aa74c520d1b95d272d0 Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 29 Aug 2015 18:59:39 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E7=9A=84=E5=9B=9E=E5=A4=8D=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_message.html.erb | 8 ++++---- app/views/users/_project_issue.html.erb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 2c3c34b07..05caa1f91 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -11,14 +11,14 @@ <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <% end %> TO - <%= link_to activity.board.course.name.to_s+" | 课程讨论区", course_path(activity.board.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%> - <%#= link_to activity.course.name.to_s+"(课程讨论区)", course_path(activity.board.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%> + <%= link_to activity.course.name.to_s+" | 课程讨论区", course_path(activity.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%> + <%#= link_to activity.course.name.to_s+"(课程讨论区)", course_path(activity.course), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
<% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe, course_boards_path(activity.board.course,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %> + <%= link_to activity.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %> <% else %> - <%= link_to activity.parent.subject.to_s.html_safe, course_boards_path(activity.board.course,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%> + <%= link_to activity.parent.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%> <% end %>
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) %> From c416a312cf87572c953d7e0865aaacbf0f18fa11 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 29 Aug 2015 19:02:47 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_homeworks.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(""); From 8be7509b33d4056e385438333649be7781e00f68 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 29 Aug 2015 19:03:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E3=80=81=E7=AB=9E?= =?UTF-8?q?=E8=B5=9B=E4=B8=BB=E9=A1=B5=E8=B7=B3=E8=BD=AC=E5=88=B0=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=BB=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/welcome_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) 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