From 7a28a65807257391786f755d8521f096a632ef2d Mon Sep 17 00:00:00 2001 From: cxt Date: Sun, 6 Sep 2015 17:40:55 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E7=BC=BA=E9=99=B7=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_poll.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_course_poll.html.erb b/app/views/users/_course_poll.html.erb index bde8de90d..0b91a6ed3 100644 --- a/app/views/users/_course_poll.html.erb +++ b/app/views/users/_course_poll.html.erb @@ -1,6 +1,6 @@ <% has_commit = has_commit_poll?(activity.id ,User.current)%> <% poll_name = activity.polls_name.empty? ? l(:label_poll_new) : activity.polls_name%> -<% if has_commit || activity.user_id == User.current %> +<% if ( activity.polls_status==2) %>
From 216bc7f70f6c4855c3530797d35e6756eee9c135 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Sun, 6 Sep 2015 22:59:27 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=8A=A8=E6=80=81=E4=B8=AD=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E7=9A=84=E6=8F=90=E4=BA=A4=E7=8A=B6=E6=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 3 +++ app/helpers/application_helper.rb | 14 ++++++++++++++ app/views/users/_course_homework.html.erb | 2 +- public/javascripts/homework.js | 10 ++++++++-- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 01671daf9..a690b224b 100644 --- a/Gemfile +++ b/Gemfile @@ -42,6 +42,9 @@ group :development, :test do gem 'pry-byebug' end gem 'pry-stack_explorer' + if RUBY_PLATFORM =~ /darwin/ + gem 'puma' + end end gem 'rspec-rails', '~> 3.0' diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2f210f466..f4a70117f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2334,6 +2334,20 @@ module ApplicationHelper end end end + #动态列表中,确定学生是该提交还是进列表 + def student_work_activity_submit_status(opt={}) + default_opt = {class: 'c_blue'}.merge(opt) + + is_teacher = User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true) + + homework = default_opt[:homework] + work = cur_user_works_for_homework homework + if work.nil? && !is_teacher + link_to "提交("+homework.student_works.count.to_s+")", new_student_work_path(:homework => homework.id), :class=> default_opt[:class] + else + link_to "提交("+homework.student_works.count.to_s+")", student_work_index_path(:homework => homework.id), :class=> default_opt[:class] + end + end #根据传入作业确定显示为编辑作品还是新建作品,或者显示作品数量 def user_for_homework_common homework,is_teacher diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index f29512b0e..516365f81 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -17,7 +17,7 @@
- <%= link_to "提交("+activity.student_works.count.to_s+")", student_work_index_path(:homework => activity.id), :class=> "c_blue" %> + <%= student_work_activity_submit_status(homework: activity) %>
截止时间:<%= activity.end_time.to_s %>
diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index 6813f90af..e38a53197 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -42,7 +42,7 @@ $(function(){ data.index = $('.ProResultTop').length+1; } - if (typeof cb == 'function') {cb(); return;} + if (typeof cb == 'function') {cb(data); return;} var html=bt('t:result-list',data); @@ -74,7 +74,13 @@ $(function(){ } if (!tested) { - test_program(function(){ + test_program(function(data){ + if (data.status!=0) { + var r=confirm("测试不通过,是否强制提交?"); + if (!r) { + return; + } + }; $(".HomeWorkCon form").submit(); }); return; From d667e6359c93562d56392a1476e17118bfcb76ed Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 7 Sep 2015 11:12:04 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index ec38d5c1d..3b5b88ee7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150906083453) do +ActiveRecord::Schema.define(:version => 20150906091045) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -476,13 +476,6 @@ ActiveRecord::Schema.define(:version => 20150906083453) 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 @@ -913,6 +906,7 @@ ActiveRecord::Schema.define(:version => 20150906083453) 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" @@ -1421,6 +1415,7 @@ ActiveRecord::Schema.define(:version => 20150906083453) do t.integer "container_id" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "user_id" end create_table "user_extensions", :force => true do |t| From aa0c0dab8366fa8493cad57abc6efde8e2247c6c Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 7 Sep 2015 15:01:08 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E2=80=9C=E6=88=91?= =?UTF-8?q?=E7=9A=84=E5=8A=A8=E6=80=81=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 6 ++- app/models/course_activity.rb | 1 + app/views/users/show.html.erb | 1 + ...07064144_add_user_id_to_user_activities.rb | 5 +++ .../20150907064547_update_user_activities.rb | 40 +++++++++++++++++++ db/schema.rb | 2 +- 6 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20150907064144_add_user_id_to_user_activities.rb create mode 100644 db/migrate/20150907064547_update_user_activities.rb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 859f19f19..d7cf29387 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -800,11 +800,13 @@ class UsersController < ApplicationController @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) + when "current_user" + @user_activities = UserActivity.where("user_id = #{User.current.id} and ((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) 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) + @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 - @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) + @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 @type = params[:type] diff --git a/app/models/course_activity.rb b/app/models/course_activity.rb index 284687870..103796a72 100644 --- a/app/models/course_activity.rb +++ b/app/models/course_activity.rb @@ -19,6 +19,7 @@ class CourseActivity < ActiveRecord::Base user_activity.act_type = self.course_act_type user_activity.container_type = "Course" user_activity.container_id = self.course_id + user_activity.user_id = self.user_id user_activity.save end end diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 92f3f4a1a..13f2518e1 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -29,6 +29,7 @@
    • 更多
    • +
    • <%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeAll postTypeGrey"%>
    • <%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
  • diff --git a/db/migrate/20150907064144_add_user_id_to_user_activities.rb b/db/migrate/20150907064144_add_user_id_to_user_activities.rb new file mode 100644 index 000000000..a038f4dab --- /dev/null +++ b/db/migrate/20150907064144_add_user_id_to_user_activities.rb @@ -0,0 +1,5 @@ +class AddUserIdToUserActivities < ActiveRecord::Migration + def change + add_column :user_activities, :user_id, :int + end +end diff --git a/db/migrate/20150907064547_update_user_activities.rb b/db/migrate/20150907064547_update_user_activities.rb new file mode 100644 index 000000000..b4c56c009 --- /dev/null +++ b/db/migrate/20150907064547_update_user_activities.rb @@ -0,0 +1,40 @@ +class UpdateUserActivities < ActiveRecord::Migration + def up + count = UserActivity.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + UserActivity.page(i).per(30).each do |activity| + if activity.container_type.to_s == 'Project' + forge_activity = ForgeActivity.where("forge_act_type = '#{activity.act_type.to_s}' and forge_act_id = #{activity.act_id}").first + if forge_activity + activity.user_id = forge_activity.user_id + else + activity.user_id = 0 + end + + elsif activity.container_type.to_s == 'Course' + course_activity = CourseActivity.where("course_act_type = '#{activity.act_type.to_s}' and course_act_id = #{activity.act_id}").first + if course_activity + activity.user_id = course_activity.user_id + else + activity.user_id = 0 + end + end + activity.save + end + end + end + end + + def down + count = UserActivity.all.count / 30 + 2 + transaction do + for i in 1 ... count do i + UserActivity.page(i).per(30).each do |activity| + activity.user_id = nil + activity.save + end + end + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 3b5b88ee7..db0b57ae8 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150906091045) do +ActiveRecord::Schema.define(:version => 20150907064547) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false From a159af813959d9b3b7ca9d04264bdf6d7e817572 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 7 Sep 2015 15:20:18 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E9=A1=B9=E7=9B=AE--=E9=82=80=E8=AF=B7--?= =?UTF-8?q?=E5=8F=91=E9=80=81=E9=82=AE=E4=BB=B6=E9=82=80=E8=AF=B7=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=AF=B9=E8=BE=93=E5=85=A5=E7=9A=84=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=88=A4=E6=96=AD=EF=BC=8C=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/invite_members_by_mail.html.erb | 18 +++++++++++++----- public/stylesheets/public.css | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/views/projects/invite_members_by_mail.html.erb b/app/views/projects/invite_members_by_mail.html.erb index 4c6ee47d8..8c951a485 100644 --- a/app/views/projects/invite_members_by_mail.html.erb +++ b/app/views/projects/invite_members_by_mail.html.erb @@ -24,16 +24,24 @@ if(email == "") { $("#valid_email").text("<%= l(:label_input_email_blank)%>"); + return false; } - else if (filter.test(email)) { - $("#valid_email").html(""); - return true; + else if(!filter.test(email)) + { + $("#valid_email").text("<%= l(:label_email_format_error)%>"); + return false; + } + else if(email.split('@')[0].length >= 20) + { + $("#valid_email").text("邮箱名过长,最长为20个字符"); + return false; } else { - $("#valid_email").text("<%= l(:label_email_format_error)%>"); + $("#valid_email").text(""); + return true; } - return false; + } function senderEmail(obj) diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 4cc859721..2288c4994 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -418,6 +418,8 @@ div.flash.notice { background-color: #dfffdf; border-color: #9fcf9f; color: #005f00; + word-wrap: break-word; + word-break: break-all } div.flash.warning, .conflict { From 61281af4971073013ad1f59cc025170e61e5b2a6 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 7 Sep 2015 15:30:11 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E6=9C=80=E8=BF=91=E7=99=BB=E5=BD=95=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=97=E8=A1=A8=E7=9A=84=E7=99=BB=E5=BD=95=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=B2=BE=E7=A1=AE=E5=88=B0=E5=88=86=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/latest_login_users.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/latest_login_users.html.erb b/app/views/admin/latest_login_users.html.erb index 89514726a..c438dcebd 100644 --- a/app/views/admin/latest_login_users.html.erb +++ b/app/views/admin/latest_login_users.html.erb @@ -54,7 +54,7 @@ <%=@count %> - <%=format_date(user.last_login_on) %> + <%=format_time(user.last_login_on) %> <%=user.id %> From 6bcaf01fe26f537fbb4088d13f9f3618d3ac133e Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Mon, 7 Sep 2015 16:01:19 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E6=A1=86=E6=A0=B7=E5=BC=8F=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_resource_share_for_project_popup.html.erb | 6 +++--- app/views/users/_resource_share_popup.html.erb | 6 +++--- public/stylesheets/new_user.css | 4 ++-- public/stylesheets/public_new.css | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/users/_resource_share_for_project_popup.html.erb b/app/views/users/_resource_share_for_project_popup.html.erb index 482569297..40bbd5e7c 100644 --- a/app/views/users/_resource_share_for_project_popup.html.erb +++ b/app/views/users/_resource_share_for_project_popup.html.erb @@ -30,11 +30,11 @@
    <% if !projects.empty? %> <% projects.each do |project| %> -
      -
    • +
        +
      • -
      • <%= project.name%>
      • +
      • <%= project.name%>
      <% end %>
    diff --git a/app/views/users/_resource_share_popup.html.erb b/app/views/users/_resource_share_popup.html.erb index 219402cbf..ed2ed44a6 100644 --- a/app/views/users/_resource_share_popup.html.erb +++ b/app/views/users/_resource_share_popup.html.erb @@ -30,11 +30,11 @@
    <% if !courses.empty? %> <% courses.each do |course| %> -
      -
    • +
        +
      • -
      • <%= course.name%>
      • +
      • <%= truncate(course.name,:lendght=>25) + '['+course.time.to_s+course.term + ']'%>
      <% end %>
    diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index f8000f674..539e9ce54 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -410,9 +410,9 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; .searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;} .searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -18px no-repeat; display:inline-block; float:left;} .searchIconPopup:hover {cursor: pointer} -.courseSend {width:260px; height:15px; line-height:15px; margin-bottom:10px;} +.courseSend {width:390px; height:15px; line-height:15px; margin-bottom:10px;display:block;white-space:nowrap;} .courseSendCheckbox {padding:0px; margin:0px; width:12px; height:12px; margin-right:10px; display:inline-block; margin-top:2px;} -.sendCourseName {font-size:12px; color:#5f6060;} +.sendCourseName {font-size:12px; color:#5f6060;display:inline-block} .courseSendSubmit {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#269ac9; margin-right:25px; float:left;cursor: pointer;} .courseSendSubmit:hover {background-color:#297fb8;} .courseSendCancel {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#c1c1c1; float:left} diff --git a/public/stylesheets/public_new.css b/public/stylesheets/public_new.css index ec7ec26a1..15650bc65 100644 --- a/public/stylesheets/public_new.css +++ b/public/stylesheets/public_new.css @@ -572,7 +572,7 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; .searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(images/resource_icon_list.png) -40px -18px no-repeat; display:inline-block; float:left;} .courseSend {width:260px; height:15px; line-height:15px; margin-bottom:10px;} .courseSendCheckbox {padding:0px; margin:0px; width:12px; height:12px; margin-right:10px; display:inline-block; margin-top:2px;} -.sendCourseName {font-size:12px; color:#5f6060;} +.sendCourseName {font-size:12px; color:#5f6060;display:inline-block} .courseSendSubmit {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#64bdd9; margin-right:25px; float:left;} .courseSendCancel {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#c1c1c1; float:left} a.sendSourceText {font-size:14px; color:#ffffff;} From 32b2d4f8740c6371a85c800101ec6965d6916108 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 7 Sep 2015 17:38:31 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=9B=BE=E7=89=87=E5=8D=B3=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A4=A7=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 16 +++++++- public/stylesheets/new_user.css | 53 +++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 3a6eac49d..8b9acb36e 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -130,4 +130,18 @@
    <% end %>
    - \ No newline at end of file + + \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index f8000f674..33a3d8413 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1001,3 +1001,56 @@ a:hover.tijiao{ background:#0f99a9;} .about_project{ overflow:hidden;display:none;} .project_r_h{ width:670px; height:40px; background:#eaeaea; margin-bottom:10px;} .project_r_h02{ width:920px; height:40px; background:#eaeaea; margin-bottom:10px;} + +/* colorbox +*******************************************************************************/ +/* + Colorbox Core Style: + The following CSS is consistent between example themes and should not be altered. +*/ +#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxWrapper {max-width:none;} +#cboxOverlay{position:fixed; width:100%; height:100%;} +#cboxMiddleLeft, #cboxBottomLeft{clear:left;} +#cboxContent{position:relative;} +#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;} +#cboxTitle{margin:0;} +#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;} +#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} +.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;} +.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;} +#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;} + +/* + User Style: + Change the following styles to modify the appearance of Colorbox. They are + ordered & tabbed in a way that represents the nesting of the generated HTML. +*/ +#cboxOverlay{background:#fff;} +#colorbox{outline:0;} +#cboxTopLeft{width:25px; height:25px; background:url(../images/colorbox/border1.png) no-repeat 0 0;} +#cboxTopCenter{height:25px; background:url(../images/colorbox/border1.png) repeat-x 0 -50px;} +#cboxTopRight{width:25px; height:25px; background:url(../images/colorbox/border1.png) no-repeat -25px 0;} +#cboxBottomLeft{width:25px; height:25px; background:url(../images/colorbox/border1.png) no-repeat 0 -25px;} +#cboxBottomCenter{height:25px; background:url(../images/colorbox/border1.png) repeat-x 0 -75px;} +#cboxBottomRight{width:25px; height:25px; background:url(../images/colorbox/border1.png) no-repeat -25px -25px;} +#cboxMiddleLeft{width:25px; background:url(../images/colorbox/border2.png) repeat-y 0 0;} +#cboxMiddleRight{width:25px; background:url(../images/colorbox/border2.png) repeat-y -25px 0;} +#cboxContent{background:#fff; overflow:hidden;} +.cboxIframe{background:#fff;} +#cboxError{padding:50px; border:1px solid #ccc;} +#cboxLoadedContent{margin-bottom:20px;} +#cboxTitle{position:absolute; bottom:0px; left:0; text-align:center; width:100%; color:#999;} +#cboxCurrent{position:absolute; bottom:0px; left:100px; color:#999;} +#cboxLoadingOverlay{background:#fff url(../images/colorbox/loading.gif) no-repeat 5px 5px;} + +/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */ +#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; } + +/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */ +#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;} + +#cboxSlideshow{position:absolute; bottom:0px; right:42px; color:#444;} +#cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;} +#cboxNext{position:absolute; bottom:0px; left:63px; color:#444;} +#cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;} \ No newline at end of file From a29d004fdc02cfdcb2bf15a3c4d217f4745d4579 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 8 Sep 2015 08:45:29 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E7=94=A8=E6=88=B7=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- db/schema.rb | 104 +++++----------------------- 2 files changed, 18 insertions(+), 88 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 859f19f19..656b61f5f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -298,7 +298,7 @@ class UsersController < ApplicationController def user_homeworks if User.current == @user @page = params[:page] ? params[:page].to_i + 1 : 0 - user_course_ids = "(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" + user_course_ids = @user.courses.empty? ? "(-1)" :"(" + @user.courses.visible.map{|course| course.id}.join(",") + ")" @homework_commons = HomeworkCommon.where("course_id in #{user_course_ids}").order("created_at desc").limit(10).offset(@page * 10) respond_to do |format| format.js diff --git a/db/schema.rb b/db/schema.rb index ec38d5c1d..48c5bcea5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150906083453) do +ActiveRecord::Schema.define(:version => 20150906091723) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -211,58 +211,6 @@ ActiveRecord::Schema.define(:version => 20150906083453) do add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true - create_table "code_review_assignments", :force => true do |t| - t.integer "issue_id" - t.integer "change_id" - t.integer "attachment_id" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.string "action_type" - t.integer "changeset_id" - end - - create_table "code_review_project_settings", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "updated_by" - t.boolean "hide_code_review_tab", :default => false - t.integer "auto_relation", :default => 1 - t.integer "assignment_tracker_id" - t.text "auto_assign" - t.integer "lock_version", :default => 0, :null => false - t.boolean "tracker_in_review_dialog", :default => false - end - - create_table "code_review_user_settings", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "mail_notification", :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table "code_reviews", :force => true do |t| - t.integer "project_id" - t.integer "change_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "line" - t.integer "updated_by_id" - t.integer "lock_version", :default => 0, :null => false - t.integer "status_changed_from" - t.integer "status_changed_to" - t.integer "issue_id" - t.string "action_type" - t.string "file_path" - t.string "rev" - t.string "rev_to" - t.integer "attachment_id" - t.integer "file_count", :default => 0, :null => false - t.boolean "diff_all" - end - create_table "comments", :force => true do |t| t.string "commented_type", :limit => 30, :default => "", :null => false t.integer "commented_id", :default => 0, :null => false @@ -476,13 +424,6 @@ ActiveRecord::Schema.define(:version => 20150906083453) 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 @@ -1169,18 +1110,18 @@ ActiveRecord::Schema.define(:version => 20150906083453) do create_table "relative_memos", :force => true do |t| t.integer "osp_id" t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false + t.string "subject", :null => false + t.text "content", :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + t.integer "replies_count", :default => 0 t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 t.string "url" t.string "username" t.string "userhomeurl" @@ -1205,19 +1146,6 @@ ActiveRecord::Schema.define(:version => 20150906083453) do add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" - create_table "rich_rich_files", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "rich_file_file_name" - t.string "rich_file_content_type" - t.integer "rich_file_file_size" - t.datetime "rich_file_updated_at" - t.string "owner_type" - t.integer "owner_id" - t.text "uri_cache" - t.string "simplified_type", :default => "file" - end - create_table "roles", :force => true do |t| t.string "name", :limit => 30, :default => "", :null => false t.integer "position", :default => 1 @@ -1269,11 +1197,10 @@ ActiveRecord::Schema.define(:version => 20150906083453) do t.string "url" t.string "title" t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "project_id" t.integer "user_id" - t.string "description" end create_table "softapplications", :force => true do |t| @@ -1434,8 +1361,8 @@ ActiveRecord::Schema.define(:version => 20150906083453) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "technical_title" t.integer "identity" + t.string "technical_title" t.string "student_id" t.string "teacher_realname" t.string "student_realname" @@ -1503,6 +1430,9 @@ ActiveRecord::Schema.define(:version => 20150906083453) do t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "level" + t.integer "file" + t.integer "issue" end create_table "user_statuses", :force => true do |t|