Merge remote-tracking branch 'origin/szzh' into guange_dev

This commit is contained in:
guange 2015-05-21 11:20:12 +08:00
commit 7b5021c4fd
45 changed files with 696 additions and 531 deletions

View File

@ -258,7 +258,7 @@ module Mobile
requires :course_id,type: Integer,desc: '课程id' requires :course_id,type: Integer,desc: '课程id'
optional :name,type:String,desc:'课件名称可能包含的字符' optional :name,type:String,desc:'课件名称可能包含的字符'
end end
get ":course_id/attachments" do post ":course_id/attachments" do
cs = CoursesService.new cs = CoursesService.new
count = cs.course_attachments params count = cs.course_attachments params
present :data, count, with: Mobile::Entities::Attachment present :data, count, with: Mobile::Entities::Attachment

View File

@ -94,6 +94,31 @@ module Mobile
present :status, 0 present :status, 0
end end
desc "用户留言"
params do
requires :token, type: String
requires :user_id, type: Integer,desc: '被留言的用户id'
end
get ':user_id/messages' do
us = UsersService.new
jours = us.get_all_messages params
present :data,jours,with:Mobile::Entities::Jours
present :status,0
end
desc "给用户留言或回复用户留言"
params do
requires :token, type: String
requires :user_id, type: Integer,desc: '被留言的用户id'
requires :content,type:String,desc:'留言内容'
optional :refer_user_id,type:Integer,desc:'被回复的用户id'
end
post ':user_id/leave_message' do
us = UsersService.new
jours = us.leave_messages params,current_user
present :status,0
end
end end
end end
end end

View File

@ -32,13 +32,17 @@ class BoardsController < ApplicationController
#modify by nwb #modify by nwb
@flag = params[:flag] || false @flag = params[:flag] || false
if @project if @project
@boards = @project.boards.includes(:last_message => :author).all if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin?
@boards = [] << @boards[0] if @boards.any? render_403
if @boards.size == 1 else
@board = @boards.first @boards = @project.boards.includes(:last_message => :author).all
show and return @boards = [] << @boards[0] if @boards.any?
if @boards.size == 1
@board = @boards.first
show and return
end
render :layout => false if request.xhr?
end end
render :layout => false if request.xhr?
elsif @course elsif @course
if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course))) if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course)))
@boards = @course.boards.includes(:last_message => :author).all @boards = @course.boards.includes(:last_message => :author).all

View File

@ -342,10 +342,15 @@ class CoursesController < ApplicationController
def export_course_member_excel def export_course_member_excel
@all_members = student_homework_score(0,0,0,"desc") @all_members = student_homework_score(0,0,0,"desc")
filename="#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}";
# 如果是ie11 需要转码
if(/rv\:11\.0/.match(request.env["HTTP_USER_AGENT"]) != nil)
filename= URI::encode(filename)
end
respond_to do |format| respond_to do |format|
format.xls { format.xls {
send_data(member_to_xls(@all_members,@course.course_groups), :type => "text/excel;charset=utf-8; header=present", send_data(member_to_xls(@all_members,@course.course_groups), :type => "text/excel;charset=utf-8; header=present",
:filename => "#{@course.teacher.lastname.to_s + @course.teacher.firstname.to_s }_#{@course.name}_#{@course.time.to_s + @course.term}#{l(:excel_member_list)}.xls") :filename => "#{filename}.xls")
} }
end end
end end

View File

@ -23,7 +23,7 @@ class FilesController < ApplicationController
before_filter :auth_login1, :only => [:index] before_filter :auth_login1, :only => [:index]
before_filter :logged_user_by_apptoken,:only => [:index] before_filter :logged_user_by_apptoken,:only => [:index]
before_filter :find_project_by_project_id#, :except => [:getattachtype] before_filter :find_project_by_project_id#, :except => [:getattachtype]
before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:search_project,:quote_resource_show_project,:search_tag_attachment] before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,:search_tag_attachment]
helper :sort helper :sort
include SortHelper include SortHelper
@ -46,6 +46,13 @@ class FilesController < ApplicationController
@obj_attachments = paginateHelper @all_attachments,10 @obj_attachments = paginateHelper @all_attachments,10
end end
def searchone4reload
attachment = Attachment.find_by_id(params[:fileid]);
respond_to do |format|
format.html{render :layout => nil,:locals=>{:file=>attachment,:course=>@course}}
end
end
def search def search
sort = "" sort = ""
@sort = "" @sort = ""

View File

@ -84,15 +84,10 @@ class IssuesController < ApplicationController
@issue_pages = Paginator.new @issue_count, @limit, params['page'] @issue_pages = Paginator.new @issue_count, @limit, params['page']
@offset ||= @issue_pages.offset @offset ||= @issue_pages.offset
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version], @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
:order => sort_clause, :order => sort_clause,
:offset => @offset, :offset => @offset,
:limit => @limit) :limit => @limit)
@issue_count_by_group = @query.issue_count_by_group @issue_count_by_group = @query.issue_count_by_group
respond_to do |format| respond_to do |format|
format.js format.js
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young

View File

@ -31,7 +31,7 @@ class ProjectsController < ApplicationController
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course] before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches] before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar] before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
before_filter :file, :statistics, :watcherlist before_filter :file, :statistics #:watcherlist
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去 # 除非项目内人员,不可查看成员, TODO: 完了写报表里去
before_filter :memberAccess, only: :member before_filter :memberAccess, only: :member
@ -417,10 +417,14 @@ class ProjectsController < ApplicationController
@members = @project.member_principals.includes(:roles, :principal).all.sort @members = @project.member_principals.includes(:roles, :principal).all.sort
end end
else else
roles = Role.find_all_givable if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin?
@subPage_title = l :label_member_list render_403
@members = @project.member_principals.includes(:roles, :principal).joins("LEFT JOIN #{OptionNumber.table_name} ON #{OptionNumber.table_name}.user_id = #{Member.table_name}.user_id and #{OptionNumber.table_name}.score_type = 2 AND #{Member.table_name}.project_id = #{OptionNumber.table_name}.project_id").order("#{OptionNumber.table_name}.total_score DESC").all else
@applied_members = appied_project_members(@project, @members) roles = Role.find_all_givable
@subPage_title = l :label_member_list
@members = @project.member_principals.includes(:roles, :principal).joins("LEFT JOIN #{OptionNumber.table_name} ON #{OptionNumber.table_name}.user_id = #{Member.table_name}.user_id and #{OptionNumber.table_name}.score_type = 2 AND #{Member.table_name}.project_id = #{OptionNumber.table_name}.project_id").order("#{OptionNumber.table_name}.total_score DESC").all
@applied_members = appied_project_members(@project, @members)
end
end end
@members = paginateHelper @members @members = paginateHelper @members
render :layout => 'base_courses' if @project.project_type == 1 render :layout => 'base_courses' if @project.project_type == 1
@ -676,11 +680,13 @@ class ProjectsController < ApplicationController
true true
end end
# added by huang
def watcherlist def watcherlist
if @watched unless @project.nil?
@users -= watched.watcher_users if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin?
render_403
else
@users -= watched.watcher_users if @watched
end
end end
end end

View File

@ -383,6 +383,8 @@ class UsersController < ApplicationController
# scope = User.logged.status(@status) # scope = User.logged.status(@status)
# @search_by = params[:search_by] ? params[:search_by][:id] : 0 # @search_by = params[:search_by] ? params[:search_by][:id] : 0
# scope = scope.like(params[:name],@search_by) if params[:name].present? # scope = scope.like(params[:name],@search_by) if params[:name].present?
@search_by = params[:search_by] ? params[:search_by] : 0
us = UsersService.new us = UsersService.new
scope = us.search_user params scope = us.search_user params
@user_count = scope.count @user_count = scope.count

View File

@ -85,6 +85,9 @@ class WordsController < ApplicationController
elsif @journal_destroyed.jour_type == "Course" elsif @journal_destroyed.jour_type == "Course"
@course = Course.find @journal_destroyed.jour_id @course = Course.find @journal_destroyed.jour_id
@jours_count = @course.journals_for_messages.where('m_parent_id IS NULL').count @jours_count = @course.journals_for_messages.where('m_parent_id IS NULL').count
elsif @journal_destroyed.jour_type == "Principal"
@user = User.find(@journal_destroyed.jour_id)
@jours_count = @user.journals_for_messages.where('m_parent_id IS NULL').count
end end
respond_to do |format| respond_to do |format|
format.js format.js

View File

@ -593,13 +593,38 @@ module ApplicationHelper
Project.project_tree(projects, &block) Project.project_tree(projects, &block)
end end
# 项目版本库可见权限判断
# 条件1、modules中设置不可见或项目没有版本库2、如果项目是私有或者项目版本库隐藏则必须是项目成员才可见
def visible_repository?(project)
@result = false
unless project.enabled_modules.where("name = 'repository'").empty? || project.repositories.count == 0
if (project.hidden_repo || !project.is_public?)
if User.current.member_of?(project)
@result = true
end
else
@result = true
end
end
return @result
end
# 判断当前用户是否为项目管理员 # 判断当前用户是否为项目管理员
def is_project_manager?(user_id,project_id) def is_project_manager?(user_id, project_id)
@result = false @result = false
mem = Member.where("user_id = ? and project_id = ?",user_id, project_id) mem = Member.where("user_id = ? and project_id = ?",user_id, project_id)
unless mem.blank? unless mem.blank?
mem.first.roles.to_s.include?("Manager") @result = mem.first.roles.to_s.include?("Manager") ? true : false
@result = false end
return @result
end
# 公开项目资源可以引用admin和管理员和资源上传者拥有设置公开私有权限
def authority_pubilic_for_files(project, file)
@result = false
if (is_project_manager?(User.current.id, @project.id) || file.author_id == User.current.id || User.current.admin) &&
project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project"
@result = true
end end
return @result return @result
end end

View File

@ -67,29 +67,33 @@ module IssuesHelper
s.html_safe s.html_safe
end end
#获取跟踪类型 #获取跟踪类型及样式
#REDO:时间紧需要优化,两个方法可以综合成一个 #REDO:时间紧可以优化.
def get_issue_type(value) def get_issue_type(value)
issuetype = []
if value == "缺陷" || value == 1 if value == "缺陷" || value == 1
class_type = "red_btn_cir ml10" issuetype << "red_btn_cir ml10"
issuetype << "缺陷"
elsif value == "功能" || value == 2 elsif value == "功能" || value == 2
class_type = "blue_btn_cir ml10" issuetype << "blue_btn_cir ml10"
issuetype << "功能"
elsif value == "支持" || value == 3 elsif value == "支持" || value == 3
class_type = "green_btn_cir ml10" issuetype << "green_btn_cir ml10"
issuetype << "支持"
elsif value == "任务" || value == 4
issuetype << "orange_btn_cir ml10"
issuetype << "任务"
else else
class_type = "orange_btn_cir ml10" issuetype << "bgreen_btn_cir ml10"
issuetype << "周报"
end end
end end
def get_issue_typevalue(value) def principals_options_for_isuue_list(project)
if value == "缺陷" || value == 1 if User.current.member_of?(project)
assign = "缺陷" project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0])
elsif value == "功能" || value == 2
assign = "功能"
elsif value == "支持" || value == 3
assign = "支持"
else else
assign = "任务" project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["指派给", 0])
end end
end end

View File

@ -4,6 +4,7 @@ class UsersService
include AvatarHelper include AvatarHelper
include CoursesHelper include CoursesHelper
include ApiHelper include ApiHelper
include WordsHelper
#将用户注册的功能函数写这里 #将用户注册的功能函数写这里
#参数约定 #参数约定
#成功返回注册后的User实例失败直接抛异常 #成功返回注册后的User实例失败直接抛异常
@ -154,6 +155,25 @@ class UsersService
@user @user
end end
# 获取某个用户的所有留言信息
def get_all_messages params
user = User.find(params[:user_id])
jours = user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
jours.update_all(:is_readed => true, :status => false)
jours.each do |journal|
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
end
jours
end
# 给某个用户留言
def leave_messages params,current_user
user = User.find(params[:user_id])
user.add_jour(current_user, params[:content], params[:refer_user_id] ||= 0)
unless params[:refer_user_id].nil? || params[:refer_user_id] == 0 || params[:refer_user_id] == User.current.id
User.find(params[:refer_user_id]).add_jour(current_user, params[:content], params[:refer_user_id])
end
end
@ -206,10 +226,18 @@ class UsersService
} }
scope = User.logged.status(status) scope = User.logged.status(status)
if params[:is_search_assitant].nil? if params[:is_search_assitant].nil?
watcher = User.watched_by(params[:user_id]) #modify by yutao 2015/5/18 没有params[:user_id]参数时去掉"id not in (?)"条件(bug:#2270) start
watcher.push(params[:user_id]) #say by yutao: params[:user_id]这个是指谁发起的搜索么? 如果是 这个值貌似应该从session获取 怪怪的赶脚-_-!
search_by = params[:search_by] ? params[:search_by] : "0" search_by = params[:search_by] ? params[:search_by] : "0"
scope = scope.where("id not in (?)",watcher).like(params[:name],search_by) if params[:name].present? if params[:name].present?
if !params[:user_id].nil?
watcher = User.watched_by(params[:user_id])
watcher.push(params[:user_id])
scope = scope.where("id not in (?)",watcher)
end
scope = scope.like(params[:name],search_by)
end
#modify by yutao 2015/5/18 没有params[:user_id]参数时去掉"id not in (?)"条件 end
else else
teachers = searchTeacherAndAssistant(Course.find(params[:course_id])) teachers = searchTeacherAndAssistant(Course.find(params[:course_id]))
scope = scope.where("id not in (?)",teachers.map{|t| t.user_id}).like(params[:name],search_by) if params[:name].present? scope = scope.where("id not in (?)",teachers.map{|t| t.user_id}).like(params[:name],search_by) if params[:name].present?

View File

@ -28,7 +28,8 @@
<div class="attachments" style="font-weight:normal;"> <div class="attachments" style="font-weight:normal;">
<% is_float ||= false %> <% is_float ||= false %>
<% for attachment in attachments %> <% for attachment in attachments %>
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"> <div style="float:left;">
<p style="height:14px;line-height:10px;width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<%if is_float%> <%if is_float%>
<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;"> <div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">
<% end%> <% end%>
@ -50,9 +51,10 @@
:id => attachment, :id => attachment,
:filename => attachment.filename%> :filename => attachment.filename%>
<% end %> <% end %>
<span title="<%= attachment.description%>"> </div>
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %> <div style="float:left;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="<%= attachment.description%>">
</span> <%= h(" - #{attachment.description}") unless attachment.description.blank? %>
</div>
<span class="size">( <span class="size">(
<%= number_to_human_size attachment.filesize %>) <%= number_to_human_size attachment.filesize %>)
</span> </span>

View File

@ -4,4 +4,5 @@
$("#error_show").html("<%= @message.html_safe %>"); $("#error_show").html("<%= @message.html_safe %>");
<% else %> <% else %>
closeModal(); closeModal();
searchone4reload('<%=params[:file_id]%>');
<% end %> <% end %>

View File

@ -1,4 +1,15 @@
<script> <script>
function searchone4reload(fileid){
var url = "<%= searchone4reload_course_files_path(@course)%>";
var data = {};data.fileid=fileid;
$.ajax({
url:url,dataType:'text',data:data,success:function(text){
var container_file_div = $("#container_files_"+fileid);
container_file_div.after(text);
container_file_div.remove();
}
});
}
function show_upload(obj) function show_upload(obj)
{ {
switch(obj) switch(obj)

View File

@ -1,66 +1,66 @@
<% delete_allowed = User.current.allowed_to?(:manage_files, course) %> <% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
<div class="re_con_top"> <div class="re_con_top">
<p class="f_l c_blue f_b f_14">共有&nbsp;<%= all_attachments.count%>&nbsp;个资源</p> <p class="f_l c_blue f_b f_14">共有&nbsp;<%= all_attachments.count%>&nbsp;个资源</p>
<p class="f_r" style="color: #808080"> <p class="f_r" style="color: #808080">
<% if order == "asc" %> <% if order == "asc" %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp; 按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp; <%= link_to "下载次数",params.merge(:sort=>"downloads:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp;/&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序 <%= link_to "引用次数",params.merge(:sort=>"quotes:desc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序
<% else %> <% else %>
按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp; 按&nbsp;<%= link_to "时间",params.merge(:sort=>"created_on:asc"),:class => "f_b c_grey" ,:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp; /&nbsp; <%= link_to "下载次数",params.merge(:sort=>"downloads:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"downloads"} %>&nbsp; /&nbsp;
<%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序 <%= link_to "引用次数",params.merge(:sort=>"quotes:asc"),:class => "f_b c_grey",:remote => @is_remote %><%= render partial: 'arrow_show',locals: { sort: sort,order:order,current:"quotes"} %>&nbsp;排序
<% end %> <% end %>
</p> </p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="files_tag" id="files_tag"> <div class="files_tag" id="files_tag">
<%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course,:tag_name => @tag_name}%> <%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course,:tag_name => @tag_name}%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="for_img_thumbnails"> <div class="for_img_thumbnails">
<% curse_attachments.each do |file| %> <% curse_attachments.each do |file| %>
<% if file.is_public? || User.current.member_of_course?(course) %> <% if file.is_public? || User.current.member_of_course?(course) %>
<div class="re_con_box"> <div class="re_con_box" id="container_files_<%= file.id %>">
<div class=""> <div class="">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %> <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %>
<% if User.current.logged? %> <% if User.current.logged? %>
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %> <% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
<span id="is_public_<%= file.id %>"> <span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %> <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %>
</span> </span>
<% else %> <% else %>
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> --> <!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
<% end %> <% end %>
<% else %> <% else %>
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% end %> <% end %>
<% else %> <% else %>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class=""> <div class="">
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p> <p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
<%= link_to( l(:button_delete), attachment_path(file), <%= link_to( l(:button_delete), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%> :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p> <p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="tag_h"> <div class="tag_h">
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div><!---re_con_box end--> </div><!---re_con_box end-->
<% else %> <% else %>
<div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div> <div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div>
<% end %>
<% end %> <% end %>
<% end %>
</div> </div>
<ul class="wlist"> <ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%> <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>

View File

@ -20,14 +20,16 @@
<div class=""> <div class="">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
<% if User.current.logged? %> <% if User.current.logged? %>
<%#--私有项目资源不能引用,不能设置公开私有--%> <% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
<%#--公开项目资源可以应用,管理员和资源上传者拥有设置公开私有权限--%> <%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> <% else %>
<% if (is_project_manager?(User.current.id, @project.id) || file.author_id == User.current.id) && project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project" %> <%= link_to(l(:label_slected_to_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
<% end %>
<% if authority_pubilic_for_files(project, file) %>
<span id="is_public_<%= file.id %>"> <span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %> <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %>
</span> </span>
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -27,6 +27,8 @@ $('#upload_file_div').slideToggle('slow');
<%elsif @course%> <%elsif @course%>
closeModal(); closeModal();
$("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>'); $("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>');
$("#courses_files_count_info").html("<%= @all_attachments.count%>");
$("#courses_files_count_nav").html("(<%= @all_attachments.count%>)")
<% end %> <% end %>
<% end %> <% end %>
$(document).ready(img_thumbnails); $(document).ready(img_thumbnails);

View File

@ -0,0 +1,39 @@
<% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
<% if file.is_public? || User.current.member_of_course?(course) %>
<div class="re_con_box" id="container_files_<%= file.id %>">
<div class="">
<%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %>
<% if User.current.logged? %>
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
<%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %>
<span id="is_public_<%= file.id %>">
<%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %>
</span>
<% else %>
<!-- <#%= link_to (file.is_public? ? "公开":"私有"),"javascript:void(0)",:class=>"f_l re_open" %> -->
<% end %>
<% else %>
<%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %>
<% end %>
<% else %>
<% end %>
</div>
<div class="cl"></div>
<div class="">
<p class="f_l mb5 c_grey02">文件大小:<%= number_to_human_size(file.filesize) %></p>
<%= link_to( l(:button_delete), attachment_path(file),
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>&nbsp;&nbsp;|&nbsp;&nbsp;下载<%= file.downloads %>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
</div>
<div class="cl"></div>
<div class="tag_h">
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
</div>
<div class="cl"></div>
</div><!---re_con_box end-->
<% else %>
<div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div>
<% end %>

View File

@ -12,7 +12,7 @@
<%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %> <%= link_to issue.author.name, user_path(issue.author), :class => "problem_name c_orange fl" %>
<span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>)</span> <span class="fl"><%= l(:label_post_on_issue) %>(<%= "#{raw column_content[2]}" %>)</span>
<div class="problem_tit_div fl"> <div class="problem_tit_div fl">
<%=link_to "#{column_content[4]}<span class = '#{get_issue_type(column_content[1])}'>#{get_issue_typevalue(column_content[1])}</span>".html_safe, issue_path(issue.id), :class => "problem_tit_a break_word",:target => "_blank" %> <%=link_to "#{column_content[4]}<span class = '#{get_issue_type(column_content[1])[0]}'>#{get_issue_type(column_content[1])[1]}</span>".html_safe, issue_path(issue.id), :class => "problem_tit_a break_word",:target => "_blank" %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<p> <p>

View File

@ -39,7 +39,7 @@
</div><!--problem_search end--> </div><!--problem_search end-->
<div id="filter_form" class="fr" > <div id="filter_form" class="fr" >
<%= select( :issue,:user_id, @project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["指派给",0]), <%= select( :issue, :user_id, principals_options_for_isuue_list(@project),
{ :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0 { :include_blank => false,:selected=>@assign_to_id ? @assign_to_id : 0
}, },
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"v[assigned_to_id]",:class=>"w90"} {:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"v[assigned_to_id]",:class=>"w90"}
@ -66,8 +66,8 @@
</div><!--filter_form end--> </div><!--filter_form end-->
<div class="cl"></div> <div class="cl"></div>
<%# end %> <%# end %>
<p class="problem_p fl" ><%= l(:label_issues_sum) %><a href="javascript:void(0)" class="c_red"><%= @project.issues.count %></a> <p class="problem_p fl" ><%= l(:label_issues_sum) %><a href="javascript:void(0)" class="c_red"><%= @project.issues.visible.all.count %></a>
<%= l(:lable_issues_undo) %><a href="javascript:void(0)" class="c_red"><%= @project.issues.where('status_id in (1,2,4,6)').count %> </a> <%= l(:lable_issues_undo) %><a href="javascript:void(0)" class="c_red"><%= @project.issues.where('status_id in (1,2,4,6)').visible.all.count %> </a>
</p> </p>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1 +1,3 @@
$("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>"); $("#issue_list").html("<%= escape_javascript(render :partial => 'issues/list',:locals => {:issues => @issues, :query => @query,:issue_pages=>@issue_pages,:issue_count=>@issue_count})%>");
$("#v_subject").focus();
$("#v_subject").blur();

View File

@ -2,7 +2,6 @@
<h2 class="project_h2"><%= l(:label_issue_new) %></h2> <h2 class="project_h2"><%= l(:label_issue_new) %></h2>
</div> </div>
<%= call_hook(:view_issues_new_top, {:issue => @issue}) %> <%= call_hook(:view_issues_new_top, {:issue => @issue}) %>
<%= labelled_form_for @issue, :url => project_issues_path(@project), <%= labelled_form_for @issue, :url => project_issues_path(@project),
:html => {:id => 'issue-form', :multipart => true} do |f| %> :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue' %> <%= error_messages_for 'issue' %>
@ -16,7 +15,6 @@
</a> </a>
<%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %> <%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %>
<% end %> <% end %>
<div id="preview" class="wiki"></div> <div id="preview" class="wiki"></div>
<% content_for :header_tags do %> <% content_for :header_tags do %>

View File

@ -14,7 +14,7 @@
<div class="talk_txt fl"> <div class="talk_txt fl">
<p class="pro_page_tit" style="word-break:break-all;"> <p class="pro_page_tit" style="word-break:break-all;">
<%= @issue.subject %> <%= @issue.subject %>
<span class='<%= "#{get_issue_type(@issue.tracker_id)}" %>'><%= get_issue_typevalue(@issue.tracker_id) %></span> <span class='<%= "#{get_issue_type(@issue.tracker_id)[0]}" %>'><%= get_issue_type(@issue.tracker_id)[1] %></span>
</p><br/> </p><br/>
<div class="cl"></div> <div class="cl"></div>

View File

@ -1,61 +0,0 @@
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<a class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :class => "f14 c_blue02" %>
<% unless @project.issues.count == 0 %>
<a class="subnav_num">(<%= @project.issues.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.boards.first.topics.count == 0 %>
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless attaments_num == 0 %>
<a class="subnav_num">(<%= attaments_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end %>
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% unless @project.enabled_modules.where("name = 'repository'").empty? || @project.repositories.count == 0 %>
<% if @project.hidden_repo || !@project.is_public? %>
<% if User.current.member_of?(@project) %>
<div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<a class="subnav_num">(<%= @project.repositories.count %>)</a>
</div>
<% end %>
<% else %>
<div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<a class="subnav_num">(<%= @project.repositories.count %>)</a>
</div>
<% end %>
<% end %>
<!-- more -->
<div class="subNav subNav_jiantou" onclick="$('#navContent').toggle(500);" id="expand_tools_expand"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContent">
<%= render 'projects/tools_expand' %>
</ul>

View File

@ -1,29 +0,0 @@
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<a class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.boards.first.topics.count == 0 %>
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless attaments_num == 0 %>
<a class="subnav_num">(<%= attaments_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end %>

View File

@ -1,40 +0,0 @@
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<a class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :class => "f14 c_blue02" %>
<% unless @project.issues.count == 0 %>
<a class="subnav_num">(<%= @project.issues.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.boards.first.topics.count == 0 %>
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless attaments_num == 0 %>
<a class="subnav_num">(<%= attaments_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end%>

View File

@ -20,5 +20,4 @@
!Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %> !Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
<%= exit_project_link(@project) %> <%= exit_project_link(@project) %>
<% end %> <% end %>
</div> </div>

View File

@ -95,7 +95,7 @@
<span>|&nbsp;</span> <span>|&nbsp;</span>
<%= l(:label_account_identity_student)%><%= course_student_link student_num %> <%= l(:label_account_identity_student)%><%= course_student_link student_num %>
<span>|&nbsp;</span> <span>|&nbsp;</span>
<%= l(:project_module_attachments)%><%= link_to course_file_num, course_files_path(@course), :class => 'info_foot_num c_blue' %></div> <%= l(:project_module_attachments)%><%= link_to course_file_num, course_files_path(@course), :class => 'info_foot_num c_blue',:id=>'courses_files_count_info' %></div>
<div class="cl"></div> <div class="cl"></div>
</div><!--课程信息 end--> </div><!--课程信息 end-->
<div class="info_box"> <div class="info_box">
@ -127,7 +127,7 @@
</div> </div>
<div class="subNav"> <div class="subNav">
<%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02" %> <%= link_to l(:label_course_file), course_files_path(@course), :class => "f14 c_blue02" %>
<%= link_to "(#{course_file_num})", course_files_path(@course), :class => "subnav_num c_orange" %> <%= link_to "(#{course_file_num})", course_files_path(@course), :class => "subnav_num c_orange",:id=>'courses_files_count_nav' %>
<%= link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white') if is_teacher %> <%= link_to( "+#{l(:label_upload_files)}", course_files_path(@course), :class => 'subnav_green ml95 c_white') if is_teacher %>
</div> </div>
<div class="subNav"> <div class="subNav">

View File

@ -35,43 +35,6 @@
<tr> <tr>
<td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td> <td class="info_font" style="width: 240px; color: #15bccf"><%= l(:label_projects_community)%></td>
<td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td> <td style="width: 430px; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
<td rowspan="2" width="250px">
<div class="top-content-search">
<script type="text/javascript">
function regexName()
{
var name = $.trim($("#name").val());
if(name.length == 0)
{
$("#project_name_span").text("<%= l(:label_search_conditions_not_null) %>");
$("#project_name_span").css('color','#ff0000');
$("#project_name_span").focus();
return false;
}
else
{
$("#project_name_span").text("");
return true;
}
}
function submitSerch()
{
if(regexName()){$("#project_search_form").submit();}
}
</script>
<%= form_tag(projects_search_path, :method => :get, :id => "project_search_form") do %>
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();", :style => "float:left" %>
<%= hidden_field_tag 'project_type', params[:project_type] %>
<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
<a href="#" onclick="submitSerch();" class="ButtonColor m3p10" style="float:left;padding-top: 3px; margin: 0px;padding-bottom:0px;" >
<%= l(:label_search)%>
</a>
<br />
<span id="project_name_span" style="float: left"></span>
<% end %>
</div>
</td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/forums", forums_path %></a></td> <td style="padding-left: 8px"><a><%= link_to request.host()+"/forums", forums_path %></a></td>

View File

@ -1,247 +1,245 @@
<% @nav_dispaly_project_label = 1 <% @nav_dispaly_project_label = 1
@nav_dispaly_forum_label = 1 %> @nav_dispaly_forum_label = 1 %>
<%#@nav_dispaly_project_label = 1 %> <%#@nav_dispaly_project_label = 1 %>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title><%= h html_title %></title> <title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" /> <meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2' %> <%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2' %>
<%= javascript_include_tag 'cookie','project', 'header','select_list_move' %> <%= javascript_include_tag 'cookie','project', 'header','select_list_move' %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
<!--项目的三种类型--> <!--项目的三种类型-->
<script type="text/javascript"> <script type="text/javascript">
function click_ok(url) function click_ok(url)
{ {
$('#light').css('display','none'); $('#light').css('display','none');
$('#fade').css('display','none'); $('#fade').css('display','none');
//ajax处理请求 //ajax处理请求
var project_type; var project_type;
if($("#development_group").attr("checked") == "checked"){ if($("#development_group").attr("checked") == "checked"){
project_type = 1; project_type = 1;
}
else if($("#research_group").attr("checked") == "checked"){
project_type = 2;
}
else if($("#friend_organization").attr("checked") == "checked"){
project_type = 3;
}
$.get(
url,
{ project_type: project_type},
function (data) {
if(data == 1)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team), 1))%>");
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'layouts/base_development_group')) %>');
$("#close_light").attr("onClick","close_window('development_group');");
}
else if(data == 2)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group), 2))%>");
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'layouts/base_research_team')) %>');
$("#close_light").attr("onClick","close_window('research_group');");
}
else if(data == 3)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization), 3))%>");
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'layouts/base_friend_group')) %>');
$("#close_light").attr("onClick","close_window('friend_organization');");
}
else
{
alert("服务器异常,请与管理员联系");
}
}
);
} }
</script> else if($("#research_group").attr("checked") == "checked"){
</head> project_type = 2;
<!--add by huang-->
<body>
<div id="Container">
<%= render :partial => 'layouts/new_header'%>
<div class="cl"></div>
<!--TopBar begin--> }
<div id="TopBar"> else if($("#friend_organization").attr("checked") == "checked"){
<div class="topbar_info02 fl"> project_type = 3;
<h2> }
<a href="http://<%= Setting.host_name %>" target="_blank" class="c_blue"> $.get(
<%= l(:label_projects_community) %> url,
</a> { project_type: project_type},
</h2> function (data) {
<p class="hidden"> if(data == 1)
<%= l(:label_user_location) %> : {
<%= link_to l(:field_homepage), home_path %> $("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team), 1))%>");
> $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/development_group')) %>');
<a href="http://<%= Setting.host_name %>"> $("#close_light").attr("onClick","close_window('development_group');");
<%=l(:label_project_hosting_platform) %> }
</a> else if(data == 2)
> {
<%= link_to @project.name, project_path(@project.id) %> $("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group), 2))%>");
</p> $("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/research_team')) %>');
</div> $("#close_light").attr("onClick","close_window('research_group');");
<div class="search fl"> }
else if(data == 3)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization), 3))%>");
$("#project_memu_list").html('<%= escape_javascript(render(:partial => 'projects/friend_group')) %>');
$("#close_light").attr("onClick","close_window('friend_organization');");
}
else
{
alert("服务器异常,请与管理员联系");
}
}
);
}
</script>
</head>
<!--add by huang-->
<body>
<div id="Container">
<%= render :partial => 'layouts/new_header'%>
<div class="cl"></div>
<%= form_tag(projects_search_path, :method => :get, :id => "project_search_form", :class => "search_form") do %> <!--TopBar begin-->
<%= text_field_tag 'name', params[:name], :placeholder => "项目名称", :class => "search_text fl", :onkeyup => "regexName('#{l(:label_search_conditions_not_null)}');" %> <div id="TopBar">
<a href="#" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" > <div class="topbar_info02 fl">
<%= l(:label_search)%> <h2>
</a> <a href="http://<%= Setting.host_name %>" target="_blank" class="c_blue">
<div class="cl"></div> <%= l(:label_projects_community) %>
<span id="project_name_span" class="fl"></span> </a>
<% end %> </h2>
</div> <p class="hidden">
</div><!--TopBar end--> <%= l(:label_user_location) %> :
<div id="content"> <%= link_to l(:field_homepage), home_path %>
<div id="LSide" class="fl"> >
<div class="project_info"> <a href="http://<%= Setting.host_name %>">
<div class="pr_info_logo fl mr10 mb5"> <%=l(:label_project_hosting_platform) %>
<%= image_tag(url_to_avatar(@project), :width => "60", :height => "60") %> </a>
</div> >
<div class="pr_info_id fl mb5 f14"> <%= link_to @project.name, project_path(@project.id) %>
<%= l(:label_project_id)%><%= @project.id %> </p>
</div>
<!--关注、申请加入/退出项目-->
<div id="join_exit_project_div">
<% text = @project.project_new_type == 1 ? l(:label_development_team) : (@project.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%>
<% typeclass = @project.project_new_type == 1 ? "pr_kafa" : (@project.project_new_type == 2 ? "pr_keyan" : "pr_friend")%>
<%= render 'layouts/join_exit_project',{:text => text, :typeclass => typeclass} %>
</div>
<!-- 项目得分 -->
<div class="cl"></div>
<div>
<%= link_to l(:label_project_name)+"#{@project.name}", project_path(@project.id), :class=>"pr_info_name fl c_dark fb break_word" %>
<% if @project.is_public? %>
<span class="img_private"><%= l(:label_public)%></span>
<% else %>
<span class="img_private"><%= l(:label_private)%></span>
<% end %>
</div>
<div class="cl"></div>
<div>
<% if @project.project_type == 0 %>
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
<%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id
}, :class => "c_orange f14" ) %>
<% end %>
</div>
<!--参数-->
<div class="pr_info_foot">
<%= l(:label_member) %><%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'info_foot_num c_blue' %>
<span>|&nbsp;</span>
<%= l(:label_user_watcher) %><%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'info_foot_num c_blue' %>
<span>|&nbsp;</span>
<%= l(:project_module_attachments) %>
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<%= link_to "#{attaments_num}", project_files_path(@project), :class => 'info_foot_num c_blue' %></span>
</div>
<div class="cl"></div>
</div><!--参数 end-->
<!--邀请加入-->
<div class="subNavBox">
<% if User.current.member_of?(@project) %>
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" onclick="$('#navContent_invit').toggle(500);"><%= l(:label_invite)%></div>
<ul class="navContent " style="display:block" id="navContent_invit">
<li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
<% if User.current.allowed_to?(:manage_members, @project) %>
<li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>
<% end %>
</ul>
<% end %><!--end-->
<!--menu 左侧工具栏 -->
<!--project_new_type: 1为开发组2为科研组3为朋友圈子-->
<div id="project_memu_list">
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
<%= render :partial => 'layouts/base_development_group', :locals => {:project => @project}%>
<% elsif @project.project_new_type == 2 %>
<%= render :partial => 'layouts/base_research_team', :locals => {:project => @project}%>
<% else %>
<%= render :partial => 'layouts/base_friend_group', :locals => {:project => @project}%>
<% end %>
</div>
<!-- end -->
</div><!--项目侧导航 end-->
<div class="cl"></div>
<!-- 项目描述 -->
<div class="project_intro">
<div id="course_description" class="course_description">
<h4 ><%= l(:label_project_overview)%></h4>
<div id="course_description_content" class="break_word">
<%= textilizable(@project.description) if @project.description && !@project.description.blank? %>
</div>
</div>
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
<label id="expend_more_information" value="show_more"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img id="arrow" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div>
</div><!--项目简介 end-->
<!-- tag模块 -->
<div class="project_Label">
<h4 class="mb5"><%= l(:label_tag)%>:</h4>
<div class="tag_h">
<div id="tags">
<%= render :partial => 'tags/project_tag', :locals => {:obj => @project,:object_flag => "2"}%>
</div>
</div>
<div class="cl"></div>
</div><!--项目标签 end-->
</div>
</div>
<div id="RSide" class="fl">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
</div>
<div style="clear:both;"></div>
<div class="cl"></div>
<%= render :partial => 'layouts/new_footer'%>
<div class="cl"></div>
</div><!--Container end-->
<div id="light" class="white_content02">
<!-- 这里写需弹出框的HTML代码 -->
<% text = @project.project_new_type == 1 ? "development_group" : (@project.project_new_type == 2 ? "research_group" : "friend_organization")%>
<div ><a href="javascript:void(0)" onClick="close_window('<%= text%>');" class="box_close" id="close_light"></a></div>
<div class=" mt10">
<h3 class="mb10 c_blue">请选择项目类型:</h3>
<ul class="mb10" id="project_type">
<li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label class="f14">&nbsp;&nbsp;开发模式:<span class="f12 ml5 c_grey">为团队开发提供一系列在线协同工具。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label class="f14">&nbsp;&nbsp;研讨模式:<span class="f12 ml5 c_grey">为小组研究提供阶段汇报和交流工具。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label class="f14">&nbsp;&nbsp;圈子模式:<span class="f12 ml5 c_grey">为朋友圈提供简洁的交流和分享工具。</span></label></li>
</ul>
<a href="javascript:void(0)" class="orange_btn" onclick="click_ok('<%= change_project_type_project_path @project%>');" >确定</a>
</div>
</div> </div>
<div id="fade" class="black_overlay">123</div> <div class="search fl">
<%= render :partial => 'layouts/new_feedback' %> <%= form_tag(projects_search_path, :method => :get, :id => "project_search_form", :class => "search_form") do %>
<div id="ajax-indicator" style="display:none;"> <%= text_field_tag 'name', params[:name], :placeholder => "项目名称", :class => "search_text fl", :onkeyup => "regexName('#{l(:label_search_conditions_not_null)}');" %>
<span><%= l(:label_loading) %></span> <a href="#" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
</div> <%= l(:label_search)%>
<div id="ajax-modal" style="display:none;"></div> </a>
<%= call_hook :view_layouts_base_body_bottom %> <div class="cl"></div>
</body> <span id="project_name_span" class="fl"></span>
<% end %>
</div>
</div><!--TopBar end-->
<div id="content">
<div id="LSide" class="fl">
<div class="project_info">
<div class="pr_info_logo fl mr10 mb5">
<%= image_tag(url_to_avatar(@project), :width => "60", :height => "60") %>
</div>
<div class="pr_info_id fl mb5 f14">
<%= l(:label_project_id)%><%= @project.id %>
</div>
<!--关注、申请加入/退出项目-->
<div id="join_exit_project_div">
<% text = @project.project_new_type == 1 ? l(:label_development_team) : (@project.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%>
<% typeclass = @project.project_new_type == 1 ? "pr_kafa" : (@project.project_new_type == 2 ? "pr_keyan" : "pr_friend")%>
<%= render 'layouts/join_exit_project',{:text => text, :typeclass => typeclass} %>
</div>
<!-- 项目得分 -->
<div class="cl"></div>
<div>
<%= link_to l(:label_project_name)+"#{@project.name}", project_path(@project.id), :class=>"pr_info_name fl c_dark fb break_word" %>
<% if @project.is_public? %>
<span class="img_private"><%= l(:label_public)%></span>
<% else %>
<span class="img_private"><%= l(:label_private)%></span>
<% end %>
</div>
<div class="cl"></div>
<div>
<% if @project.project_type == 0 %>
<span class="fb f14 "><%= l(:label_project_score)%> :</span>
<%= link_to(format("%.2f" ,project_scores(@project) ).to_i, {:controller => 'projects',
:action => 'show_projects_score',
:remote => true,
:id => @project.id}, :class => "c_orange f14" ) %>
<% end %>
</div>
<!--参数-->
<div class="pr_info_foot">
<%= l(:label_member) %><%= link_to "#{@project.members.count}", project_member_path(@project), :class => 'info_foot_num c_blue' %>
<span>|&nbsp;</span>
<%= l(:label_user_watcher) %><%= link_to "#{@project.watcher_users.count}", {:controller=>"projects", :action=>"watcherlist", :id => @project.id}, :class => 'info_foot_num c_blue' %>
<span>|&nbsp;</span>
<%= l(:project_module_attachments) %>
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<%= link_to "#{attaments_num}", project_files_path(@project), :class => 'info_foot_num c_blue' %></span>
</div>
<div class="cl"></div>
</div><!--参数 end-->
<!--邀请加入-->
<div class="subNavBox">
<% if User.current.member_of?(@project) %>
<div class="subNav currentDd currentDt subNav_jiantou" id="expand_tools_expand_invit" nhtype="toggle4cookie" data-id="expand_invit" data-target="#navContent_invit"><%= l(:label_invite)%></div>
<ul class="navContent " style="display:block" id="navContent_invit">
<li><%= link_to l(:label_invite_new_user), :controller=>"projects", :action=>"invite_members_by_mail", :id => @project %></li>
<% if User.current.allowed_to?(:manage_members, @project) %>
<li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>
<% end %>
</ul>
<% end %><!--end-->
<!--menu 左侧工具栏 -->
<!--project_new_type: 1为开发组2为科研组3为朋友圈子-->
<div id="project_memu_list">
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
<%= render :partial => 'projects/development_group', :locals => {:project => @project}%>
<% elsif @project.project_new_type == 2 %>
<%= render :partial => 'projects/research_team', :locals => {:project => @project}%>
<% else %>
<%= render :partial => 'projects/friend_group', :locals => {:project => @project}%>
<% end %>
</div>
<!-- end -->
</div><!--项目侧导航 end-->
<div class="cl"></div>
<!-- 项目描述 -->
<div class="project_intro">
<div id="course_description" class="course_description">
<h4 ><%= l(:label_project_overview)%></h4>
<div id="course_description_content" class="break_word">
<%= textilizable(@project.description) if @project.description && !@project.description.blank? %>
</div>
</div>
<div class="lg-foot" id="lg-foot" onclick="show_more_msg();">
<label id="expend_more_information" value="show_more"><%= l(:label_expend_information)%></label>
<span class="g-arr-down">
<img id="arrow" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</div>
</div><!--项目简介 end-->
<!-- tag模块 -->
<div class="project_Label">
<h4 class="mb5"><%= l(:label_tag)%>:</h4>
<div class="tag_h">
<div id="tags">
<%= render :partial => 'tags/project_tag', :locals => {:obj => @project,:object_flag => "2"}%>
</div>
</div>
<div class="cl"></div>
</div><!--项目标签 end-->
</div>
</div>
<div id="RSide" class="fl">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
</div>
<div style="clear:both;"></div>
<div class="cl"></div>
<%= render :partial => 'layouts/new_footer'%>
<div class="cl"></div>
</div><!--Container end-->
<div id="light" class="white_content02">
<!-- 这里写需弹出框的HTML代码 -->
<% text = @project.project_new_type == 1 ? "development_group" : (@project.project_new_type == 2 ? "research_group" : "friend_organization")%>
<div ><a href="javascript:void(0)" onClick="close_window('<%= text%>');" class="box_close" id="close_light"></a></div>
<div class=" mt10">
<h3 class="mb10 c_blue">请选择项目类型:</h3>
<ul class="mb10" id="project_type">
<li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label class="f14">&nbsp;&nbsp;开发模式:<span class="f12 ml5 c_grey">为团队开发提供一系列在线协同工具。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label class="f14">&nbsp;&nbsp;研讨模式:<span class="f12 ml5 c_grey">为小组研究提供阶段汇报和交流工具。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label class="f14">&nbsp;&nbsp;圈子模式:<span class="f12 ml5 c_grey">为朋友圈提供简洁的交流和分享工具。</span></label></li>
</ul>
<a href="javascript:void(0)" class="orange_btn" onclick="click_ok('<%= change_project_type_project_path @project%>');" >确定</a>
</div>
</div>
<div id="fade" class="black_overlay">123</div>
<%= render :partial => 'layouts/new_feedback' %>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html> </html>

View File

@ -0,0 +1,52 @@
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<a class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :class => "f14 c_blue02" %>
<% unless @project.issues.visible.all.count == 0 %>
<a class="subnav_num">(<%= @project.issues.visible.all.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.boards.first.topics.count == 0 %>
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless attaments_num == 0 %>
<a class="subnav_num">(<%= attaments_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end %>
<%# --版本库被设置成私有、module中设置不显示、没有创建版本库 三种情况不显示-- %>
<% if visible_repository?(@project) %>
<div class="subNav">
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<a class="subnav_num">(<%= @project.repositories.count %>)</a>
</div>
<% end %>
<!-- more -->
<div class="subNav subNav_jiantou" id="expand_tools_expand" nhtype="toggle4cookie" data-id="expand_tool_more" data-target="#navContent" data-val="retract"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContent">
<%= render 'projects/tools_expand' %>
</ul>

View File

@ -0,0 +1,29 @@
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<a class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.boards.first.topics.count == 0 %>
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless attaments_num == 0 %>
<a class="subnav_num">(<%= attaments_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end %>

View File

@ -0,0 +1,40 @@
<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>
<div class="subNav">
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :class => "f14 c_blue02" %>
<% unless ForgeActivity.where("project_id = ?", @project.id).count == 0 %>
<a class="subnav_num">(<%= ForgeActivity.where("project_id = ?", @project.id).count %>)</a>
<% end %>
</div>
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<div class="subNav">
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :class => "f14 c_blue02" %>
<% unless @project.issues.count == 0 %>
<a class="subnav_num">(<%= @project.issues.visible.all.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :class => "subnav_green" %>
<% end %>
</div>
<% end %>
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "f14 c_blue02" %>
<% unless @project.boards.first.topics.count == 0 %>
<a class="subnav_num">(<%= @project.boards.first.topics.count %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
</div>
<% end%>
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
<div class="subNav">
<%= link_to l(:project_module_files), project_files_path(@project), :class => "f14 c_blue02" %>
<% unless attaments_num == 0 %>
<a class="subnav_num">(<%= attaments_num %>)</a>
<% end %>
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<% end %>
</div>
<% end%>

View File

@ -1,6 +1,6 @@
<script type="text/javascript"> <script type="text/javascript">
<%if @select_tab%> $(function(){
$(function(){ <%if @select_tab%>
<%if @select_tab == "modules"%> <%if @select_tab == "modules"%>
project_setting(2); project_setting(2);
<% elsif @select_tab == "versions"%> <% elsif @select_tab == "versions"%>
@ -10,10 +10,10 @@
project_setting(6); project_setting(6);
$("#pro_st_edit_ku").toggle(); $("#pro_st_edit_ku").toggle();
<%else%> <%else%>
<% end%> <% end%>
}); <% end%>
<% end%> $("div[nhname='pro_setting']").show();
});
</script> </script>
<div class="project_r_h"> <div class="project_r_h">
@ -21,7 +21,7 @@
</div> </div>
<!--通过admin界面配置不同角色显示不同的模块--> <!--通过admin界面配置不同角色显示不同的模块-->
<div class=" pro_setting"> <div class=" pro_setting" nhname="pro_setting" style="display:none;">
<div id="pro_st_tb_" class="pro_st_tb_"> <div id="pro_st_tb_" class="pro_st_tb_">
<ul> <ul>
<% show_memu = show_project_memu User.current%> <% show_memu = show_project_memu User.current%>

View File

@ -53,7 +53,7 @@
} }
$.ajax({ $.ajax({
type :"POST", type :"POST",
url :prefix + '/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+province, url :prefix + '/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+encodeURIComponent(province),
data :'text', data :'text',
success: function(data){ success: function(data){
$("#schoollist").html(data); $("#schoollist").html(data);

View File

@ -5,13 +5,13 @@
</div> </div>
<!-- 上左下右 --> <!-- 上左下右 -->
<div class='desc_item'> <div class='desc_item'>
<span class=''> <div class='' style="float:left;max-width:300px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;">
<% unless course.is_public == 1 %> <% unless course.is_public == 1 %>
<span class="private_project"><%= l(:label_private) %></span> <span class="private_project"><%= l(:label_private) %></span>
<% end %> <% end %>
<%= link_to(course.name.truncate(25, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %> <%= link_to(course.name+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
</span> </div>
<span class='font_bolder'> <span class='font_bolder'>
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %> <%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
<%#=course.try(:teacher).try(:name)%> <%#=course.try(:teacher).try(:name)%>

View File

@ -5,6 +5,8 @@
$('#jours_count').html("<%= @jours_count %>"); $('#jours_count').html("<%= @jours_count %>");
<% elsif @course && @jours_count%> <% elsif @course && @jours_count%>
$('#course_jour_count').html("(<%= @jours_count %>)"); $('#course_jour_count').html("(<%= @jours_count %>)");
<% elsif @user && @jours_count%>
$('#jour_count').html("<%= @jours_count %>");
<% end %> <% end %>
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>') var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
destroyedItem.fadeOut(600,function(){ destroyedItem.fadeOut(600,function(){

View File

@ -393,6 +393,7 @@ zh:
label_document_added: 文档已添加 label_document_added: 文档已添加
label_forum_message_added: 贴吧发帖成功 label_forum_message_added: 贴吧发帖成功
label_forum_add: 贴吧创建成功 label_forum_add: 贴吧创建成功
label_forum_reply: 贴吧回复成功
label_message_reply: 回帖人 label_message_reply: 回帖人
label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。) label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。)
label_role: 角色 label_role: 角色

View File

@ -715,6 +715,7 @@ RedmineApp::Application.routes.draw do
collection do collection do
match "getattachtype", :via => [:get, :post] match "getattachtype", :via => [:get, :post]
match "search",:via => [:post,:get] match "search",:via => [:post,:get]
match "searchone4reload",:via => [:post,:get]
match "search_tag_attachment", :via => [:post,:get] match "search_tag_attachment", :via => [:post,:get]
end end
member do member do

View File

@ -541,7 +541,6 @@ ActiveRecord::Schema.define(:version => 20150514133640) do
t.integer "is_teacher_score", :default => 0 t.integer "is_teacher_score", :default => 0
end end
add_index "homework_attaches", ["bid_id"], :name => "bid_id"
add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
create_table "homework_evaluations", :force => true do |t| create_table "homework_evaluations", :force => true do |t|
@ -556,9 +555,7 @@ ActiveRecord::Schema.define(:version => 20150514133640) do
t.integer "bid_id" t.integer "bid_id"
end end
add_index "homework_for_courses", ["bid_id"], :name => "bid_id"
add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
add_index "homework_for_courses", ["course_id"], :name => "course_id"
add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
create_table "homework_users", :force => true do |t| create_table "homework_users", :force => true do |t|
@ -1163,14 +1160,12 @@ ActiveRecord::Schema.define(:version => 20150514133640) do
create_table "students_for_courses", :force => true do |t| create_table "students_for_courses", :force => true do |t|
t.integer "student_id" t.integer "student_id"
t.integer "course_id" t.integer "course_id"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "student_idCopy"
end end
add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id"
add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id"
add_index "students_for_courses", ["student_id"], :name => "student_id"
create_table "taggings", :force => true do |t| create_table "taggings", :force => true do |t|
t.integer "tag_id" t.integer "tag_id"

View File

@ -20,8 +20,8 @@ module Redmine
notifications << Notifiable.new('message_posted') notifications << Notifiable.new('message_posted')
notifications << Notifiable.new('wiki_content_added') notifications << Notifiable.new('wiki_content_added')
notifications << Notifiable.new('wiki_content_updated') notifications << Notifiable.new('wiki_content_updated')
notifications << Notifiable.new('forum_add') notifications << Notifiable.new('forum_reply')
notifications << Notifiable.new('forum_message_added', 'forum_add') notifications << Notifiable.new('forum_message_added', 'forum_reply')
notifications notifications
end end
end end

View File

@ -384,4 +384,45 @@ function submitProjectBoard()
{ {
$("#message-form").submit(); $("#message-form").submit();
} }
} }
//cookie记忆html区块 显示/隐藏 的代码 start
$(function(){
var personalized_expand_key = "personalized_expand";
function personalized_init(){
var personalized_map = cookieget(personalized_expand_key);
if(personalized_map!=false){
personalized_map = JSON.parse(personalized_map);
$("*[nhtype='toggle4cookie']").each(function(){
var personalized_id=$(this).data('id');
var val = personalized_map[personalized_id];
if(val!=undefined && val!=$(this).data('val')){
personalized_click($(this),0);
}
});
}
}
function personalized_click(obj,timeout){
var target = $(obj.data('target'));
var oldval = obj.data('val');
var val='';
if(oldval=='expand'){val='retract';}else{val='expand';}
obj.data('val',val);
var personalized_map = cookieget(personalized_expand_key);
if(personalized_map == false){
personalized_map={};
}else{
personalized_map = JSON.parse(personalized_map);
}
var personalized_id=obj.data('id');
personalized_map[personalized_id]=val;
cookiesave(personalized_expand_key,JSON.stringify(personalized_map));
target.toggle(timeout);
}
$("*[nhtype='toggle4cookie']").click(function(){
personalized_click($(this),500);
});
personalized_init();
});
//cookie记忆html区块 显示/隐藏 的代码 end

View File

@ -1904,6 +1904,18 @@ input.autocomplete.ajax-loading {
background-image: url(../images/loading.gif); background-image: url(../images/loading.gif);
} }
.private_project {
position: relative;
bottom: 2px;
text-transform: uppercase;
background: #d22;
color: #fff;
font-weight: bold;
padding: 0px 2px 0px 2px;
font-size: 60%;
margin-right: 2px;
border-radius: 2px;
}
/***** Flash & error messages ****/ /***** Flash & error messages ****/
#errorExplanation, div.flash, .nodata, .warning, .conflict { #errorExplanation, div.flash, .nodata, .warning, .conflict {
padding: 4px 4px 4px 30px; padding: 4px 4px 4px 30px;

View File

@ -177,6 +177,7 @@ a:hover.blue_u_btn{background:#64bdd9; color:#fff;}
.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;}
.blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;}
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} .orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
.bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;}
/* commonpic */ /* commonpic */
.pic_date{ display:block; background:url(../images/new_project/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;} .pic_date{ display:block; background:url(../images/new_project/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; float:left;}
.pic_add{ display:block; background:url(../images/new_project/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;} .pic_add{ display:block; background:url(../images/new_project/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; float:left;}