Merge branch 'szzh' into develop

Conflicts:
	config/routes.rb
	db/schema.rb
This commit is contained in:
xianbo 2014-05-15 09:46:38 +08:00
commit 66a5db5ad3
52 changed files with 1806 additions and 1031 deletions

View File

@ -62,6 +62,18 @@ class AttachmentsController < ApplicationController
end
end
#更新资源文件类型
def updateType
@attachment = Attachment.find(params[:attachmentid])
if @attachment != nil
@attachment.attachtype = params[:newtype]
@attachment.save
render :text =>'success'
else
render :text=>'error'
end
end
def thumbnail
if @attachment.thumbnailable? && thumbnail = @attachment.thumbnail(:size => params[:size])
if stale?(:etag => thumbnail)

View File

@ -718,13 +718,14 @@ class BidsController < ApplicationController
def update
@bid = Bid.find(params[:id])
@project = @bid.courses.first#Project.find(params[:course_id])
if @bid.update_attributes(params[:bid])
flash[:notice] = l(:label_update_homework_succeed)
@project = Project.find(params[:course_id])
#@project = Project.find(params[:course_id])
redirect_to project_homework_path(@project)
else
@bid.safe_attributes = params[:bid]
render :action => 'edit'
render :action => 'edit', :layout =>'base_courses'
end
end

View File

@ -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
@ -53,7 +53,7 @@ class FilesController < ApplicationController
def create
container = (params[:version_id].blank? ? @project : @project.versions.find_by_id(params[:version_id]))
attachments = Attachment.attach_files(container, params[:attachments])
attachments = Attachment.attach_filesex(container, params[:attachments],params[:attachment_type])
render_attachment_warning_if_needed(container)
if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
@ -61,4 +61,23 @@ class FilesController < ApplicationController
end
redirect_to project_files_path(@project)
end
# 返回制定资源类型的资源列表
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
@contenttype = params[:contentType].to_s
respond_to do |format|
format.js
end
end
end

View File

@ -43,7 +43,7 @@ class MessagesController < ApplicationController
@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
@replies = @topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on ASC").
reorder("#{Message.table_name}.created_on DESC").
limit(@reply_pages.per_page).
offset(@reply_pages.offset).
all

View File

@ -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)
@ -295,8 +295,12 @@ class ProjectsController < ApplicationController
project_type = params[:project_type].to_i
projects_all = (project_type.eql? Project::ProjectType_course) ? Project.course_entities : Project.project_entities
@projects = projects_all.visible
@projects_all = @projects.visible.like(params[:name]) if params[:name].present?
#@projects_all = @projects.visible.like(params[:name]) if params[:name].present?
if params[:name].present?
@projects_all = @projects.visible.like(params[:name])
else
@projects_all = @projects;
end
@project_count = @projects_all.count
@project_pages = Paginator.new @project_count, per_page_option, params['page']

View File

@ -28,6 +28,11 @@ class SchoolController < ApplicationController
end
#获取制定学校开设的课程数
def course_count school_id
School.find(school_id).courses.count
end
def index

View File

@ -549,6 +549,14 @@ class UsersController < ApplicationController
format.api { render_validation_errors(@user) }
end
end
unless @user.id.nil?
#后台注册的用户默认权限为男性开发员
ue = UserExtensions.create(:identity => 3,
:gender => 0,
:user_id => @user.id)
ue.save
end
end
def edit

View File

@ -390,6 +390,16 @@ module ApplicationHelper
s.html_safe
end
#扩展的checkbox生成
def principals_check_box_tags_ex(name, principals)
s = ''
principals.each do |principal|
s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal.userInfo }</label>\n"
end
s.html_safe
end
# Returns a string for users/groups option tags
def principals_options_for_select(collection, selected=nil)
s = ''

View File

@ -108,5 +108,7 @@ module CoursesHelper
now > cTime
end
def find_by_extra_from_project extra
Course.find_by_extra(try(extra))
end
end

View File

@ -44,4 +44,23 @@ module FilesHelper
File.new(zipfile_name,'w+')
end
# 判断指定的资源时候符合类型
def isTypeOk(attachment, type, contentType)
result = false
if type != 0
if attachment.attachtype == type
result = true
end
else
result = true
end
if result
if contentType != '0' && contentType != attachment.suffix_type
result = false
end
end
result
end
end

View File

@ -24,7 +24,7 @@ module MembersHelper
principal_pages = Redmine::Pagination::Paginator.new principal_count, 10, params['page'] #by young
principals = scope.offset(principal_pages.offset).limit(principal_pages.per_page).all
s = content_tag('div', principals_check_box_tags('membership[user_ids][]', principals), :id => 'principals')
s = content_tag('div', principals_check_box_tags_ex('membership[user_ids][]', principals), :id => 'principals')
links = pagination_links_full(principal_pages, principal_count, :per_page_links => false) {|text, parameters, options|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true

View File

@ -32,7 +32,7 @@ module ProjectsHelper
{:name => 'categories', :action => :manage_categories, :partial => 'projects/settings/issue_categories', :label => :label_issue_category_plural},
# {:name => 'wiki', :action => :manage_wiki, :partial => 'projects/settings/wiki', :label => :label_wiki},
{:name => 'repositories', :action => :manage_repository, :partial => 'projects/settings/repositories', :label => :label_repository_plural},
{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural},
#{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural},
{:name => 'activities', :action => :manage_project_activities, :partial => 'projects/settings/activities', :label => :enumeration_activities}
]
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
@ -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
@ -145,7 +145,7 @@ module ProjectsHelper
#Added by young
def course_settings_tabs
tabs = [{:name => 'info', :action => :edit_project, :partial => 'projects/edit', :label => :label_information_plural, :course=>'1'},
{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural, :project_type => 1},
#{:name => 'boards', :action => :manage_boards, :partial => 'projects/settings/boards', :label => :label_board_plural, :project_type => 1},
# {:name => 'repositories', :action => :manage_repository, :partial => 'projects/settings/repositories', :label => :label_repository_plural},
{:name => 'members', :action => :manage_members, :partial => 'projects/settings/members', :label => :label_member_plural}
]

View File

@ -106,6 +106,30 @@ module WelcomeHelper
# (c1.take(max)+c2).take(sum)
end
#查找所有学校按每个学校开设课程数量降序排序
#page 分页查询开始条数的编号,从0开始
#limit 分页查询的数量
def find_maxmin_course_school page,limit
School.find_by_sql("SELECT *,(SELECT COUNT(*) FROM courses WHERE school_id = schools.id) AS a
FROM schools
ORDER BY a DESC LIMIT #{page},#{limit}")
#School.where(" id IN (SELECT school_id FROM courses GROUP BY school_id)").limit limit;
#School.order("#{School.course_count}").limit(limit).all
#@school = School.all.sort
#@school.each do |s|
# s.courses.count
#end
#result = []
#@school = School.all.to_ary
#i = 1
#for i in i < School.count
# j = i - 1
# for j in j > 0
# if @school[j].courses.count >
# end
#end
end
def find_miracle_project(sum, max_rate)
max = sum*(max_rate.to_f/10)
c1 = find_new_project(sum).to_a.dup
@ -130,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

View File

@ -23,6 +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",:primary_key => "id"
validates_presence_of :filename, :author
validates_length_of :filename, :maximum => 255
@ -65,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))
@ -260,6 +285,13 @@ class Attachment < ActiveRecord::Base
result
end
def self.attach_filesex(obj, attachments,attachment_type)
result = obj.save_attachmentsex(attachments, User.current,attachment_type)
obj.attach_saved_attachments
result
end
def self.latest_attach(attachments, filename)
attachments.sort_by(&:created_on).reverse.detect {
|att| att.filename.downcase == filename.downcase

View File

@ -0,0 +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

View File

@ -7,6 +7,7 @@ class Course < ActiveRecord::Base
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
has_many :bid
validates_presence_of :password, :term
validates_format_of :class_period, :message => "class period can only digital!", :with =>/^[1-9]\d*$/
safe_attributes 'extra',
'time',
'name',
@ -18,6 +19,13 @@ class Course < ActiveRecord::Base
'term',
'password'
#自定义验证
def validate
if !class_period.match([0-9])
errors.add_to_base("class period can only digital")
end
end
def get_endup_time
begin
end_time = Time.parse(self.endup_time)
@ -39,5 +47,4 @@ class Course < ActiveRecord::Base
return time
end
end
end

View File

@ -63,7 +63,7 @@ class Mailer < ActionMailer::Base
# Mailer.issue_add(issue).deliver => sends an email to issue recipients
def issue_add(issue)
redmine_headers 'Project' => issue.project.identifier,
'Issue-Id' => issue.id,
'Issue-Id' => (issue.project.issues.index(issue).to_i + 1).to_s,
'Issue-Author' => issue.author.login
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
message_id issue
@ -85,7 +85,7 @@ class Mailer < ActionMailer::Base
def issue_edit(journal)
issue = journal.journalized.reload
redmine_headers 'Project' => issue.project.identifier,
'Issue-Id' => issue.id,
'Issue-Id' => (issue.project.issues.index(issue).to_i + 1).to_s,
'Issue-Author' => issue.author.login
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
message_id journal

View File

@ -38,7 +38,6 @@ class Project < ActiveRecord::Base
:conditions => "#{Principal.table_name}.type='Group' OR (#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE})"
has_many :users, :through => :members
has_many :principals, :through => :member_principals, :source => :principal
has_many :enabled_modules, :dependent => :delete_all
has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
has_many :issues, :dependent => :destroy, :include => [:status, :tracker]
@ -160,6 +159,25 @@ class Project < ActiveRecord::Base
self.where('project_type = ?', 1)
end
# 获取项目的资源类型列表
def attachmenttypes
@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])
errors.add_to_base("class period can only digital")
end
end
# 项目留言 added by fq
def self.add_jour(user, notes)
@ -726,7 +744,8 @@ class Project < ActiveRecord::Base
'custom_fields',
'tracker_ids',
'issue_custom_field_ids',
'project_type'
'project_type',
'attachmenttype'

View File

@ -191,6 +191,10 @@ class User < Principal
end
}
#选择项目成员时显示的用户信息文字
def userInfo
info=self.name + ' (' + self.login + ')';
end
###添加留言 fq
def add_jour(user, notes, reference_user_id = 0, options = {})

View File

@ -0,0 +1,14 @@
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
<% if attachmenttypes.any? %>
<div id="put-tag-form-<%=attachment.id%>" class="hidden">
<%= select_tag "attachment_type",
options_from_collection_for_select(attachmenttypes, "id",
"typeName",attachment.attachtype), :onchange=>"attachmenttypes_change("+attachment.id.to_s + ",this.value)"%>
</div>
<%= link_to(image_tag('edit/edit.png'), 'javascript:void(0);',:style=>"white-space:nowrap;", :id=>"edit_box"+attachment.id.to_s ,
:onclick =>"$('#put-tag-form-" +attachment.id.to_s+ "').show();
$('#attach_type_id_label" +attachment.id.to_s+ "').hide();
$('#edit_box" +attachment.id.to_s+ "').hide();") if edit_allowed %>
<% end %>

View File

@ -13,8 +13,10 @@
<span class="font_lighter"><%= l(:label_user_create_project_homework) %></span>
<span><%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></span>
<span style="float: right">
<% if(User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
<%# 提交作业按钮 %>
<%= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@project) %>
<% end %>
<% if (User.current.admin?||User.current.id==bid.author_id) %>
<%= link_to(
l(:button_edit),
@ -33,10 +35,19 @@
</tr>
<tr>
<td colspan="2"><span class="font_lighter">
<% @bidding_project = bid.biding_projects.all
@temp = []
@bidding_project.each do |pro|
if pro.project && pro.project.project_status
@temp << pro
end
@temp
end
%>
<% if bid.homework_type == 1%>
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<strong><%= link_to bid.homeworks.count, project_for_bid_path(bid.id) %></strong>)
<%= l(:label_x_homework_project, :count => @temp.count) %>(<strong><%= link_to @temp.count, project_for_bid_path(bid.id) %></strong>)
<% else %>
<%= l(:label_x_homework_project, :count => bid.biding_projects.count) %>(<strong><%= link_to bid.biding_projects.count, project_for_bid_path(bid.id) %></strong>)
<%= l(:label_x_homework_project, :count => @temp.count) %>(<strong><%= link_to @temp.count, project_for_bid_path(bid.id) %></strong>)
<% end %></span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span>
<span style="float: right">

View File

@ -148,11 +148,12 @@
</span></td>
</tr>
<tr>
<td>
<td colspan="2">
<% if Time.parse(@bid.deadline.to_s) < Time.parse(b_project.created_at.to_s) %>
<span class="required">迟交</span>
<% end %>
</td>
<td align="right"><%= link_to image_tag('delete.png') %></td>
</tr>
</table>
</td>

View File

@ -20,10 +20,6 @@
<%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %>
<% end %>
</div>
<span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",
:locals => {:obj => @bid,:show_flag => true,:user_id =>User.current.id}%>
</span>
</span>
</div>
<div style="clear: both;"></div>
@ -35,6 +31,6 @@
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
<ul>
</ul>
</div>

View File

@ -12,6 +12,7 @@
<span style="float: right"><%= l(:label_homework) %> (<span class=""><%= link_to (course.homeworks.count), {:controller => 'projects', :action => 'homework', :id => course.identifier} %></span>)
&nbsp;&nbsp;&nbsp;
<%= l(:label_course_news)%> (<span style="color: #ed8924"><%= link_to (course.news.count), {:controller => 'news', :action => 'index', :project_id => course.identifier} %></span>)
</span>
</td>
</tr>
<tr>

View File

@ -1,5 +1,6 @@
<h3><%=l(:label_attachment_new)%></h3>
<% versions = project.versions.sort %>
<% attachmenttypes = project.attachmenttypes %>
<%= error_messages_for 'attachment' %>
<%= form_tag(project_files_path(project), :multipart => true, :class => "tabular") do %>
<div class="box">
@ -10,6 +11,14 @@
options_from_collection_for_select(versions, "id", "name") %></p>
<% end %>
<% if attachmenttypes.any? %>
<p> <label for="attachment_type"><%=l(:attachment_type)%></label>
<%= select_tag "attachment_type",
options_from_collection_for_select(attachmenttypes, "id",
"typeName") %>
</p>
<% end %>
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
</div>
<%= submit_tag l(:button_add) %>

View File

@ -0,0 +1,72 @@
<% selAttachType =@attachtype %>
<% selContentType =@contenttype %>
<% attachmenttypes = @project.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
<table class="list files" id="ver-zebra">
<colgroup>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<!-- <col class="vzebra-odd"/> -->
</colgroup>
<thead>
<tr>
<%= 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_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") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr>
</thead>
<tbody>
<% @containers.each do |container| %>
<% next if container.attachments.empty? -%>
<% if container.is_a?(Version) -%>
<tr>
<th colspan="5" align="left" style="line-height: 30px; font-size: 14px; ">
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
</th>
</tr>
<% end -%>
<% container.attachments.each do |file| %>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= 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;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %>
</span>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
</tr>
<tr>
<td class='description' colspan="6">
<div class="tags_area">
<%# @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div>
</td>
</tr>
<% end -%>
<% reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>

View File

@ -0,0 +1,71 @@
<% selAttachType =@attachtype %>
<% selContentType =@contenttype %>
<% attachmenttypes = @project.attachmenttypes %>
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<% edit_allowed = User.current.allowed_to?(:manage_files, @project) %>
<table class="list files" id="ver-zebra">
<colgroup>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<col class="vzebra-odd"/>
<col class="vzebra-even"/>
<!-- <col class="vzebra-odd"/> -->
</colgroup>
<thead>
<tr>
<%= 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_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") %>
<!-- <%= sort_header_tag('description', :caption => l(:field_description)) %> -->
</tr>
</thead>
<tbody>
<% @containers.each do |container| %>
<% next if container.attachments.empty? -%>
<% container.attachments.each do |file| %>
<% if isTypeOk(file,selAttachType,selContentType) %>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; "><%= 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;" %></td>
<!-- <td class="created_on"><%#= format_time(file.created_on) %></td> -->
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="attach_type">
<span id="attach_type_id_label<%= file.id %>" style="white-space:nowrap;"><%= file.attachmentstype.typeName %></span>
&nbsp;
<span id="attach_type_id_edit<%= file.id %>" style="white-space:nowrap;">
<%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes,
:attachment => file,:contentype=>selContentType} %>
</span>
</td>
<td class="content_type"><%= file.show_suffix_type %></td>
<td class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
</tr>
<tr>
<td class='description' colspan="6">
<div class="tags_area">
<%# @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"} %>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a>
</div>
</td>
</tr>
<% end -%>
<% end -%>
<% reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>

View File

@ -0,0 +1,5 @@
<% if @attachtype==0 && @contenttype=='0' %>
$("#all_browse_div").html('<%= j(render partial: "show_all_attachment")%>');
<%else%>
$("#all_browse_div").html('<%= j(render partial: "sort_by_attachtypel")%>');
<%end%>

View File

@ -1,132 +1,6 @@
<!-- <h3> --><!-- %=l(:label_attachment_plural)%></h3 -->
<style>
#ver-zebra, .file_table_des
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 5px 10px;
width: 98%;
text-align: left;
border-collapse: collapse;
line-height: 20px;
font-size: 14px;
}
#ver-zebra th
{
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #039;
text-align: left;
}
#ver-zebra td
{
padding: 8px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #669;
}
#ver-zebra td.description {
background-color: white;
padding: 0px;
margin: 0px auto;
}
div.tags_area {
padding: 2px 10px 10px 10px;
margin: 0px;
margin-bottom: 10px;
/*border-bottom: 1px dashed #CCCCCC;*/
overflow: hidden;
position: relative;
}
.tags_gradint {
}
.read-more{
padding: 5px;
border-top: 4px double #ddd;
background: #fff;
color: #333;
}
.read-more a{
padding-right: 22px;
background: url() no-repeat 100% 50%;
font-weight: bold;
text-decoration: none;
}
.read-more a:hover{
color: #000;
}
.vzebra-odd
{
background: #eff2ff;
}
.vzebra-even
{
background: #e8edff;
}
#ver-zebra #vzebra-adventure, #ver-zebra #vzebra-children
{
background: #ffffff;
border-bottom: 1px solid #c8d4fd;
}
#ver-zebra #vzebra-comedy, #ver-zebra #vzebra-action
{
background: #ffffff;
border-bottom: 1px solid #d6dfff;
}
.filename{
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
div.pagination{
margin: 10px 0px;
height: 1.5em;
text-align: left;
font-size: 13px;
}
.m5p5{
display: inline-block;
height: auto;
color: white !important;
margin: 8px;
padding: 3px 7px;
}
.m5p5:hover {
text-decoration: none;
/*padding-bottom: 3px;*/
/*border-bottom: 1px solid #666666;*/
border-radius: 4px;
border: 1px solid #15bccf;
box-shadow: 3px 3px 3px #666666;
}
.relation_file_div{
margin: 0px 25px;
}
.relation_file_div fieldset{
margin: 0px 0px;
padding: 10px;
border-radius: 5px;
transition: all 2s linear 1s;
}
.relation_file_div input#attach_search:focus{
border: 1px solid #1B95C6;
box-shadow: 0px 0px 4px #1B95C6;
width: 200px;
}
.relation_file_div input#attach_search{
width: 150px;
outline: none;
border-radius: 5px;
-webkit-transition: 1s width;
-moz-transition : 1s width;
-o-transition : 1s width;
transition : 1s width;
}
</style>
<% attachmenttypes = @project.attachmenttypes %>
<% sufixtypes = @project.contenttypes %>
<span class="borad-title"><%= (@project.project_type == 1) ? t(:label_user_course) : t(:label_project) %>资源共享区</span>
@ -137,6 +11,20 @@ div.pagination{
<%#= link_to('上传文件', new_project_file_path(@project), :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %>
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
<% if attachmenttypes.any? %>
&nbsp; &nbsp; &nbsp;
<label for="attachment_browse_label"><%= l(:attachment_browse) %></label>
<%= select_tag "attachment_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_from_collection_for_select(attachmenttypes, "id", "typeName"),
:onchange => "attachmenttypes_searchex(this.value)" %>
<% end %>
<% if sufixtypes.any? %>
&nbsp;
<label for="attach_sufix_browse_label"><%= l(:attachment_sufix_browse) %></label>
<%= select_tag "attach_sufix_browse", content_tag(:option, l(:attachment_all), :value => '0') +options_for_select(sufixtypes),
:onchange => "attachment_contenttypes_searchex(this.value)" %>
<% end %>
<div id="upload_file_div" class="relation_file_div hidden">
<%= render :partial => 'new', locals: {project: @project} %>
</div>
@ -174,66 +62,14 @@ div.pagination{
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
<table class="list files" id="ver-zebra" >
<colgroup>
<col class="vzebra-odd" />
<col class="vzebra-even" />
<col class="vzebra-odd" />
<col class="vzebra-even" />
<col class="vzebra-odd" />
</colgroup>
<thead><tr>
<%= 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('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('description', :caption => l(:field_description)) %> -->
</tr></thead>
<tbody>
<% @containers.each do |container| %>
<% next if container.attachments.empty? -%>
<% if container.is_a?(Version) -%>
<tr>
<th colspan="5" align="left" style="line-height: 30px; font-size: 14px; ">
<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package", :style => "color: #666666;") %>
</th>
</tr>
<% end -%>
<% container.attachments.each do |file| %>
<tr class="file <%= cycle("odd", "odd") %>">
<td class="filename" style="font-size: 13px; width: 240px; "><%= 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;" %></td>
<td class="created_on"><%= format_time(file.created_on) %></td>
<td class="filesize"><%= number_to_human_size(file.filesize) %></td>
<td class="downloads"><%= file.downloads %></td>
<!-- <td class="digest" width="300px"><%= file.description %></td> -->
<td align="center">
<%= link_to(image_tag('delete.png'), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
</td>
</tr>
<tr>
<td class='description' colspan="5">
<div class="tags_area">
<% @preTags = %w|预设A 预设B 预设C 预设D 预设E 预设Z | %>
<%= render :partial => 'tags/tag', :locals => {:obj => file, :object_flag => "6"}%>
<div class="tags_gradint"></div>
</div>
<div class="read-more hidden"><a href="javascript:void(0);" onclick="readmore(this);"> 更多 </a></div>
</td>
</tr>
<% end -%>
<% reset_cycle %>
<% end -%>
<!-- %= h downloadAll(@containers) % -->
<!-- %= link_to "download all file", (downloadAll(@containers)) % -->
</tbody>
</table>
<div id="all_browse_div" class="all_browse_div">
<%= render :partial => 'show_all_attachment' %>
</div>
<% html_title(l(:label_attachment_plural)) -%>
<script type='text/javascript';>
<script type='text/javascript'>
var slideHeight = 29;
function readmore(aNode) {
// console.log(aNode)
@ -246,7 +82,7 @@ function readmore (aNode) {
var $tags = $td_tags_area.find('#tags')
var $icona = $td_tags_area.find('.tags_icona')
var slideHeight = 20; //px
var slideHeight = 5; //px
var defHeight = $tags.height();
var curHeight = $tags_area.height();
@ -264,7 +100,8 @@ function readmore (aNode) {
$read_more_a.html('更多');
$icona.html('<%=image_tag "/images/sidebar/add.png"%>')
$tags_gradint.fadeIn();
};
}
;
}
$(function () {
@ -272,7 +109,80 @@ $(function () {
var defHeight = $('.tags_area').height();
if (defHeight >= slideHeight) {
$('.tags_area').css('height', slideHeight + 'px');
};
}
;
});
function eval_ajax (xhr, textStatus) {
if (textStatus == 'success') {
eval(xhr.responseText);
} else if (textStatus == 'error') {
alert('error');
}
}
function attachmenttypes_searchex(value) {
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: encodeURIComponent(value),
contentType:$('#attach_sufix_browse').val()
}
}).complete(eval_ajax);
}
function attachment_contenttypes_searchex(value) {
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
}
function attachtype_edit(value) {
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: encodeURIComponent(value)
}
}).complete(eval_ajax);
}
function attachmenttypes_change(id, type) {
$.ajax({
url: '<%=updateType_attachments_path%>',
type: "POST",
data: {
attachmentid: encodeURIComponent(id),
newtype: encodeURIComponent(type)
}
}).complete(function (xhr, textStatus) {
if (textStatus == 'success') {
$.ajax({
url: '<%=getattachtype_project_files_path(project_id: @project)%>',
type: "POST",
data: {
type: $('#attachment_browse').val(),
contentType: $('#attach_sufix_browse').val()
}
}).error(function () {
alert('error');
});
} else if (textStatus == 'error') {
alert('error');
}
});
}
</script>

View File

@ -0,0 +1,73 @@
<!--add by huang-->
<div class="clearfix"></div>
<<<<<<< HEAD
<div id="footer" style="margin-left:-5px;padding-top: 50px;clear: both;font-size: 12px;">
<div style="border-top:solid 1px #C6E9F1;width: auto;margin-top: 80px;"></div>
<div class="base_footer">
<div align="center">
<!--gcm-->
<p>
<span>主办单位:</span>
<span class="footer_text_link"><%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span>
<span class="footer_text_link"><%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span>
<span id="copyright">版权@2007~2014</span>
<span id="contact_us" class="footer_text_link"><%= link_to "联系我们","http://forge.trustie.net/projects/2/member",:target=>"_blank"%></span>
<span id="record"class="footer_text_link"><%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%></span>
</p>
<div id="logo_link">
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>"国防科学技术大学计算机学院"),"http://www.nudt.edu.cn/special.asp?classid=12"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>"北京大学信息科学技术学院软件研究所"), "http://eecs.pku.edu.cn"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>"北京航空航天大学计算机学院"), "http://scse.buaa.edu.cn/"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/iscas.png',:size=>'100x30',:alt=>"中国科学院软件研究所"), "http://www.iscas.ac.cn"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/inforbus.png',:size=>'100x30',:alt=>"山东中创软件商用中间件股份有限公司"), "http://www.inforbus.com"%></span>
</div>
<!--gcm-->
</div>
</div>
=======
<div id="footer" style="margin-left:-5px;padding-top: 150px;clear: both;font-size: 12px;">
<div style="border-top:solid 1px #C6E9F1;"></div>
<div class="base_footer">
<div align="center">
<!--gcm-->
<p>
<span>主办单位:</span>
<span class="footer_text_link"><%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span>
<span class="footer_text_link"><%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span>
<span id="copyright">版权@2007~2014</span>
<span id="contact_us" class="footer_text_link"><%= link_to "联系我们","http://forge.trustie.net/projects/2/member",:target=>"_blank"%></span>
<span id="record"class="footer_text_link"><%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%></span>
</p>
<div id="logo_link">
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/nudt.png',:size=>'100x30',:alt=>"国防科学技术大学计算机学院"),"http://www.nudt.edu.cn/special.asp?classid=12"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/peking_eecs.png',:size=>'100x30',:alt=>"北京大学信息科学技术学院软件研究所"), "http://eecs.pku.edu.cn"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/buaa_scse.png',:size=>'100x30',:alt=>"北京航空航天大学计算机学院"), "http://scse.buaa.edu.cn/"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/iscas.png',:size=>'100x30',:alt=>"中国科学院软件研究所"), "http://www.iscas.ac.cn"%></span>
<span class="footer_logo_link"><%= link_to image_tag('/images/footer_logo/inforbus.png',:size=>'100x30',:alt=>"山东中创软件商用中间件股份有限公司"), "http://www.inforbus.com"%></span>
</div>
<!--gcm-->
</div>
</div>
>>>>>>> develop
</div>
</div>
<div class="debug">
<%= debug(params) if Rails.env.development? %>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46523987-1', 'trustie.net');
ga('send', 'pageview');
</script>
</div>

View File

@ -124,7 +124,7 @@
<table class="borad-text-list">
<tr>
<td class="font_lighter"><%= reply_count += 1 %>楼 </td>
<td class="font_lighter"><span style="display: none"><%= reply_count += 1 %>楼</span> </td>
<td>
<div class="contextual-borad">
<%= link_to(

View File

@ -30,7 +30,7 @@
</table>
<% end %>
</div>
<%= sort_course(@s_type, @project_type)%>
<%= sort_course(@s_type, @project_type, @school_id)%>
<div id="projects-index">
<%= render_project_hierarchy(@projects)%>

View File

@ -188,8 +188,8 @@
<% find_new_forum_topics(11).each do |topic|%>
<li class="message-brief-intro" style="min-height: 60px; line-height:2em; ">
<div style="display: inline-block; width: 100%;">
<span style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
<span class="memo_activity" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= 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;" %>
</span>
<br>
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>

View File

@ -1,6 +1,7 @@
<%= stylesheet_link_tag 'welcome' %>
<%= javascript_include_tag 'welcome' %>
<script type="text/javascript" language="javascript">
<script type="text/javascript" language="javascript" xmlns="http://www.w3.org/1999/html"
xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
$(function(){
$("#main").find("a").attr("target", "_blank");
@ -23,17 +24,17 @@
<%= image_tag(@logoLink, size:'75x75') %>
</div>
<div class="welcome_left" >
<div class="course welcome_left" >
<br />
<span class="font_welcome_school"> <% if params[:school_id].nil? and User.current.user_extensions.school.nil? %>
<% else%>
<% if params[:school_id] == "0" %>
<% else %>
<% if params[:school_id].nil? %>
<%= School.find(User.current.user_extensions.school.id).name %>
<%= 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'}%>
<br />
<% else %>
<%= School.find(params[:school_id]).name %>
<%= link_to School.find(params[:school_id]).name ,options={:action => 'course',:school_id => params[:school_id]}, html_options={:class => 'font_welcome_school',:method => 'get'}%>
<br />
<% end %>
<% end %>
@ -59,8 +60,65 @@
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3><strong>新开课程</strong></h3>
<% if(find_miracle_course(10, 7,params[:school_id]).count == 0) %>
<span><%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => nil} %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
</ul>
<ul class="d-p-projectlist">
<h1></h1>
<p id="errorExplanation">
该学校未开设任何课程,您可以查看其他学校课程
</p>
<h1></h1>
<% find_all_new_hot_course(9).map do |project| %>
<li class='<%= cycle("odd", "even") %>' title=<%=project.description.to_s%>>
<div class='avatar'>
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %>
</div>
<!-- 上左下右 -->
<div class='desc_item' >
<span class=''>
<% course = Course.find_by_extra(project.identifier)%>
<% if(course.school == nil) %>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% else %>
<%= course.school.name.try(:gsub, /(.+)$/, '\1:') %>
<% end %>
</span>
<span class='font_bolder'>
<%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %>
<%#=course.try(:teacher).try(:name)%>
</span>
</div>
<div class='desc_item text_nowrap' style="width: 310px;">
[<%= 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) %>资料)
</div>
<!-- <div class='desc_item' style="">
<span class='font_lighter' title=<%#=project.description.to_s%>><%#=project.description.truncate(25, omission: '...')%></span>
</div> -->
<div>
<% if !course_endTime_timeout?(project)%>
<div >
<%= new_watcher_link(project, User.current)%>
</div>
<% end %>
</div>
</li>
<% end %>
</ul>
</div>
<% else %>
<span><%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :school_id => params[:school_id]} %></span>
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
</ul>
<ul class="d-p-projectlist">
<% find_miracle_course(10, 7,params[:school_id]).map do |project| %>
<li class='<%= cycle("odd", "even") %>' title=<%=project.description.to_s%>>
@ -68,13 +126,6 @@
<%= image_tag(get_course_avatar(project), :class => "avatar-4") %>
</div>
<!-- 上左下右 -->
<div class='desc_item text_nowrap' >
[<%= 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) %>资料)
</div>
<div class='desc_item' >
<span class=''>
<% course = Course.find_by_extra(project.identifier) %>
@ -85,6 +136,13 @@
<%#=course.try(:teacher).try(:name)%>
</span>
</div>
<div class='desc_item text_nowrap' style="width: 310px;">
[<%= 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) %>资料)
</div>
<!-- <div class='desc_item' style="">
<span class='font_lighter' title=<%#=project.description.to_s%>><%#=project.description.truncate(25, omission: '...')%></span>
</div> -->
@ -99,10 +157,11 @@
<% end; reset_cycle %>
</ul>
</div>
<% end %>
</div>
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
<h3 style="padding-bottom:px ;margin-left: 5px; color: #e8770d;">
<h3 style="padding-bottom:0px ;margin-left: 5px; color: #e8770d;">
<strong>问题和反馈动态</strong>
<%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
<%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
@ -113,15 +172,15 @@
<% find_new_forum_topics(10).each do |topic|%>
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; ">
<div style="display: inline-block; width: 100%;">
<span style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
<span class="memo_activity" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%= 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;" %>
</span>
<br>
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>
<span style="margin-left: 24px; color: rgb(172, 174, 177); white-space: nowrap; font-size:9pt !important;;"><%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前</span>
<span style="margin-left: 8px; margin-bottom: 0px; color: rgb(172, 174, 177) !important; white-space: nowrap;">
由&nbsp;<%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);" %>&nbsp;发表
</span>
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size 9pt !important;;">回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)</span>
<span style="float: right; color: rgb(172, 174, 177); white-space: nowrap; font-size:9pt !important;;">回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)</span>
</div>
</li>
<% end %>

View File

@ -100,7 +100,7 @@
<% find_new_forum_topics(7).each do |topic|%>
<li class="message-brief-intro">
<div class='memo_title'>
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
</div>
<div class='memo_attr'>
<span class='memo_timestamp'>

View File

@ -10,5 +10,6 @@ if Dir.glob(File.join(vendor_plugins_dir, "*")).any?
exit 1
end
# Initialize the rails application
RedmineApp::Application.initialize!

View File

@ -132,6 +132,10 @@ en:
actionview_instancetag_blank_option: Please select
attachment_all: "All"
attachment_browse: "Attachment Content Browse"
attachment_sufix_browse: "Attachment Type Browse"
attachment_type: "Attachment Type"
general_text_No: 'No'
general_text_Yes: 'Yes'
general_text_no: 'no'

View File

@ -140,6 +140,10 @@ zh:
actionview_instancetag_blank_option: 请选择
attachment_all: "全部"
attachment_sufix_browse: "文件类型"
attachment_browse: "内容类型"
attachment_type: '资源分类'
general_text_No: '否'
general_text_Yes: '是'
general_text_no: '否'

View File

@ -301,7 +301,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]
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
@ -453,7 +458,11 @@ RedmineApp::Application.routes.draw do
get 'attachments/autocomplete'
match 'attachments/autocomplete', :to => 'attachments#autocomplete', via: [:post]
post 'attachments/relationfile', to: 'attachments#add_exist_file_to_project', as: 'attach_relation'
resources :attachments, :only => [:show, :destroy]
resources :attachments, :only => [:show, :destroy] do
collection do
match "updateType" , via: [:get, :post]
end
end
resources :groups do
member do

View File

@ -0,0 +1,19 @@
# encoding: utf-8
class CreateAttachmentstypes < ActiveRecord::Migration
def self.up
create_table :attachmentstypes do |t|
t.column :typeId, :integer, :null => false
t.column :typeName, :string, :limit =>50
end
Attachmentstype.create(typeId:1,typeName:'源代码')
Attachmentstype.create(typeId:1,typeName:'课件')
Attachmentstype.create(typeId:1,typeName:'研究报告')
Attachmentstype.create(typeId:2,typeName:'源代码')
Attachmentstype.create(typeId:2,typeName:'课件')
Attachmentstype.create(typeId:2,typeName:'研究报告')
end
def self.down
drop_table :attachmentstypes
end
end

View File

@ -0,0 +1,5 @@
class AddAttachtypeToAttachments < ActiveRecord::Migration
def change
add_column :attachments, :attachtype, :int ,default: 1
end
end

View File

@ -0,0 +1,5 @@
class AddAttachmenttypeToProject < ActiveRecord::Migration
def change
add_column :projects, :attachmenttype, :int ,default: 1
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140505083430) do
ActiveRecord::Schema.define(:version => 20140509020307) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -45,12 +45,21 @@ ActiveRecord::Schema.define(:version => 20140505083430) do
t.datetime "created_on"
t.string "description"
t.string "disk_directory"
t.integer "attachtype", :default => 1
end
add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id"
add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type"
add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on"
create_table "attachmentstypes", :id => false, :force => true do |t|
t.integer "id", :null => false
t.integer "typeId"
t.string "typeName", :limit => 50
end
add_index "attachmentstypes", ["id"], :name => "id"
create_table "auth_sources", :force => true do |t|
t.string "type", :limit => 30, :default => "", :null => false
t.string "name", :limit => 60, :default => "", :null => false
@ -614,6 +623,7 @@ ActiveRecord::Schema.define(:version => 20140505083430) do
t.boolean "inherit_members", :default => false, :null => false
t.integer "project_type"
t.boolean "hidden_repo", :default => false, :null => false
t.integer "attachmenttype", :default => 1
end
add_index "projects", ["lft"], :name => "index_projects_on_lft"
@ -803,11 +813,6 @@ ActiveRecord::Schema.define(:version => 20140505083430) do
add_index "time_entries", ["project_id"], :name => "time_entries_project_id"
add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id"
create_table "tmp", :force => true do |t|
t.string "name"
t.string "part_number"
end
create_table "tokens", :force => true do |t|
t.integer "user_id", :default => 0, :null => false
t.string "action", :limit => 30, :default => "", :null => false
@ -1014,10 +1019,4 @@ ActiveRecord::Schema.define(:version => 20140505083430) do
add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status"
add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id"
create_table "yans", :force => true do |t|
t.string "name"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
end

View File

@ -60,6 +60,11 @@ module Redmine
@unsaved_attachments ||= []
end
def save_attachmentsex(attachments, author=User.current,attachment_type)
@curattachment_type = attachment_type
result = save_attachments(attachments,author)
result
end
def save_attachments(attachments, author=User.current)
if attachments.is_a?(Hash)
attachments = attachments.stringify_keys
@ -91,6 +96,7 @@ module Redmine
end
next unless a
a.description = attachment['description'].to_s.strip
a.attachtype = @curattachment_type;
if a.new_record?
unsaved_attachments << a
else

BIN
public/images/Edit/edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

View File

@ -1840,7 +1840,7 @@ a.remove-upload:hover {text-decoration:none !important;}
/*gcm upload file count and deleteall*/
#upload_file_count #count {color:red; font-size:1.5em;}
span.add_attachment .remove_all {background:none;background: url(../images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block;position:absolute;right:21px;text-decoration:none;}
span.add_attachment .remove_all {background:none;background: url(../images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block;position:absolute;right:61px;text-decoration:none;}
div.fileover { background-color: lavender; }

View File

@ -14,9 +14,11 @@ span[id^=valid_user]{
-moz-box-sizing: border-box;
-box-sizing: border-box;
}
.div_inline {
display: inline-block;
}
/*文字不换行*/
.text_nowrap {
word-break: keep-all;
@ -24,27 +26,35 @@ span[id^=valid_user]{
overflow: hidden;
text-overflow: ellipsis;
}
/*字体 斜体*/
.font_italic {
font-style: italic;
}
/*字体加粗*/
.font_bolder {
font-weight: bolder;
}
.text_center {
text-align: center;
}
.ph10_5{ /*padding horizontal 10% 5%*/
.ph10_5 {
/*padding horizontal 10% 5%*/
padding: 0px 5% 0px 10%;
}
.clear_both {
clear: both;
}
.memo-content pre {
white-space: normal;
word-wrap: break-word;
}
.highlight {
background-color: #fff34d;
-moz-border-radius: 3px;
@ -61,15 +71,18 @@ span[id^=valid_user]{
-webkit-opacity: 0.7;
opacity: 0.7;
}
.clearfix {
width: 100%;
height: 0px;
clear: both;
display: block;
}
.hidden {
display: none;
}
.font_color_orange {
color: #E8770D;
}
@ -77,13 +90,13 @@ span[id^=valid_user]{
* {
font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif;
}
/* 模态窗口
*******************************************************************************/
/** jRating CSS **/
/**Div containing the color of the stars */
.jRatingAverage {
background-color: #f62929;
position: relative;
@ -92,6 +105,7 @@ span[id^=valid_user]{
z-index: 2;
height: 100%;
}
.jRatingColor {
background-color: #FFD400; /* bgcolor of the stars*/
position: relative;
@ -121,10 +135,12 @@ p.jRatingInfos {
text-align: center;
padding-top: 5px;
}
p.jRatingInfos span.maxRate {
color: #c9c9c9;
font-size: 14px;
}
/* 模态窗口
*******************************************************************************/
@ -153,6 +169,7 @@ p.jRatingInfos span.maxRate {
position: fixed;
top: 200px;
}
#OpenWindow-header {
background: url("/images/showmodal/hd-bg.png") repeat scroll 0 0 transparent;
border-bottom: 1px solid #CCCCCC;
@ -160,6 +177,7 @@ p.jRatingInfos span.maxRate {
border-top-right-radius: 5px;
padding: 18px 18px 14px;
}
#OpenWindow-content {
-webkit-transition: all 0.2s linear 1s;
-o-transition: all 0.2s linear 1s;
@ -180,9 +198,11 @@ p.jRatingInfos span.maxRate {
width: 14px;
z-index: 2;
}
body {
/*font-size: 13px;*/
}
#OpenWindow .txt-fld {
border-bottom: 1px solid #EEEEEE;
padding: 14px 20px;
@ -190,6 +210,7 @@ body {
text-align: right;
width: 364px;
}
#OpenWindow .txt-fld input {
background: none repeat scroll 0 0 #F7F7F7;
border-color: #CCCCCC #E7E6E6 #E7E6E6 #CCCCCC;
@ -203,14 +224,17 @@ body {
padding: 8px;
width: 244px;
}
#OpenWindow .txt-fld input.good_input {
background: url("/images/showmodal/good.png") no-repeat scroll 236px center #DEF5E1;
}
#OpenWindow .btn-fld {
overflow: hidden;
padding: 12px 20px 12px 130px;
width: 254px;
}
#OpenWindow button {
background: none repeat scroll 0 0 #3F9D4A;
border: medium none;
@ -225,6 +249,7 @@ body {
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
width: auto;
}
/*********************************************************************************************************************
* Wen的OpenWindow
*********************************************************************************************************************/
@ -243,11 +268,13 @@ body {
position: fixed;
top: 200px;
}
#WOpenWindow .school_list {
width: 900px;
line-height: 20px;
}
#WOpenWindow-header {
background: url("/images/showmodal/hd-bg.png") repeat scroll 0 0 transparent;
border-bottom: 1px solid #CCCCCC;
@ -255,6 +282,7 @@ body {
border-top-right-radius: 5px;
padding: 18px 18px 14px;
}
#WOpenWindow-content {
-webkit-transition: all 0.2s linear 1s;
-o-transition: all 0.2s linear 1s;
@ -264,6 +292,7 @@ body {
border-top-right-radius: 5px;
padding: 18px 18px 14px;
}
#WOpenWindow .content {
width: 1000px;
height: 220px;
@ -274,7 +303,6 @@ body {
}
#WOpenWindow .txt-fld {
border-bottom: 1px solid #EEEEEE;
padding: 14px 20px;
@ -282,6 +310,7 @@ body {
text-align: right;
width: 364px;
}
#WOpenWindow .txt-fld input {
background: none repeat scroll 0 0 #F7F7F7;
border-color: #CCCCCC #E7E6E6 #E7E6E6 #CCCCCC;
@ -295,14 +324,17 @@ body {
padding: 8px;
width: 244px;
}
#WOpenWindow .txt-fld input.good_input {
background: url("/images/showmodal/good.png") no-repeat scroll 236px center #DEF5E1;
}
#WOpenWindow .btn-fld {
overflow: hidden;
padding: 12px 20px 12px 130px;
width: 254px;
}
#WOpenWindow button {
background: none repeat scroll 0 0 #3F9D4A;
border: medium none;
@ -318,10 +350,8 @@ body {
width: auto;
}
/*********************************************************************************************************************/
/* 按钮
*******************************************************************************/
.orangeButton {
@ -345,6 +375,7 @@ body {
text-decoration: none;
text-shadow: 0px 1px 0px #754529;
}
.orangeButton:hover {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #db6825), color-stop(1, #e87832));
background: -moz-linear-gradient(top, #db6825 5%, #e87832 100%);
@ -355,10 +386,12 @@ body {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#db6825', endColorstr = '#e87832', GradientType = 0);
background-color: #db6825;
}
.orangeButton:active {
position: relative;
top: 1px;
}
input[class~='whiteButton'], .whiteButton {
-moz-box-shadow: inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow: inset 0px 1px 0px 0px #ffffff;
@ -386,6 +419,7 @@ input[class~='whiteButton'], .whiteButton {
text-decoration: none;
text-shadow: 0px 1px 0px #ffffff;
}
input[class~='whiteButton']:hover, .whiteButton:hover {
color: #c61a1a;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f6f6f6), color-stop(1, #ffffff));
@ -398,20 +432,24 @@ input[class~='whiteButton']:hover, .whiteButton:hover {
text-decoration: none;
background-color: #f6f6f6;
}
input[class~='whiteButton']:active, .whiteButton:active {
position: relative;
top: 1px;
text-decoration: none;
}
input[class~='m3p10'], .m3p10 {
margin: 0;
padding: 3px 10px;
height: 20px;
display: inline-block;
}
input[class~='h30'], .h30 {
height: 30px;
}
/* minimal
*******************************************************************************/
input[class='nyan-minimal'], .nyan-minimal {
@ -432,6 +470,7 @@ input[class='nyan-minimal'], .nyan-minimal {
padding-left: 10px;
padding-right: 10px;
}
input[class='nyan-minimal'], .nyan-minimal:hover {
background: #d9d9d9;
-webkit-box-shadow: inset 0 0 1px 1px #eaeaea;
@ -440,6 +479,7 @@ input[class='nyan-minimal'], .nyan-minimal:hover {
color: #222;
cursor: pointer;
}
input[class='nyan-minimal'], .nyan-minimal:active {
background: #d0d0d0;
-webkit-box-shadow: inset 0 0 1px 1px #e3e3e3;
@ -472,6 +512,7 @@ input[class='nyan-clean-gray'], .nyan-clean-gray {
padding-left: 10px;
padding-right: 10px;
}
input[class='nyan-clean-gray']:hover, .nyan-clean-gray:hover {
background-color: #dddddd;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #dddddd), color-stop(100%, #bbbbbb));
@ -485,6 +526,7 @@ input[class='nyan-clean-gray']:hover, .nyan-clean-gray:hover {
cursor: pointer;
text-shadow: 0 1px 0 #ddd;
}
input[class='nyan-clean-gray']:active, .nyan-clean-gray:active {
border: 1px solid #aaa;
border-bottom: 1px solid #888;
@ -493,7 +535,6 @@ input[class='nyan-clean-gray']:active, .nyan-clean-gray:active {
box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee;
}
#share_label {
line-height: 1.4em
}
@ -506,12 +547,14 @@ input[class='nyan-clean-gray']:active, .nyan-clean-gray:active {
width: 100px;
padding: 3px 5px 0px 5px;
}
.tools a:visited {
color: #116699;
text-decoration: none;
padding: 3px 5px 0px 5px;
width: 100px;
}
.tools a:hover {
color: white;
padding: 3px 3px 0px 20px;
@ -519,6 +562,7 @@ input[class='nyan-clean-gray']:active, .nyan-clean-gray:active {
text-decoration: none;
background-color: #539D26;
}
.tools a:active {
color: white;
padding: 3px 3px 0px 20px;
@ -532,6 +576,7 @@ input[class='nyan-clean-gray']:active, .nyan-clean-gray:active {
margin: 0px 0px 0px 10%;
padding: 0;
}
.tools li {
background: url("/images/sidebar/tool_tag_alpha.png") 10px 30% no-repeat transparent;
color: #3e3e3e;
@ -542,9 +587,11 @@ input[class='nyan-clean-gray']:active, .nyan-clean-gray:active {
font-size: 1.0em;
/*border-bottom: 1px solid #CCC;*/
}
.tools li:last-child {
border: none;
}
/* 贴吧 forum memo
*******************************************************************************/
@ -556,6 +603,7 @@ div.actions input[type="text"]{
-box-sizing: border-box;
}
.lz {
position: relative;
min-height: 200px;
@ -564,17 +612,20 @@ div.actions input[type="text"]{
box-shadow: 1px 1px 6px #97EBF4;
border: 1px solid #F1F1F1;
}
.lz-left {
float: left;
margin: 2%;
padding: 0;
}
.memo-section {
width: auto;
margin-left: 15%;
padding-top: 1%;
border-left: 2px dotted #EEE;
}
.memo-title {
margin: 1em 0;
padding-left: 1%;
@ -582,6 +633,7 @@ div.actions input[type="text"]{
font-weight: bold;
border-bottom: 1px dashed rgb(204, 204, 204);
}
.memo-content {
padding: 1%;
margin: 1%;
@ -589,18 +641,21 @@ div.actions input[type="text"]{
background-color: #F8F8F8;
border-radius: 3px;
}
.memo-timestamp {
position: absolute;
bottom: 0px;
right: 0;
margin: 20px;
}
.replies {
overflow: hidden;
max-width: 100%;
float: right;
/*max-width: 90%;*/
}
.reply-box {
float: right;
width: 640px;
@ -609,6 +664,7 @@ div.actions input[type="text"]{
border-top: 2px double #C6F3F9;
/*border-radius: 10px;*/
}
.memo-content img, .comments img {
overflow: hidden;
/*width: 100%;*/
@ -616,33 +672,39 @@ div.actions input[type="text"]{
height: auto !important;
width: expression(this.width > 500 ? "500px" : this.width+"px");
}
table.content-text-list tbody tr td.sticky, div.memo-section .sticky {
background: url(../images/zding.gif) no-repeat 0 1px; padding-left: 35px;
background: url(../images/zding.gif) no-repeat 0 1px;
padding-left: 35px;
/*background: url(../images/2uparrow.png) no-repeat 0 1px; padding-left: 20px;*/
font-weight: bold;
margin-left: 5px;
}
table.content-text-list tbody tr td.locked, div.memo-section .locked {
background: url(../images/locked.png) no-repeat 0 1px;
padding-left: 20px;
margin-left: 5px;
}
/* 问题列表
*******************************************************************************/
.query_form {
}
.content-title-top {
padding-bottom: 10px;
}
.custom_query {
max-width: 95%;
margin: 3px auto;
border-bottom : solid 1px #;
-o-box-shadow: inset 0px 1px 1px 0px #FAFAFA;
-moz-box-shadow: inset 0px 1px 1px 0px #FAFAFA;
-webkit-box-shadow: inset 0px 1px 1px 0px #FAFAFA;
box-shadow: inset 0px 1px 1px 0px #FAFAFA;
}
.custom_query>span {
display: block;
max-width: 100%;
@ -652,6 +714,7 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
border-radius: 3px;
background-color: #DBEBEE;
}
.custom_query > .hide-when-print {
max-width: 97%;
padding: 1px 3px 6px;
@ -660,6 +723,7 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
/* 项目新闻栏
*******************************************************************************/
.add_frame {
@ -670,6 +734,7 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
/*box-shadow: 1px 1px 6px rgb(241,241,241);*/
/*border: 1px solid #F1F1F1;*/
}
.add_frame_header {
background: linear-gradient(#fbfbfb, #f8f8f8) repeat scroll 0% 0% transparent;
border-bottom: 1px solid rgb(226, 226, 226);
@ -682,22 +747,29 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
font-size: 1.5em;
padding-left: 4%;
}
/* xx动态框
*******************************************************************************/
.project_acts *{border:1px solid #000000;}
.project_acts * {
border: 1px solid #000000;
}
.project_acts {
height: 250px;
}
.project_acts .project_acts_left {
float: left;
height: 100%;
width: 61%;
}
.project_acts .project_acts_right {
height: 100%;
margin-left: 61%;
}
/* stores 资源库
*******************************************************************************/
.line_block {
@ -710,9 +782,11 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
-moz-box-sizing: border-box;
-box-sizing: border-box;
}
.resource_sum {
height: auto;
}
.line_block p {
margin: 20px -2px 0px 0px;
/*background: linear-gradient(#ffffff, #e5e5e5) repeat scroll 0% 0% transparent;*/
@ -728,15 +802,18 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
padding-left: 4%;
border-bottom: 1px solid rgb(21, 165, 200);
}
.resource_sum, .line_blo {
border: 1px solid #eeeeee;
}
.filename {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 247px;
max-width: 230px;
}
.line_block .table1 {
display: table;
width: 100%;
@ -744,11 +821,13 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
border-right: 1px solid #eeeeee;
border-bottom: 1px solid #eeeeee;
}
.line_block .table_row1 {
height: 38px;
display: table-row;
width: 100%;
}
.line_block .table_cell1 {
display: table-cell;
padding: 2px;
@ -760,10 +839,12 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
width: 62%;
padding-left: 8px;
}
.line_block .filedown1 {
width: 19%;
text-align: center;
}
.line_block .downicon1 {
width: 19%;
text-align: center;
@ -772,13 +853,16 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
.blue-color, .blue-color a {
color: rgb(109, 153, 178);
}
.gray-color, .gray-color a {
color: rgb(153, 153, 153);
}
#top_field {
max-width: 100%;
margin: 20px auto;
}
.blueinputbar {
-o-transform-origin: 138px 46.5px;
-o-transition: background 0.2s cubic-bezier(0, 0, 1, 1);
@ -816,6 +900,7 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
vertical-align: top;
word-wrap: break-word;
}
input.blueinputbar:focus {
box-shadow: rgba(0, 0, 0, 0.047) 0px 1px 3px 0px inset, rgba(82, 168, 236, 0.600) 0px 0px 5px 0px;
border-bottom: 1px solid #56B4EF;
@ -824,6 +909,7 @@ input.blueinputbar:focus {
border-right: 1px solid #56B4EF;
border-top: 1px solid #56B4EF;
}
.r1 {
font-size: 13px;
line-height: 1.7em;
@ -832,15 +918,18 @@ input.blueinputbar:focus {
/*padding-left: 20px;*/
/*width: 50em;*/
}
.r1 .cb {
font-size: 16px;
color: #3333cc;
}
/* course 用户 课程 历史
*******************************************************************************/
.courses_history {
opacity: 0.7;
}
.courses_history a {
color: #666;
}
@ -858,4 +947,196 @@ div.issue{
box-shadow: 3px 3px 10px rgba(100,150,205,0.1);*/
}
/* project 文件列表 资源库
*******************************************************************************/
.tags_area {
height: 5px;
}
#ver-zebra, .file_table_des {
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 5px 10px;
width: 98%;
text-align: left;
border-collapse: collapse;
font-size: 14px;
}
#ver-zebra th {
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #039;
text-align: left;
}
#ver-zebra td {
padding: 8px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #669;
}
#ver-zebra td.description {
background-color: white;
padding: 0px;
margin: 0px auto;
}
#ver-zebra1, .file_table_des {
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin: 5px 10px;
width: 98%;
text-align: left;
border-collapse: collapse;
line-height: 20px;
font-size: 14px;
}
#ver-zebra1 th {
font-size: 14px;
font-weight: normal;
padding: 12px 15px;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #039;
text-align: left;
}
#ver-zebra1 td {
padding: 8px ;
border-right: 1px solid #fff;
border-left: 1px solid #fff;
color: #669;
}
#ver-zebra1 td.description {
background-color: white;
padding: 0px;
margin: 0px auto;
}
div.tags_area {
padding: 2px 10px 10px 10px;
margin: 0px;
margin-bottom: 10px;
/*border-bottom: 1px dashed #CCCCCC;*/
overflow: hidden;
position: relative;
}
.tags_gradint {
}
.read-more {
padding: 5px;
border-top: 4px double #ddd;
background: #fff;
color: #333;
}
.read-more a {
padding-right: 22px;
background: no-repeat 100% 50%;
font-weight: bold;
text-decoration: none;
}
.read-more a:hover {
color: #000;
}
.vzebra-odd {
background: #eff2ff;
}
.vzebra-even {
background: #e8edff;
}
#ver-zebra #vzebra-adventure, #ver-zebra #vzebra-children {
background: #ffffff;
border-bottom: 1px solid #c8d4fd;
}
#ver-zebra #vzebra-comedy, #ver-zebra #vzebra-action {
background: #ffffff;
border-bottom: 1px solid #d6dfff;
}
#ver-zebra1 #vzebra-adventure, #ver-zebra #vzebra-children {
background: #ffffff;
border-bottom: 1px solid #c8d4fd;
}
#ver-zebra1 #vzebra-comedy, #ver-zebra #vzebra-action {
background: #ffffff;
border-bottom: 1px solid #d6dfff;
}
ver-zebra .filename {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
div.pagination {
margin: 10px 0px;
height: 1.5em;
text-align: left;
font-size: 13px;
}
.m5p5 {
display: inline-block;
height: auto;
color: white !important;
margin: 8px;
padding: 3px 7px;
}
.m5p5:hover {
text-decoration: none;
/*padding-bottom: 3px;*/
/*border-bottom: 1px solid #666666;*/
border-radius: 4px;
border: 1px solid #15bccf;
box-shadow: 3px 3px 3px #666666;
}
.relation_file_div {
margin: 0px 25px;
}
.relation_file_div fieldset {
margin: 0px 0px;
padding: 10px;
border-radius: 5px;
transition: all 2s linear 1s;
}
.relation_file_div input#attach_search:focus {
border: 1px solid #1B95C6;
box-shadow: 0px 0px 4px #1B95C6;
width: 200px;
}
.relation_file_div input#attach_search {
width: 150px;
outline: none;
border-radius: 5px;
-webkit-transition: 1s width;
-moz-transition: 1s width;
-o-transition: 1s width;
transition: 1s width;
}
.all_browse_div table .description{
border-bottom: 1px solid #efffff;
}
.all_browse_div table td{
vertical-align: middle;
}

View File

@ -405,6 +405,16 @@ a.attachments_list_color {
background: url('../images/list-icon.png') no-repeat scroll left center;
font-size: 10pt;
}
/*帖子标题前吧名*/
.memo_activity .memo_Bar_title{
display: inline-block;
/*color: #59ceff;*/
color: #e8770d;
font-weight: bold;
margin-bottom: 3px;
padding-left: 0px;
font-size: 10pt;
}
/*帖子的各种属性*/
.memo_activity .memo_attr{
margin-left: 20px;
@ -442,4 +452,15 @@ a.attachments_list_color {
font-size: 10pt;
}
/************************** 贴吧动态 结束 ****************************
/************************** 贴吧动态 结束 ****************************/
/************************** 学校课程 开始 ****************************/
.course{
}
.course .font_welcome_school{
font-family: Tahoma,"Microsoft YaHei";
font-weight: bold;
font-size: 20px;
color:#e8770d;
}
/************************** 学校课程 结束 ****************************/

9
test/fixtures/attachmentstypes.yml vendored Normal file
View File

@ -0,0 +1,9 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
one:
typeId:
typeName:
two:
typeId:
typeName:

View File

@ -0,0 +1,7 @@
require 'test_helper'
class AttachmentstypeTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end