1.添加资源分类浏览视图

2.处理分类选择变化事件
3.资源处理优化
exceptionHandle
nwb 12 years ago
parent a80da022cb
commit e5bbd68c8c

@ -62,6 +62,7 @@ class AttachmentsController < ApplicationController
end
end
def thumbnail
if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size])
if stale?(:etag => thumbnail)

@ -62,7 +62,20 @@ class FilesController < ApplicationController
redirect_to project_files_path(@project)
end
def show_by_attachtype
def showbyattachtype
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
if @project.project_type == 1
render :layout => 'base_courses'
else
render :layout => !request.xhr?
end
end
end

@ -61,7 +61,7 @@ class SchoolController < ApplicationController
render :text => options
end
def get_schoollist
@school = School.where("province = ?", params[:province])

@ -38,7 +38,7 @@ module AttachmentsHelper
else
false
end
end
def render_api_attachment(attachment, api)

@ -44,4 +44,10 @@ module FilesHelper
File.new(zipfile_name,'w+')
end
def browseByCategory
isCategoryBrowser = 1
#isCategoryBrowser
end
end

@ -23,7 +23,7 @@ class Attachment < ActiveRecord::Base
belongs_to :project, foreign_key: 'container_id', conditions: "attachments.container_type = 'Project'"
belongs_to :softapplication, foreign_key: 'container_id', conditions: "attachments.container_type = 'Softapplication'"
belongs_to :author, :class_name => "User", :foreign_key => "author_id"
belongs_to :attachmentstype, :foreign_key => "attachtype"
belongs_to :attachmentstype, :foreign_key => "attachtype",:primary_key => "id"
validates_presence_of :filename, :author
validates_length_of :filename, :maximum => 255

@ -1,3 +1,4 @@
class Attachmentstype < ActiveRecord::Base
attr_accessible :typeId, :typeName
has_many :attachments, :foreign_key => "attachtype",:primary_key => "id"
end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -132,6 +132,7 @@ en:
actionview_instancetag_blank_option: Please select
attachment_browse: 'Attachment Browse'
attachment_type: 'Attachment Type'
general_text_No: 'No'
general_text_Yes: 'Yes'

@ -140,6 +140,7 @@ zh:
actionview_instancetag_blank_option: 请选择
attachment_browse: '分类浏览'
attachment_type: '资源分类'
general_text_No: '否'
general_text_Yes: '是'

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save