From bca503f17128ca60ddb787f141bc8be3b6a12c08 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 25 Dec 2015 17:07:27 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E5=A1=AB=E5=86=99=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 3 ++- .../student_work/_programing_work_show.html.erb | 16 ++++++++++++++-- .../student_work/_revise_attachment.html.erb | 14 +++++++++++--- app/views/student_work/_show.html.erb | 16 ++++++++++++++-- .../student_work/_upload_attachment.html.erb | 11 +++++++++-- public/stylesheets/courses.css | 1 + 6 files changed, 51 insertions(+), 10 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 5cb646c8e..9319c4db2 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -649,7 +649,8 @@ class StudentWorkController < ApplicationController if revise_attachments.count == 2 revise_attachments.last.destroy end - #@attachment = @work.attachments.where("attachtype = 7").order("created_on desc").first + attachment = @work.attachments.where("attachtype = 7").first + attachment.update_attributes(:description => params[:description]) respond_to do |format| format.js end diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 880be0ffa..f7ecb0ccf 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -115,8 +115,20 @@ $('#ajax-modal').parent().addClass("resourceUploadPopup"); $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); } - function submit_files(){ - $("#upload_form").submit(); + function regex_des() { + if ($.trim($("#attachment_des").val()) == "") { + $("#hint_message").text("附件描述不能为空"); + $("#hint_message").css('color','#ff0000'); + return false; + } else { + $("#hint_message").text(""); + return true; + } + } + function submit_revise_files(){ + if (regex_des()) { + $("#upload_form").submit(); + } } function closeModal(){ hideModal($(".uploadBoxContainer")); diff --git a/app/views/student_work/_revise_attachment.html.erb b/app/views/student_work/_revise_attachment.html.erb index 4d85b1813..2279856da 100644 --- a/app/views/student_work/_revise_attachment.html.erb +++ b/app/views/student_work/_revise_attachment.html.erb @@ -7,8 +7,12 @@
追加附件: <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %> - 追加时间:<%=format_time revise_attachment.created_on.to_s %>  (<%=revise_attachment_status @homework,revise_attachment %>) + 追加时间:<%=format_time revise_attachment.created_on.to_s %>  (<%=revise_attachment_status @homework,revise_attachment %>)
+ <% unless revise_attachment.description == "" %> + 附件描述:

<%=revise_attachment.description %>

+ <% end %>
+
<% end %> <% if work.user == User.current %>
@@ -18,10 +22,14 @@
追加附件: <%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %> - 追加时间:<%=format_time revise_attachment.created_on.to_s %> + 追加时间:<%=format_time revise_attachment.created_on.to_s %>
+ <% unless revise_attachment.description == "" %> + 附件描述:

<%=revise_attachment.description %>

+ <% end %>
<% end %> -
+
+ <% end %> diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index f92614e10..662ddece4 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -113,8 +113,20 @@ $('#ajax-modal').parent().addClass("resourceUploadPopup"); $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); } - function submit_files(){ - $("#upload_form").submit(); + function regex_des() { + if ($.trim($("#attachment_des").val()) == "") { + $("#hint_message").text("附件描述不能为空"); + $("#hint_message").css('color','#ff0000'); + return false; + } else { + $("#hint_message").text(""); + return true; + } + } + function submit_revise_files(){ + if (regex_des()) { + $("#upload_form").submit(); + } } function closeModal(){ hideModal($(".uploadBoxContainer")); diff --git a/app/views/student_work/_upload_attachment.html.erb b/app/views/student_work/_upload_attachment.html.erb index d9c69fc17..02f05c4df 100644 --- a/app/views/student_work/_upload_attachment.html.erb +++ b/app/views/student_work/_upload_attachment.html.erb @@ -9,7 +9,7 @@
- + 选择文件 <%= file_field_tag 'attachments[dummy][file]', :id => '_file', @@ -37,9 +37,16 @@
最多只能上传一个小于50MB的附件
+
+ +
+
+

+
- <%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %> + 确定 + <%#= submit_tag '确定',:onclick=>'submit_revise_files();',:onfocus=>'this.blur()',:id=>'upload_files_submit_btn',:class=>'sendSourceText' %>
取消 diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index b07e93701..86586243d 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1227,6 +1227,7 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat; .mb10 {margin-bottom: 10px} .mb15 {margin-bottom: 15px} div.disable_link {background-color: #c1c1c1 !important;} +.reUploadDetail{border:1px solid #dddddd; float:left; resize:none; width:400px; height:80px; overflow-y:auto;outline: none;} /*新课程资源库*/ .reCon{ margin:5px; width:710px;} From 8ed01bf572f6338e8cf6362001ee12d5b0a6e0de Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 25 Dec 2015 17:16:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?issue=E5=88=97=E8=A1=A8=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/_list.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 5945fece4..52f6570da 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -41,7 +41,7 @@ <% end %> <% if issues.count == 10%> - <%= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> + <%= link_to "点击展开更多",project_issues_path({:project_id => project.id,:page => issue_pages.page}.merge(params)),:id => "show_more_issues",:remote => "true",:class => "loadMore mt10 f_grey"%> <% end%> From e3b395960c7089a16efb8cc7c51367ed2ffa5354 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 25 Dec 2015 17:46:45 +0800 Subject: [PATCH 3/5] =?UTF-8?q?base64=E7=9A=84+=E5=8F=B7=E8=A6=81=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 2a4430935..d66c6a30d 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -17,6 +17,7 @@ class ZipdownController < ApplicationController begin if params[:base64file] file = Base64.decode64(params[:base64file]) + file = file.sub('*', '+') send_file "#{OUTPUT_FOLDER}/#{file}", :filename => filename_for_content_disposition(file), :type => detect_content_type(file) else send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => filename_for_content_disposition(params[:filename]), :type => detect_content_type(params[:file]) @@ -118,11 +119,15 @@ class ZipdownController < ApplicationController [{files:[out_file.file_path], count: 1, index: 1, real_file: out_file.file_path, file: File.basename(out_file.file_path), - base64file: Base64.encode64(File.basename(out_file.file_path)), + base64file: encode64(File.basename(out_file.file_path)), size:(out_file.pack_size / 1024.0 / 1024.0).round(2) }] end + def encode64(str) + Base64.encode64(str).sub('+', '*') + end + def zip_homework_common homework_common bid_homework_path = [] digests = [] @@ -142,7 +147,7 @@ class ZipdownController < ApplicationController [{files:[out_file.file_path], count: 1, index: 1, real_file: out_file.file_path, file: File.basename(out_file.file_path), - base64file: Base64.encode64(File.basename(out_file.file_path)), + base64file: encode64(File.basename(out_file.file_path)), size:(out_file.pack_size / 1024.0 / 1024.0).round(2) }] end From cd36a6874ed96a4f3db7c4157cd731d9f9226d1c Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Dec 2015 18:03:32 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9issue=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E9=94=99=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_project_issue.html.erb | 1 + public/stylesheets/public.css | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index 7767fedc7..cd9704186 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -81,6 +81,7 @@ <%= format_time(attachment.created_on) %>
+
<% end %> <% end %>
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 7047316c6..5f2fc0820 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -581,7 +581,8 @@ a.postReplyCancel:hover {color:#ffffff;} .homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} .table_maxWidth table {max-width: 642px;} .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;} -.homepagePostAssignTo {float:left; font-size:14px; color:#15bccf; height:30px; line-height:30px; vertical-align:middle;} +.homepagePostAssignTo {float:left; font-size:14px; color:#15bccf;} +.homepagePostAssignToAct {float:left; font-size:14px; color:#15bccf;} .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;} .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;} .postAttSize {color:#888888; font-size:12px; margin-left: 5px;} From d2f56693b426635692b439b880e3ec272170ed44 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 25 Dec 2015 19:02:26 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E6=8A=A5404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index d82a9de8a..fb381e8ea 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -439,6 +439,7 @@ RedmineApp::Application.routes.draw do post '/courses/:id/course_activity', :to => 'courses#show', :as => 'course_activity' get '/boards/:id/boards_topic', :to =>'boards#show', :as => 'boards_topic' match 'courses/:course_id/news/index', :to => 'news#index', :via => [:get, :post], :as => 'new_course_news' + match 'courses/:course_id/news/new', :to => 'news#new', :via => [:get, :post] #added by young resources :users do