-
- <%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search f_l",:remote=>true) do %>
- <%= text_field_tag 'name', params[:name], name: "name", :class => 're_schbox',:style=>"padding: 0px"%>
- <%= submit_tag "课内搜索", :class => "re_schbtn b_lblue",:name => "incourse",:id => "incourse", :onmouseover => "presscss('incourse')",:onmouseout =>"buttoncss()" %>
- <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %>
+
+
+ <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
<% html_title(l(:label_attachment_plural)) -%>
\ No newline at end of file
diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb
index f04d70577..08e23fb19 100644
--- a/app/views/files/_course_list.html.erb
+++ b/app/views/files/_course_list.html.erb
@@ -1,79 +1,90 @@
-<% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
-
-
共有 <%= all_attachments.count%> 个资源
-
- <% if order == "asc" %>
- 按 <%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
- <%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
- <%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
- <% else %>
- 按 <%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"created_on"} %> /
- <%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"downloads"} %> /
- <%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'files/arrow_show',locals: { sort: sort,order:order,current:"quotes"} %> 排序
- <% end %>
-
-
-
-
-
- <%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course,:tag_name => @tag_name}%>
-
-
-
+<% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
<% curse_attachments.each do |file| %>
<% if file.is_public? || User.current.member_of_course?(course) || User.current.admin? %>
-
-
- <%= link_to truncate(file.filename,length: 35, omission: '...'),
- download_named_attachment_path(file.id, file.filename),
- :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
- <% if User.current.logged? %>
- <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
- <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
+
+
+
+ <%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
+
+
+
+ <%= link_to truncate(file.filename,length: 35, omission: '...'),
+ download_named_attachment_path(file.id, file.filename),
+ :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkBlue f_14 f_b" %>
+ <%= file_preview_eye(file, class: 'preview') %>
+
+ <% if file.is_public? == false%>
+ 私有
+ <%end %>
+
+
+
+
上传时间:<%= format_date(file.created_on)%>
+ <% if file.tag_list.length > 0%>
+
上传类型:<%= file.tag_list[0] %>
+ <% end %>
+
文件大小:<%= number_to_human_size(file.filesize) %>
+
下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %>
+
+
+
+
+ <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
+ <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
+
+
+
+
+ -
+ <% if User.current.logged? %>
- <% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
- <% if @course.is_public? %>
-
- <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %>
-
- <% else %>
-
- 私有
-
- <% end %>
+ <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
+ <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
+
- <% else %>
-
- <% end %>
- <% else %>
- <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
- <% end %>
- <%= file_preview_tag(file, class: 'f_l re_open') %>
- <% else %>
- <% end %>
-
-
-
-
文件大小:<%= number_to_human_size(file.filesize) %>
- <%= link_to( l(:button_delete), attachment_path(file),
- :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course"%>
-
<%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %>
-
-
-
-
- <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
- <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
-
-
-
+
<%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}')") %>
+
<%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %>
+ <% if @course.is_public? %>
+
+
+ <%= link_to (file.is_public? ? "设为私有":"设为公开"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"postOptionLink",:method => :post %>
+
+
+ <%end%>
+
+ <%= link_to( '删除资源', attachment_path(file),
+ :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "postOptionLink") if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" && file.destroyable %>
+
+
+
+ <% end %>
+ <%else%>
+
+ - <%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}')") %>
+
+ <% end %>
+ <% end %>
+
+
+
+
+
+
+
+
+
<% else %>
<%= file.filename %>是私有资源
<% end %>
<% end %>
-
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
-
-
+
+<% if curse_attachments.count == 10%>
+ <% if params[:action] == 'search' %>
+ <%=link_to "点击展开更多", search_course_files_path({:course_id => course.id,:page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
+ <%else%>
+
+ <%=link_to "点击展开更多", course_files_path({:course_id => course.id,:page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
+ <%end%>
+<% end%>
+
diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb
index 3d1ded552..f9c6c1666 100644
--- a/app/views/files/_tag_yun.html.erb
+++ b/app/views/files/_tag_yun.html.erb
@@ -8,12 +8,12 @@
<% tag_list.each do |k,v|%>
<% if tag_name && tag_name == k%>
-
<%= k%>(<%= v%>)
+
<%= k%> x<%= v%>
<% else%>
<%= k%>(<%= v%>)
+ ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%> x<%= v%>
<% end%>
<% end%>
<% end%>
\ No newline at end of file
diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb
index 8b199ab4e..383ea155e 100644
--- a/app/views/files/index.html.erb
+++ b/app/views/files/index.html.erb
@@ -1,12 +1,18 @@
-
+
<% if @container_type == 0 %>
- <%= render :partial => 'project_file_new', locals: {project: @project} %>
+
+ <%= render :partial => 'project_file_new', locals: {project: @project} %>
+
<% elsif @container_type == 1 %>
- <%= render :partial => 'course_file', locals: {course: @course} %>
+
+ <%= render :partial => 'course_file', locals: {course: @course} %>
+
<% elsif @container_type == 2 %>
- <%= render :partial => 'files/subfield_files', locals: {org_subfield: @org_subfield} %>
+
+ <%= render :partial => 'files/subfield_files', locals: {org_subfield: @org_subfield} %>
+
<% end %>
-
+
diff --git a/app/views/files/index.js.erb b/app/views/files/index.js.erb
new file mode 100644
index 000000000..e4f38f7d9
--- /dev/null
+++ b/app/views/files/index.js.erb
@@ -0,0 +1,4 @@
+
+<% if @course %>
+$("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
+<%end %>
\ No newline at end of file
diff --git a/app/views/files/search.js.erb b/app/views/files/search.js.erb
index 50f46d2f5..fd88b3f9e 100644
--- a/app/views/files/search.js.erb
+++ b/app/views/files/search.js.erb
@@ -1 +1,6 @@
-$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");
\ No newline at end of file
+<% if (@obj_pages &&( @obj_pages.page > 1)) || (@feedback_pages && (@feedback_pages.page > 1)) %> //搜索的时候有时候是需要加载下一页,有时候是直接替换当前 #course_list。这个根据 page来判定
+ $("#show_more_attachments").replaceWith("<%= escape_javascript( render :partial => 'files/course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach} )%>");
+<% else %>
+ $("#course_list").html("<%= escape_javascript(render :partial => 'files/course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");
+ $("#attachment_count").html("<%= @result.count%>")
+<% end %>
\ No newline at end of file
diff --git a/app/views/files/search_tag_attachment.js.erb b/app/views/files/search_tag_attachment.js.erb
index 50f46d2f5..4b1e9734d 100644
--- a/app/views/files/search_tag_attachment.js.erb
+++ b/app/views/files/search_tag_attachment.js.erb
@@ -1 +1,2 @@
-$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");
\ No newline at end of file
+$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>");
+$("#attachment_count").html("<%= @result.count%>")
\ No newline at end of file
diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb
index 808e80239..8599ad750 100644
--- a/app/views/layouts/base_org.html.erb
+++ b/app/views/layouts/base_org.html.erb
@@ -13,7 +13,7 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','courses','org' %>
- <%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','org'%>
+ <%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
<%= javascript_include_tag 'attachments' %>
<%= call_hook :view_layouts_base_html_head %>
@@ -120,19 +120,21 @@
-
- <%= link_to '文章', organization_org_document_comments_path(@organization) %>
- <% if User.current.logged? %>
- (
- <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %>
- )
- <% end %>
- |
- <%= link_to '成员', members_organization_path(@organization.id) %>
- <% if User.current.logged? %>
- (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>)
- <% end %>
-
+ <% if User.current.logged? %>
+
+ <%= link_to '文章', organization_org_document_comments_path(@organization) %>
+ <% if User.current.logged? %>
+ (
+ <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %>
+ )
+ <% end %>
+ |
+ <%= link_to '成员', members_organization_path(@organization.id) %>
+ <% if User.current.logged? %>
+ (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>)
+ <% end %>
+
+ <% end %>
- <% if @topic.author.id == User.current.id%>
+ <% if User.current.logged? %>
-
- -
- <%= link_to(
- l(:button_edit),
- {:action => 'edit', :id => @topic},
- :class => 'postOptionLink'
- ) if @message.course_editable_by?(User.current) %>
-
- -
- <%= link_to(
- l(:button_delete),
- {:action => 'destroy', :id => @topic},
- :method => :post,
- :data => {:confirm => l(:text_are_you_sure)},
- :class => 'postOptionLink'
- ) if @message.course_destroyable_by?(User.current) %>
- <%#= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
-
+ <% if @topic.author.id == User.current.id %>
+ -
+ <%= link_to(
+ l(:button_edit),
+ {:action => 'edit', :id => @topic},
+ :class => 'postOptionLink'
+ ) if @message.course_editable_by?(User.current) %>
+
+ -
+ <%= link_to(
+ l(:button_delete),
+ {:action => 'destroy', :id => @topic},
+ :method => :post,
+ :data => {:confirm => l(:text_are_you_sure)},
+ :class => 'postOptionLink'
+ ) if @message.course_destroyable_by?(User.current) %>
+
+ <% end %>
+ - <%= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
diff --git a/app/views/messages/_org_subfield_show.html.erb b/app/views/messages/_org_subfield_show.html.erb
new file mode 100644
index 000000000..304694b39
--- /dev/null
+++ b/app/views/messages/_org_subfield_show.html.erb
@@ -0,0 +1,200 @@
+<%= content_for(:header_tags) do %>
+ <%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
+<% end %>
+
+
+
+
+
+
+
+ <%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
+
+
+ <% if @message.org_subfield_editable_by?(User.current) %>
+
+
+ -
+
+ -
+ <%= link_to(
+ l(:button_edit),
+ {:action => 'edit', :id => @topic},
+ :class => 'postOptionLink'
+ ) if @message.org_subfield_editable_by?(User.current) %>
+
+ -
+ <%= link_to(
+ l(:button_delete),
+ {:action => 'destroy', :id => @topic},
+ :method => :post,
+ :data => {:confirm => l(:text_are_you_sure)},
+ :class => 'postOptionLink'
+ ) if @message.org_subfield_editable_by?(User.current) %>
+
+
+
+
+
+
+ <%end%>
+
+
+
+
+ <% if @topic.try(:author).try(:realname) == ' ' %>
+ <%= link_to @topic.try(:author), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
+ <% else %>
+ <%= link_to @topic.try(:author).try(:realname), user_path(@topic.author,:host=>Setting.host_user), :class => "linkBlue2", :target=> "_blank" %>
+ <% end %>
+
+
<%= format_time( @topic.created_on)%>
+
+
+ <%= @topic.content.html_safe%>
+
+
+
+ <%= link_to_attachments_course @topic, :author => false %>
+
+
+
+
+
+
+ <% unless @replies.empty? %>
+
+
回复(<%=@reply_count %>)
+
+
+
+
+ <% @replies.each_with_index do |reply,i| %>
+
+
+
+ <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
+
+
+
+ <% if reply.try(:author).try(:realname) == ' ' %>
+ <%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
+ <% end %>
+
+
+ <%= reply.content.html_safe%>
+
+
+ <%= format_time(reply.created_on) %>
+
+
+
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+ <% if !@topic.locked? && authorize_for_course('messages', 'reply') %>
+
+
+
+
+ <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
+ <%= render :partial => 'form_course', :locals => {:f => f, :replying => true} %>
+ <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'course_board_canel_message_replay();', :class => "blue_btn grey_btn fr c_white mt10 mr5" %>
+ <%= link_to l(:button_submit), "javascript:void(0)", :onclick => 'course_board_submit_message_replay();', :class => "blue_btn fr c_white mt10", :style => "margin-left: 50px;" %>
+ <% end %>
+
+
+
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/messages/_project_show.html.erb b/app/views/messages/_project_show.html.erb
index bd2e3469a..e5aba7c02 100644
--- a/app/views/messages/_project_show.html.erb
+++ b/app/views/messages/_project_show.html.erb
@@ -92,132 +92,136 @@
showNormalImage('message_description_<%= @topic.id %>');
});
-
-
-
- <%= link_to image_tag(url_to_avatar(@topic.author),:width=>50,:height => 50,:alt=>'图像' ),user_path(@topic.author) %>
-
-
- <% if @topic.author.id == User.current.id%>
-
-
- -
-
- -
- <%= link_to(l(:button_edit), {:action => 'edit', :id => @topic}, :class => 'postOptionLink') if @message.editable_by?(User.current) %>
-
- -
- <%= link_to(l(:button_delete), {:action => 'destroy', :id => @topic},:method => :post,
- :data => {:confirm => l(:text_are_you_sure)},
- :class => 'postOptionLink'
- ) if @message.destroyable_by?(User.current) %>
- <%#= link_to "发送",messages_join_org_subfield_path(:message_id => @topic.id) , :remote=> true,:class => 'postOptionLink' %>
-
-
-
-
-
- <%end%>
-