From 5d2bb4ccbdafedbab3ac6d206c375284bfe5a39e Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 13 May 2014 10:30:15 +0800
Subject: [PATCH 1/6] =?UTF-8?q?1.=E9=80=89=E6=8B=A9=E5=AD=A6=E6=A0=A1?=
=?UTF-8?q?=E8=BF=9B=E5=85=A5=E5=AD=A6=E6=A0=A1=E8=AF=BE=E7=A8=8B=E5=88=97?=
=?UTF-8?q?=E8=A1=A8=EF=BC=8C=E7=82=B9=E5=87=BB=E6=9B=B4=E5=A4=9A=E7=94=B1?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=89=80=E6=9C=89=E8=AF=BE=E7=A8=8B=E5=8F=AF?=
=?UTF-8?q?=E8=83=BD=E6=94=B9=E4=B8=BA=E6=98=BE=E7=A4=BA=E5=BD=93=E5=89=8D?=
=?UTF-8?q?=E5=AD=A6=E6=A0=A1=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=EF=BC=8C?=
=?UTF-8?q?=E4=B9=8B=E5=90=8E=E6=8E=92=E5=BA=8F=E4=B9=9F=E4=B8=80=E6=A0=B7?=
=?UTF-8?q?=202.=E5=BD=93=E6=9F=A5=E8=AF=A2=E5=AD=A6=E6=A0=A1=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E5=88=97=E8=A1=A8=E4=B8=BA=E7=A9=BA=E6=97=B6=EF=BC=8C?=
=?UTF-8?q?=E6=8E=A8=E8=8D=90=E6=94=B9=E4=B8=BA=E6=9C=AC=E7=B3=BB=E7=BB=9F?=
=?UTF-8?q?=E4=B8=AD=E6=9C=AC=E5=B9=B4=E5=BA=A6=E5=BC=80=E8=AE=BE=E7=9A=84?=
=?UTF-8?q?=E6=9C=80=E5=A5=BD=E7=9A=84=E8=AF=BE=E7=A8=8B=EF=BC=8C=E5=90=8C?=
=?UTF-8?q?=E6=97=B6=E5=8A=A0=E5=85=A5=E8=AF=BE=E7=A8=8B=E6=94=B9=E4=B8=BA?=
=?UTF-8?q?=E5=85=B3=E6=B3=A8=E8=AF=BE=E7=A8=8B=E3=80=82=E6=AD=A4=E6=97=B6?=
=?UTF-8?q?=E7=82=B9=E5=87=BB=E6=9B=B4=E5=A4=9A=E6=9F=A5=E7=9C=8B=E7=9A=84?=
=?UTF-8?q?=E4=B8=BA=E6=89=80=E6=9C=89=E8=AF=BE=E7=A8=8B=203.=E6=9F=A5?=
=?UTF-8?q?=E8=AF=A2=E5=87=BA=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8=E5=B0=86?=
=?UTF-8?q?=E5=AD=A6=E6=A0=A1=E5=92=8C=E6=95=99=E5=B8=88=E6=94=BE=E5=9C=A8?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=B8=8A=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/projects_controller.rb | 2 +-
app/helpers/projects_helper.rb | 26 +-
app/helpers/welcome_helper.rb | 6 +
app/views/projects/course.html.erb | 2 +-
app/views/welcome/course.html.erb | 321 +++++++++++++------------
5 files changed, 185 insertions(+), 172 deletions(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index d26cf698e..a120394ef 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -198,7 +198,7 @@ class ProjectsController < ApplicationController
@project_type = params[:project_type]
@school_id = params[:school_id]
per_page_option = 10
- if @school_id == "0" or @school.nil?
+ if @school_id == "0" or @school_id.nil?
@projects_all = Project.active.visible.
joins("LEFT JOIN #{ProjectStatus.table_name} ON #{Project.table_name}.id = #{ProjectStatus.table_name}.project_id").
where("#{Project.table_name}.project_type = ? ", Project::ProjectType_course)
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 5bd677bdf..bddf9d0d4 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -62,33 +62,33 @@ module ProjectsHelper
content_tag('div', content, :class => "tabs_enterprise")
end
- def sort_course(state, project_type)
+ def sort_course(state, project_type, school_id)
content = ''.html_safe
case state
when 0
- content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type), :class=>"selected"), :class=>"selected")
- content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type)))
+ content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type), :school_id => school_id, :class=>"selected"), :class=>"selected")
+ content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
- content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type)))
+ content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
when 1
- content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type)))
- content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type), :class=>"selected"), :class=>"selected")
+ content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
+ content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id), :class=>"selected"), :class=>"selected")
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
- content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type)))
+ content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
when 2
- content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type)))
- content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type)))
+ content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
+ content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type), :class=>"selected"), :class=>"selected")
- content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type)))
+ content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id)))
#gcm
when 3
- content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type)))
- content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type)))
+ content << content_tag('li', link_to(l(:label_sort_by_time), course_path(:project_sort_type => '0', :project_type => project_type, :school_id => school_id)))
+ content << content_tag('li', link_to(l(:label_sort_by_active), course_path(:project_sort_type => '1', :project_type => project_type, :school_id => school_id)))
# content << content_tag('li', link_to(l(:label_sort_by_influence), course_path(:project_sort_type => '2', :project_type => project_type)))
- content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type), :class=>"selected"), :class=>"selected")
+ content << content_tag('li', link_to(l(:label_sort_by_activity), course_path(:project_sort_type => '3', :project_type => project_type, :school_id => school_id), :class=>"selected"), :class=>"selected")
end
#gcmend
diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb
index ed435fe6d..e05f789a9 100644
--- a/app/helpers/welcome_helper.rb
+++ b/app/helpers/welcome_helper.rb
@@ -154,6 +154,12 @@ module WelcomeHelper
sort_course_by_hot limit
end
+ def find_all_new_hot_course limit = 9
+ #sort_project_by_hot_rails 1, 'course_ac_para DESC', limit
+ time_now = Time.new.strftime("%Y");
+ Project.visible.joins(:project_status).where("#{Project.table_name}.project_type = ? and #{Project.table_name}.created_on like '%#{time_now}%'", 1).order("course_ac_para DESC").limit(limit).all
+ end
+
def find_all_hot_bid
sort_bid_by_hot
end
diff --git a/app/views/projects/course.html.erb b/app/views/projects/course.html.erb
index 1359b8bea..98228c168 100644
--- a/app/views/projects/course.html.erb
+++ b/app/views/projects/course.html.erb
@@ -30,7 +30,7 @@
<% end %>
-<%= sort_course(@s_type, @project_type)%>
+<%= sort_course(@s_type, @project_type, @school_id)%>
<%= render_project_hierarchy(@projects)%>
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index 286ff60d3..005f53710 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -1,197 +1,204 @@
<%= stylesheet_link_tag 'welcome' %>
<%= javascript_include_tag 'welcome' %>
-
- <%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
-
微信扫码
-
-
-
- <%= image_tag(@logoLink, size:'75x75') %>
+
+ <%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
+
微信扫码
+
+
+
+ <%= image_tag(@logoLink, size:'75x75') %>
-
-
-
+
+
+
<% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
- <% else%>
+ <% else%>
<% if params[:school_id] == "0" %>
- <% else %>
+ <% else %>
<% if params[:school_id].nil? %>
<%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course',:school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school',:method => 'get'}%>
-
+
<% else %>
<%= link_to School.find(params[:school_id]).name ,options={:action => 'course',:school_id => params[:school_id]}, html_options={:class => 'font_welcome_school',:method => 'get'}%>
-
+
<% end %>
<% end %>
<% end %>
- <%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %>
- <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
- , <%= l(:label_welcome_trustie_course_description) %>
- <% else %>
- <% if params[:school_id] == "0" %>
- , <%= l(:label_welcome_trustie_course_description) %>
- <% end %>
- <% end %>
-
-
- <%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%>
-
-
-
+
<%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_course) %>
+ <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
+
, <%= l(:label_welcome_trustie_course_description) %>
+ <% else %>
+ <% if params[:school_id] == "0" %>
+
, <%= l(:label_welcome_trustie_course_description) %>
+ <% end %>
+ <% end %>
+
+
+ <%= render :partial => "search_project", :locals => {:project_type => Project::ProjectType_course}%>
+
+
+
-
+
-
新开课程
-
<%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => params[:school_id]} %>
-
-
+
新开课程
+ <% if(find_miracle_course(10, 7,params[:school_id]).map.count == 0) %>
+
<%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => nil} %>
+
+
+
+ <% else %>
+
<%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => params[:school_id]} %>
+
+
+
+ <% find_miracle_course(10, 7,params[:school_id]).map do |project| %>
+ - >
+
+ <%= image_tag(get_course_avatar(project), :class => "avatar-4") %>
+
+
+
+
+ <% course = Course.find_by_extra(project.identifier) %>
+ <%= course.school.name.try(:gsub, /(.+)$/, '\1:') %>
+
+
+ <%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %>
+ <%#=course.try(:teacher).try(:name)%>
+
+
+
+ [<%= get_course_term project %>]
+ <%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
+ (<%= link_to "#{studentCount(project)}人", project_member_path(project, :role => 2) ,:course =>'1' %>)
+ <% files_count = (project.attachments.count.to_i+Version.joins(:project).where("projects.id=#{project.id}").count.to_i).to_s %>
+ (<%=link_to "#{files_count}份", project_files_path(project) %>资料)
+
+
+
+ <% if !course_endTime_timeout?(project)%>
+
+ <%= join_in_course(project, User.current)%>
+
+ <% end %>
+
+
+ <% end; reset_cycle %>
+
+
+ <% end %>
-
- 问题和反馈动态
- <%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
- <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
-
-
<%= link_to "更多>>", forums_path %>
-
-
- <% find_new_forum_topics(10).each do |topic|%>
- -
-
+
+ 问题和反馈动态
+ <%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
+ <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
+
+
<%= link_to "更多>>", forums_path %>
+
+
+ <% find_new_forum_topics(10).each do |topic|%>
+ -
+
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
-
- <%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前
+
+ <%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前
由 <%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);" %> 发表
- 回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)
-
-
- <% end %>
-
-
+
回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)
+
+
+ <% end %>
+
+
-
-
-
- 当前网站状态 |
- 活跃课程: <%=@courseCount%> |
- 高校: 2个 |
- 教师: <%=@teacherCount%> 名 |
- 学生: <%=@studentCount%> 名 |
- |
-
-
+
+
+
+ 当前网站状态 |
+ 活跃课程: <%=@courseCount%> |
+ 高校: 2个 |
+ 教师: <%=@teacherCount%> 名 |
+ 学生: <%=@studentCount%> 名 |
+ |
+
+
\ No newline at end of file
From 75f584a6e25b2f69891ac07aaf0538d3829c40ee Mon Sep 17 00:00:00 2001
From: nwb
Date: Tue, 13 May 2014 11:54:21 +0800
Subject: [PATCH 2/6] =?UTF-8?q?1.=E5=AE=8C=E6=88=90=E5=88=86=E7=B1=BB?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E4=B8=8B=E8=BD=BD=E8=A7=86=E5=9B=BE=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=202.=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=EF=BC=8C?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 21 +-
app/controllers/school_controller.rb | 2 +-
app/views/files/_show_all_attachment.html.erb | 61 +++
app/views/files/_show_by_attachtype.html.erb | 421 ------------------
app/views/files/_sort_by_attachtypel.html.erb | 57 +++
app/views/files/getattachtype.js.erb | 5 +
app/views/files/index.html.erb | 149 +------
app/views/files/show_by_attachtype.html.erb | 421 ------------------
config/routes.rb | 9 +-
9 files changed, 157 insertions(+), 989 deletions(-)
create mode 100644 app/views/files/_show_all_attachment.html.erb
delete mode 100644 app/views/files/_show_by_attachtype.html.erb
create mode 100644 app/views/files/_sort_by_attachtypel.html.erb
create mode 100644 app/views/files/getattachtype.js.erb
delete mode 100644 app/views/files/show_by_attachtype.html.erb
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index c67310f6f..075a54f65 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -19,8 +19,8 @@ class FilesController < ApplicationController
layout 'base_projects'#by young
menu_item :files
- before_filter :find_project_by_project_id
- before_filter :authorize
+ before_filter :find_project_by_project_id#, :except => [:getattachtype]
+ before_filter :authorize, :except => [:getattachtype]
helper :sort
include SortHelper
@@ -62,20 +62,21 @@ class FilesController < ApplicationController
redirect_to project_files_path(@project)
end
- def showbyattachtype
- sort_init 'created_on', 'desc'
- sort_update 'created_on' => "#{Attachment.table_name}.created_on",
+ # 返回制定资源类型的资源列表
+ def getattachtype
+ sort_init 'created_on', 'desc'
+ sort_update 'created_on' => "#{Attachment.table_name}.created_on",
'filename' => "#{Attachment.table_name}.filename",
'size' => "#{Attachment.table_name}.filesize",
'downloads' => "#{Attachment.table_name}.downloads"
-
+
@containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] #modify by Long Jun
@containers += @project.versions.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").all.sort
+
+ @attachtype = params[:type].to_i
- if @project.project_type == 1
- render :layout => 'base_courses'
- else
- render :layout => !request.xhr?
+ respond_to do |format|
+ format.js
end
end
end
diff --git a/app/controllers/school_controller.rb b/app/controllers/school_controller.rb
index b4f5b0468..b8fb7a6f6 100644
--- a/app/controllers/school_controller.rb
+++ b/app/controllers/school_controller.rb
@@ -23,7 +23,7 @@ class SchoolController < ApplicationController
end
end
-
+
def upload_logo
end
diff --git a/app/views/files/_show_all_attachment.html.erb b/app/views/files/_show_all_attachment.html.erb
new file mode 100644
index 000000000..c65f58cc5
--- /dev/null
+++ b/app/views/files/_show_all_attachment.html.erb
@@ -0,0 +1,61 @@
+<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
+
+
+
+
+
+
+
+
+
+
+ <%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%>
+ <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%>
+ <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%>
+ <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
+ <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %>
+ <%= sort_header_tag('operation', :caption => "", :scope =>"col", :id => "vzebra-children") %>
+
+
+
+ <% @containers.each do |container| %>
+ <% next if container.attachments.empty? -%>
+ <% if container.is_a?(Version) -%>
+
+
+ <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
+ |
+
+ <% end -%>
+ <% container.attachments.each do |file| %>
+ ">
+ <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> |
+ <%= format_time(file.created_on) %> |
+ <%= number_to_human_size(file.filesize) %> |
+ <%= file.attachmentstype.typeName %> |
+ <%= file.downloads %> |
+
+
+ <%= link_to(image_tag('delete.png'), attachment_path(file),
+ :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
+ |
+
+
+
+
+
+ |
+
+ <% end -%>
+ <% reset_cycle %>
+ <% end -%>
+
+
+
+
+
+
diff --git a/app/views/files/_show_by_attachtype.html.erb b/app/views/files/_show_by_attachtype.html.erb
deleted file mode 100644
index eedc90684..000000000
--- a/app/views/files/_show_by_attachtype.html.erb
+++ /dev/null
@@ -1,421 +0,0 @@
-
-<%isCategoryBrowser=true%>
-<% selAttachType =1%>
-<% attachmenttypes = @project.attachmenttypes %>
-
-
-
-<%=(@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区
-
-
- <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
-
-
-
-
-<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %>
-
-
-<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
-
-<%if !isCategoryBrowser%>
-
-
-
-
-
-
-
-
-
-
-
- <%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%>
- <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%>
- <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%>
- <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
- <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %>
- <%= sort_header_tag('operation', :caption => "", :scope =>"col", :id => "vzebra-children") %>
-
-
-
- <% @containers.each do |container| %>
- <% next if container.attachments.empty? -%>
- <% if container.is_a?(Version) -%>
-
-
- <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
- |
-
- <% end -%>
- <% container.attachments.each do |file| %>
- ">
- <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> |
- <%= format_time(file.created_on) %> |
- <%= number_to_human_size(file.filesize) %> |
- <%= file.attachmentstype.typeName %> |
- <%= file.downloads %> |
-
-
- <%= link_to(image_tag('delete.png'), attachment_path(file),
- :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
- |
-
-
-
-
-
- |
-
- <% end -%>
- <% reset_cycle %>
- <% end -%>
-
-
-
-
-
-
-
-<%else%>
-
-
-
-
-
-
-
-
-
-
-
- <%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%>
- <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%>
- <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%>
- <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
- <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %>
- <%= sort_header_tag('operation', :caption => "", :scope =>"col", :id => "vzebra-children") %>
-
-
-
- <% @containers.each do |container| %>
- <% next if container.attachments.empty? -%>
- <% container.attachments.each do |file| %>
- <% if file.attachtype==selAttachType%>
- ">
- <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> |
- <%= format_time(file.created_on) %> |
- <%= number_to_human_size(file.filesize) %> |
- <%= file.attachmentstype.typeName %> |
- <%= file.downloads %> |
-
-
- <%= link_to(image_tag('delete.png'), attachment_path(file),
- :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
- |
-
-
-
-
-
- |
-
- <% end -%>
- <% end -%>
- <% reset_cycle %>
- <% end -%>
-
-
-
-
-
-
-
-<%end%>
-<% html_title(l(:label_attachment_plural)) -%>
-
-
-
-<%inited=false%>
-
\ No newline at end of file
diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb
new file mode 100644
index 000000000..d07ed399c
--- /dev/null
+++ b/app/views/files/_sort_by_attachtypel.html.erb
@@ -0,0 +1,57 @@
+<% selAttachType =@attachtype%>
+<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
+
+
+
+
+
+
+
+
+
+
+
+ <%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%>
+ <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%>
+ <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%>
+ <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
+ <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %>
+ <%= sort_header_tag('operation', :caption => "", :scope =>"col", :id => "vzebra-children") %>
+
+
+
+ <% @containers.each do |container| %>
+ <% next if container.attachments.empty? -%>
+ <% container.attachments.each do |file| %>
+ <% if file.attachtype==selAttachType%>
+ ">
+ <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> |
+ <%= format_time(file.created_on) %> |
+ <%= number_to_human_size(file.filesize) %> |
+ <%= file.attachmentstype.typeName %> |
+ <%= file.downloads %> |
+
+
+ <%= link_to(image_tag('delete.png'), attachment_path(file),
+ :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
+ |
+
+
+
+
+
+ |
+
+ <% end -%>
+ <% end -%>
+ <% reset_cycle %>
+ <% end -%>
+
+
+
+
+
diff --git a/app/views/files/getattachtype.js.erb b/app/views/files/getattachtype.js.erb
new file mode 100644
index 000000000..4f13cc883
--- /dev/null
+++ b/app/views/files/getattachtype.js.erb
@@ -0,0 +1,5 @@
+ <% if @attachtype==0%>
+ $("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
+ <%else%>
+ $("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>');
+ <%end%>
diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb
index 0a367e7e2..490f74f94 100644
--- a/app/views/files/index.html.erb
+++ b/app/views/files/index.html.erb
@@ -1,6 +1,4 @@
-<%isCategoryBrowser=false%>
-<% selAttachType =1%>
<% attachmenttypes = @project.attachmenttypes %>
-
-
-<%=(@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区
-
-
- <%#= link_to(l(:label_attachment_new), 'javascript:void(0);', :onclick=>"$('#file_buttons').slideToggle();", :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
-
-
-
-
-<%= javascript_tag "observeSearchfield('attach_search', null, '#{ escape_javascript attachments_autocomplete_path(:project_id => @project.id, :format => 'js') }')" %>
-
-
-<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
-
-<%if !isCategoryBrowser%>
-
-
-
-
-
-
-
-
-
-
-
- <%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%>
- <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%>
- <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%>
- <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
- <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %>
- <%= sort_header_tag('operation', :caption => "", :scope =>"col", :id => "vzebra-children") %>
-
-
-
- <% @containers.each do |container| %>
- <% next if container.attachments.empty? -%>
- <% if container.is_a?(Version) -%>
-
-
- <%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
- |
-
- <% end -%>
- <% container.attachments.each do |file| %>
- ">
- <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> |
- <%= format_time(file.created_on) %> |
- <%= number_to_human_size(file.filesize) %> |
- <%= file.attachmentstype.typeName %> |
- <%= file.downloads %> |
-
-
- <%= link_to(image_tag('delete.png'), attachment_path(file),
- :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
- |
-
-
-
-
-
- |
-
- <% end -%>
- <% reset_cycle %>
- <% end -%>
-
-
-
-
-
-
-
-<%else%>
-
-
-
-
-
-
-
-
-
-
-
- <%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%>
- <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%>
- <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%>
- <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
- <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %>
- <%= sort_header_tag('operation', :caption => "", :scope =>"col", :id => "vzebra-children") %>
-
-
-
- <% @containers.each do |container| %>
- <% next if container.attachments.empty? -%>
- <% container.attachments.each do |file| %>
- <% if file.attachtype==selAttachType%>
- ">
- <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> |
- <%= format_time(file.created_on) %> |
- <%= number_to_human_size(file.filesize) %> |
- <%= file.attachmentstype.typeName %> |
- <%= file.downloads %> |
-
-
- <%= link_to(image_tag('delete.png'), attachment_path(file),
- :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
- |
-
-
-
-
-
- |
-
- <% end -%>
- <% end -%>
- <% reset_cycle %>
- <% end -%>
-
-
-
-
-
-
-
-<%end%>
-<% html_title(l(:label_attachment_plural)) -%>
-
-
-
-<%inited=false%>
-
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index d804e5b0c..a5dc322cf 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -19,7 +19,7 @@ RedmineApp::Application.routes.draw do
resources :no_uses
delete 'no_uses', :to => 'no_uses#delete'
- resources :apply_project_masters
+ resources :apply_project_masters
delete 'apply_project_masters', :to => 'apply_project_masters#delete'
@@ -299,7 +299,12 @@ RedmineApp::Application.routes.draw do
# issue form update
match 'issues/update_form', :controller => 'issues', :action => 'update_form', :via => [:put, :post], :as => 'issue_form'
- resources :files, :only => [:index, :new, :create,:showbyattachtype]
+ resources :files, :only => [:index, :new, :create] do
+ collection do
+ match "getattachtype" , via: [:get, :post]
+ #match 'getattachtype/:attachtype', :to => 'files#getattachtype', via: [:get, :post]
+ end
+ end
resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
collection do
From 79b498914a18963f157c733e86037ae70d8c6b72 Mon Sep 17 00:00:00 2001
From: nwb
Date: Tue, 13 May 2014 11:56:36 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/files/_sort_by_attachtypel.html.erb | 83 ++++++++++---------
1 file changed, 44 insertions(+), 39 deletions(-)
diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb
index d07ed399c..0544a4b66 100644
--- a/app/views/files/_sort_by_attachtypel.html.erb
+++ b/app/views/files/_sort_by_attachtypel.html.erb
@@ -1,51 +1,54 @@
-<% selAttachType =@attachtype%>
+<% selAttachType =@attachtype %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
- <%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%>
- <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%>
- <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%>
- <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
- <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %>
- <%= sort_header_tag('operation', :caption => "", :scope =>"col", :id => "vzebra-children") %>
+
+
+ <%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %>
+ <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
+ <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %>
+ <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %>
+ <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
+ <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
-
+
+
<% @containers.each do |container| %>
<% next if container.attachments.empty? -%>
<% container.attachments.each do |file| %>
- <% if file.attachtype==selAttachType%>
- ">
- <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> |
- <%= format_time(file.created_on) %> |
- <%= number_to_human_size(file.filesize) %> |
- <%= file.attachmentstype.typeName %> |
- <%= file.downloads %> |
-
-
- <%= link_to(image_tag('delete.png'), attachment_path(file),
- :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
- |
-
-
-
-
-
- |
-
+ <% if file.attachtype==selAttachType %>
+ ">
+ <%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> |
+ <%= format_time(file.created_on) %> |
+ <%= number_to_human_size(file.filesize) %> |
+ <%= file.attachmentstype.typeName %> |
+ <%= file.downloads %> |
+
+
+ <%= link_to(image_tag('delete.png'), attachment_path(file),
+ :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
+ |
+
+
+
+
+
+ |
+
<% end -%>
<% end -%>
<% reset_cycle %>
@@ -55,3 +58,5 @@
+
+
\ No newline at end of file
From 284e6ba20aa295a485502caaac69f8ac4aefc927 Mon Sep 17 00:00:00 2001
From: nwb
Date: Tue, 13 May 2014 15:49:14 +0800
Subject: [PATCH 4/6] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=95=B0=E6=8D=AE=202.=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90=E8=A7=86=E5=9B=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/models/attachment.rb | 24 +++++++++
app/models/attachmentstype.rb | 7 +++
app/models/project.rb | 8 +++
app/views/files/_show_all_attachment.html.erb | 5 +-
app/views/files/_sort_by_attachtypel.html.erb | 5 +-
app/views/files/index.html.erb | 46 ++++++++++++-----
config/environment.rb | 1 +
config/locales/en.yml | 5 +-
config/locales/zh.yml | 3 +-
.../20140508030039_create_attachmentstypes.rb | 6 +++
db/schema.rb | 50 ++++++++++++++++++-
11 files changed, 142 insertions(+), 18 deletions(-)
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index 6a62613bb..3bfd705f9 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -66,6 +66,30 @@ class Attachment < ActiveRecord::Base
copy
end
+ #获取资源的后缀类型
+ def suffix_type
+ childArr = self.filename.split('.')
+ suffix = '*'
+ if childArr.length > 1
+ suffix = childArr[childArr.length-1]
+ end
+ suffix
+ end
+
+ #获取用来显示的后缀名称
+ def show_suffix_type
+ suffix = 'other'
+ temp = self.suffix_type.downcase
+ if self.attachmentstype.suffixArr.include?(temp)
+ suffix = temp
+ end
+ suffix
+ end
+
+ def suffixArr
+ @@SuffixArr
+ end
+
def validate_max_file_size
if @temp_file && self.filesize > Setting.attachment_max_size.to_i.kilobytes
errors.add(:base, l(:error_attachment_too_big, :max_size => Setting.attachment_max_size.to_i.kilobytes))
diff --git a/app/models/attachmentstype.rb b/app/models/attachmentstype.rb
index 54102ee79..6a37cc51f 100644
--- a/app/models/attachmentstype.rb
+++ b/app/models/attachmentstype.rb
@@ -1,4 +1,11 @@
class Attachmentstype < ActiveRecord::Base
attr_accessible :typeId, :typeName
has_many :attachments, :foreign_key => "attachtype",:primary_key => "id"
+
+ # 当前使用的文件内容分类列表
+ @@SuffixArr = ['pdf','zip','doc','docx','rar','txt','jpg','bmp','xls','xlsx']
+
+ def suffixArr
+ @@SuffixArr
+ end
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 007f7e300..3c2956a94 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -164,6 +164,14 @@ class Project < ActiveRecord::Base
@attachmenttypes = Attachmentstype.find(:all, :conditions => ["#{Attachmentstype.table_name}.typeId= ?",self.attachmenttype ])
end
+ # 获取资源后缀名列表
+ def contenttypes
+ attachmenttypes
+ if @attachmenttypes.length >0
+ @attachmenttypes.last().suffixArr
+ end
+ end
+
#自定义验证
def validation
if !class_period.match([0-9])
diff --git a/app/views/files/_show_all_attachment.html.erb b/app/views/files/_show_all_attachment.html.erb
index c65f58cc5..57ac897d2 100644
--- a/app/views/files/_show_all_attachment.html.erb
+++ b/app/views/files/_show_all_attachment.html.erb
@@ -1,4 +1,5 @@
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
+<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
@@ -12,7 +13,8 @@
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope =>"col" , :id => "vzebra-adventure")%>
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope =>"col" , :id => "vzebra-comedy")%>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope =>"col", :id=> "vzebra-children")%>
- <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
+ <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope =>"col", :id=> "vzebra-attachmenttype")%>
+ <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope =>"col", :id=> "vzebra-contenttype")%>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope =>"col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope =>"col", :id => "vzebra-children") %>
@@ -33,6 +35,7 @@
<%= format_time(file.created_on) %> |
<%= number_to_human_size(file.filesize) %> |
<%= file.attachmentstype.typeName %> |
+ <%= file.show_suffix_type %> |
<%= file.downloads %> |
diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb
index 0544a4b66..82d2a7b87 100644
--- a/app/views/files/_sort_by_attachtypel.html.erb
+++ b/app/views/files/_sort_by_attachtypel.html.erb
@@ -1,5 +1,6 @@
<% selAttachType =@attachtype %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
+<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
@@ -15,7 +16,8 @@
<%= sort_header_tag('filename', :caption => l(:field_filename), :scope => "col", :id => "vzebra-adventure") %>
<%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %>
<%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children") %>
- <%= sort_header_tag('attach_type', :caption => l(:attachment_type), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %>
+ <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype") %>
+ <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope =>"col", :id=> "vzebra-contenttype")%>
<%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action") %>
<%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children") %>
@@ -31,6 +33,7 @@
<%= format_time(file.created_on) %> |
<%= number_to_human_size(file.filesize) %> |
<%= file.attachmentstype.typeName %> |
+ <%= file.show_suffix_type %> |
<%= file.downloads %> |
diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb
index 490f74f94..5abacf294 100644
--- a/app/views/files/index.html.erb
+++ b/app/views/files/index.html.erb
@@ -1,5 +1,6 @@
<% attachmenttypes = @project.attachmenttypes %>
+<% sufixtypes = @project.contenttypes %>
| |