diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 057d962c8..1cd5b0f15 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -1,3 +1,4 @@ +#encoding: utf-8 # Redmine - project management software # Copyright (C) 2006-2013 Jean-Philippe Lang # @@ -378,6 +379,8 @@ class FilesController < ApplicationController tag_name = l(:label_media) when "4" tag_name = l(:label_code) + when "6" + tag_name = "论文" else tag_name = "" end diff --git a/app/views/files/_attachement_list.html.erb b/app/views/files/_attachement_list.html.erb index 4c631d22f..01e5dca5f 100644 --- a/app/views/files/_attachement_list.html.erb +++ b/app/views/files/_attachement_list.html.erb @@ -1,26 +1,4 @@ -
- -<% 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 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')%> - <%= if attachment.id.nil? - #待补充代码 - else - link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') - end - %> - <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> - <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> - - <% end %> -<% end %> - -
<% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%> <% if @course %> @@ -68,3 +46,29 @@ (<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) +
+ +
+ +<% 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 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')%> + <%= if attachment.id.nil? + #待补充代码 + else + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') + end + %> + <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> + + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> +<% end %> + +
+
\ No newline at end of file diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 8283e15b7..4176b72d0 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -26,6 +26,9 @@ case 4: $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 4}) %>'); break; + case 6: + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 6}) %>'); + break; default: $('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {:course => @course,:course_attachment_type => 5}) %>'); } @@ -77,6 +80,7 @@ 软件 |  媒体 |  代码 |  + 论文 |  其他

<% end %> diff --git a/app/views/files/_new_style_attachment_list.html.erb b/app/views/files/_new_style_attachment_list.html.erb new file mode 100644 index 000000000..022486413 --- /dev/null +++ b/app/views/files/_new_style_attachment_list.html.erb @@ -0,0 +1,71 @@ +<% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%> + +<% if @course %> + <%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => ie8? ? '':'file_selector', + :multiple => true, + :onchange => 'addInputFilesCourseSource(this,"'+ checkBox.to_s+'");', + :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'), + :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) + } %> +<% else %> + <%= 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'), + :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) + } %> +<% end %> + + + + + <%= l(:label_no_file_uploaded)%> + +(<%= l(:label_max_size) %>: +<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) +
+
+ +<% 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 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')%> + <%= if attachment.id.nil? + #待补充代码 + else + link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') + end + %> + <%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %> + + <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> + + <% end %> +<% end %> + +
\ No newline at end of file diff --git a/app/views/files/_upload_course_files.erb b/app/views/files/_upload_course_files.erb new file mode 100644 index 000000000..62d5c68e4 --- /dev/null +++ b/app/views/files/_upload_course_files.erb @@ -0,0 +1,42 @@ + +
+
+

<%= l(:label_upload_files)%>

+
+ <%= error_messages_for 'attachment' %> + + + <%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> + + +
+ 课件 |  + 软件 |  + 媒体 |  + 代码 |  + 论文 |  + 其他 +
+
+
+ <%= render :partial => 'files/new_style_attachment_list',:locals => {:course => course} %> +
+
+ <%= l(:button_cancel)%> + <%= l(:button_confirm)%> + + <% end %> +
+ +
+ <% content_for :header_tags do %> + <%= javascript_include_tag 'attachments' %> + <% end %> +
+ + \ No newline at end of file diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb index e11a4bf38..21cd94d8d 100644 --- a/app/views/files/_upload_show.html.erb +++ b/app/views/files/_upload_show.html.erb @@ -1,7 +1,7 @@ -
+
-

<%= l(:label_upload_files)%>

+

<%= l(:label_upload_files)%>

<%= error_messages_for 'attachment' %> diff --git a/app/views/files/_upload_show_project.html.erb b/app/views/files/_upload_show_project.html.erb index 25a03b347..8223f071e 100644 --- a/app/views/files/_upload_show_project.html.erb +++ b/app/views/files/_upload_show_project.html.erb @@ -1,16 +1,16 @@ -
+
-

<%= l(:label_upload_files)%>

+

<%= l(:label_upload_files)%>

<%= error_messages_for 'attachment' %> <%= form_tag(project_files_path(project), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> - <%= render :partial => 'attachement_list',:locals => {:project => project} %> + <%= render :partial => 'files/attachement_list',:locals => {:project => project} %>
- <%= l(:button_cancel)%> + <%= l(:button_cancel)%> <%= l(:button_confirm)%> <% end %>
diff --git a/app/views/files/create.js.erb b/app/views/files/create.js.erb index 81810344e..f24d60811 100644 --- a/app/views/files/create.js.erb +++ b/app/views/files/create.js.erb @@ -22,7 +22,7 @@ $("#attachments_fields").children().remove(); $("#upload_file_count").text("未上传文件"); $('#upload_file_div').slideToggle('slow'); <% if @project %> - closeModal(); + hideModal(); $("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>'); $("#project_files_count_info").html("<%= @all_attachments.count%>"); $("#project_files_count_nav").html("(<%= @all_attachments.count%>)") diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb index 305187b02..fd25fc224 100644 --- a/app/views/layouts/_new_feedback.html.erb +++ b/app/views/layouts/_new_feedback.html.erb @@ -26,7 +26,7 @@ <%#= l(:label_technical_support) %> -

请加入师姐答疑群

173184401

+

请加入师姐师姐答疑群

173184401

diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 98e8f378d..39de4faeb 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -138,7 +138,10 @@
123
diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index 1f4fabde5..e51683295 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -34,7 +34,8 @@ <%= link_to "(#{attaments_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %> <% end %> <% if User.current.member_of?(@project) %> - <%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %> + <%#= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %> + +上传资源 <% end %>
<% end %> diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js index 329d0db5a..685699064 100644 --- a/public/javascripts/attachments.js +++ b/public/javascripts/attachments.js @@ -37,27 +37,27 @@ function addFile_board(inputEl, file, eagerUpload, id) { fileSpan.append( $('', { 'type': 'text', - 'class': 'filename readonly', + 'class': 'upload_filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly' }).val(file.name), - $('', { - 'type': 'text', - 'class': 'description', - 'name': 'attachments[' + attachmentId + '][description]', - 'maxlength': 254, - 'placeholder': $(inputEl).data('descriptionPlaceholder') - }).toggle(!eagerUpload), - $('' + $(inputEl).data('fieldIsPublic') + ':').attr({ - 'class': 'ispublic-label' - }), - $('', { - 'type': 'checkbox', - 'class': 'is_public_checkbox', - 'value': 1, - 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', - checked: 'checked' - }).toggle(!eagerUpload), +// $('', { +// 'type': 'text', +// 'class': 'description', +// 'name': 'attachments[' + attachmentId + '][description]', +// 'maxlength': 254, +// 'placeholder': $(inputEl).data('descriptionPlaceholder') +// }).toggle(!eagerUpload), +// $('' + $(inputEl).data('fieldIsPublic') + ':').attr({ +// 'class': 'ispublic-label' +// }), +// $('', { +// 'type': 'checkbox', +// 'class': 'is_public_checkbox', +// 'value': 1, +// 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', +// checked: 'checked' +// }).toggle(!eagerUpload), $(' ').attr({ 'href': "#", 'class': 'remove-upload', @@ -103,27 +103,27 @@ function addFile(inputEl, file, eagerUpload) { fileSpan.append( $('', { 'type': 'text', - 'class': 'filename readonly', + 'class': 'upload_filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly' }).val(file.name), - $('', { - 'type': 'text', - 'class': 'description', - 'name': 'attachments[' + attachmentId + '][description]', - 'maxlength': 254, - 'placeholder': $(inputEl).data('descriptionPlaceholder') - }).toggle(!eagerUpload), - $('' + $(inputEl).data('fieldIsPublic') + ':').attr({ - 'class': 'ispublic-label' - }), - $('', { - 'type': 'checkbox', - 'class': 'is_public_checkbox', - 'value': 1, - 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', - checked: 'checked' - }).toggle(!eagerUpload), +// $('', { +// 'type': 'text', +// 'class': 'description', +// 'name': 'attachments[' + attachmentId + '][description]', +// 'maxlength': 254, +// 'placeholder': $(inputEl).data('descriptionPlaceholder') +// }).toggle(!eagerUpload), +// $('' + $(inputEl).data('fieldIsPublic') + ':').attr({ +// 'class': 'ispublic-label' +// }), +// $('', { +// 'type': 'checkbox', +// 'class': 'is_public_checkbox', +// 'value': 1, +// 'name': 'attachments[' + attachmentId + '][is_public_checkbox]', +// checked: 'checked' +// }).toggle(!eagerUpload), $(' ').attr({ 'href': "#", 'class': 'remove-upload' @@ -532,17 +532,17 @@ function addFileCourseSource(inputEl, file, eagerUpload,checkBox) { fileSpan.append( $('', { 'type': 'text', - 'class': 'filename readonly', + 'class': 'upload_filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly' }).val(file.name), - $('', { - 'type': 'text', - 'class': 'description', - 'name': 'attachments[' + attachmentId + '][description]', - 'maxlength': 254, - 'placeholder': $(inputEl).data('descriptionPlaceholder') - }).toggle(!eagerUpload), +// $('', { +// 'type': 'text', +// 'class': 'description', +// 'name': 'attachments[' + attachmentId + '][description]', +// 'maxlength': 254, +// 'placeholder': $(inputEl).data('descriptionPlaceholder') +// }).toggle(!eagerUpload), $('
', { 'class': 'div_attachments', 'name': 'div_' + 'attachments_' + attachmentId diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 5612a774e..e4b31c61c 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -552,7 +552,7 @@ blockquote {background: #e8e8e8;padding: 10px;margin-bottom: 5px;word-break: bre #attachments_fields input.description {margin-left: 4px;width: 100px;} #attachments_fields span.ispublic-label {display: inline-block;width: 30px;margin-left: 10px;} a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;margin-left: 5px;} -#attachments_fields input.filename {border: 0;height: 1.8em;width: 150px;color: #555;background-color: inherit;background: url(../images/attachment.png) no-repeat 1px 50%;padding-left: 18px;padding-top: 2px; white-space: nowrap; text-overflow:ellipsis;} +#attachments_fields input.filename {border: 0;height: 1.8em;color: #555;background-color: inherit;background: url(../images/attachment.png) no-repeat 1px ;padding-left: 18px;padding-top: 2px; white-space: nowrap; } span.add_attachment {font-size: 80%;line-height: 2.5em;} #attachments_fields span {display: block;white-space: nowrap;} .file_selector{position: relative;opacity: 0;filter: alpha(opacity:0);} @@ -570,7 +570,7 @@ a.remove-upload:hover {text-decoration:none !important;} .attachments_fields span.ispublic-label {display: inline-block;width: 30px;margin-left: 10px;} a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;margin-left: 5px;} -.attachments_fields input.filename {border: 0;height: 1.8em;width: 150px;color: #555;background-color: inherit;background: url(../images/attachment.png) no-repeat 1px 50%;padding-left: 18px;padding-top: 2px;} +.attachments_fields input.filename {border: 0;height: 1.8em;color: #555;background-color: inherit;background: url(../images/attachment.png) no-repeat 1px ;padding-left: 18px;padding-top: 2px;} span.add_attachment {font-size: 80%;line-height: 2.5em;} .attachments_fields span {display: block;white-space: nowrap;} .file_selector{position: relative;opacity: 0;filter: alpha(opacity:0);} @@ -889,6 +889,7 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f .c_w{ color:#fff;} .filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} +.upload_filename{ background: url(../images/pic_file.png) 0 -20px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .evaluation{position: relative;} .evaluation_submit{position: absolute;right: 0px;bottom: 0px;} .student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; } diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index f753b191b..8b3c8f3ce 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1144,6 +1144,7 @@ img.ui-datepicker-trigger { text-overflow: ellipsis; margin-bottom: 3px; } +.upload_filename{ background: url(../images/pic_file.png) 0 -25px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;} .message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);} diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 2623fe65e..4594d0c51 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -369,7 +369,7 @@ span.add_attachment {font-size: 80%;line-height: 2.5em;} #attachments_fields .ajax-loading input.filename {background:url(../images/loading.gif) no-repeat 0px 50%;} .reply_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #ccc; color:#999; border-radius:3px; padding:2px 10px; margin-bottom:10px;display: block;margin-left: 470px;} .reply_btn:hover{ background:#999; color:#fff; } - +.upload_filename{ background: url(../images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 370px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .attachments_fields input.description {margin-left:4px; width:100px; } .attachments_fields span .boldSpan{display:block; white-space:nowrap; font-family:'微软雅黑';} .attachments_fields div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; }