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 01/14] =?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 65b5b467d440bd99793a9c6726c8575c41e6a8b2 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 26 Aug 2015 16:50:26 +0800 Subject: [PATCH 02/14] =?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 03/14] =?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 2124b3c3924b7673bcde2006c233c1a1ef174c15 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 26 Aug 2015 17:02:54 +0800 Subject: [PATCH 04/14] =?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 06/14] =?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) %>) - + <% 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) + } %> +
+
- <% content_for :header_tags do %> - <%= javascript_include_tag 'attachments' %> - <% end %> + - - - - - - - - \ 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 07/14] =?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 08/14] =?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 @@ -