From 4c87071765c721a24366633533e77d4813aa4d5a Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 20 Aug 2015 17:24:34 +0800 Subject: [PATCH 01/86] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin_controller.rb | 14 -------- app/controllers/users_controller.rb | 6 ++++ app/views/users/show.html.erb | 52 ++++++++++++++++++++++++----- db/schema.rb | 8 +---- 4 files changed, 50 insertions(+), 30 deletions(-) diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 25536615a..acff52dc9 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -419,20 +419,6 @@ class AdminController < ApplicationController def messages_list @memo = Memo.reorder("created_at desc") -=begin - case params[:format] - when 'xml', 'json' - @offset, @limit = api_offset_and_limit({:limit => 30}) - else - @limit = 30#per_page_option - end - - @memo_count = @memo.count - @memo_pages = Paginator.new @memo_count, @limit, params['page'] - @offset ||= @memo_pages.offset - @memo = @memo.limit(@limit).offset(@offset).all -=end - respond_to do |format| format.html end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 058cf971f..2e3ec769d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -534,6 +534,12 @@ class UsersController < ApplicationController end def show + if @user == User.current + @user_activities = UserActivity.where("(container_type='Course' and container_id in (select course_id FROM members WHERE user_id=#{@user.id})) or (container_type='Project' and container_id in (SELECT project_id FROM members WHERE user_id=#{@user.id}))").order('created_at desc') +=begin + SELECT * FROM user_activities WHERE (container_type='Course' AND container_id IN (SELECT course_id FROM members WHERE user_id=4)) OR (container_type='Project' AND container_id IN (SELECT project_id FROM members WHERE user_id=4)) +=end + end render :layout=>'new_base_user' end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 4975229eb..5e5082082 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -10,7 +10,7 @@
  • 作业动态
  • 通知动态
  • 论坛动态
  • -
  • 问卷动态
  • +
  • @@ -24,7 +24,40 @@
  • -
    + <% @user_activities.each do |user_activity| unless @user_activities.nil? %> + <% case user_activity.act_type.to_s%> + <% when 'CourseActivity'%> + <% @course_act= CourseActivity.where("id=#{user_activity.act_id}").first%> + <% case @course_act.course_act_type.to_s %> + <% when 'HomeworkCommon'%> +
    +
    用户头像
    +
    + + +
    + +
    截止时间:2015-08-20
    +
    +
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    + +
    +
    +
    + <% end %> + <% end %> + <% end %> +
    用户头像
    @@ -34,7 +67,7 @@
    截止时间:2015-08-20
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    -
    +
    -
    + +
    @@ -139,7 +173,7 @@
    用户头像
    - +
    很开心!
    @@ -147,7 +181,7 @@
    用户头像
    - +
    假期好热,没出去。
    @@ -199,7 +233,7 @@
    用户头像
    - +
    尹教授 2015-08-01删除
    请大家说下软件工程是什么!
    @@ -207,7 +241,7 @@
    用户头像
    - +
    软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
    diff --git a/db/schema.rb b/db/schema.rb index 7e3743b0e..c390dc2fe 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -474,13 +474,6 @@ ActiveRecord::Schema.define(:version => 20150820025358) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -893,6 +886,7 @@ ActiveRecord::Schema.define(:version => 20150820025358) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" + t.datetime "updated_on" end add_index "news", ["author_id"], :name => "index_news_on_author_id" From e1fb2a6babe5a21eb0ac3dd7d2d6758ddbf7b92c Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 21 Aug 2015 16:07:18 +0800 Subject: [PATCH 02/86] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 11 +- app/views/users/_course_news.html.erb | 36 +++ app/views/users/show.html.erb | 423 +++++++++++++------------- app/views/users/show_chen.erb | 279 +++++++++++++++++ public/stylesheets/new_public.css | 2 +- 5 files changed, 538 insertions(+), 213 deletions(-) create mode 100644 app/views/users/_course_news.html.erb create mode 100644 app/views/users/show_chen.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 2e3ec769d..e6e4f96d7 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -534,12 +534,13 @@ class UsersController < ApplicationController end def show - if @user == User.current + #if @user == User.current + @user_activities = UserActivity.where("(container_type='Course' and container_id in (select course_id FROM members WHERE user_id=#{@user.id})) or (container_type='Project' and container_id in (SELECT project_id FROM members WHERE user_id=#{@user.id}))").order('created_at desc') -=begin - SELECT * FROM user_activities WHERE (container_type='Course' AND container_id IN (SELECT course_id FROM members WHERE user_id=4)) OR (container_type='Project' AND container_id IN (SELECT project_id FROM members WHERE user_id=4)) -=end - end + + #SELECT * FROM user_activities WHERE (container_type='Course' AND container_id IN (SELECT course_id FROM members WHERE user_id=4)) OR (container_type='Project' AND container_id IN (SELECT project_id FROM members WHERE user_id=4)) + #else + #end render :layout=>'new_base_user' end diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb new file mode 100644 index 000000000..f57e05e34 --- /dev/null +++ b/app/views/users/_course_news.html.erb @@ -0,0 +1,36 @@ +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@activity.author), :width => "90", :height => "90"), user_path(@activity.author_id), :alt => "用户头像" %> + +
    +
    +
    + <% if @activity.try(:author).try(:realname) == ' ' %> + <%= link_to @activity.try(:author), user_path(@activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to @activity.try(:author).try(:realname), user_path(@activity.author_id), :class => "newsBlue mr15" %> + <% end %> TO + <%= @activity.course.name %>(课程名称) +
    + +
    +
    发布时间:<%= format_date(@activity.created_on) %>
    +
    +
    (通知描述)<%= @activity.description.html_safe %>
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 5e5082082..416c5485c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -24,23 +24,81 @@
    - <% @user_activities.each do |user_activity| unless @user_activities.nil? %> - <% case user_activity.act_type.to_s%> - <% when 'CourseActivity'%> - <% @course_act= CourseActivity.where("id=#{user_activity.act_id}").first%> - <% case @course_act.course_act_type.to_s %> - <% when 'HomeworkCommon'%> -
    -
    用户头像
    +
    +<% @user_activities.each do |user_activity| + unless @user_activities.nil? %> + <% case user_activity.act_type.to_s %> + <% when 'CourseActivity' %> + <% @course_act= CourseActivity.where("id=#{user_activity.act_id}").first %> + <% case @course_act.course_act_type.to_s %> + <% when 'HomeworkCommon' %> + <% @activity=HomeworkCommon.where("id=#{@course_act.course_act_id}").first %> +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@activity.user), :width => "90", :height => "90"), user_path(@activity.user_id), :alt => "用户头像" %> + +
    +
    +
    + <% if @activity.try(:user).try(:realname) == ' ' %> + <%= link_to @activity.try(:user), user_path(@activity.user_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to @activity.try(:user).try(:realname), user_path(@activity.user_id), :class => "newsBlue mr15" %> + <% end %> TO + <%= @activity.course.name %>(课程名称) +
    + +
    + +
    截止时间:<%= format_date(@activity.end_time) %>
    +
    +
    (作业描述)<%= @activity.description.html_safe %>
    + +
    +
    +
    +
    + <% when 'News' %> + <% @activity=News.where("id=#{@course_act.course_act_id}").first %> + + <% when 'Message'%> + <% @activity=Message.where("id=#{@course_act.course_act_id}").first %> + <% if @activity.parent_id.nil? %> +
    +
    +
    + 用户头像 +
    - - +
    + <% if @activity.try(:author).try(:realname) == ' ' %> + <%= link_to @activity.try(:author), user_path(@activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to @activity.try(:author).try(:realname), user_path(@activity.author_id), :class => "newsBlue mr15" %> + <% end %> + TO + <%= @activity.course.name %>(课程讨论区) +
    +
    - -
    截止时间:2015-08-20
    +
    时间:<%= format_date(@activity.created_on) %>
    -
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    - - <% end %> - <% end %> +
    +
    +
    回复(<%=@activity.replies_count %>)
    +
    2015-07-31
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    + 用户头像 +
    +
    +
    + 黄井泉 学生 + 2015-08-01删除 +
    +
    很开心!
    +
    +
    +
    +
    +
    + 用户头像 +
    +
    +
    + 陈正东 学生 + 2015-08-02删除 +
    +
    假期好热,没出去。
    +
    +
    +
    +
    +
    + <% end %> + <% end %> + <% when 'ForgeActivity' %> + <% @project_act= ForgeActivity.where("id=#{user_activity.act_id}").first %> + <% case @project_act.forge_act_type.to_s %> + <% when 'Issue' %> + <% @activity=Issue.where("id=#{@project_act.forge_act_id}").first %> +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@activity.author), :width => "90", :height => "90"), user_path(@activity.author_id), :alt => "用户头像" %> + +
    +
    +
    + <% if @activity.try(:author).try(:realname) == ' ' %> + <%= link_to @activity.try(:author), user_path(@activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to @activity.try(:author).try(:realname), user_path(@activity.author_id), :class => "newsBlue mr15" %> + <% end %> TO + <%=@activity.project.name %>(项目名称)
    +
    + <%=@activity.subject %>(缺陷标题)<%=@activity.status.name %> +
    + +
    (缺陷描述)<%=@activity.description.html_safe %>
    +
    + 文件附件.zip(123KB) +
    +
    + 图片附件.png(123KB) +
    + +
    +
    +
    +
    +
    +
    回复(5)
    +
    2015-07-26
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    + 用户头像 +
    +
    +
    + 尹教授 + 2015-08-01删除 +
    +
    请大家说下软件工程是什么!
    +
    +
    +
    +
    +
    + 用户头像 +
    +
    +
    + Tang 学生 + 2015-08-01删除 +
    +
    软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
    +
    +
    +
    +
    +
    + <% when 'Message' %> + <% end %> <% end %> -
    -
    用户头像
    -
    - - -
    - -
    截止时间:2015-08-20
    -
    -
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    - -
    -
    -
    - - -
    -
    -
    -
    用户头像
    -
    - - -
    -
    时间:2015-07-31
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    回复(5)
    -
    2015-07-31
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    用户头像
    -
    - -
    很开心!
    -
    -
    -
    -
    -
    用户头像
    -
    - -
    假期好热,没出去。
    -
    -
    -
    -
    -
    -
    -
    -
    用户头像
    -
    - - -
    -
    指派给  苏稳
    -
    时间:2015-08-20
    -
    -
    (缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    - - -
    - -
    -
    -
    -
    -
    -
    -
    回复(5)
    -
    2015-07-26
    - -
    -
    - -
    -
    - - - -
    -
    -
    -
    用户头像
    -
    -
    尹教授 2015-08-01删除
    -
    请大家说下软件工程是什么!
    -
    -
    -
    -
    -
    用户头像
    -
    - -
    软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
    -
    -
    -
    -
    -
    \ No newline at end of file +<% end %> +<% end %> \ No newline at end of file diff --git a/app/views/users/show_chen.erb b/app/views/users/show_chen.erb new file mode 100644 index 000000000..74b303fad --- /dev/null +++ b/app/views/users/show_chen.erb @@ -0,0 +1,279 @@ +
    +
    +
    最新动态
    + +
    + +
    +
    + 用户头像
    +
    + + +
    + +
    截止时间:2015-08-20
    +
    +
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    + +
    +
    +
    +
    +
    +
    +
    + 用户头像
    +
    + + +
    + +
    截止时间:2015-08-20
    +
    +
    (作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    + +
    +
    +
    +
    + + + +
    +
    +
    + 用户头像
    +
    + + +
    +
    时间:2015-07-31
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    回复(5)
    +
    2015-07-31
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    + 用户头像 +
    +
    +
    黄井泉 学生 + 2015-08-01删除 +
    +
    很开心!
    +
    +
    +
    +
    +
    + 用户头像 +
    +
    +
    陈正东 学生 + 2015-08-02删除 +
    +
    假期好热,没出去。
    +
    +
    +
    +
    +
    +
    +
    +
    + 用户头像
    +
    + + +
    +
    指派给  苏稳 +
    +
    时间:2015-08-20
    +
    +
    (缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
    +
    + 文件附件.zip(123KB) +
    +
    + 图片附件.png(123KB) +
    +
    + +
    +
    +
    +
    +
    +
    +
    回复(5)
    +
    2015-07-26
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    + 用户头像 +
    +
    +
    尹教授 + 2015-08-01删除 +
    +
    请大家说下软件工程是什么!
    +
    +
    +
    +
    +
    + 用户头像 +
    +
    +
    Tang 学生 + 2015-08-01删除 +
    +
    软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
    +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/public/stylesheets/new_public.css b/public/stylesheets/new_public.css index 17057eabb..b71ff9604 100644 --- a/public/stylesheets/new_public.css +++ b/public/stylesheets/new_public.css @@ -471,7 +471,7 @@ a.postTypeGrey:hover {color:#15bccf;} .homepagePostTo {font-size:14px; color:#484848; margin-bottom:15px;} .homepagePostTitle {font-size:14px; color:#484848; margin-bottom:15px;} .homepagePostSubmitContainer {height:30px; margin-bottom:15px;} -.homepagePostSubmit {font-size:14px; color:#888888; width:80px; height:30px; text-align:center; vertical-align:middle; line-height:30px; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px;} +.homepagePostSubmit {font-size:14px; color:#888888; width:90px; height:30px; text-align:center; vertical-align:middle; line-height:30px; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px;} .homepagePostSubmit:hover {background-color:#d8d8d8;} .homepagePostIntro {font-size:12px; color:#888888;} .homepagePostDeadline {font-size:12px; color:#888888; float:left; height:30px; line-height:30px; vertical-align:middle;} From 011184b5372ae253b20c6ad663b31f2b701ff5e4 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 21 Aug 2015 17:26:52 +0800 Subject: [PATCH 03/86] =?UTF-8?q?=E4=B8=AA=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/views/users/_course_homework.html.erb | 39 ++++ app/views/users/_course_message.html.erb | 82 +++++++++ app/views/users/_course_news.html.erb | 16 +- app/views/users/_project_issue.html.erb | 87 +++++++++ app/views/users/_project_message.html.erb | 82 +++++++++ app/views/users/show.html.erb | 215 +--------------------- 6 files changed, 304 insertions(+), 217 deletions(-) create mode 100644 app/views/users/_course_homework.html.erb create mode 100644 app/views/users/_course_message.html.erb create mode 100644 app/views/users/_project_issue.html.erb create mode 100644 app/views/users/_project_message.html.erb diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb new file mode 100644 index 000000000..2534cad9d --- /dev/null +++ b/app/views/users/_course_homework.html.erb @@ -0,0 +1,39 @@ +
    +
    +
    + <%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %> + +
    +
    +
    + <% if activity.try(:user).try(:realname) == ' ' %> + <%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %> + <% end %> TO + <%= activity.course.name %>(课程名称) +
    + +
    + +
    截止时间:<%= format_date(activity.end_time) %>
    +
    +
    (作业描述)<%= activity.description.html_safe %>
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb new file mode 100644 index 000000000..24078696f --- /dev/null +++ b/app/views/users/_course_message.html.erb @@ -0,0 +1,82 @@ +<% if activity.parent_id.nil? %> +
    +
    +
    + 用户头像 +
    +
    +
    + <% if activity.try(:author).try(:realname) == ' ' %> + <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> + <% end %> + TO + <%= activity.course.name %>(课程讨论区) +
    + +
    +
    时间:<%= format_date(activity.created_on) %>
    +
    + +
    +
    +
    +
    +
    +
    回复(<%=activity.replies_count %>)
    +
    2015-07-31
    + +
    +
    + +
    +
    + + + +
    +
    +
    +
    + 用户头像 +
    +
    +
    + 黄井泉 学生 + 2015-08-01删除 +
    +
    很开心!
    +
    +
    +
    +
    +
    + 用户头像 +
    +
    +
    + 陈正东 学生 + 2015-08-02删除 +
    +
    假期好热,没出去。
    +
    +
    +
    +
    +
    +<% end %> \ No newline at end of file diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index f57e05e34..414ff79e8 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -1,24 +1,24 @@
    - <%= link_to image_tag(url_to_avatar(@activity.author), :width => "90", :height => "90"), user_path(@activity.author_id), :alt => "用户头像" %> + <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
    - <% if @activity.try(:author).try(:realname) == ' ' %> - <%= link_to @activity.try(:author), user_path(@activity.author_id), :class => "newsBlue mr15" %> + <% if @ctivity.try(:author).try(:realname) == ' ' %> + <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> - <%= link_to @activity.try(:author).try(:realname), user_path(@activity.author_id), :class => "newsBlue mr15" %> + <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <% end %> TO - <%= @activity.course.name %>(课程名称) + <%= activity.course.name %>(课程名称)
    + <%= activity.title %>(通知标题)
    -
    发布时间:<%= format_date(@activity.created_on) %>
    +
    发布时间:<%= format_date(activity.created_on) %>
    -
    (通知描述)<%= @activity.description.html_safe %>
    +
    (通知描述)<%= activity.description.html_safe %>
    -
    - - -
    -
    \ No newline at end of file From 2d75fea96b9d504cfbf2ccea7ca7342c8d59a878 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 24 Aug 2015 14:44:22 +0800 Subject: [PATCH 06/86] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 35 +++------------ app/views/layouts/_user_courses.html.erb | 12 +++++ app/views/layouts/new_base_user.html.erb | 33 ++++---------- app/views/users/user_courses4show.html.erb | 16 ------- app/views/users/user_courses4show.js.erb | 1 + public/javascripts/new_user.js | 51 +++++++++++++++------- public/stylesheets/new_public.css | 2 +- 7 files changed, 62 insertions(+), 88 deletions(-) create mode 100644 app/views/layouts/_user_courses.html.erb delete mode 100644 app/views/users/user_courses4show.html.erb create mode 100644 app/views/users/user_courses4show.js.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 59823ec8f..6bdd3d6fc 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -473,40 +473,15 @@ class UsersController < ApplicationController end end + #显示更多用户课程 def user_courses4show - query = Course.joins("join members m on #{Course.table_name}.id=m.course_id") - query = query.where("m.user_id = ?",@user.id).order("#{Course.table_name}.id desc") - if User.current == @user #看自己 - else - if @user.user_extensions!=nil && @user.user_extensions.identity == 0 #看老师 - query = query.joins("join member_roles r on m.id = r.member_id") - query = query.where("r.role_id in(3,7,9)") - end - query = query.where(Course.table_name+".is_public = 1") - end - - if params[:lastid]!=nil && !params[:lastid].empty? - query = query.where(" #{Course.table_name}.id < ?",params[:lastid],) - end - @list = query.limit(8) - - render :layout=>nil + @page = params[:page].to_i + 1 + @courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5).offset(@page * 5) end - def user_projects4show - query = Project.joins("join members m on #{Project.table_name}.id=m.project_id") - query = query.where("m.user_id = ? and #{Project.table_name}.project_type=?",@user.id,Project::ProjectType_project) - if User.current == @user #看自己 - else - query = query.where(Project.table_name+".is_public = 1") - # TODO or exists (select 1 from project c2,members m2 where c2.id=m2.course_id and c2.id=#{Project.table_name}.id and m2.user_id= User.current.id) - end - if params[:lastid]!=nil && !params[:lastid].empty? - query = query.where("( (#{Project.table_name}.updated_on=? and #{Project.table_name}.id < ?) or #{Project.table_name}.updated_onnil end def user_course_activities diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb new file mode 100644 index 000000000..393e3d48f --- /dev/null +++ b/app/views/layouts/_user_courses.html.erb @@ -0,0 +1,12 @@ +<% courses.each do |course|%> +
  • + <%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey"%> +
  • +<% end %> + +<% if courses.size == 5%> +
  • + + +
  • +<% end%> \ No newline at end of file diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index 419fa70ce..15af50332 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -102,18 +102,7 @@
      <% courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)%> - <% courses.each do |course|%> -
    • - course.id, :host=>Setting.host_course) %>" class="coursesLineGrey"> - <%= course.name %> - -
    • - <% end %> - <% if courses.size == 5%> -
    • - -
    • - <% end%> + <%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
    @@ -124,19 +113,13 @@
      - <% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%> - <% projects.each do |project|%> -
    • - project.id, :host=>Setting.host_name) %>" class="coursesLineGrey"> - <%= project.name %> - -
    • - <% end %> - <% if projects.size == 5%> -
    • - -
    • - <% end%> + <%# projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%> + <%#= render :partial => 'layouts/user_item', :locals => {:items => courses,:is_course => false} %> + <%# if projects.size == 5%> + + <%# end%>
    diff --git a/app/views/users/user_courses4show.html.erb b/app/views/users/user_courses4show.html.erb deleted file mode 100644 index 7aab1b2a5..000000000 --- a/app/views/users/user_courses4show.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -<% for item in @list %> - - -<% end %> diff --git a/app/views/users/user_courses4show.js.erb b/app/views/users/user_courses4show.js.erb new file mode 100644 index 000000000..12696e232 --- /dev/null +++ b/app/views/users/user_courses4show.js.erb @@ -0,0 +1 @@ +$("#user_show_more_course").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_courses',:locals => {:courses => @courses,:user => @user, :page => @page} )%>"); diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 44f719a0b..ae94e48a7 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -1,6 +1,4 @@ $(function(){ - $("#RSide").css("min-height",$("#LSide").height()-40).css("padding","10px"); - //头像相关 $("#homepage_portrait_image").live("mouseover",function(){ $("#edit_user_file_btn").show(); @@ -29,18 +27,39 @@ function edit_user_introduction(url){ ); } -$(function(){ - $(".newsType").mouseover(function(){ - $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px -25px no-repeat"}); - }); - $(".newsType").mouseout(function(){ - $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px 0px no-repeat"}); - }); - $(".resourcesSelected").mouseover(function(){ - $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px -25px no-repeat"}); - }); - $(".resourcesSelected").mouseout(function(){ - $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px 0px no-repeat"}); - }); -}); +//显示更多的课程 +function show_more_course(url){ + $.get( + url, + { page: $("#course_page_num").val() }, + function (data) { + } + ); +} + +//显示更多的项目 +function show_more_project(url){ + $.get( + url, + { brief_introduction: $("#user_brief_introduction_edit").val() }, + function (data) { + + } + ); +} +// +//$(function(){ +// $(".newsType").mouseover(function(){ +// $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px -25px no-repeat"}); +// }); +// $(".newsType").mouseout(function(){ +// $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px 0px no-repeat"}); +// }); +// $(".resourcesSelected").mouseover(function(){ +// $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px -25px no-repeat"}); +// }); +// $(".resourcesSelected").mouseout(function(){ +// $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px 0px no-repeat"}); +// }); +//}); //个人动态 end \ No newline at end of file diff --git a/public/stylesheets/new_public.css b/public/stylesheets/new_public.css index 7e3e92923..0f684f5a0 100644 --- a/public/stylesheets/new_public.css +++ b/public/stylesheets/new_public.css @@ -415,7 +415,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no- .homepageImageSexWomen {width: 20px;height: 20px;background: url(../images/homepage_icon.png) -10px -149px no-repeat;float: left;} .homepageSignatureTextarea {width:207px; height:80px; max-width:207px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 15px;;} .homepageSignature {font-size:12px; color:#888888; margin-left:15px; margin-top:10px; margin-bottom:12px; width:208px;} -.homepageImageBlock {margin:0 auto; width:78px; float:left; text-align:center; display:inline-block;} +.homepageImageBlock {margin:0 auto; width:75px; float:left; text-align:center; display:inline-block;} .homepageImageNumber {font-size:12px; color:#484848;} a.homepageImageNumber:hover {color:#15bccf;} .homepageImageText {font-size:12px; color:#888888;} From 7f2f2c5d40dbec858f45027f7189644598f8ef4c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 24 Aug 2015 14:53:35 +0800 Subject: [PATCH 07/86] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=EF=BC=8C=E9=A1=B9=E7=9B=AE=E6=9B=B4=E5=A4=9A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 3 ++- app/views/layouts/_user_projects.html.erb | 11 +++++++++++ app/views/layouts/new_base_user.html.erb | 9 ++------- app/views/users/user_projects4show.html.erb | 16 ---------------- app/views/users/user_projects4show.js.erb | 1 + public/javascripts/new_user.js | 2 +- 6 files changed, 17 insertions(+), 25 deletions(-) create mode 100644 app/views/layouts/_user_projects.html.erb delete mode 100644 app/views/users/user_projects4show.html.erb create mode 100644 app/views/users/user_projects4show.js.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6bdd3d6fc..2af2b9c42 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -481,7 +481,8 @@ class UsersController < ApplicationController #显示更多用户项目 def user_projects4show - + @page = params[:page].to_i + 1 + @projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5).offset(@page * 5) end def user_course_activities diff --git a/app/views/layouts/_user_projects.html.erb b/app/views/layouts/_user_projects.html.erb new file mode 100644 index 000000000..864b6888c --- /dev/null +++ b/app/views/layouts/_user_projects.html.erb @@ -0,0 +1,11 @@ +<% projects.each do |project|%> +
  • + <%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey"%> +
  • +<% end %> +<% if projects.size == 5%> +
  • + + +
  • +<% end%> \ No newline at end of file diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index 15af50332..4d85ef1b3 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -113,13 +113,8 @@
      - <%# projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%> - <%#= render :partial => 'layouts/user_item', :locals => {:items => courses,:is_course => false} %> - <%# if projects.size == 5%> - - <%# end%> + <% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%> + <%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
    diff --git a/app/views/users/user_projects4show.html.erb b/app/views/users/user_projects4show.html.erb deleted file mode 100644 index 3c709bd5d..000000000 --- a/app/views/users/user_projects4show.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -<% for item in @list %> - -<% end %> diff --git a/app/views/users/user_projects4show.js.erb b/app/views/users/user_projects4show.js.erb new file mode 100644 index 000000000..c19a79c81 --- /dev/null +++ b/app/views/users/user_projects4show.js.erb @@ -0,0 +1 @@ +$("#user_show_more_project").replaceWith("<%= escape_javascript( render :partial => 'layouts/user_projects',:locals => {:projects => @projects,:user => @user, :page => @page} )%>"); diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index ae94e48a7..e89b7374b 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -41,7 +41,7 @@ function show_more_course(url){ function show_more_project(url){ $.get( url, - { brief_introduction: $("#user_brief_introduction_edit").val() }, + { page: $("#project_page_num").val() }, function (data) { } From fe91442c96ee3e07ffd4565cb3ccfb36050b538a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 24 Aug 2015 15:18:07 +0800 Subject: [PATCH 08/86] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B7=B2=E5=85=B3=E9=97=AD=E8=AF=BE=E7=A8=8B=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_user_courses.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb index 393e3d48f..d5f0507f1 100644 --- a/app/views/layouts/_user_courses.html.erb +++ b/app/views/layouts/_user_courses.html.erb @@ -1,6 +1,6 @@ <% courses.each do |course|%>
  • - <%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey"%> + <%= link_to (course_endTime_timeout?(course) ? "[已关闭] #{course.name}" : "#{course.name}").html_safe, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey"%>
  • <% end %> From dabef542fecb985a60473127cd8cab81961aa200 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 24 Aug 2015 15:30:11 +0800 Subject: [PATCH 09/86] =?UTF-8?q?=E6=9B=B4=E6=96=B0css=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=AE=9E=E7=8E=B0=E6=9C=AA=E7=99=BB=E9=99=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=97=B6=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 2 +- app/views/layouts/_unlogin_header.html.erb | 60 +++++---- public/stylesheets/new_public.css | 146 ++++++++++++++------- 3 files changed, 134 insertions(+), 74 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index cb93ca7fa..c91b452dc 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -18,7 +18,7 @@
    -
    + - -
    (缺陷描述)<%=activity.description.html_safe %>
    -
    +
    (缺陷描述)<%=activity.description.html_safe %>
    +
    + <% if activity.attachments.any? %> + <% activity.attachments.each do |attachment| %> +
    +

    +

    + + <%= link_to_short_attachment attachment, :class => 'homepagePostFileAtt newsBlue', :download => true -%> + +
    + <% if attachment.is_text? %> + <%= link_to image_tag('magnifier.png'), + :controller => 'attachments', + :action => 'show', + :id => attachment, + :filename => attachment.filename %> + <% end %> + + <%= number_to_human_size attachment.filesize %> + +

    +
    + <% end %> + <% end %> +
    +
    课程 - - - + <%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting"), "javascript:void(0);"%>
      @@ -107,9 +105,7 @@
    项目 - - - + <%=link_to image_tag("../images/menu_setting.png",width:"14px", height: "14px",class: "homepageMenuSetting"), "javascript:void(0);"%>
      From 5b99effbc8577c1ca412cae43da5e1b2fe7f343c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Aug 2015 10:30:31 +0800 Subject: [PATCH 23/86] =?UTF-8?q?=E6=9B=B4=E6=96=B0css=EF=BC=8C=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E4=B8=AA=E4=BA=BA=E7=AE=80=E4=BB=8B=E5=8A=9F=E8=83=BD?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layouts/_user_brief_introduction.html.erb | 4 +- app/views/users/user_homeworks.html.erb | 73 +++++++++---------- public/stylesheets/new_public.css | 24 ++++-- 3 files changed, 50 insertions(+), 51 deletions(-) diff --git a/app/views/layouts/_user_brief_introduction.html.erb b/app/views/layouts/_user_brief_introduction.html.erb index 58a7bad83..3b0500fed 100644 --- a/app/views/layouts/_user_brief_introduction.html.erb +++ b/app/views/layouts/_user_brief_introduction.html.erb @@ -4,7 +4,5 @@ 这位童鞋很懒,什么也没有留下~  <% end %> <% if User.current == user%> - - - + <%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_user_introduction();"%> <% end%> \ No newline at end of file diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 6ed40a879..763c87c39 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -1,56 +1,45 @@ -
      +
      发布作业
      - - 课程名称 - 导入作业 -
      - - -
      + +
      +
      + 导入作业 + +
      + +
      - -
      +
      用户头像
      @@ -61,8 +50,10 @@
      时间:2015-08-20
      (缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
      - - +
      • @@ -78,19 +69,21 @@
      -
      +
      用户头像
      - +
      指派给  苏稳
      时间:2015-08-20
      (缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
      - - +
      • diff --git a/public/stylesheets/new_public.css b/public/stylesheets/new_public.css index 130faa30d..fde65f63d 100644 --- a/public/stylesheets/new_public.css +++ b/public/stylesheets/new_public.css @@ -783,11 +783,11 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} /*20150820课程作业 LB*/ .HomeWork {width:708px; background-color:#ffffff; padding:20px; border:1px solid #dddddd;} .RightBanner {width:708px; height:34px; border-bottom:1px solid #e9e9e9;} -.InputBox{ border:1px solid #d9d9d9; height:28px; line-height:28px; padding-left:5px; font-size:14px;} +select.InputBox,input.InputBox,textarea.InputBox{ border:1px solid #d9d9d9; color:#888888; height:28px; line-height:28px; padding-left:5px; font-size:14px;} a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} a:hover.BlueCirBtn{ background:#15bccf; color:#fff;} -.W350{ width:350px;} -.W120{ width:120px;} +.W440{ width:440px;} +.W120{ width:110px;} .W700{ width:700px;} a.AnnexBtn{ background: url(../images/homepage_icon.png) 0px -343px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;} a:hover.AnnexBtn{background: url(../images/homepage_icon.png) -90px -343px no-repeat; color:#15bccf;} @@ -799,7 +799,7 @@ a.DropBtn{background: url(../images/homepage_icon.png) -125px -339px no-repeat; a:hover.DropBtn{background: url(../images/homepage_icon.png) -125px -370px no-repeat;} .DropLine{border-top:1px solid #d9d9d9; float:left; width:623px; height:10px; margin-top:10px;} /*20150820编程作业 LB*/ -.W315{ width:315px;} +.W320{ width:320px;} .icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;} a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;} .icon_remove{background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;} @@ -809,14 +809,22 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .c_grey{ color:#888888;} .HomeWorkP{ width:690px; font-size:14px;} .H150{ height:150px;} -.ProResult{width:748px; background-color:#fff; border:1px solid #dddddd; border-bottom:none;} +.ProResult{width:748px; background-color:#fff; border:1px solid #dddddd;border-bottom:none; } .ProResultTop{ height:38px; line-height:38px; border-bottom:1px solid #dddddd; background:#f2f2f2; padding:0 10px;} -.ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd;} +.ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; } .W50{ width:50px;} -.W200{ width:210px;} -.ProResultTable tr td{ height:35px; border-bottom:1px solid #dddddd; } +.W200{ width:200px;} .ProResultTable{ color:#888888;} .T_C{ text-align:center;} +.SearchIcon{background:url(../images/homepage_icon.png) 676px -393px no-repeat; } +.SearchIcon:hover{background:url(../images/homepage_icon.png) 676px -419px no-repeat; } +a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } +a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} +a.FilesName{ max-width:540px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} +a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} +.ProResultUl span { display:block; float:left;} +.ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; } +.DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;} From c93bc5be40bd8a812d1a2105d9abdcca5edb1475 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Aug 2015 13:50:42 +0800 Subject: [PATCH 24/86] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=95=88=E6=9E=9C=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 3 + app/helpers/application_helper.rb | 22 ++- app/views/users/user_homeworks.html.erb | 192 ++++++++++++------------ public/stylesheets/new_public.css | 6 +- 4 files changed, 123 insertions(+), 100 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ca897fc3d..b396b9c84 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -304,6 +304,9 @@ class UsersController < ApplicationController #用户作业列表 def user_homeworks + user_course_ids = "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" + homework_commons = HomeworkCommon.where("course_id in #{user_course_ids}").order("created_at desc") + @homework_commons = paginateHelper homework_commons,10 respond_to do |format| format.html {render :layout => 'new_base_user'} end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7c7f0c63f..709426d41 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2314,7 +2314,27 @@ module ApplicationHelper elsif homework.homework_type == 2 #编程作业不能修改作品 "作品已交".html_safe else - link_to l(:label_edit_homework), edit_student_work_path(work.id),:class => 'fr mr10 work_edit' + link_to l(:label_edit_homework), edit_student_work_path(work.id),:class => 'fr mr10 work_edit c_blue' + end + end + end + + #根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量 + def user_for_homework_common homework,is_teacher + if is_teacher #老师显示作品数量 + link_to "提交(#{homework.student_works.count})",student_work_index_path(:homework => homework.id),:class => "c_blue" + else #学生显示提交作品、修改作品等按钮 + work = cur_user_works_for_homework homework + if work.nil? + link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' + else + if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前 + link_to "修改作品", "", :class => 'c_blue', :title => "开启匿评后不可修改作品" + elsif homework.homework_type == 2 #编程作业不能修改作品 + link_to "作品已交", "",:class => 'c_blue',:title => "编程作业不可修改作品" + else + link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue' + end end end end diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 763c87c39..a6032a60b 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -1,101 +1,97 @@ - -
        -
        -
        用户头像
        -
        - - -
        -
        指派给  苏稳
        -
        时间:2015-08-20
        -
        -
        (缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
        - -
        - +<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%> + +
        +
        +
        发布作业
        -
        -
        -
        -
        -
        -
        -
        用户头像
        -
        - - -
        -
        指派给  苏稳
        -
        时间:2015-08-20
        + -
        (缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;
        - -
        - +
        +<% end%> + +<% @homework_commons.each do |homework_common|%> + <% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %> +
        +
        +
        + <%=link_to image_tag(url_to_avatar(homework_common.user),width:"90px", height: "90px"), user_activities_path(homework_common.user.id)%> +
        +
        +
        + <%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%> + TO + <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%> +
        +
        + <%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%> +
        + +
        +
        + <%= user_for_homework_common homework_common,is_teacher %> +
        +
        + <%= l(:label_end_time)%>:<%= homework_common.end_time%> +
        +
        +
        + <%= homework_common.description.html_safe %> +
        +
        + <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %> +
        +
        + <% if is_teacher%> +
        +
          +
        • +
            +
          • + <%= link_to l(:button_edit),edit_homework_common_path(homework_common), :class => "postOptionLink"%> +
          • +
          • + <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %> +
          • +
          +
        • +
        +
        + <% end%> +
        +
        -
        -
        -
        -
        \ No newline at end of file +
        +<% end%> diff --git a/public/stylesheets/new_public.css b/public/stylesheets/new_public.css index fde65f63d..a5f4dd8f4 100644 --- a/public/stylesheets/new_public.css +++ b/public/stylesheets/new_public.css @@ -10,6 +10,9 @@ a:hover,a:active{color:#000;} /*常用*/ /*#RSide{ background:#fff;}*/ +/*上传图片处理*/ +.upload_img img{max-width: 100%;} +blockquote img{max-width: 100%;} .hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .none{display: none;} .rside_back{ width:670px; margin-left:10px; background:#fff; margin-bottom:10px;} @@ -475,7 +478,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no- .homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;} .homepageEditProfile {width:20px; height:20px; border-radius:2px; background-color:#888888; position:absolute; right:9px; bottom:9px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;} .homepageEditProfileIcon {background:url(../images/homepage_icon.png) -11px -35px no-repeat; width:20px; height:20px; display:block;} -.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:20px; float:left;} +.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;} .homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} .homepageImageSexWomen {width: 20px;height: 20px;background: url(../images/homepage_icon.png) -10px -149px no-repeat;float: left;} .homepageSignatureTextarea {width:207px; height:80px; max-width:207px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 15px;;} @@ -820,6 +823,7 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .SearchIcon:hover{background:url(../images/homepage_icon.png) 676px -419px no-repeat; } a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} +a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;} a.FilesName{ max-width:540px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} .ProResultUl span { display:block; float:left;} From bcd12e7e4883cabef286853dccf10eaa12f7c892 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Aug 2015 14:09:37 +0800 Subject: [PATCH 25/86] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2=20=20=E9=A1=B6?= =?UTF-8?q?=E9=83=A8=E5=AF=BC=E8=88=AA=E6=A0=8F=E5=92=8C=E5=BA=95=E9=83=A8?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_logined_header.html.erb | 2 +- app/views/layouts/base_courses.html.erb | 24 ++-- app/views/layouts/base_projects.html.erb | 22 +++- app/views/layouts/new_base_user.html.erb | 2 +- public/stylesheets/header.css | 106 ++++++++++++++++++ .../{new_public.css => new_user.css} | 0 6 files changed, 140 insertions(+), 16 deletions(-) create mode 100644 public/stylesheets/header.css rename public/stylesheets/{new_public.css => new_user.css} (100%) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index b1483d70c..10d71993d 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -8,7 +8,7 @@ <%= link_to "首页",user_activities_path(User.current.id), :class => "homepageWhite f16"%>
      • + 资源库 diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 3242d79e9..6e9c98b95 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -1,4 +1,4 @@ -<% course_model %> +<%# course_model %> <% teacher_num = teacherCount(@course) %> <% student_num = studentCount(@course) %> <% course_file_num = visable_attachemnts_incourse(@course).count%> @@ -17,17 +17,22 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> - <%= stylesheet_link_tag 'public', 'leftside', 'jquery/jquery-ui-1.9.2', 'courses'%> + <%= stylesheet_link_tag 'public', 'leftside', 'jquery/jquery-ui-1.9.2', 'courses','header'%> <%= javascript_include_tag "course","header","attachments" %> <%= yield :header_tags -%> + +
        - <%= render :partial => 'layouts/new_header' %> -
        -

        @@ -178,11 +183,12 @@

        -
        - - <%= render :partial => 'layouts/new_footer' %> -
        + +
        +<%= render :partial => 'layouts/footer' %> +
        + <%= render :partial => 'layouts/new_feedback' %> + +
        +<%= render :partial => 'layouts/footer' %> +
        + +
        <% text = @project.project_new_type == 1 ? "development_group" : (@project.project_new_type == 2 ? "research_group" : "friend_organization")%> diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index 3104dd147..46203b337 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_public', 'user_leftside', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","new_user"%> diff --git a/public/stylesheets/header.css b/public/stylesheets/header.css new file mode 100644 index 000000000..8389afbb9 --- /dev/null +++ b/public/stylesheets/header.css @@ -0,0 +1,106 @@ +/*新个人主页框架css*/ +.navContainer {width:100%; background-color:#15bccf;} +.homepageContentContainer {width:100%; margin:0 auto; background-color:#eaebed;} +.homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;} +.navHomepage {width:1000px; height:54px; background-color:#15bccf; margin:0 auto;} +.navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:40px;} +.navHomepageMenu {margin-right:40px;display:inline-block;height:54px; line-height:54px; vertical-align:middle;} +/*.navHomepageMenu:hover {background-color:#0ea6b7;}*/ +.navHomepageSearchBoxcontainer {margin-top:11px; } +.navHomepageSearchBox {width:380px; border:none; outline:none; height:32px; margin-top:11px; background-color:#ffffff;} +.navHomepageSearchInput {width:345px; height:32px; outline:none; border:none; float:left; padding-left:5px;; margin:0;} +.homepageSearchIcon {width:30px; height:32px; background:url(../images/nav_icon.png) -8px 3px no-repeat; float:left;} +a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-repeat;} +.navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #98a1a6; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;} +#navSearchAlert {display:none;} +.navHomepageNews {width:30px; display:block; float:right; margin-top:12px; position:relative;} +.homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:29px; display:block;} +.newsActive {width:10px; height:10px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;} +.navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;} +.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block;} +.homepageProfileMenuIcon:hover {background:url(../images/nav_icon.png) 30px -122px no-repeat;} +.navHomepageProfile ul li ul {display:none;} +.navHomepageProfile ul li:hover ul {display:block;} +.homepageLeft {width:240px; float:left; margin-right:10px; margin-bottom:10px;} +.homepageRight {width:750px; float:left; margin-top:15px; margin-bottom:10px;} +.homepagePortraitContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; margin-top:15px; padding-bottom:15px;} +.homepagePortraitImage {width:206px; height:206px; padding:2px; margin:15px 14px 10px 14px; position:relative; border:1px solid #cbcbcb;} +.homepagePortraitImage:hover {border:1px solid #15bccf;} +.homepageFollow {background:url(../images/homepage_icon.png) -10px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;} +.homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;} +.homepageEditProfile {width:20px; height:20px; border-radius:2px; background-color:#888888; position:absolute; right:9px; bottom:9px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;} +.homepageEditProfileIcon {background:url(../images/homepage_icon.png) -11px -35px no-repeat; width:20px; height:20px; display:block;} +.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:21px; float:left;} +.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} +.homepageImageSexWomen {width: 20px;height: 20px;background: url(../images/homepage_icon.png) -10px -149px no-repeat;float: left;} +.homepageSignatureTextarea {width:207px; height:80px; max-width:207px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 15px;;} +.homepageSignature {font-size:12px; color:#888888; margin-left:15px; margin-top:10px; margin-bottom:12px; width:208px;} +.homepageImageBlock {margin:0 auto; width:78px; float:left; text-align:center; display:inline-block;} +.homepageImageNumber {font-size:12px; color:#484848;} +a.homepageImageNumber:hover {color:#15bccf;} +.homepageImageText {font-size:12px; color:#888888;} +.homepageVerDiv {height:28px; vertical-align:middle; width:1px; float:left; display:inline-block; background-color:#d1d1d1; margin-top:3px;} +.homepageLeftMenuContainer {width:238px; border:1px solid #dddddd; border-bottom:none; background-color:#ffffff; margin-top:10px;} +.homepageLeftMenuBlock {border-bottom:1px solid #dddddd; height:50px; line-height:50px; vertical-align:middle;} +.homepageLeftMenuCourses {font-size:14px; border-bottom:1px solid #dddddd;} +.homepageLeftMenuCoursesLine {padding-left:25px; height:38px; line-height:38px; vertical-align:middle;} +.homepageLeftMenuCoursesLine:hover {background-color:#b3e0ee;} +a.coursesLineGrey {color:#808080; display:block;} +a.coursesLineGrey:hover {color:#ffffff;} +.homepageLeftMenuMore {height:18px;} +.homepageLeftMenuMore:hover {background-color:#b3e0ee;} +.homepageLeftMenuMoreIcon {background:url(../images/homepage_icon.png) -74px -240px no-repeat; display:block; height:18px;} +.homepageMenuSetting {display:inline-block; margin-left:155px;} +a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;} +.homepageLeftLabelContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px;} +.homepageLabelText {color:#484848; font-size:16px; margin-left:10px; margin-bottom:12px; display:block;} +.homepageRightBanner {width:720px; height:34px; margin:0px auto; border-bottom:1px solid #e9e9e9;} +.NewsBannerName {font-size:16px; color:#4b4b4b; display:block; background:url(../images/homepage_icon.png) -18px -230px no-repeat; width:150px; float:left; padding-left:15px; margin-top:4px;} +.newsType {width:60px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-40px; font-size:12px; color:#888888; display:none; line-height:2; z-index:9999;} +.newsReadSetting {width:700px; background-color:#f6f6f6; border-bottom:1px solid #eeeeee; margin:10px auto; height:39px; line-height:39px; vertical-align:middle; font-size:14px; color:#7a7a7a; padding-left:10px;} +.homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin-left:10px;} +.homepageNewsPortrait {width:40px; display:block; margin-top:7px;} +.homepageNewsPublisher {width:80px; max-width:80px; margin-right:10px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;} +.homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;} +a.homepageWhite {color:#ffffff;} +a.homepageWhite:hover {color:#a1ebff} +a.newsGrey {color:#4b4b4b;} +a.newsGrey:hover {color:#000000;} +a.replyGrey {color:#888888; display:inline-block;} +a.replyGrey:hover {color:#4b4b4b;} +a.replyGrey1 {color:#888888;} +a.replyGrey1:hover {color:#4b4b4b;} +a.newsBlue {color:#15bccf;} +a.newsBlue:hover {color:#0781b4;} +a.menuGrey {color:#808080;} +a.menuGrey:hover {color:#fe7d68;} +.navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #98a1a6; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;} +#navSearchAlert {display:none;} + +/*myctrip*/ +.userImage{position:absolute; right:140px; top:5px; width:30px;height:30px; background: url(../images/item.png) 2px 4px no-repeat; line-height:1.4;} +a.topnav_login_a{color:#fff; display:inline-block;} +a.topnav_login_a:hover {color:#a1ebff;} +a.topnav_login_mes{color:#fff; width:10px;height:20px; padding-left:15px; background: url(../images/item.png) -84px -145px no-repeat; display:inline-block; vertical-align:top;} +a.topnav_login_mes:hover {color:#a1ebff;} +a.topnav_login_box{ color:#fff; font-size:14px; font-weight:bold; width:90px; display:inline-block;} +.menuArrow {background:url(../images/item.png) -20px -40px no-repeat;} +li.menuArrow:hover {background:url(../images/item.png) -20px -70px no-repeat;} +a.topnav_login_box:hover {color:#a1ebff;} +.navRow1 {margin:0; padding:0;} +.navRow2 {margin:0; padding:0;} +.topnav_login_list{ border:1px solid #15bccf; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2;margin-top: -7px;} +.topnav_login_list a{color:#15bccf;} +.topnav_login_list li{ } + +/*底部*/ +#Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;} +.footerAboutContainer {width:auto; border-bottom:1px solid #efefef;} +.footerAbout{ width:455px; margin:0 auto;height:35px; line-height:35px; border-bottom:1px solid #efefef; } +.languageBox {width:55px; height:20px; margin-left:5px; outline:none; color:#666666; border:1px solid #d9d9d9;} +.departments{ width:890px; margin:5px auto 0 auto;height:30px;line-height:30px;} +.copyright{ width:375px; margin:0 auto;height:20px;line-height:20px;} +a.f_grey {color:#666666;} +a.f_grey:hover {color:#000000;} \ No newline at end of file diff --git a/public/stylesheets/new_public.css b/public/stylesheets/new_user.css similarity index 100% rename from public/stylesheets/new_public.css rename to public/stylesheets/new_user.css From d25971f546b4a2c7b731d9d0bc71b929f2a15aa6 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 25 Aug 2015 14:24:20 +0800 Subject: [PATCH 26/86] =?UTF-8?q?=E7=99=BB=E9=99=86=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 9 +- app/views/account/login.html.erb | 319 +++++++++++++++++++------- app/views/layouts/login.html.erb | 151 ++---------- public/stylesheets/new_public.css | 5 +- 4 files changed, 267 insertions(+), 217 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 0e2f9569c..02736346c 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -27,8 +27,9 @@ class AccountController < ApplicationController if request.get? if User.current.logged? redirect_to home_url + else + render :layout => 'login' end - # render :layout => 'login' else authenticate_user end @@ -129,10 +130,12 @@ class AccountController < ApplicationController end when '3' #register_automatically(@user) - unless @user.new_record? + if !@user.new_record? self.logged_user = @user flash[:notice] = l(:notice_account_activated) redirect_to my_account_url + else + redirect_to signin_path end else #register_manually_by_administrator(@user) @@ -355,11 +358,13 @@ class AccountController < ApplicationController def invalid_credentials logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}" flash.now[:error] = l(:notice_account_invalid_creditentials) + render :layout => 'login' end def invalid_credentials_new logger.warn "Failed login for '#{params[:username]}' from #{request.remote_ip} at #{Time.now.utc}" flash.now[:error] = l(:notice_account_invalid_creditentials_new) + render :layout => 'login' end # Register a user for email activation. diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index bb289eb03..93ac9fba7 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -1,17 +1,49 @@ -<% @nav_dispaly_home_path_label = 1 - @nav_dispaly_main_course_label = 1 - @nav_dispaly_main_project_label = 1 - @nav_dispaly_main_contest_label = 1 %> -<% @nav_dispaly_forum_label = 1%> -<%= call_hook :view_account_login_top %> - - - - - - -
        -<%= form_tag(signin_path) do %> -<%= back_url_hidden_field_tag %> - - - - - - - - - -<% if Setting.openid? %> - - - - -<% end %> - - - - - - - -
        - - - <%= text_field_tag 'username', params[:username], :tabindex => '1' , :value => "#{l(:label_login_prompt)}", - :onfocus => "clearInfo('username','#{l(:label_login_prompt)}')", - :onblur => "showInfo('username','#{l(:label_login_prompt)}')", - :style => "resize: none;font-size: 12px;color: #818283;"%> -
        - - - <%= password_field_tag 'password', nil, :tabindex => '2' %> -
        - - - <%= text_field_tag "openid_url", nil, :tabindex => '3' %> -
        - <% if Setting.autologin? %> - +
        +
        +
        + +
        欢迎加入Trustie高校创新实践社区,老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。Trustie是在中国推行大规模开放在线研究模式(MOORE)的支撑平台。
        +
        +
        +
        +
        +
          +
        • 登陆
        • +
        • +
        +
        + +
        + <%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %> + <%= back_url_hidden_field_tag %> +
        + <%= text_field_tag 'username', params[:username], :tabindex => '1' , + :class=>'loginSignBox',:placeholder=>'请输入邮箱地址或昵称'%> + +
        + <% if Setting.openid? %> +
        + <%= text_field_tag "openid_url", nil, :tabindex => '3',:placeholder=>'请输入OpenId URL' %> +
        + <% end %> +
        + + <%= password_field_tag 'password', nil, :tabindex => '2',:class=>'loginSignBox' ,:placeholder=>'请输密码'%> +
        +
        + <% if Setting.autologin? %> +
        + <%= check_box_tag 'autologin', 1, true, :tabindex => 4 %> +
        + <%= l(:label_stay_logged_in) %> + <% end %> + + <% if Setting.lost_password? %> + 忘记密码? + <% end %> +
        <% end %> -
        - - - <% if Setting.lost_password? %> - <%= link_to l(:label_password_lost), lost_password_path %> - <% end %> - - - -
        -<% end %> -
        -<%= call_hook :view_account_login_bottom %> +
        + 登陆 +
        -<% if params[:username].present? %> -<%= javascript_tag "$('#password').focus();" %> -<% else %> -<%= javascript_tag "$('#username').focus();" %> -<% end %> +
        + +
        +
        +
        +
          +
        • 注册<%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %> +
        • +
        +
        +
        + <%= form_for :user, :url => register_path,:method=>'post',:html=>{:id=>'main_reg_form'} do |f| %> + <%= error_messages_for 'user' %> +
        + + <%= f.text_field :mail,:size => 25, :class=>'loginSignBox' ,:placeholder=>"请输入邮箱地址"%> + +
        +
        + + <%= f.password_field :password, :size => 25,:placeholder=>"请输入密码",:class=>'loginSignBox' %> + +
        +
        + + <%= f.password_field :password_confirmation, :size => 25,:placeholder=>"请再次输入密码",:class=>'loginSignBox' %> + +
        +
        + + <%= f.text_field :login, :size => 25,:placeholder=>"请输入用户昵称",:class=>'loginSignBox'%> + +
        +
        + 注册 + +
        + <% end %> +
        +
        +
      +
      +
      +
      diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb index a0e7f909c..e766b27d0 100644 --- a/app/views/layouts/login.html.erb +++ b/app/views/layouts/login.html.erb @@ -1,131 +1,28 @@ - <%= stylesheet_link_tag 'new_public'%> - <%= stylesheet_link_tag 'leftside'%> + + + + + <%= h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_public', 'user_leftside', :media => 'all' %> + <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> - <%= javascript_include_tag 'javascripts/jquery-1.3.2' %> - <%= javascript_include_tag 'bootstrap' %> - + <%= javascript_include_tag "bootstrap","avatars","new_user"%> + <%= heads_for_theme %> + <%= call_hook :view_layouts_base_html_head %> + <%= yield :header_tags -%> + -
      -
      -
      - -
      欢迎加入Trustie高校创新实践社区,老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。Trustie是在中国推行大规模开放在线研究模式(MOORE)的支撑平台。
      -
      -
      -
      -
      -
        -
      • 登陆
      • -
      • -
      -
      -
      -
      - -
      -
      - -
      - - -
      -
      -
      -
      -
        -
      • 注册 -
      • -
      -
      -
      -
      - -
      请输入有效邮箱地址
      -
      -
      - -
      至少需要 6 个字符
      -
      -
      - -
      -
      - -
      用户昵称为2-18个中英文,数字或下划线
      -
      - -
      -
      -
      -
      -
      + <% is_current_user = User.current.logged? && User.current == @user%> + <% if User.current.logged? %> + <%= render :partial => 'layouts/logined_header' %> + <% else%> + <%= render :partial => 'layouts/unlogin_header' %> + <% end%>
      +<%= render_flash_messages %> +<%= yield %> diff --git a/public/stylesheets/new_public.css b/public/stylesheets/new_public.css index c2cc7d719..7878f5bb0 100644 --- a/public/stylesheets/new_public.css +++ b/public/stylesheets/new_public.css @@ -124,6 +124,7 @@ a.c_blue{ color:#15bccf;} a.c_dblue{ color:#09658c;} a:hover.c_dblue{ color:#15bccf;} a.c_white{ color:#fff;} +input.c_white { color:#fff} a.c_dorange{ color:#fd6e2a;} a.c_dark{color: #3e4040;} a:hover.c_dark{color: #3ca5c6;} @@ -612,7 +613,9 @@ a.loginChooseTab {color:#484848; height:30px; display:block;} .loginSignBox {width:308px; height:38px; margin-left:46px; border:1px solid #98a1a6; outline:none;} .loginSignOption {margin-left:46px; margin-top:15px;} .loginIn {width:405px; background-color:#ffffff; padding-bottom:30px;} -.loginSignAlert {font-size:12px; color:#fc0000; margin-left:60px;} +.loginSignAlert {font-size:12px; margin-left:60px;} +.loginSignRow {height:60px; min-height:60px;} + From 725143b89455678845e9f7c7e9dc87ab780f9431 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 25 Aug 2015 14:51:07 +0800 Subject: [PATCH 27/86] =?UTF-8?q?=E7=99=BB=E9=99=86=E7=95=8C=E9=9D=A2=20?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/account/login.html.erb | 5 ++++- app/views/layouts/login.html.erb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index 93ac9fba7..4b822a616 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -157,13 +157,16 @@
      +
      • 登陆
      - +
      <%= flash.empty? ? "" : flash[:error].html_safe %>
      +
      + <%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %> <%= back_url_hidden_field_tag %>
      diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb index e766b27d0..0349caf13 100644 --- a/app/views/layouts/login.html.erb +++ b/app/views/layouts/login.html.erb @@ -24,5 +24,5 @@ <%= render :partial => 'layouts/unlogin_header' %> <% end%>
      -<%= render_flash_messages %> + <%= yield %> From 4915f7977e6460ad2fcef740b7a2c47a5b1aee41 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 25 Aug 2015 15:08:35 +0800 Subject: [PATCH 28/86] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 1 + app/views/users/_project_issue.html.erb | 113 ++++++++++++---------- app/views/users/_project_message.html.erb | 54 +++++------ 3 files changed, 89 insertions(+), 79 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ca897fc3d..5ba0b6e4a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -75,6 +75,7 @@ class UsersController < ApplicationController include GitlabHelper include UserScoreHelper helper :user_score + helper :journals # added by liuping 关注 diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 3b0087bb4..925625c28 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -1,48 +1,53 @@ +<% reply_links = authorize_for('issues', 'edit') -%>
      <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %> -
      -
      +
      <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> <% end %> TO - <%=activity.project.name %>(项目名称)
      + <%= link_to activity.project.name.to_s+"(项目名称)", project_path(activity.project), :class => "newsBlue ml15", :style=>"word-break:break-all" %> +
      - <%=activity.subject %>(缺陷标题)<%=activity.status.name %> + <%= link_to activity.subject.to_s+"(缺陷标题)", issue_path(activity), :class => "postGrey", :style=>"word-break:break-all" %> + <%=activity.status.name %>
      -
      指派给  <% if activity.try(:assigned_to).try(:realname) == ' '%><%= activity.try(:assigned_to)%><% else %><%=activity.try(:assigned_to).try(:realname) %><% end %> +
      指派给   + <% unless activity.assigned_to_id.nil? %> + <% if activity.try(:assigned_to).try(:realname) == ' ' %> + <%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% else %> + <%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %> + <% end %> + <% end %>
      时间:<%=format_date(activity.created_on) %>
      (缺陷描述)<%=activity.description.html_safe %>
      -
      +
      <% if activity.attachments.any? %> <% activity.attachments.each do |attachment| %> -
      -

      -

      - - <%= link_to_short_attachment attachment, :class => 'homepagePostFileAtt newsBlue', :download => true -%> - -
      - <% if attachment.is_text? %> - <%= link_to image_tag('magnifier.png'), - :controller => 'attachments', - :action => 'show', - :id => attachment, - :filename => attachment.filename %> - <% end %> - - <%= number_to_human_size attachment.filesize %> +
      + + <%= link_to_short_attachment attachment, :class => 'homepagePostFileAtt newsBlue', :download => true -%> -

      -
      + <% if attachment.is_text? %> + <%= link_to image_tag('magnifier.png'), + :controller => 'attachments', + :action => 'show', + :id => attachment, + :filename => attachment.filename %> + <% end %> + ( + <%= number_to_human_size attachment.filesize %>) + +
      <% end %> <% end %>
      @@ -67,9 +72,10 @@
      +
      -
      回复(5)
      -
      2015-07-26
      +
      回复(<%=activity.journals.count %>)
      +
      <%=format_date(activity.updated_on)%>
      @@ -82,31 +88,34 @@
      -
      -
      - 用户头像 -
      -
      -
      - 尹教授 - 2015-08-01删除 -
      -
      请大家说下软件工程是什么!
      -
      -
      -
      -
      -
      - 用户头像 -
      -
      -
      - Tang 学生 - 2015-08-01删除 -
      -
      软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。
      -
      -
      -
      + + <% activity.journals.reorder("created_on desc").each do |reply| unless activity.journals.nil?%> +
      +
      + <%= link_to image_tag(url_to_avatar(reply.user), :width => "45", :height => "45"), user_path(reply.user_id), :alt => "用户头像" %> +
      +
      +
      + <% 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" %> + <% end %> + <%= format_date(reply.created_on) %> + + +
      + <% if reply.details.any? %> + <% details_to_strings(reply.details).each do |string| %> +
      <%=string %>
      + <% end %> + <% else %> +
      <%=reply.notes.html_safe %>
      + <% end %> +
      +
      +
      + <% end %> + <% end %>
      \ No newline at end of file diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index a2b97d2da..248be6143 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -64,33 +64,33 @@
      <% activity= activity.parent_id.nil? ? activity:activity.parent%> <% activity.children.reorder("created_on desc").each do |reply| unless activity.children.nil?%> -
      -
      - <%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %> -
      -
      -
      - <% if reply.try(:author).try(:realname) == ' ' %> - <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> - <% else %> - <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> - <% end %> - <%=format_date(reply.created_on)%> - <%= link_to( - l(:button_delete), - {:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'}, - :method => :post, - :data => {:confirm => l(:text_are_you_sure)}, - :title => l(:button_delete), - :class => 'replyGrey fr ml10' - ) if reply.course_destroyable_by?(User.current) %> - -
      -
      <%= reply.content.html_safe %>
      -
      -
      -
      - <% end %> +
      +
      + <%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %> +
      +
      +
      + <% if reply.try(:author).try(:realname) == ' ' %> + <%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> + <% else %> + <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %> + <% end %> + <%= format_date(reply.created_on) %> + <%= link_to( + l(:button_delete), + {:controller => 'messages', :action => 'destroy', :id => reply.id, :board_id => reply.board_id, :is_board => 'false'}, + :method => :post, + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:button_delete), + :class => 'replyGrey fr ml10' + ) if reply.course_destroyable_by?(User.current) %> + +
      +
      <%= reply.content.html_safe %>
      +
      +
      +
      + <% end %> <% end %>
      From 87ee2e744fbc924ed1255fefdd2bca41bfcfe3ba Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Aug 2015 15:09:02 +0800 Subject: [PATCH 29/86] =?UTF-8?q?=E5=85=AC=E5=85=B1=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=E3=80=81=E8=AF=BE=E7=A8=8B=E3=80=81=E9=A1=B9=E7=9B=AE=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=95=8C=E9=9D=A2=E5=AF=BC=E8=88=AA=E6=A0=8F=E5=92=8C?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E5=AF=BC=E8=88=AA=E6=A0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base.html.erb | 18 +++- app/views/layouts/base_forums.html.erb | 53 ++++++---- app/views/layouts/base_memos.html.erb | 25 +++-- app/views/layouts/users_base.html.erb | 26 +++-- app/views/memos/_topic_form.html.erb | 5 +- app/views/welcome/_link_to_another.html.erb | 3 +- public/stylesheets/base.css | 106 ++++++++++++++++++++ public/stylesheets/header.css | 6 +- 8 files changed, 196 insertions(+), 46 deletions(-) create mode 100644 public/stylesheets/base.css diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 483cabac5..6bca696fc 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -17,19 +17,30 @@ <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> + <%= stylesheet_link_tag 'base','header', :media => 'all'%> + +
      + +
      +
      -<%=render :partial => 'layouts/base_header'%>
      <%= render_flash_messages %> <%= yield %> <%= call_hook :view_layouts_base_content %>
      - <%=render :partial => 'layouts/base_footer'%> + <%#=render :partial => 'layouts/base_footer'%>
      @@ -41,6 +52,9 @@
      +
      +<%= render :partial => 'layouts/footer' %> +
      <%= call_hook :view_layouts_base_body_bottom %> diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index eae133184..de75f7e2f 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -1,8 +1,3 @@ -<% @nav_dispaly_home_path_label = 1 - @nav_dispaly_main_course_label = 1 - @nav_dispaly_main_project_label = 1 - @nav_dispaly_main_contest_label = 1 %> -<% @nav_dispaly_forum_label = 1%> @@ -20,14 +15,25 @@ <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> - + <%= stylesheet_link_tag 'base','header', :media => 'all'%> + + +
      + +
      +
      -
      - <%=render :partial => 'layouts/base_header'%> +
      -
      +
      @@ -37,7 +43,7 @@ <%= form_tag(:controller => 'forums', :action => "search_memo", :id => params[:id], :method => :get) do %> <%= text_field_tag 'name', params[:name], :size => 20 %> <%= hidden_field_tag 'forum_id', params[:id] %> - <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> + <%= submit_tag l(:label_search), :class => "enterprise", :name => nil %> <% end %> @@ -46,46 +52,46 @@ -
      <%= l(:label_projects_community)%> <%= link_to request.host()+"/forums", forums_path %>

      <%=link_to l(:label_home),home_path %> > <%=link_to '公共贴吧', :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name, forum_path(@forum) %>

      -
      + +
      - + <%= render_flash_messages %> <%= yield %> <%= call_hook :view_layouts_base_content %>
      - <%= render :partial => 'layouts/base_footer'%> + <%#= render :partial => 'layouts/base_footer'%>
      +
      + <%= render :partial => 'layouts/footer' %> +
      <%= call_hook :view_layouts_base_body_bottom %> diff --git a/app/views/layouts/base_memos.html.erb b/app/views/layouts/base_memos.html.erb index dc2d3f33f..2831d642e 100644 --- a/app/views/layouts/base_memos.html.erb +++ b/app/views/layouts/base_memos.html.erb @@ -1,8 +1,3 @@ -<% @nav_dispaly_home_path_label = 1 - @nav_dispaly_main_course_label = 1 - @nav_dispaly_main_project_label = 1 - @nav_dispaly_main_contest_label = 1 %> -<% @nav_dispaly_forum_label = 1%> @@ -20,13 +15,24 @@ <%= javascript_include_tag "ckeditor/ckeditor.js" %> <%= yield :header_tags -%> + <%= stylesheet_link_tag 'base','header', :media => 'all'%> + +
      + +
      +
      -
      - <%=render :partial => 'layouts/base_header'%> +
      @@ -78,7 +84,7 @@ <%= call_hook :view_layouts_base_content %>
      - <%= render :partial => 'layouts/base_footer'%> + <%#= render :partial => 'layouts/base_footer'%>
      +
      + <%= render :partial => 'layouts/footer' %> +
      <%= call_hook :view_layouts_base_body_bottom %>
      diff --git a/app/views/layouts/users_base.html.erb b/app/views/layouts/users_base.html.erb index 98f4451f5..4048f23e5 100644 --- a/app/views/layouts/users_base.html.erb +++ b/app/views/layouts/users_base.html.erb @@ -1,8 +1,3 @@ -<% @nav_dispaly_home_path_label = 1 - @nav_dispaly_user_label = 1 - @nav_dispaly_store_all_label = 1 - %> -<% @nav_dispaly_forum_label = 1%> @@ -21,19 +16,29 @@ <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> + <%= stylesheet_link_tag 'base','header', :media => 'all'%> - + +
      + +
      +
      - <%=render :partial => 'layouts/base_header'%> + <%#=render :partial => 'layouts/base_header'%>
      <%= render_flash_messages %> <%= yield %> <%= call_hook :view_layouts_base_content %>
      - <%=render :partial => 'layouts/base_footer'%>
      @@ -45,6 +50,11 @@
      + +
      +<%= render :partial => 'layouts/footer' %> +
      + <%= call_hook :view_layouts_base_body_bottom %> diff --git a/app/views/memos/_topic_form.html.erb b/app/views/memos/_topic_form.html.erb index 6ce63bef6..b9495663e 100644 --- a/app/views/memos/_topic_form.html.erb +++ b/app/views/memos/_topic_form.html.erb @@ -7,10 +7,11 @@
      - -
      + +
      <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
      +
      <%= f.submit :value => l(:label_memo_create), :style => "margin-left: 100px;"%> <%= link_to l(:button_back), forum_path(@forum) %>
      <% end %> \ No newline at end of file diff --git a/app/views/welcome/_link_to_another.html.erb b/app/views/welcome/_link_to_another.html.erb index 6540409d1..b5940a113 100644 --- a/app/views/welcome/_link_to_another.html.erb +++ b/app/views/welcome/_link_to_another.html.erb @@ -1,5 +1,6 @@ <%hidden_non_project = Setting.find_by_name("hidden_non_project") - visiable = hidden_non_project && hidden_non_project.value == "0"%> + visiable = true #hidden_non_project && hidden_non_project.value == "0" +%> <% unless visiable%>
      <%=l(:label_projects_management_platform)%> diff --git a/public/stylesheets/base.css b/public/stylesheets/base.css new file mode 100644 index 000000000..54b9c497e --- /dev/null +++ b/public/stylesheets/base.css @@ -0,0 +1,106 @@ +/* CSS Document */ +/* 2015-06-26 */ +body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;} +body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5;} +div,img,tr,td,table{ border:0;} +table,tr,td{border:0;cellspacing:0; cellpadding:0;} +ol,ul,li{ list-style-type:none} +a:link,a:visited{text-decoration:none;} +/*a:hover,a:active{color:#000;}*/ +/*常用*/ +/*#RSide{ background:#fff;}*/ +/*上传图片处理*/ +#navHomepageSearch{margin-top: 11px;background-color: white;} +.upload_img img{max-width: 100%;} +blockquote img{max-width: 100%;} +.hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.none{display: none;} +.rside_back{ width:670px; margin-left:10px; background:#fff; margin-bottom:10px;} +.break_word{ word-break:break-all; word-wrap: break-word;} +select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; } +.sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; background:#dbdbdb;} +.sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;} +/*table{ background:#fff;}*/ +.more{ font-weight:normal; color:#999; font-size:12px;} +.no_line{ border-bottom:none;} +.line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;} +.no_border{ border:none;background:none;} +.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;} +.db {display:block;} +/* font & color */ +.f12{font-size:12px; font-weight:normal;} +.f14{font-size:14px;} +.f16{font-size:16px;} +.f18{font-size:18px;} +.fb{font-weight:bold;} + +/* Float & Clear */ +.cl{ clear:both; overflow:hidden; } +.fl{float:left;display:inline;} +.fr{float:right;display:inline;} +.f_l{ float:left;} +.f_r{ float:right;} +.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden} +.clearfix{clear:both;zoom:1} +.break_word{ word-break:break-all; word-wrap: break-word;} +.white_space{white-space:nowrap;} + +/* Spacing */ +.ml2{ margin-left:2px;} +.ml3{ margin-left:3px;} +.ml4{ margin-left:4px;} +.ml5{ margin-left:5px;} +.ml8{ margin-left:8px;} +.ml10{ margin-left:10px;} +.ml15{ margin-left:15px;} +.ml20{ margin-left:20px;} +.ml40{ margin-left:40px;} +.ml45{ margin-left:45px;} +.ml55{ margin-left:55px;} +.ml30{ margin-left:30px;} +.ml60{ margin-left:60px;} +.ml80{ margin-left:80px;} +.ml90{ margin-left:90px;} +.ml100{ margin-left:100px;} +.ml110{ margin-left:110px;} +.ml150 { margin-left:150px;} +.mr5{ margin-right:5px;} +.mr45 {margin-right:45px;} +.mr55{ margin-right:55px;} +.mr10{ margin-right:10px;} +.mr15 {margin-right:15px;} +.mr20{ margin-right:20px;} +.mr30{ margin-right:30px;} +.mr40{ margin-right:40px;} +.mw20{ margin: 0 20px;} +.mt3{ margin-top:3px;} +.mt5{ margin-top:5px;} +.mt8{ margin-top:8px;} +.mt10{ margin-top:10px !important;} +.mt15 {margin-top:15px;} +.mb4{ margin-bottom:4px;} +.mb5{ margin-bottom:5px;} +.mb8 {margin-bottom:8px;} +.mb10{ margin-bottom:10px !important;} +.mb20{ margin-bottom:20px;} +.pl15{ padding-left:15px;} +.w20{ width:20px;} +.w60{ width:60px;} +.w70{ width:70px;} +.w90{ width:90px;} +.w210{ width:210px;} +.w150{ width:150px;} +.w280{ width:280px;} +.w430{ width:470px;} +.w520{ width:520px;} +.w543{ width:543px;} +.w557{ width:557px;} +.w583{ width:583px;} +.w350{ width:350px;} +.w610{ width:610px;} +.w600{ width:600px;} +.h22{ height:22px;} +.h26{ height:26px;} +.h50{ height:50px;} +.h70{ height:70px;} +.h150{ height:150px;} \ No newline at end of file diff --git a/public/stylesheets/header.css b/public/stylesheets/header.css index 8389afbb9..248284b11 100644 --- a/public/stylesheets/header.css +++ b/public/stylesheets/header.css @@ -8,7 +8,7 @@ /*.navHomepageMenu:hover {background-color:#0ea6b7;}*/ .navHomepageSearchBoxcontainer {margin-top:11px; } .navHomepageSearchBox {width:380px; border:none; outline:none; height:32px; margin-top:11px; background-color:#ffffff;} -.navHomepageSearchInput {width:345px; height:32px; outline:none; border:none; float:left; padding-left:5px;; margin:0;} +.navHomepageSearchInput {width:345px; height:32px; outline:none; border:none !important; float:left;padding: 0 0 0 5px !important; margin:0;} .homepageSearchIcon {width:30px; height:32px; background:url(../images/nav_icon.png) -8px 3px no-repeat; float:left;} a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-repeat;} .navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #98a1a6; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;} @@ -64,8 +64,8 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;} .homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;} .homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;} -a.homepageWhite {color:#ffffff;} -a.homepageWhite:hover {color:#a1ebff} +a.homepageWhite {color:#ffffff !important;} +a.homepageWhite:hover {color:#a1ebff !important;} a.newsGrey {color:#4b4b4b;} a.newsGrey:hover {color:#000000;} a.replyGrey {color:#888888; display:inline-block;} From 256ccedfe8ef3ff5c42b6914ef1221c885288856 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Tue, 25 Aug 2015 15:16:24 +0800 Subject: [PATCH 30/86] schema --- db/schema.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/db/schema.rb b/db/schema.rb index 4639c07ec..4440af24a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -474,6 +474,13 @@ ActiveRecord::Schema.define(:version => 20150820025358) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "discuss_demos", :force => true do |t| + t.string "title" + t.text "body" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -769,6 +776,16 @@ ActiveRecord::Schema.define(:version => 20150820025358) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_details_copy", :force => true do |t| + t.integer "journal_id", :default => 0, :null => false + t.string "property", :limit => 30, :default => "", :null => false + t.string "prop_key", :limit => 30, :default => "", :null => false + t.text "old_value" + t.text "value" + end + + add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" + create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" @@ -896,7 +913,6 @@ ActiveRecord::Schema.define(:version => 20150820025358) do t.datetime "created_on" t.integer "comments_count", :default => 0, :null => false t.integer "course_id" - t.datetime "updated_on" end add_index "news", ["author_id"], :name => "index_news_on_author_id" From e2af9e26f88ecc50da0c35e74c6d11dcd402f285 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Aug 2015 15:35:45 +0800 Subject: [PATCH 31/86] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?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/layouts/_logined_header.html.erb | 2 +- app/views/users/_course_news.html.erb | 2 +- app/views/users/show.html.erb | 26 +++++++++------------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 10d71993d..16e5be059 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -54,7 +54,7 @@ <%= link_to "
      #{image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo")}
      ".html_safe,user_activities_path(User.current.id)%> diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 0e82d7622..7cc5ef5df 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -36,7 +36,7 @@
      回复(<%=activity.comments_count %>)
      -
      <%=format_date(activity.updated_on)%>
      +
      <%#=format_date(activity.updated_on)%>
      diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 85f415d1d..b30a51c4b 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -27,31 +27,27 @@
      <% @user_activities.each do |user_activity| unless @user_activities.nil? %> + <% act= user_activity.act %> <% case user_activity.act_type.to_s %> <% when 'CourseActivity' %> - <% @course_act= CourseActivity.where("id=#{user_activity.act_id}").first %> - <% unless @course_act.nil? %> - <% case @course_act.course_act_type.to_s %> + <% if act %> + <% activity= act.course_act %> + <% case act.course_act_type.to_s %> <% when 'HomeworkCommon' %> - <% @activity=HomeworkCommon.where("id=#{@course_act.course_act_id}").first %> - <%= render :partial => 'course_homework', :locals => {:activity => @activity,:user_activity =>user_activity} %> + <%= render :partial => 'course_homework', :locals => {:activity => activity,:user_activity =>user_activity} %> <% when 'News' %> - <% @activity=News.where("id=#{@course_act.course_act_id}").first %> - <%= render :partial => 'course_news', :locals => {:activity => @activity,:user_activity =>user_activity} %> + <%= render :partial => 'course_news', :locals => {:activity => activity,:user_activity =>user_activity} %> <% when 'Message'%> - <% @activity=Message.where("id=#{@course_act.course_act_id}").first %> - <%= render :partial => 'course_message', :locals => {:activity => @activity,:user_activity =>user_activity} %> + <%= render :partial => 'course_message', :locals => {:activity => activity,:user_activity =>user_activity} %> <% end %> <% end %> <% when 'ForgeActivity' %> - <% @project_act= ForgeActivity.where("id=#{user_activity.act_id}").first %> - <% case @project_act.forge_act_type.to_s %> + <% activity= act.forge_act unless act.forge_act_type == "ProjectCreateInfo" %> + <% case act.forge_act_type.to_s %> <% when 'Issue' %> - <% @activity=Issue.where("id=#{@project_act.forge_act_id}").first %> - <%= render :partial => 'project_issue', :locals => {:activity => @activity,:user_activity =>user_activity} %> + <%= render :partial => 'project_issue', :locals => {:activity => activity,:user_activity =>user_activity} %> <% when 'Message' %> - <% @activity=Message.where("id=#{@project_act.forge_act_id}").first %> - <%= render :partial => 'project_message', :locals => {:activity => @activity,:user_activity =>user_activity} %> + <%= render :partial => 'project_message', :locals => {:activity => activity,:user_activity =>user_activity} %> <% end %> <% end %> <% end %> From 44419eff04c284f3a7e88fbbfb1d2fa1b47bae2e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Aug 2015 15:39:50 +0800 Subject: [PATCH 32/86] rake db --- db/schema.rb | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 4440af24a..1c77ff04b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -776,16 +776,6 @@ ActiveRecord::Schema.define(:version => 20150820025358) do add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_details_copy", :force => true do |t| - t.integer "journal_id", :default => 0, :null => false - t.string "property", :limit => 30, :default => "", :null => false - t.string "prop_key", :limit => 30, :default => "", :null => false - t.text "old_value" - t.text "value" - end - - add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id" - create_table "journal_replies", :id => false, :force => true do |t| t.integer "journal_id" t.integer "user_id" From 0d9a397453c1a1cb83f21f47ae14a609a9467179 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Aug 2015 16:01:31 +0800 Subject: [PATCH 33/86] =?UTF-8?q?=E7=99=BB=E5=BD=95=E3=80=81=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=E9=80=89?= =?UTF-8?q?=E6=8B=A9js=20=E7=94=A8=E6=88=B7=E4=B8=BB=E9=A1=B5=20show?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 12 ++++---- app/views/layouts/_logined_header.html.erb | 32 ++++++++++++---------- app/views/layouts/_unlogin_header.html.erb | 32 ++++++++++++---------- public/javascripts/new_user.js | 7 ----- 4 files changed, 41 insertions(+), 42 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e1b9f4252..22d8deb0c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -549,13 +549,11 @@ class UsersController < ApplicationController end def show - #if @user == User.current - - @user_activities = UserActivity.where("(container_type='Course' and container_id in (select course_id FROM members WHERE user_id=#{@user.id})) or (container_type='Project' and container_id in (SELECT project_id FROM members WHERE user_id=#{@user.id}))").order('created_at desc') - @user_activities = paginateHelper @user_activities,500 - #SELECT * FROM user_activities WHERE (container_type='Course' AND container_id IN (SELECT course_id FROM members WHERE user_id=4)) OR (container_type='Project' AND container_id IN (SELECT project_id FROM members WHERE user_id=4)) - #else - #end + @page = (params[:page] || -1).to_i + 1 + user_project_ids = "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")" + user_course_ids = "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" + @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids}) or (container_type = 'Course' and container_id in #{user_course_ids})").order('created_at desc').limit(10).offset(@page * 10) + # @user_activities = paginateHelper @user_activities,500 render :layout=>'new_base_user' end diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 16e5be059..74c4bb9a9 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -25,23 +25,18 @@ + + \ No newline at end of file diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb index b4423a713..9d9ed813f 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -16,23 +16,18 @@
    - + -
    -<%= render :partial => 'layouts/footer' %> -
    +
    + <%= render :partial => 'layouts/footer' %> +
    <%= render :partial => 'layouts/new_feedback' %> - + + + + + + + + + +
    diff --git a/app/views/users/search.html.erb b/app/views/users/search.html.erb index 13979f79f..a8401c406 100644 --- a/app/views/users/search.html.erb +++ b/app/views/users/search.html.erb @@ -28,14 +28,14 @@ - + + + + + + + + From 18029fcb227705cb4d00e391456d54a27441d5db Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 25 Aug 2015 20:06:25 +0800 Subject: [PATCH 50/86] 111 --- app/views/users/user_homeworks.html.erb | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 19ecf3588..db929d7ac 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -26,9 +26,13 @@
    导入作业 -
    +
    + +
    -
    +
    + +
    @@ -38,14 +42,23 @@
    From fce523606c486de99f07be4dade361b2f8986959 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 25 Aug 2015 20:08:52 +0800 Subject: [PATCH 51/86] =?UTF-8?q?=E4=B8=AA=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/users_controller.rb | 11 ++-- app/views/users/_user_activities.html.erb | 44 ++++++++++++++++ app/views/users/show.html.erb | 61 ++++++----------------- app/views/users/show.js.erb | 4 ++ 4 files changed, 71 insertions(+), 49 deletions(-) create mode 100644 app/views/users/_user_activities.html.erb create mode 100644 app/views/users/show.js.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 505a3dd9a..a12fa37e4 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -552,10 +552,10 @@ class UsersController < ApplicationController end def show - @page = (params[:page] || -1).to_i + 1 + @page = params[:page] ? params[:page].to_i + 1 : 0 @type = params[:type] - user_project_ids = "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")" - user_course_ids = "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" + user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")" + user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" if @type case @type when "course_homework" @@ -575,7 +575,10 @@ class UsersController < ApplicationController @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10) end # @user_activities = paginateHelper @user_activities,500 - render :layout=>'new_base_user' + respond_to do |format| + format.js + format.html {render :layout => 'new_base_user'} + end end def show_old diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb new file mode 100644 index 000000000..60992c384 --- /dev/null +++ b/app/views/users/_user_activities.html.erb @@ -0,0 +1,44 @@ +<% user_activities.each do |user_activity| + unless user_activities.nil? %> + <% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %> + <% case user_activity.container_type.to_s %> + <% when 'Course' %> + <% if act %> + <% case user_activity.act_type.to_s %> + <% when 'HomeworkCommon' %> + <%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity =>user_activity} %> + <% when 'News' %> + <%= render :partial => 'course_news', :locals => {:activity => act,:user_activity =>user_activity} %> + <% when 'Message'%> + <%= render :partial => 'course_message', :locals => {:activity => act,:user_activity =>user_activity} %> + <%# when 'Course'%> + <%#= render :partial => 'course_create', :locals => {:activity => act,:user_activity =>user_activity} %> + <%# when 'Attachment' %> + <%#= render :partial => 'course_attachment', :locals => {:activity => act, :user_activity => user_activity} %> + <%# when 'JournalsForMessage' %> + <%#= render :partial => 'course_journalsformessage', :locals => {:activity => act, :user_activity => user_activity} %> + <%# when 'Poll' %> + <%#= render :partial => 'course_poll', :locals => {:activity => act, :user_activity => user_activity} %> + <% end %> + <% end %> + <% when 'Project' %> + <% case user_activity.act_type.to_s %> + <% when 'Issue' %> + <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity =>user_activity} %> + <% when 'Message' %> + <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity =>user_activity} %> + <%# when 'Journal' %> + <%#= render :partial => 'project_journal', :locals => {:activity => act,:user_activity =>user_activity} %> + <%# when 'News' %> + <%#= render :partial => 'project_news', :locals => {:activity => act,:user_activity =>user_activity} %> + <%# when 'Document' %> + <%#= render :partial => 'project_document', :locals => {:activity => act,:user_activity =>user_activity} %> + <%# when 'Attachment' %> + <%#= render :partial => 'project_attachment', :locals => {:activity => act,:user_activity =>user_activity} %> + <%# when 'ProjectCreateInfo' %> + <%#= render :partial => 'project_create', :locals => {:activity => act,:user_activity =>user_activity} %> + <% end %> + <% end %> + <% end %> +<% end %> + \ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 5189017ba..e650130ff 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,3 +1,18 @@ + +
    最新动态
    @@ -30,49 +45,5 @@
    -<% @user_activities.each do |user_activity| - unless @user_activities.nil? %> - <% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %> - <% case user_activity.container_type.to_s %> - <% when 'Course' %> - <% if act %> - <% case user_activity.act_type.to_s %> - <% when 'HomeworkCommon' %> - <%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity =>user_activity} %> - <% when 'News' %> - <%= render :partial => 'course_news', :locals => {:activity => act,:user_activity =>user_activity} %> - <% when 'Message'%> - <%= render :partial => 'course_message', :locals => {:activity => act,:user_activity =>user_activity} %> - <%# when 'Course'%> - <%#= render :partial => 'course_create', :locals => {:activity => act,:user_activity =>user_activity} %> - <%# when 'Attachment' %> - <%#= render :partial => 'course_attachment', :locals => {:activity => act, :user_activity => user_activity} %> - <%# when 'JournalsForMessage' %> - <%#= render :partial => 'course_journalsformessage', :locals => {:activity => act, :user_activity => user_activity} %> - <%# when 'Poll' %> - <%#= render :partial => 'course_poll', :locals => {:activity => act, :user_activity => user_activity} %> - <% end %> - <% end %> - <% when 'Project' %> - <% case user_activity.act_type.to_s %> - <% when 'Issue' %> - <%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity =>user_activity} %> - <% when 'Message' %> - <%= render :partial => 'project_message', :locals => {:activity => act,:user_activity =>user_activity} %> - <%# when 'Journal' %> - <%#= render :partial => 'project_journal', :locals => {:activity => act,:user_activity =>user_activity} %> - <%# when 'News' %> - <%#= render :partial => 'project_news', :locals => {:activity => act,:user_activity =>user_activity} %> - <%# when 'Document' %> - <%#= render :partial => 'project_document', :locals => {:activity => act,:user_activity =>user_activity} %> - <%# when 'Attachment' %> - <%#= render :partial => 'project_attachment', :locals => {:activity => act,:user_activity =>user_activity} %> - <%# when 'ProjectCreateInfo' %> - <%#= render :partial => 'project_create', :locals => {:activity => act,:user_activity =>user_activity} %> - <% end %> - <% end %> -<% end %> -<% end %> - \ No newline at end of file +<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => @page} %> \ No newline at end of file diff --git a/app/views/users/show.js.erb b/app/views/users/show.js.erb new file mode 100644 index 000000000..0ce84cf0e --- /dev/null +++ b/app/views/users/show.js.erb @@ -0,0 +1,4 @@ +$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities',:locals => {:user_activities => @user_activities, :page => @page} )%>"); +<% if @user_activities.count < 10%> +$(window).off("scroll", scrollHandler); +<% end%> From cccc0577c7a79794c0d9f5e621ff7c75a1cd2156 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 26 Aug 2015 08:51:39 +0800 Subject: [PATCH 52/86] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/show.html.erb | 4 +++- public/stylesheets/new_user.css | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e650130ff..d0e8351ee 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -3,7 +3,8 @@ if ($(window).scrollTop() == $(document).height() - $(window).height()) { $.get( '<%= user_activities_path(@user.id)%>', - { page : $("#show_more_activities").val()}, + { page : $("#show_more_activities").val(), + type: $("#user_activities_type").val()}, function (data) { } @@ -13,6 +14,7 @@ $(window).scroll(scrollHandler); +
    最新动态
    diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index a526b0266..fb16d39c5 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -578,7 +578,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#15bccf;} .homepagePostReplyDes {float:left; width:595px; margin-left:15px;} .homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:12px;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} -.homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} +.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#15bccf; height:30px; line-height:30px; vertical-align:middle;} .homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;} .homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;} From cf12ee877ed4eedfe6a60b8c8715441dc63ef883 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 26 Aug 2015 09:11:03 +0800 Subject: [PATCH 53/86] =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=B5=84=E6=96=99?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=AA=E4=BA=BA=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/my_controller.rb | 2 +- app/views/my/account.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 1839dd1fd..4124472e1 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -137,7 +137,7 @@ class MyController < ApplicationController @se.identity = params[:identity].to_i if params[:identity] @se.technical_title = params[:technical_title] if params[:technical_title] @se.student_id = params[:no] if params[:no] - @se.brief_introduction = params[:brief_introduction] + # @se.brief_introduction = params[:brief_introduction] @se.description = params[:description] if @user.save && @se.save diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index c23266afd..23fc1a3ad 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -30,7 +30,7 @@
  • 工作单位 : 
  • 地区 : 
  • 邮件通知 : 
  • -
  • 个人签名 : 
  • +
  • 个人简介 : 
  •   
  • @@ -141,7 +141,7 @@ <%= select_tag( 'user[mail_notification]', options_for_select( user_mail_notification_options(@user), @user.mail_notification) ) %> -
  • +
  • <%= f.select :language, :Chinese => :zh, :English => :en %>
  • From 757da1ec0a665f4e178b32b76f87b26fca6c01b3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Aug 2015 09:36:05 +0800 Subject: [PATCH 54/86] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=B5=84=E6=96=99=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 7 +------ public/javascripts/new_user.js | 1 + public/stylesheets/users.css | 7 +++++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 23fc1a3ad..c25363323 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -1,9 +1,4 @@ - - -
    +
      diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 377842b66..7fc515c4a 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -1,6 +1,7 @@ $(function(){ //右侧最小高度 = 左侧高度 - 15px 保证两边高度基本一样,页面美观 $("#RSide").css("min-height",$("#LSide").height()-15); + $("#users_setting").css("min-height",$("#LSide").height()-35); //头像相关 $("#homepage_portrait_image").live("mouseover",function(){ diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 9a809b7ce..967c7770b 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -70,7 +70,7 @@ a.select_btn_select{ background:#64bddb; color:#fff;} .wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;} .wlist_select a { background-color:#48aac9; color:#fff;} /* 设置 */ -#users_setting{clear:both;width:730px;/*滑动门的宽度*/} +#users_setting{clear:both;width:730px;background: #fff;padding: 10px;/*滑动门的宽度*/} /* TAB 切换效果 */ .users_tb_{ border-bottom:3px solid #CCC; height:26px; } .users_tb_ ul{height:26px; } @@ -144,4 +144,7 @@ div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;} span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;} span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} div.ke-toolbar .ke-outline{border:none;} -.cr{clear: right;} \ No newline at end of file +.cr{clear: right;} + +div.content{padding-top:10px;} +.pcontent>.school_list,.content>.school_list { padding-left: 5px;} \ No newline at end of file From d735eee4a390b349a3956bad3e99b1de61590b98 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 26 Aug 2015 11:41:32 +0800 Subject: [PATCH 55/86] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E5=92=8C=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=85=B3=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 6 ++-- app/controllers/watchers_controller.rb | 37 ++++++++++++++++++++++-- app/views/layouts/new_base_user.html.erb | 6 ++-- app/views/users/_user_fans_item.html.erb | 9 ++++-- app/views/users/user_fanslist.html.erb | 20 +++++++++---- app/views/watchers/_set_watcher.js.erb | 8 +++-- public/stylesheets/new_user.css | 8 +++++ 7 files changed, 77 insertions(+), 17 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a12fa37e4..36dd35250 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1276,8 +1276,8 @@ class UsersController < ApplicationController @obj_count = query.count(); @obj_pages = Paginator.new @obj_count,limit,params['page'] @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); - - render :template=>'users/user_fanslist',:layout=>'base_users_new' + @action = 'watch' + render :template=>'users/user_fanslist',:layout=>'new_base_user' end ###add by huang def user_fanslist @@ -1287,7 +1287,7 @@ class UsersController < ApplicationController @obj_pages = Paginator.new @obj_count,limit,params['page'] @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); @action = 'fans' - render :layout=>'base_users_new' + render :layout=>'new_base_user' end def user_visitorlist limit = 10; diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index 35e1d5ba4..a3cb2ef97 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -22,9 +22,26 @@ class WatchersController < ApplicationController def watch s = WatchesService.new watchables = s.watch params.merge(:current_user_id => User.current.id) + if params[:action_name] == 'watch' + limit = 10; + query = User.watched_by(params[:target_id]); + @obj_count = query.count(); + @obj_pages = Paginator.new @obj_count,limit,params['page'] + @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @action = 'watch' + elsif params[:action_name] == 'fans' + limit = 10; + query = User.find(params[:target_id]).watcher_users; + @obj_count = query.count(); + @obj_pages = Paginator.new @obj_count,limit,params['page'] + @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @action = 'fans' + else + + end respond_to do |format| format.html { redirect_to_referer_or {render :text => (true ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} - format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'add'} } + format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'add',:list => @list,:action_name=>params[:action_name],:page=>params[:page]} } end rescue Exception => e if e.message == "404" @@ -38,9 +55,25 @@ class WatchersController < ApplicationController def unwatch s = WatchesService.new watchables = s.unwatch params.merge(:current_user_id => User.current.id) + if params[:action_name] == 'watch' + limit = 10; + query = User.watched_by(params[:target_id]); + @obj_count = query.count(); + @obj_pages = Paginator.new @obj_count,limit,params['page'] + @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @action = 'watch' + elsif params[:action_name] == 'fans' + limit = 10; + query = User.find(params[:target_id]).watcher_users; + @obj_count = query.count(); + @obj_pages = Paginator.new @obj_count,limit,params['page'] + @list = query.order("#{Watcher.table_name}.id desc").limit(limit).offset(@obj_pages.offset).all(); + @action = 'fans' + else + end respond_to do |format| format.html { redirect_to_referer_or {render :text => (false ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} - format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'delete'} } + format.js { render :partial => 'set_watcher', :locals => {:user => User.current, :watched => watchables,:params=>params,:opt=>'delete',:list=>@list,:action_name=>params[:action_name],:page=>params[:page]} } end rescue Exception => e if e.message == "404" diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index 2944dd9cf..b5d9ba628 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside','users', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside','users',:media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= javascript_include_tag "bootstrap","avatars","new_user"%> @@ -66,14 +66,14 @@
    -
    +
    <%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
    关注
    -
    +
    <%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
    粉丝
    diff --git a/app/views/users/_user_fans_item.html.erb b/app/views/users/_user_fans_item.html.erb index 4ca8fbefc..b3fc7905c 100644 --- a/app/views/users/_user_fans_item.html.erb +++ b/app/views/users/_user_fans_item.html.erb @@ -1,3 +1,5 @@ +<% unless list.nil?%> +<% for item in list %> + <% if(User.current.logged? && User.current != item )%> <%if(item.watched_by?(User.current))%> - 取消关注 + 取消关注 <% else %> - 添加关注 + 添加关注 <% end %> <% end %>
    +<% end %> +<% end %> \ No newline at end of file diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb index 0b42da9f8..29176aadc 100644 --- a/app/views/users/user_fanslist.html.erb +++ b/app/views/users/user_fanslist.html.erb @@ -1,4 +1,12 @@ -
    + +
    <% if @action == 'fans' %> @@ -13,13 +21,15 @@ <% end %>
    - <% for item in @list %> - <%= render :partial => 'users/user_fans_item', :locals => {:item => item,:target=>@user} %> - <% end %> +
    + <%# for item in @list %> + <%= render :partial => 'users/user_fans_item', :locals => {:list => @list,:target=>@user,:action_name=>@action,:page=>params[:page]} %> + <%# end %> +

    <%= l(:label_no_data) %>

      <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
    -
    + diff --git a/app/views/watchers/_set_watcher.js.erb b/app/views/watchers/_set_watcher.js.erb index 1efa8a4a1..5420b3616 100644 --- a/app/views/watchers/_set_watcher.js.erb +++ b/app/views/watchers/_set_watcher.js.erb @@ -5,10 +5,14 @@ $("#user_fans_number").html("<%= watched.first.watcher_users.count.to_s%>"); //在当前用户的粉丝、关注页面 <% elsif( params[:target_id] == User.current.id.to_s )%> - + $("#users_list").html("<%= escape_javascript (render :partial => 'users/user_fans_item', :locals => {:list => list,:target=>User.current,:action_name=>action_name,:page=>params[:page]}) %>"); + $("#watch_user_number_div").html('<%= escape_javascript ( link_to User.watched_by(params[:target_id]).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>params[:target_id]},:class=>"homepageImageNumber") %>'); + $("#fans_user_number_div").html('<%= escape_javascript ( link_to User.find(params[:target_id]).watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>params[:target_id]},:class=>"homepageImageNumber", :id => "user_fans_number") %>'); //在其他用户的粉丝、关注页面 <% else %> - +$("#users_list").html("<%= escape_javascript (render :partial => 'users/user_fans_item', :locals => {:list => list,:target=>User.find(params[:target_id]),:action_name=>action_name,:page=>params[:page]}) %>"); +//在他人的用户分析下关注,不会改变他人的关注数,所以不必要刷新 + //$("#watch_user_number").html('<%#= escape_javascript ( link_to User.watched_by(params[:target_id]).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>params[:target_id]},:class=>"homepageImageNumber") %>'); <% end %> <% else %> diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index fb16d39c5..4bddb54bb 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -619,6 +619,14 @@ a.loginChooseTab {color:#484848; height:30px; display:block;} .loginSignAlert {font-size:12px; margin-left:60px;} .loginSignRow {height:60px; min-height:60px;} +/*关注列表*/ +.inf_user_image{ padding-left:8px; margin:0px; background-color:#fff; height: auto;padding-bottom: 8px;} +ul.list_watch{ + padding-left: 0px; + list-style-type:none; + height:auto; + border-bottom: 1px dashed rgb(204, 204, 204); +} /*底部*/ From ccfa93be6600d910e6d1c234cc440880db3bab20 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Aug 2015 13:56:37 +0800 Subject: [PATCH 56/86] =?UTF-8?q?=E8=80=81=E5=B8=88=E5=B8=83=E7=BD=AE?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/_user_homework_attachment.html.erb | 65 +++++++++++++++++++ app/views/users/_user_homework_form.html.erb | 56 ++++++++++++++++ app/views/users/user_homeworks.html.erb | 52 ++------------- public/javascripts/new_user.js | 3 + public/stylesheets/new_user.css | 11 ++++ public/stylesheets/users.css | 18 ++--- 6 files changed, 148 insertions(+), 57 deletions(-) create mode 100644 app/views/users/_user_homework_attachment.html.erb create mode 100644 app/views/users/_user_homework_form.html.erb diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb new file mode 100644 index 000000000..9e198a762 --- /dev/null +++ b/app/views/users/_user_homework_attachment.html.erb @@ -0,0 +1,65 @@ +
    + + <% if defined?(container) && container && container.saved_attachments %> + <% container.attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> + <% container.saved_attachments.each_with_index do |attachment, i| %> + + <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> + <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> + <%= l(:field_is_public)%>: + <%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%> + <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> +<% end %> + + <% project = project %> + + <%= button_tag l(:button_browse), :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn', :style => ie8? ? 'display:none' : '' %> + <%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => ie8? ? '' : 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => ie8? ? '' : 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js',:project =>project), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all) + } %> + + <%= l(:label_no_file_uploaded)%> + + (<%= l(:label_max_size) %>: + <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) + + + <% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> + <% end %> +
    + + + + + + + + + \ No newline at end of file diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb new file mode 100644 index 000000000..3a4c3496c --- /dev/null +++ b/app/views/users/_user_homework_form.html.erb @@ -0,0 +1,56 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> +
    +
    + +
    +
    + +
    + 导入作业 + + <%= calendar_for('homework_end_time')%> + + + + + + + +
    +
    + +
    + <% if edit_mode %> + <%= f.kindeditor :description,:editor_id => 'homework_description_editor',:height => "150px",:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %> + <% else %> + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + <%= f.kindeditor :description,:editor_id => 'homework_description_editor',:height => "150px" %> + <% end %> +
    +
    + +
    + +
    +
    + +
    + <%= render :partial => 'attachments/new_form', :locals => {:container => homework} %> +
    +
    + + +
    + + + + + +
    +
    \ No newline at end of file diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index db929d7ac..48666a0cb 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -19,54 +19,10 @@
    发布作业
    - + <% homework = HomeworkCommon.new %> + <%= labelled_form_for homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %> + <%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %> + <% end%>
    <% end%> diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 7fc515c4a..42a1271cd 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -11,6 +11,9 @@ $(function(){ $("#edit_user_file_btn").hide(); $("#watch_user_btn").hide(); }); + + //日历选择样式 + //$(".ui-datepicker-trigger").replaceWith("
    ") }); //编辑个人简介 diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index fb16d39c5..4326dae41 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -834,6 +834,17 @@ a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflo .ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; } .DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;} +/*日历选择图*/ +img.ui-datepicker-trigger { + display:block; + background:url(../images/public_icon.png) -31px 0 no-repeat; + cursor: pointer; + vertical-align: middle; + width:16px; + height:15px; + float:left; +} + diff --git a/public/stylesheets/users.css b/public/stylesheets/users.css index 967c7770b..4a54724fd 100644 --- a/public/stylesheets/users.css +++ b/public/stylesheets/users.css @@ -135,16 +135,16 @@ a:hover.c_lgrey{ color:#3ca5c6;} .users_r_h2{background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;} -a.hidepic>img{display:none;} +/*a.hidepic>img{display:none;}*/ -div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;} -span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;} -span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )} -div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;} -span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;} -span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;} -div.ke-toolbar .ke-outline{border:none;} -.cr{clear: right;} +/*div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}*/ +/*span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}*/ +/*span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )}*/ +/*div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}*/ +/*span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}*/ +/*span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}*/ +/*div.ke-toolbar .ke-outline{border:none;}*/ +/*.cr{clear: right;}*/ div.content{padding-top:10px;} .pcontent>.school_list,.content>.school_list { padding-left: 5px;} \ No newline at end of file From 686af68026f6d0e76fd856b902795a829613ed31 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Aug 2015 14:11:28 +0800 Subject: [PATCH 57/86] =?UTF-8?q?=E5=85=B3=E6=B3=A8=E3=80=81=E7=B2=89?= =?UTF-8?q?=E4=B8=9D=E3=80=81=E7=BC=96=E8=BE=91=E8=B5=84=E6=96=99=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B7=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/new_base_user.html.erb | 2 +- app/views/users/user_fanslist.html.erb | 2 +- public/stylesheets/new_user.css | 3 ++- public/stylesheets/users.css | 2 -- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/views/layouts/new_base_user.html.erb b/app/views/layouts/new_base_user.html.erb index b5d9ba628..315960a4c 100644 --- a/app/views/layouts/new_base_user.html.erb +++ b/app/views/layouts/new_base_user.html.erb @@ -47,7 +47,7 @@ <% end%>
    - +
    +
    + +
    + 我已阅读并接受Trustie服务协议条款
    注册 From 334e6dbd554e6eaaf9956be0c3956770f8878b17 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 26 Aug 2015 15:14:25 +0800 Subject: [PATCH 64/86] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=9C=AA=E8=AF=BB?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/new_user.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index df47c9e77..b383dfa8f 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -853,7 +853,9 @@ img.ui-datepicker-trigger { height:15px; float:left; } - +/*消息*/ +.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;} +.homepageNewsTypeNotRead {width:95px; font-size:12px; color:#888888; display:block;} From e2869faa0856d332e61d0b089cfd4825b52d428c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Aug 2015 15:17:56 +0800 Subject: [PATCH 65/86] =?UTF-8?q?=E6=97=A5=E5=8E=86=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=99=A8=E7=9A=84=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_form.html.erb | 6 ++++-- public/stylesheets/new_user.css | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 3a4c3496c..ad6f0fa2f 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -7,8 +7,10 @@
    导入作业 - - <%= calendar_for('homework_end_time')%> +
    + + <%= calendar_for('homework_end_time')%> +
    diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index df47c9e77..d2ee3d7f9 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -852,8 +852,10 @@ img.ui-datepicker-trigger { width:16px; height:15px; float:left; + margin: 7px; } - +.calendar_input{border-left:none !important;border-bottom: none!important; border-top: none!important; border-right: 1px solid #d9d9d9;} +.calendar_div{border: 1px solid #d9d9d9;} From 048319ef8eca1444fa59afb9703b1da1150c9eac Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 26 Aug 2015 15:24:57 +0800 Subject: [PATCH 66/86] =?UTF-8?q?=E4=B8=AA=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/users_controller.rb | 8 +- app/views/users/_course_homework.html.erb | 2 +- app/views/users/_course_message.html.erb | 46 ++--- app/views/users/_course_news.html.erb | 61 +++---- app/views/users/_course_news_reply.html.erb | 177 +++++++++++++++++++ app/views/users/_course_poll.html.erb | 2 +- app/views/users/_project_issue.html.erb | 47 +++-- app/views/users/_project_message.html.erb | 179 ++++++++++---------- app/views/users/_user_activities.html.erb | 4 +- app/views/users/show.html.erb | 17 +- 10 files changed, 366 insertions(+), 177 deletions(-) create mode 100644 app/views/users/_course_news_reply.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index a12fa37e4..e1e606f9c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -556,6 +556,8 @@ class UsersController < ApplicationController @type = params[:type] user_project_ids = @user.projects.visible.empty? ? "(-1)" : "(" + @user.projects.visible.map{|project| project.id}.join(",") + ")" user_course_ids = @user.courses.visible.empty? ? "(-1)" : "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" + course_types = "('Message','News','HomeworkCommon')" + project_types = "('Message','Issue')" if @type case @type when "course_homework" @@ -564,14 +566,16 @@ class UsersController < ApplicationController @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'News'").order('created_at desc').limit(10).offset(@page * 10) when "course_message" @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('created_at desc').limit(10).offset(@page * 10) + when "course_poll" + @user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('created_at desc').limit(10).offset(@page * 10) when "project_issue" @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('created_at desc').limit(10).offset(@page * 10) when "project_message" @user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('created_at desc').limit(10).offset(@page * 10) + else + @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10) end else - course_types = "('Message','News','HomeworkCommon')" - project_types = "('Message','Issue')" @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids}) and act_type in #{course_types}").order('created_at desc').limit(10).offset(@page * 10) end # @user_activities = paginateHelper @user_activities,500 diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index d0b830740..5a74b6814 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -1,5 +1,5 @@
    -
    +
    <%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %>
    diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index b6dfdbbe6..3d0c1b171 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -1,5 +1,5 @@
    -
    +
    <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
    @@ -37,16 +37,16 @@
    -
    + + <!–删除–>
    -
    <%= reply.content.html_safe %>
    +
    <%#= reply.content.html_safe %>
    - <% end %> - <% end %> -
    + <%# end %> + <%# end %> +
    -->
    diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 7cc5ef5df..044ce9c6e 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -1,5 +1,5 @@
    -
    +
    <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
    @@ -33,46 +33,49 @@
    -
    + + <%# if comment.try(:author).try(:realname) == ' ' %> + <%#= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> + <%# else %> + <%#= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %> + <%# end %> + <%#=format_date(comment.created_on)%> + <%#= link_to_if_authorized_course l(:button_delete), {:controller => 'comments', :action => 'destroy', :id => activity, :comment_id => comment}, + :data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %> + <!–删除–>
    -
    <%= comment.comments.html_safe %>
    +
    <%#= comment.comments.html_safe %>
    - <% end %> - <% end %> -
    + <%# end %> + <%# end %> +
    -->
    \ No newline at end of file diff --git a/app/views/users/_course_news_reply.html.erb b/app/views/users/_course_news_reply.html.erb new file mode 100644 index 000000000..c3f8571be --- /dev/null +++ b/app/views/users/_course_news_reply.html.erb @@ -0,0 +1,177 @@ + +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> + +<% if @news.commentable? %> +
    +

    <%= l(:label_comment_add) %>

    + <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %> +
    + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + <%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%> +
    +

    + + <%= l(:label_cancel_with_space) %> + + + <%= l(:label_comment_with_space) %> + +

    + <% end %> +
    +<% end %> + +
    + + <%= form_for('new_form', :method => :post, + :url => {:controller => 'words', :action => 'leave_course_message'},:html => {:id=>'leave_message_form'}) do |f|%> + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + +

    + <% end %> +
    + +
    + +
    + + + + + diff --git a/app/views/users/_course_poll.html.erb b/app/views/users/_course_poll.html.erb index f76b6d0ae..01991d379 100644 --- a/app/views/users/_course_poll.html.erb +++ b/app/views/users/_course_poll.html.erb @@ -1,5 +1,5 @@
    -
    +
    <%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %> diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 925625c28..6661043a7 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -1,6 +1,5 @@ -<% reply_links = authorize_for('issues', 'edit') -%>
    -
    +
    <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
    @@ -71,11 +70,11 @@
    -
    + + #<!–删除–>
    - <% if reply.details.any? %> - <% details_to_strings(reply.details).each do |string| %> -
    <%=string %>
    - <% end %> - <% else %> -
    <%=reply.notes.html_safe %>
    - <% end %> + <%# if reply.details.any? %> + <%# details_to_strings(reply.details).each do |string| %> +
    <%#=string %>
    + <%# end %> + <%# else %> +
    <%#=reply.notes.html_safe %>
    + <%# end %>
    - <% end %> - <% end %> -
    + <%# end %> + <%# end %> +
    -->
    \ No newline at end of file diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 248be6143..d9b87926c 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -1,96 +1,95 @@ - -
    -
    -
    - <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %> -
    -
    -
    - <% if activity.try(:author).try(:realname) == ' ' %> - <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% end %> - TO - <%= link_to activity.project.name.to_s+"(项目讨论区)", project_path(activity.project), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%> - -
    -
    - <% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe+"(讨论区内容)", project_boards_path(Board.where('id=?',activity.board_id).first.project_id), :class=> "postGrey", :style=>"word-break:break-all" %> - <% else %> - <%= link_to activity.parent.subject.to_s.html_safe+"(讨论区内容)", project_boards_path(Board.where('id=?',activity.board_id).first.project_id), :class=> "postGrey", :style=>"word-break:break-all"%> - <% end %> -
    -
    -
    时间:<%= format_date(activity.created_on) %>
    -
    - -
    -
    -
    回复( - <% if activity.parent_id.nil? %> - <%=activity.replies_count %> - <% else %> - <%=activity.parent.replies_count %> - <% end %>)
    -
    <%=format_date(activity.updated_on)%>
    - -
    -
    - +
    +
    +
    + -
    -
    <%= reply.content.html_safe %>
    -
    -
    -
    - <% end %> - <% end %> +
    -
    + <%# end %> + <%# end %> +
  • --> +
    diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 60992c384..e0ae950c7 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -17,8 +17,8 @@ <%#= render :partial => 'course_attachment', :locals => {:activity => act, :user_activity => user_activity} %> <%# when 'JournalsForMessage' %> <%#= render :partial => 'course_journalsformessage', :locals => {:activity => act, :user_activity => user_activity} %> - <%# when 'Poll' %> - <%#= render :partial => 'course_poll', :locals => {:activity => act, :user_activity => user_activity} %> + <% when 'Poll' %> + <%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity => user_activity} %> <% end %> <% end %> <% when 'Project' %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index d0e8351ee..78995ab76 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -26,22 +26,29 @@
  • 课程动态
  • <%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%>
  • -
  • <%= link_to "通知动态", {:controller => "users", :action => "show", :type => "course_news"}, :class => "homepagePostTypeAssignment postTypeGrey"%> +
  • <%= link_to "通知动态", {:controller => "users", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%> -
  • <%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeAssignment postTypeGrey"%> - +
  • <%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%> +
  • <%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%> +
    • 项目动态
    • -
    • <%= link_to "问题动态", {:controller => "users", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeAssignment postTypeGrey"%> -
    • <%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "project_message"}, :class => "homepagePostTypeAssignment postTypeGrey"%> +
    • <%= link_to "问题动态", {:controller => "users", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%> +
    • <%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
  • +
  • +
      +
    • 更多
    • +
    • <%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAssignment postTypeGrey"%> +
    +
  • From 7340a664f2bcc3dd166858c1dfd3c986ff223e3d Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 26 Aug 2015 15:42:12 +0800 Subject: [PATCH 67/86] =?UTF-8?q?=E9=93=BE=E6=8E=A5=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_messages.html.erb | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 7b7060603..916fe1291 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -5,25 +5,25 @@
    - 留言 + + <%= link_to '留言',feedback_path(@user),:class=>'homepageMenuText'%>
    diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index a8107ce5f..d04979b10 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -1,13 +1,26 @@ -
    - - <% if @user.user_extensions.identity == 0 && @user.allowed_to?(:add_course, nil, :global => true) %> - 新建课程 - <% end %> -
    -
    + + + + + + + + <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"user" %> -
    + @@ -37,4 +50,4 @@
    -
    \ No newline at end of file + \ No newline at end of file From 5ec24913bb8ef8409025dc78fe3ecd68d99ddac4 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 26 Aug 2015 16:06:15 +0800 Subject: [PATCH 69/86] =?UTF-8?q?=E7=95=99=E8=A8=80=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E8=89=B2=20=E7=95=99=E8=A8=80=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_newfeedback.html.erb | 6 +++++- public/stylesheets/new_user.css | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index d04979b10..13b4524ba 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -24,6 +24,10 @@ + \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index df47c9e77..f719f0b23 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -629,6 +629,9 @@ ul.list_watch{ border-bottom: 1px dashed rgb(204, 204, 204); } +/*留言*/ +.feedBack {width:728px; background-color:#ffffff; padding:10px; border:1px solid #dddddd;float: right} + /*底部*/ #Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;} From b824c3fa46d5e42c5ab1c116196512f9048c7c79 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 26 Aug 2015 16:31:28 +0800 Subject: [PATCH 70/86] =?UTF-8?q?1=E3=80=81=E5=8E=BB=E6=8E=89=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E4=BB=A3=E7=A0=81=202=E3=80=81=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=A0=B7=E5=BC=8F=E5=88=97=E8=A1=A8=E8=BF=87=E5=AE=BD?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=B7=A8=E8=A1=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 88 +------ app/views/users/user_messages_new.html.erb | 267 --------------------- config/routes.rb | 1 - public/stylesheets/new_user.css | 2 +- 4 files changed, 3 insertions(+), 355 deletions(-) delete mode 100644 app/views/users/user_messages_new.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 726dfe50b..e8d512a2e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -45,14 +45,14 @@ class UsersController < ApplicationController :activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index, :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist, :user_resource,:user_resource_create,:user_resource_delete,:rename_resource,:search_user_course,:add_exist_file_to_course, - :search_user_project,:resource_preview,:resource_search,:add_exist_file_to_project,:user_messages, :user_messages_new,:edit_brief_introduction] + :search_user_project,:resource_preview,:resource_search,:add_exist_file_to_project,:user_messages, :edit_brief_introduction] #edit has been deleted by huang, 2013-9-23 before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource, - :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction, :user_messages_new] + :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction] before_filter :auth_user_extension, only: :show #before_filter :rest_user_score, only: :show #before_filter :select_entry, only: :user_projects @@ -201,90 +201,6 @@ class UsersController < ApplicationController end end - def user_messages_new - unless User.current.logged? - render_403 - return - end - # 当前用户查看消息,则设置消息为已读 - course_querys = @user.course_messages - forge_querys = @user.forge_messages - user_querys = @user.user_feedback_messages - forum_querys = @user.memo_messages - # if User.current.id == @user.id - # course_querys.update_all(:viewed => true) - # forge_querys.update_all(:viewed => true) - # user_querys.update_all(:viewed => true) - # forum_querys.update_all(:viewed => true) - # end - @new_message_count = @user.forge_messages.count + @user.memo_messages.count + @user.course_messages.count + @user.user_feedback_messages.count - case params[:type] - when nil - @message_alls = [] - messages = MessageAll.where("user_id =?",@user).order("created_at desc") - messages.each do |message_all| - @message_alls << message_all.message - end - - # @user_course_messages = MessageAll.where("user_id =? and message_type=?",@user,"CourseMessage").order("created_at desc") - # @user_forge_messages = MessageAll.where("user_id =? and message_type=?",@user,"ForgeMessage").order("created_at desc") - # @user_memo_messages = MessageAll.where("user_id =? and message_type=?",@user,"MemoMessage").order("created_at desc") - # @user_feedback_messages = MessageAll.where("user_id =? and message_type=?",@user,"UserFeedbackMessage").order("created_at desc") - # @user_course_messages_count = @user_course_messages.count - # @user_forge_messages_count = @user_forge_messages.count - # @user_memo_messages_count = @user_memo_messages.count - # @user_feedback_messages_count = @user_feedback_messages.count - when 'homework' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") - #@user_course_messages_count = @user_course_messages.count - when 'course_message' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc") - #@user_course_messages_count = @user_course_messages.count - when 'forge_message' - @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc") - #@user_forge_messages_count = @user_forge_messages.count - when 'course_news' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc") - #@user_course_messages_count = @user_course_messages.count - when 'forge_news' - @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc") - #@user_forge_messages_count = @user_forge_messages.count - when 'course_news_reply' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc") - #@user_course_messages_count = @user_course_messages.count - when 'forge_news_reply' - @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc") - #@user_forge_messagess_count = @user_forge_messages.count - when 'poll' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc") - #@user_course_messages_count = @user_course_messages.count - when 'works_reviewers' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc") - #@user_course_messages_count = @user_course_messages.count - when 'works_reply' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc") - #@user_course_messages_count = @user_course_messages.count - when 'issue' - @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc") - #@user_forge_messages_count = @user_forge_messages.count - when 'issue_update' # 缺陷状态更新、留言 - @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc") - #@user_forge_messages_count = @user_forge_messages.count - when 'forum' - @message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc") - #@user_memo_messages_count = @user_memo_messages.count - when 'user_feedback' - @message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc") - #@user_feedback_messages_count = @user_feedback_messages.count - else - render_404 - return - end - respond_to do |format| - format.html{render :layout=>'new_base_user'} - end - end - def user_projects_index if User.current.admin? memberships = @user.memberships.all(conditions: "projects.project_type = #{Project::ProjectType_project}").first diff --git a/app/views/users/user_messages_new.html.erb b/app/views/users/user_messages_new.html.erb deleted file mode 100644 index 4f612b8b6..000000000 --- a/app/views/users/user_messages_new.html.erb +++ /dev/null @@ -1,267 +0,0 @@ -
    -
    -
    -
    消息
    - -
    -<% if params[:type].nil? %> -
    - 有 8 封未读全部设为已读 -
    -<% end %> -
    -<% if @new_message_count >0 %> - <%# 课程消息 %> - <% unless @message_alls.nil? %> - <% @message_alls.each do |ma| %> - <% if ma.class == CourseMessage %> - <% if ma.course_message_type == "News" %> -
      -
    • <%= image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30") %>
    • -
    • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %>
    • -
    • ">发布通知
    • -
    • - <%= link_to ma.course_message.title, {:controller => 'news', :action => 'show', :id => ma.course_message.id }, - :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", - :title => "#{ma.course_message.title}" %>
    • -
    • <%= time_tag(ma.course_message.created_on).html_safe %>
    • -
    - <% end %> - <% if ma.course_message_type == "Comment" %> -
      -
    • <%= image_tag(url_to_avatar(ma.course_message.author), :width => "30", :height => "30") %>
    • -
    • <%=link_to ma.course_message.author, user_path(ma.course_message.author), :class => "newsBlue" %>
    • -
    • ">回复了通知
    • -
    • - <%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id }, - :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", - :title => "#{ma.course_message.comments.html_safe}" %>
    • -
    • <%= time_tag(ma.course_message.created_on).html_safe %>
    • -
    - <% end %> - <% if ma.course_message_type == "HomeworkCommon" %> - - <% end %> - <% if ma.course_message_type == "Poll" %> - - <% end %> - <% if ma.course_message_type == "Message" %> - - <% end %> - <% if ma.course_message_type == "StudentWorksScore" %> - - <% end %> - <% if ma.course_message_type == "JournalsForMessage" %> - - <% end %> - <% end %> - - <% if ma.class == ForgeMessage %> - <% if ma.forge_message_type == "Issue" %> - - <% end %> - <% if ma.forge_message_type == "Journal" %> - - <% end %> - <% if ma.forge_message_type == "Message" %> - - <% end %> - <% if ma.forge_message_type == "News" %> - - <% end %> - <% if ma.forge_message_type == "Comment" %> -
      -
    • <%= image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30") %>
    • -
    • <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue" %>
    • -
    • 回复了新闻
    • -
    • - <%= link_to "#{ma.forge_message.comments.html_safe}", - {:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.forge_message.comments.html_safe}"%>
    • -
    • <%= time_tag(ma.forge_message.created_on).html_safe %>
    • -
    - <% end %> - <% end %> - - <% if ma.class == MemoMessage %> - <% if ma.memo_type == "Memo" %> - - <% end %> - <% end %> - - <% if ma.class == UserFeedbackMessage %> - <% if ma.journals_for_message_type == "JournalsForMessage" %> - - <% end %> - <% end %> - <% end %> - <% end %> - - - -<% else %> -
    暂无消息!
    -<% end %> -
    -
    -
    -
    - - - - - - - - - - - - diff --git a/config/routes.rb b/config/routes.rb index 7ba09a83a..86e238049 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -366,7 +366,6 @@ RedmineApp::Application.routes.draw do match 'users/:id/user_projects', :to => 'users#user_projects', :via => :get #消息 match 'users/:id/user_messages', :to => 'users#user_messages', :via => :get, :as => "user_message" - match 'users/:id/user_messages_new', :to => 'users#user_messages_new', :via => :get, :as => "user_messages_new" #match 'users/:id/user_messages/:homework', :to => 'users#user_messages_homework', :via => :get, :as => "user_message_homewrok" diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 39d34b92b..a1ca5674a 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -512,7 +512,7 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;} .homepageNewsPortrait {width:40px; display:block; margin-top:7px;} .homepageNewsPublisher {width:80px; max-width:80px; margin-right:10px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;} -.homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;height:49px; max-height:49px; } .homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;} a.homepageWhite {color:#ffffff;} a.homepageWhite:hover {color:#a1ebff} From ccfd69602cceb590169f07675a6f3d9cecbbe49b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 26 Aug 2015 16:31:28 +0800 Subject: [PATCH 71/86] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 4 +++ app/views/account/agreement.html.erb | 51 +++++++++++++++++++++++++++ app/views/account/login.html.erb | 2 +- config/routes.rb | 1 + public/stylesheets/new_user.css | 13 +++++++ 5 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 app/views/account/agreement.html.erb diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 40a9fab63..bc5c15873 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -36,6 +36,10 @@ class AccountController < ApplicationController end end + def agreement + render :layout => 'users_base' + end + # Log out current user and redirect to welcome page def logout if User.current.anonymous? diff --git a/app/views/account/agreement.html.erb b/app/views/account/agreement.html.erb new file mode 100644 index 000000000..f18731348 --- /dev/null +++ b/app/views/account/agreement.html.erb @@ -0,0 +1,51 @@ +<%= stylesheet_link_tag 'new_user'%> +
    +
    +

    Trustie服务协议

    +
    +

    尊敬的用户,您好!
    +欢迎使用Trustie平台,在您使用Trustie平台前,请您认真阅读并遵守《Trustie服务协议》(以下简称"本协议"),请您务必审慎阅读、充分理解协议的各条款内容。
    +当您在注册过程中点击查看"看过并同意本服务协议",按照注册流程成功注册为Trustie平台的用户即表示您已充分阅读、理解并完全接受本协议中的全部条款。您承诺接受并遵守本协议的约定,届时您不应以未阅读本协议的内容等理由,主张本协议无效或本协议中的某些条款无效,或要求撤销本协议。

    +

    一、Trustie平台权利和义务

    +

    1、尊重用户隐私:尊重用户隐私,保障用户隐私安全是Trustie平台的一项基本政策;
    +2、管理平台用户:Trustie平台依据国家法律、地方法律和国际法律等的标准以及本行业的规则来管理平台注册用户;
    +3、处理用户反馈:Trustie平台的相关人员会及时处理用户反馈的问题并给予及时回复。

    +

    二、用户权利和义务

    +

    用户在使用Trustie平台的过程中,必须遵守如下原则:
    +1、遵守中国的有关法律和法规;
    +2、使用网络服务不作非法用途;
    +3、不干扰和混乱网络服务;
    +4、遵守所有使用网络服务的网络协议、规定、程序和惯例;
    +5、不传输任何非法的、骚扰性的、中伤他人的、辱骂性的、恐吓性的、伤害性的、庸俗的,淫秽等信息资料;
    +6、不传输任何教唆他人构成犯罪行为的资料;
    +7、用户不得故意或者过失损害Trustie平台合法权利和利益。及时回复。

    +

    三、关于责任

    +

    鉴于网络服务的特殊性,用户同意Trustie团队有权在事先通知的情况下,变更、中断、升级部分网络服务。Trustie团队不担保网络服务不会中断,但承诺在用户可承受的时间内快速恢复服务,同时确保用户数据的安全性和可靠性。

    +

    四、服务条款的修改

    +

    Trustie团队保留在必要时对本协议修改的权利,一旦发生变动,这些条款可由Trustie团队及时更新,且毋须另行通知,修改后的条款一旦在网页上公布即有效代替原来的服务条款。您可随时查阅最新版服务条款。

    +

    本协议最终解释权归Trustie团队所有。

    +
    + + +
    +
    + + diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index 85db7f695..68fb4b9ba 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -246,7 +246,7 @@
    - 我已阅读并接受Trustie服务协议条款
    + 我已阅读并接受Trustie服务协议条款
    注册 diff --git a/config/routes.rb b/config/routes.rb index 2c75f9862..135d4e811 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -262,6 +262,7 @@ RedmineApp::Application.routes.draw do match 'account/heartbeat', to: 'account#heartbeat', :via => :get match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post] match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post] + match 'agreement',:to => 'account#agreement',:as => 'agreement',:via=>[:get] match 'account/register', :via => [:get, :post], :as => 'register' match 'account/lost_password', :via => [:get, :post], :as => 'lost_password' match 'account/activate', :via => :get diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index f719f0b23..59e50ead5 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -633,6 +633,19 @@ ul.list_watch{ .feedBack {width:728px; background-color:#ffffff; padding:10px; border:1px solid #dddddd;float: right} + +/*20150826忘记密码 LB*/ +.BgBox{ width:968px; border:1px solid #dddddd; background:#fff; padding:15px; padding-top:10px;} +.BgBox_h2{ font-size:16px; color:#484848; width:968px;border-bottom:1px solid #e3e3e3; padding-bottom:5px;} +.NomalInput{width:308px; height:38px; border:1px solid #98a1a6; outline:none; color:#888888; font-size:14px;} +.BgBoxCon{ width:310px; margin:80px auto;} +.BgBoxConP{ font-size:14px; color:#484848;} +.LoginButton {width:315px; height:40px; background-color:#269ac9; font-size:14px; text-align:center; line-height:40px; vertical-align:middle;} +.LoginButton:hover {background-color:#297fb8;} +/*20150826协议 LB*/ +.AgreementBox{ margin:20px 0; color:#666666; font-size:14px; line-height:1.9;} +.Agreementh4{ color:#2980b9; font-weight:bold; font-size:14px; margin-top:30px;} + /*底部*/ #Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;} .footerAboutContainer {width:auto; border-bottom:1px solid #efefef;} From ef74d129c5df05b948f81741a603e002b5680450 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 26 Aug 2015 16:35:53 +0800 Subject: [PATCH 72/86] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E9=93=BE=E6=8E=A5=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_messages.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 916fe1291..97a159884 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -10,7 +10,7 @@
  • <%= link_to "作业消息",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'homework'}, :class => "resourcesGrey" %>
  • <%= link_to "课程讨论区",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_message'}, :class => "resourcesGrey" %>
  • <%= link_to "课程通知",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news'}, :class => "resourcesGrey" %>
  • -
  • <%= link_to "通知回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news_reply', :class => "resourcesGrey" } %>
  • +
  • <%= link_to "通知回复",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'course_news_reply'}, :class => "resourcesGrey" %>
  • <%= link_to "课程问卷",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'poll'}, :class => "resourcesGrey" %>
  • <%= link_to "作品评阅",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reviewers'}, :class => "resourcesGrey" %>
  • <%= link_to "作品讨论",{:controller=> 'users', :action => 'user_messages', id: User.current.id, host: Setting.host_user, :type => 'works_reply'}, :class => "resourcesGrey" %>
  • From 65b5b467d440bd99793a9c6726c8575c41e6a8b2 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 26 Aug 2015 16:50:26 +0800 Subject: [PATCH 73/86] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 3 +- app/views/account/lost_password.html.erb | 50 +++++++++++++++++------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index bc5c15873..60f12fb38 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -36,8 +36,9 @@ class AccountController < ApplicationController end end + # 服务协议 def agreement - render :layout => 'users_base' + render :layout => 'static_base' end # Log out current user and redirect to welcome page diff --git a/app/views/account/lost_password.html.erb b/app/views/account/lost_password.html.erb index 3c6c57f52..46d3b2d7b 100644 --- a/app/views/account/lost_password.html.erb +++ b/app/views/account/lost_password.html.erb @@ -1,16 +1,36 @@ -<% @nav_dispaly_home_path_label = 1 - @nav_dispaly_main_course_label = 1 - @nav_dispaly_main_project_label = 1 - @nav_dispaly_main_contest_label = 1 %> -<% @nav_dispaly_forum_label = 1%> -

    <%=l(:label_password_forget)%>

    +<%= stylesheet_link_tag 'new_user'%> -<%= form_tag(lost_password_path) do %> -
    -

    - - <%= text_field_tag 'mail', nil, :size => 40, :placeholder => '请输入注册邮箱'%> - <%= submit_tag l(:button_submit) %> -

    -
    -<% end %> +
    +
    +

    忘记密码

    +
    +

    通过注册邮箱链接重设密码

    + + + +
    + + +
    +
    + + + From 9e9de44397a39690eda7165ae20171cb556cc63b Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 26 Aug 2015 16:51:03 +0800 Subject: [PATCH 74/86] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/static_base.html.erb | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 app/views/layouts/static_base.html.erb diff --git a/app/views/layouts/static_base.html.erb b/app/views/layouts/static_base.html.erb new file mode 100644 index 000000000..b81b0755d --- /dev/null +++ b/app/views/layouts/static_base.html.erb @@ -0,0 +1,41 @@ + + + + + <%=h html_title %> + + + <%= csrf_meta_tag %> + <%= favicon %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> + <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> + <%= javascript_heads %> + <%= javascript_include_tag "jquery.leanModal.min" %> + <%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%> + <%= heads_for_theme %> + <%= call_hook :view_layouts_base_html_head %> + + <%= yield :header_tags -%> + <%= stylesheet_link_tag 'base','header', :media => 'all'%> + + +
    + +
    +
    + <%= yield %> +
    +
    +
    +<%= render :partial => 'layouts/footer' %> +
    + +<%= call_hook :view_layouts_base_body_bottom %> + + From 85b90f9958f1d0726ee0d9711d70551f8238be16 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 26 Aug 2015 16:56:41 +0800 Subject: [PATCH 75/86] =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e8d512a2e..cefb6514c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -120,7 +120,7 @@ class UsersController < ApplicationController user_querys.update_all(:viewed => true) forum_querys.update_all(:viewed => true) end - @new_message_count = @user.forge_messages.count + @user.memo_messages.count + @user.course_messages.count + @user.user_feedback_messages.count + @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count case params[:type] when nil @message_alls = [] @@ -128,27 +128,15 @@ class UsersController < ApplicationController messages.each do |message_all| @message_alls << message_all.message end - - # @user_course_messages = MessageAll.where("user_id =? and message_type=?",@user,"CourseMessage").order("created_at desc") - # @user_forge_messages = MessageAll.where("user_id =? and message_type=?",@user,"ForgeMessage").order("created_at desc") - # @user_memo_messages = MessageAll.where("user_id =? and message_type=?",@user,"MemoMessage").order("created_at desc") - # @user_feedback_messages = MessageAll.where("user_id =? and message_type=?",@user,"UserFeedbackMessage").order("created_at desc") - # @user_course_messages_count = @user_course_messages.count - # @user_forge_messages_count = @user_forge_messages.count - # @user_memo_messages_count = @user_memo_messages.count - # @user_feedback_messages_count = @user_feedback_messages.count when 'homework' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_course_messages_count = @user_course_messages.count when 'course_message' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_course_messages_count = @user_course_messages.count when 'forge_message' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_forge_messages_count = @user_forge_messages.count when 'course_news' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "News", @user).order("created_at desc") @message_alls_count = @message_alls.count @@ -156,42 +144,32 @@ class UsersController < ApplicationController when 'forge_news' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_forge_messages_count = @user_forge_messages.count when 'course_news_reply' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc") - #@user_course_messages_count = @user_course_messages.count when 'forge_news_reply' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_forge_messagess_count = @user_forge_messages.count when 'poll' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_course_messages_count = @user_course_messages.count when 'works_reviewers' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_course_messages_count = @user_course_messages.count when 'works_reply' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_course_messages_count = @user_course_messages.count when 'issue' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Issue", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_forge_messages_count = @user_forge_messages.count when 'issue_update' # 缺陷状态更新、留言 @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_forge_messages_count = @user_forge_messages.count when 'forum' @message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_memo_messages_count = @user_memo_messages.count when 'user_feedback' @message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc") @message_alls_count = @message_alls.count - #@user_feedback_messages_count = @user_feedback_messages.count else render_404 return From 2124b3c3924b7673bcde2006c233c1a1ef174c15 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 26 Aug 2015 17:02:54 +0800 Subject: [PATCH 76/86] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=BC=BA=E9=99=B7=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_homework.html.erb | 6 ++--- app/views/users/_course_message.html.erb | 9 ++++--- app/views/users/_course_news.html.erb | 4 +-- app/views/users/_course_poll.html.erb | 6 ++--- app/views/users/_project_issue.html.erb | 4 +-- app/views/users/_project_message.html.erb | 9 ++++--- app/views/users/_user_activities.html.erb | 32 ++++++++++++----------- 7 files changed, 37 insertions(+), 33 deletions(-) diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 5a74b6814..9fc312c96 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -4,7 +4,7 @@ <%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %>
    -
    +
    <% if activity.try(:user).try(:realname) == ' ' %> <%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %> <% else %> @@ -12,12 +12,12 @@ <% end %> TO <%= link_to activity.course.name.to_s+"(课程名称)", course_path(activity.course_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
    -
    +
    <%= link_to activity.name.to_s+"(作业名称)", student_work_index_path(:homework => activity.id), :class => "postGrey", :style=>"word-break:break-all" %>
    - <%= link_to "提交("+activity.student_works.count.to_s+")", student_work_index_path(activity.id), :class=> "c_blue" %> + <%= link_to "提交("+activity.student_works.count.to_s+")", student_work_index_path(:homework => activity.id), :class=> "c_blue" %>
    截止时间:<%= format_date(activity.end_time) %>
    diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 3d0c1b171..bf42c179f 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -4,7 +4,7 @@ <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -13,16 +13,17 @@ TO <%= 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(Board.where('id=?',activity.board_id).first.course_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(Board.where('id=?',activity.board_id).first.course_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 %>
    时间:<%= format_date(activity.created_on) %>
    +
    (描述)<%= activity.content.html_safe %>
    -
    +
    <% if @ctivity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -12,7 +12,7 @@ <% end %> TO <%= link_to activity.course.name.to_s+"(课程名称)", course_path(activity.course), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
    -
    +
    <%=link_to activity.title.to_s+"(通知标题)", news_path(activity), :class=> "postGrey", :style=>"word-break:break-all" %>
    diff --git a/app/views/users/_course_poll.html.erb b/app/views/users/_course_poll.html.erb index 01991d379..26e928dbf 100644 --- a/app/views/users/_course_poll.html.erb +++ b/app/views/users/_course_poll.html.erb @@ -5,7 +5,7 @@ <%= link_to image_tag(url_to_avatar(activity.user), :width => "90", :height => "90"), user_path(activity.user_id), :alt => "用户头像" %>
    -
    +
    <% if activity.try(:user).try(:realname) == ' ' %> <%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %> <% else %> @@ -15,13 +15,13 @@ <%= link_to Course.find(activity.polls_group_id).name.to_s+"(课程名称)", course_path(activity.polls_group_id), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
    -
    +
    时间:<%= format_date(activity.created_at) %>
    -
    (问卷描述)<%=activity.polls_description.to_s%>
    +
    (问卷描述)<%=activity.polls_description.to_s%>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -12,7 +12,7 @@ <% end %> TO <%= link_to activity.project.name.to_s+"(项目名称)", project_path(activity.project), :class => "newsBlue ml15", :style=>"word-break:break-all" %>
    -
    +
    <%= link_to activity.subject.to_s+"(缺陷标题)", issue_path(activity), :class => "postGrey", :style=>"word-break:break-all" %> <%=activity.status.name %>
    diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index d9b87926c..652f18fd1 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -4,7 +4,7 @@ <%= link_to image_tag(url_to_avatar(activity.author), :width => "90", :height => "90"), user_path(activity.author_id), :alt => "用户头像" %>
    -
    +
    <% if activity.try(:author).try(:realname) == ' ' %> <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> <% else %> @@ -14,16 +14,17 @@ <%= link_to activity.project.name.to_s+"(项目讨论区)", project_path(activity.project), :class => "newsBlue ml15 mr5", :style=>"word-break:break-all"%>
    -
    +
    <% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe+"(讨论区内容)", project_boards_path(Board.where('id=?',activity.board_id).first.project_id), :class=> "postGrey", :style=>"word-break:break-all" %> + <%= link_to activity.subject.to_s.html_safe+"(讨论区标题)", project_boards_path(activity.project,: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+"(讨论区内容)", project_boards_path(Board.where('id=?',activity.board_id).first.project_id), :class=> "postGrey", :style=>"word-break:break-all"%> + <%= link_to activity.parent.subject.to_s.html_safe+"(讨论区标题)", project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%> <% end %>
    时间:<%= format_date(activity.created_on) %>
    +
    (描述)<%= activity.content.html_safe %>
    <% 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.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.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_message.html.erb b/app/views/users/_project_message.html.erb index 652f18fd1..ef7f9eada 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -16,9 +16,9 @@
    <% if activity.parent_id.nil? %> - <%= link_to activity.subject.to_s.html_safe+"(讨论区标题)", project_boards_path(activity.project,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all" %> + <%= link_to activity.subject.to_s.html_safe+"(帖子标题)", project_boards_path(activity.project,: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+"(讨论区标题)", project_boards_path(activity.project,: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+"(帖子标题)", project_boards_path(activity.project,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey", :style=>"word-break:break-all"%> <% end %>
    From 049e27f15f4266697f916b582d973379f070906f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Aug 2015 17:29:47 +0800 Subject: [PATCH 78/86] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 34 ++++++++- app/helpers/users_helper.rb | 12 +++ .../users/_user_homework_attachment.html.erb | 74 ++++++++----------- app/views/users/_user_homework_form.html.erb | 30 ++------ app/views/users/user_homeworks.html.erb | 2 +- config/routes.rb | 3 +- public/javascripts/new_user.js | 47 ++++++++---- public/stylesheets/new_user.css | 17 +++++ 8 files changed, 134 insertions(+), 85 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 591404687..5e9485d89 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -45,7 +45,7 @@ class UsersController < ApplicationController :activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index, :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist, :user_resource,:user_resource_create,:user_resource_delete,:rename_resource,:search_user_course,:add_exist_file_to_course, - :search_user_project,:resource_preview,:resource_search,:add_exist_file_to_project,:user_messages,:edit_brief_introduction] + :search_user_project,:resource_preview,:resource_search,:add_exist_file_to_project,:user_messages,:edit_brief_introduction,:user_new_homework] #edit has been deleted by huang, 2013-9-23 before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, @@ -314,6 +314,38 @@ class UsersController < ApplicationController end end + def user_new_homework + if params[:homework_common] + homework = HomeworkCommon.new + homework.name = params[:homework_common][:name] + homework.description = params[:homework_common][:description] + homework.end_time = params[:homework_common][:end_time] + homework.publish_time = Time.now + homework.homework_type = 1 + homework.late_penalty = 0 + homework.user_id = User.current.id + homework.course_id = params[:course_id] + + homework.save_attachments(params[:attachments]) + render_attachment_warning_if_needed(homework) + + #匿评作业相关属性 + homework_detail_manual = HomeworkDetailManual.new + homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 + homework_detail_manual.comment_status = 1 + homework_detail_manual.evaluation_start = Time.now + homework_detail_manual.evaluation_end = Time.now + homework_detail_manual.evaluation_num = params[:evaluation_num] + homework_detail_manual.absence_penalty = 0 + homework.homework_detail_manual = homework_detail_manual + + if homework.save + homework_detail_manual.save if homework_detail_manual + redirect_to user_homeworks_user_path(User.current.id) + end + end + end + include CoursesHelper def user_courses diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 342ee70be..ebfd9f881 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -537,4 +537,16 @@ module UsersHelper end end + #获取指定用户作为老师的课程 + def get_as_teacher_courses user + type = [] + user.courses.select{|c| user.allowed_to?(:as_teacher,c)}.each do |course| + option = [] + option << course.name + option << course.id + type << option + end + type + end + end diff --git a/app/views/users/_user_homework_attachment.html.erb b/app/views/users/_user_homework_attachment.html.erb index 9e198a762..eafa9cf0d 100644 --- a/app/views/users/_user_homework_attachment.html.erb +++ b/app/views/users/_user_homework_attachment.html.erb @@ -1,4 +1,4 @@ -
    +
    <% if defined?(container) && container && container.saved_attachments %> <% container.attachments.each_with_index do |attachment, i| %> @@ -10,8 +10,8 @@ <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> - <% end %> - <% container.saved_attachments.each_with_index do |attachment, i| %> + <% end %> + <% container.saved_attachments.each_with_index do |attachment, i| %> <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%> <%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %> @@ -20,46 +20,34 @@ <%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %> <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> - <% end %> -<% end %> - - <% project = project %> - - <%= button_tag l(:button_browse), :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn', :style => ie8? ? 'display:none' : '' %> - <%= file_field_tag 'attachments[dummy][file]', - :id => '_file', - :class => ie8? ? '' : 'file_selector', - :multiple => true, - :onchange => 'addInputFiles(this);', - :style => ie8? ? '' : 'display:none', - :data => { - :max_file_size => Setting.attachment_max_size.to_i.kilobytes, - :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js',:project =>project), - :description_placeholder => l(:label_optional_description), - :field_is_public => l(:field_is_public), - :are_you_sure => l(:text_are_you_sure), - :file_count => l(:label_file_count), - :delete_all_files => l(:text_are_you_sure_all) - } %> - - <%= l(:label_no_file_uploaded)%> - - (<%= l(:label_max_size) %>: - <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) - - - <% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> - <% end %> + <% end %> + <% end %> + + <%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => ie8? ? '' : 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => ie8? ? '' : 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js',:project =>nil), + :description_placeholder => l(:label_optional_description), + :field_is_public => l(:field_is_public), + :are_you_sure => l(:text_are_you_sure), + :file_count => l(:label_file_count), + :delete_all_files => l(:text_are_you_sure_all) + } %>
    +
    + - - - - - - - \ No newline at end of file +<% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> +<% end %> \ No newline at end of file diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index ad6f0fa2f..90fa51715 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -2,22 +2,16 @@
    +

    导入作业
    - + <%= calendar_for('homework_end_time')%>
    - - - - - - -
    @@ -32,27 +26,17 @@
    - + + <%= select_tag :course_id,options_for_select(get_as_teacher_courses(User.current),homework.course_id), {:class => "InputBox W700 SearchIcon"} %>
    -
    - <%= render :partial => 'attachments/new_form', :locals => {:container => homework} %> -
    -
    + <%= render :partial => 'users/user_homework_attachment', :locals => { :container => homework } %> -
    - 上传附件 - 资源库 - 发送 +
    + 发送 取消
    -
    - - - - -
    \ No newline at end of file diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index 48666a0cb..c322c4582 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -20,7 +20,7 @@
    发布作业
    <% homework = HomeworkCommon.new %> - <%= labelled_form_for homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %> + <%= labelled_form_for homework,:url => user_new_homework_users_path,:method => "post" do |f| %> <%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %> <% end%>
    diff --git a/config/routes.rb b/config/routes.rb index 2c75f9862..cd540c77e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -307,6 +307,7 @@ RedmineApp::Application.routes.draw do resources :users do collection do match "tag_saveEx" , :via => [:get, :post] + post "user_new_homework" end member do match 'user_projects_index', :to => 'users#user_projects_index', :via => :get @@ -325,7 +326,7 @@ RedmineApp::Application.routes.draw do match 'user_visitorlist', :to => 'users#user_visitorlist', :via => :get match 'user_homeworks', :to => 'users#user_homeworks', :via => :get match 'watch_projects', :to => 'users#watch_projects', :via => :get - + # # added by bai match 'show_score', :to => 'users#show_score', :via => :get match 'topic_score_index', :to => 'users#topic_score_index', :via => [:get, :post] diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 42a1271cd..2b6b94eae 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -54,19 +54,34 @@ function show_more_project(url){ } ); } -// -//$(function(){ -// $(".newsType").mouseover(function(){ -// $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px -25px no-repeat"}); -// }); -// $(".newsType").mouseout(function(){ -// $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px 0px no-repeat"}); -// }); -// $(".resourcesSelected").mouseover(function(){ -// $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px -25px no-repeat"}); -// }); -// $(".resourcesSelected").mouseout(function(){ -// $(".resourcesIcon").css({background:"url(images/resource_icon_list.png) 0px 0px no-repeat"}); -// }); -//}); -//个人动态 end \ No newline at end of file + +//老师提交 新建/修改 作业 +function submit_homework(id) +{ + if(!regex_homework_name()) + { + $("#homework_name").focus(); + } + else + { + homework_description_editor.sync(); + $("#"+id).submit(); + } +} + +//验证新建作业的名字 +function regex_homework_name() +{ + var name = $.trim($("#homework_name").val()); + + if(name=="") + { + $("#homework_name_span").text("名称不能为空"); + return false; + } + else + { + $("#homework_name_span").text(""); + return true; + } +} \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index d2ee3d7f9..6544da428 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -857,6 +857,23 @@ img.ui-datepicker-trigger { .calendar_input{border-left:none !important;border-bottom: none!important; border-top: none!important; border-right: 1px solid #d9d9d9;} .calendar_div{border: 1px solid #d9d9d9;} +#attachments_fields input.filename { + border: 0; + height: 1.8em; + max-width: 670px; + color: #7f7f7f; + background-color: inherit; + background: url(../images/pic_file.png) 0 3px no-repeat; + padding-left: 18px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + margin-bottom: 3px; +} +.description{display: none !important;} +.ispublic-label{display: none !important;} +.is_public_checkbox{display: none !important;} + From afeaecc478c626fdecad7b10eeb5e0e1f7a29b37 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Aug 2015 17:37:53 +0800 Subject: [PATCH 79/86] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_list.html.erb | 3 ++- app/views/users/user_homeworks.html.erb | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb index 6476f9e71..7998128e0 100644 --- a/app/views/users/_user_homework_list.html.erb +++ b/app/views/users/_user_homework_list.html.erb @@ -30,7 +30,8 @@ <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %>
    - <% if is_teacher%> + <%# if is_teacher%> + <% if false%>
    • diff --git a/app/views/users/user_homeworks.html.erb b/app/views/users/user_homeworks.html.erb index c322c4582..0191dca7f 100644 --- a/app/views/users/user_homeworks.html.erb +++ b/app/views/users/user_homeworks.html.erb @@ -24,6 +24,14 @@ <%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %> <% end%>
    + +<%else%> +
    +
    +
    作业
    +
    +
    +
    <% end%> <%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => @homework_commons,:page => 0} %> From 5b9c9312f54e83edb1b99751c6823ff1c1d45412 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Aug 2015 17:42:02 +0800 Subject: [PATCH 80/86] =?UTF-8?q?=E7=95=99=E8=A8=80=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_newfeedback.html.erb | 2 +- db/schema.rb | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/users/user_newfeedback.html.erb b/app/views/users/user_newfeedback.html.erb index 13b4524ba..b8c5b106d 100644 --- a/app/views/users/user_newfeedback.html.erb +++ b/app/views/users/user_newfeedback.html.erb @@ -24,7 +24,7 @@ -