Merge remote-tracking branch 'origin/szzh' into szzh
This commit is contained in:
commit
d6fe4082af
|
@ -32,13 +32,17 @@ class BoardsController < ApplicationController
|
|||
#modify by nwb
|
||||
@flag = params[:flag] || false
|
||||
if @project
|
||||
@boards = @project.boards.includes(:last_message => :author).all
|
||||
@boards = [] << @boards[0] if @boards.any?
|
||||
if @boards.size == 1
|
||||
@board = @boards.first
|
||||
show and return
|
||||
if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin?
|
||||
render_403
|
||||
else
|
||||
@boards = @project.boards.includes(:last_message => :author).all
|
||||
@boards = [] << @boards[0] if @boards.any?
|
||||
if @boards.size == 1
|
||||
@board = @boards.first
|
||||
show and return
|
||||
end
|
||||
render :layout => false if request.xhr?
|
||||
end
|
||||
render :layout => false if request.xhr?
|
||||
elsif @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
|
||||
|
|
|
@ -342,10 +342,15 @@ class CoursesController < ApplicationController
|
|||
|
||||
def export_course_member_excel
|
||||
@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|
|
||||
format.xls {
|
||||
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
|
||||
|
|
|
@ -23,7 +23,7 @@ class FilesController < ApplicationController
|
|||
before_filter :auth_login1, :only => [:index]
|
||||
before_filter :logged_user_by_apptoken,:only => [:index]
|
||||
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
|
||||
include SortHelper
|
||||
|
@ -46,6 +46,13 @@ class FilesController < ApplicationController
|
|||
@obj_attachments = paginateHelper @all_attachments,10
|
||||
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
|
||||
sort = ""
|
||||
@sort = ""
|
||||
|
|
|
@ -84,15 +84,10 @@ class IssuesController < ApplicationController
|
|||
@issue_pages = Paginator.new @issue_count, @limit, params['page']
|
||||
@offset ||= @issue_pages.offset
|
||||
@issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],
|
||||
:order => sort_clause,
|
||||
:offset => @offset,
|
||||
:limit => @limit)
|
||||
:order => sort_clause,
|
||||
:offset => @offset,
|
||||
:limit => @limit)
|
||||
@issue_count_by_group = @query.issue_count_by_group
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young
|
||||
|
|
|
@ -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_global, :only => [:new, :create,:view_homework_attaches]
|
||||
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
||||
before_filter :file, :statistics, :watcherlist
|
||||
before_filter :file, :statistics #:watcherlist
|
||||
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去
|
||||
before_filter :memberAccess, only: :member
|
||||
|
||||
|
@ -417,10 +417,14 @@ class ProjectsController < ApplicationController
|
|||
@members = @project.member_principals.includes(:roles, :principal).all.sort
|
||||
end
|
||||
else
|
||||
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)
|
||||
if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin?
|
||||
render_403
|
||||
else
|
||||
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
|
||||
@members = paginateHelper @members
|
||||
render :layout => 'base_courses' if @project.project_type == 1
|
||||
|
@ -676,11 +680,13 @@ class ProjectsController < ApplicationController
|
|||
true
|
||||
end
|
||||
|
||||
# added by huang
|
||||
|
||||
def watcherlist
|
||||
if @watched
|
||||
@users -= watched.watcher_users
|
||||
unless @project.nil?
|
||||
if !@project.is_public? && !User.current.member_of?(@project) && !User.current.admin?
|
||||
render_403
|
||||
else
|
||||
@users -= watched.watcher_users if @watched
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -383,6 +383,8 @@ class UsersController < ApplicationController
|
|||
# scope = User.logged.status(@status)
|
||||
# @search_by = params[:search_by] ? params[:search_by][:id] : 0
|
||||
# scope = scope.like(params[:name],@search_by) if params[:name].present?
|
||||
@search_by = params[:search_by] ? params[:search_by] : 0
|
||||
|
||||
us = UsersService.new
|
||||
scope = us.search_user params
|
||||
@user_count = scope.count
|
||||
|
|
|
@ -85,6 +85,9 @@ class WordsController < ApplicationController
|
|||
elsif @journal_destroyed.jour_type == "Course"
|
||||
@course = Course.find @journal_destroyed.jour_id
|
||||
@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
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -593,13 +593,38 @@ module ApplicationHelper
|
|||
Project.project_tree(projects, &block)
|
||||
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
|
||||
mem = Member.where("user_id = ? and project_id = ?",user_id, project_id)
|
||||
unless mem.blank?
|
||||
mem.first.roles.to_s.include?("Manager")
|
||||
@result = false
|
||||
@result = mem.first.roles.to_s.include?("Manager") ? true : 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
|
||||
return @result
|
||||
end
|
||||
|
|
|
@ -67,29 +67,33 @@ module IssuesHelper
|
|||
s.html_safe
|
||||
end
|
||||
|
||||
#获取跟踪类型
|
||||
#REDO:时间紧需要优化,两个方法可以综合成一个
|
||||
#获取跟踪类型及样式
|
||||
#REDO:时间紧可以优化.
|
||||
def get_issue_type(value)
|
||||
issuetype = []
|
||||
if value == "缺陷" || value == 1
|
||||
class_type = "red_btn_cir ml10"
|
||||
issuetype << "red_btn_cir ml10"
|
||||
issuetype << "缺陷"
|
||||
elsif value == "功能" || value == 2
|
||||
class_type = "blue_btn_cir ml10"
|
||||
issuetype << "blue_btn_cir ml10"
|
||||
issuetype << "功能"
|
||||
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
|
||||
class_type = "orange_btn_cir ml10"
|
||||
issuetype << "bgreen_btn_cir ml10"
|
||||
issuetype << "周报"
|
||||
end
|
||||
end
|
||||
|
||||
def get_issue_typevalue(value)
|
||||
if value == "缺陷" || value == 1
|
||||
assign = "缺陷"
|
||||
elsif value == "功能" || value == 2
|
||||
assign = "功能"
|
||||
elsif value == "支持" || value == 3
|
||||
assign = "支持"
|
||||
def principals_options_for_isuue_list(project)
|
||||
if User.current.member_of?(project)
|
||||
project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["<< #{l(:label_me)} >>", User.current.id]).unshift(["指派给", 0])
|
||||
else
|
||||
assign = "任务"
|
||||
project.members.order("lower(users.login)").map{|c| [c.name, c.user_id]}.unshift(["指派给", 0])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -226,10 +226,18 @@ class UsersService
|
|||
}
|
||||
scope = User.logged.status(status)
|
||||
if params[:is_search_assitant].nil?
|
||||
watcher = User.watched_by(params[:user_id])
|
||||
watcher.push(params[:user_id])
|
||||
#modify by yutao 2015/5/18 没有params[:user_id]参数时去掉"id not in (?)"条件(bug:#2270) start
|
||||
#say by yutao: params[:user_id]这个是指谁发起的搜索么? 如果是 这个值貌似应该从session获取 怪怪的赶脚-_-!
|
||||
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
|
||||
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?
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
<div class="attachments" style="font-weight:normal;">
|
||||
<% is_float ||= false %>
|
||||
<% 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%>
|
||||
<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">
|
||||
<% end%>
|
||||
|
@ -50,9 +51,10 @@
|
|||
:id => attachment,
|
||||
:filename => attachment.filename%>
|
||||
<% end %>
|
||||
<span title="<%= attachment.description%>">
|
||||
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
|
||||
</span>
|
||||
</div>
|
||||
<div style="float:left;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" title="<%= attachment.description%>">
|
||||
<%= h(" - #{attachment.description}") unless attachment.description.blank? %>
|
||||
</div>
|
||||
<span class="size">(
|
||||
<%= number_to_human_size attachment.filesize %>)
|
||||
</span>
|
||||
|
|
|
@ -4,4 +4,5 @@
|
|||
$("#error_show").html("<%= @message.html_safe %>");
|
||||
<% else %>
|
||||
closeModal();
|
||||
searchone4reload('<%=params[:file_id]%>');
|
||||
<% end %>
|
||||
|
|
|
@ -1,4 +1,15 @@
|
|||
<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)
|
||||
{
|
||||
switch(obj)
|
||||
|
|
|
@ -1,66 +1,66 @@
|
|||
<% delete_allowed = User.current.allowed_to?(:manage_files, course) %>
|
||||
<div class="re_con_top">
|
||||
<p class="f_l c_blue f_b f_14">共有 <%= all_attachments.count%> 个资源</p>
|
||||
<p class="f_r" style="color: #808080">
|
||||
<p class="f_r" style="color: #808080">
|
||||
<% if order == "asc" %>
|
||||
按 <%= 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"} %> /
|
||||
<%= 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"} %> /
|
||||
<%= 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"} %> 排序
|
||||
按 <%= 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"} %> /
|
||||
<%= 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"} %> /
|
||||
<%= 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"} %> 排序
|
||||
<% else %>
|
||||
按 <%= 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"} %> /
|
||||
<%= 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"} %> /
|
||||
<%= 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"} %> 排序
|
||||
<%= 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"} %> 排序
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<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 class="cl"></div>
|
||||
|
||||
<div class="for_img_thumbnails">
|
||||
<% curse_attachments.each do |file| %>
|
||||
<% if file.is_public? || User.current.member_of_course?(course) %>
|
||||
<div class="re_con_box">
|
||||
<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) %>
|
||||
<% curse_attachments.each do |file| %>
|
||||
<% 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" %>
|
||||
<% 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) %> | 下载<%= file.downloads %> | 引用<%= 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>
|
||||
<% 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) %> | 下载<%= file.downloads %> | 引用<%= 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 %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
|
|
|
@ -20,14 +20,16 @@
|
|||
<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" %>
|
||||
<% if User.current.logged? %>
|
||||
<%#--私有项目资源不能引用,不能设置公开私有--%>
|
||||
<%#--公开项目资源可以应用,管理员和资源上传者拥有设置公开私有权限--%>
|
||||
<%= 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) %>
|
||||
<% 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" %>
|
||||
<% 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) %>
|
||||
<% else %>
|
||||
<%= 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 %>">
|
||||
<%= 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>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -27,6 +27,8 @@ $('#upload_file_div').slideToggle('slow');
|
|||
<%elsif @course%>
|
||||
closeModal();
|
||||
$("#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 %>
|
||||
$(document).ready(img_thumbnails);
|
||||
|
|
|
@ -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) %> | 下载<%= file.downloads %> | 引用<%= 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 %>
|
|
@ -12,7 +12,7 @@
|
|||
<%= 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>
|
||||
<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 class="cl"></div>
|
||||
<p>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
</div><!--problem_search end-->
|
||||
|
||||
<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
|
||||
},
|
||||
{:onchange=>"remote_function();",:id=>"assigned_to_id",:name=>"v[assigned_to_id]",:class=>"w90"}
|
||||
|
@ -66,8 +66,8 @@
|
|||
</div><!--filter_form end-->
|
||||
<div class="cl"></div>
|
||||
<%# end %>
|
||||
<p class="problem_p fl" ><%= l(:label_issues_sum) %>:<a href="javascript:void(0)" class="c_red"><%= @project.issues.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>
|
||||
<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)').visible.all.count %> </a>
|
||||
</p>
|
||||
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -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();
|
|
@ -2,7 +2,6 @@
|
|||
<h2 class="project_h2"><%= l(:label_issue_new) %></h2>
|
||||
</div>
|
||||
<%= call_hook(:view_issues_new_top, {:issue => @issue}) %>
|
||||
|
||||
<%= labelled_form_for @issue, :url => project_issues_path(@project),
|
||||
:html => {:id => 'issue-form', :multipart => true} do |f| %>
|
||||
<%= error_messages_for 'issue' %>
|
||||
|
@ -16,7 +15,6 @@
|
|||
</a>
|
||||
<%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %>
|
||||
<% end %>
|
||||
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<div class="talk_txt fl">
|
||||
<p class="pro_page_tit" style="word-break:break-all;">
|
||||
<%= @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/>
|
||||
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -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>
|
|
@ -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 %>
|
|
@ -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%>
|
|
@ -20,5 +20,4 @@
|
|||
!Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
|
||||
<%= exit_project_link(@project) %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
<span>| </span>
|
||||
<%= l(:label_account_identity_student)%>(<%= course_student_link student_num %>)
|
||||
<span>| </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><!--课程信息 end-->
|
||||
<div class="info_box">
|
||||
|
@ -127,7 +127,7 @@
|
|||
</div>
|
||||
<div class="subNav">
|
||||
<%= 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 %>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
|
|
|
@ -1,247 +1,245 @@
|
|||
<% @nav_dispaly_project_label = 1
|
||||
@nav_dispaly_forum_label = 1 %>
|
||||
@nav_dispaly_forum_label = 1 %>
|
||||
<%#@nav_dispaly_project_label = 1 %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><%= h html_title %></title>
|
||||
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2' %>
|
||||
<%= javascript_include_tag 'cookie','project', 'header','select_list_move' %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><%= h html_title %></title>
|
||||
<meta name="description" content="<%= Redmine::Info.app_name %>" />
|
||||
<meta name="keywords" content="issue,bug,tracker" />
|
||||
<%= csrf_meta_tag %>
|
||||
<%= favicon %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2' %>
|
||||
<%= javascript_include_tag 'cookie','project', 'header','select_list_move' %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
|
||||
<!--项目的三种类型-->
|
||||
<script type="text/javascript">
|
||||
function click_ok(url)
|
||||
{
|
||||
$('#light').css('display','none');
|
||||
$('#fade').css('display','none');
|
||||
//ajax处理请求
|
||||
var project_type;
|
||||
if($("#development_group").attr("checked") == "checked"){
|
||||
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 type="text/javascript">
|
||||
function click_ok(url)
|
||||
{
|
||||
$('#light').css('display','none');
|
||||
$('#fade').css('display','none');
|
||||
//ajax处理请求
|
||||
var project_type;
|
||||
if($("#development_group").attr("checked") == "checked"){
|
||||
project_type = 1;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<!--add by huang-->
|
||||
<body>
|
||||
<div id="Container">
|
||||
<%= render :partial => 'layouts/new_header'%>
|
||||
<div class="cl"></div>
|
||||
else if($("#research_group").attr("checked") == "checked"){
|
||||
project_type = 2;
|
||||
|
||||
<!--TopBar begin-->
|
||||
<div id="TopBar">
|
||||
<div class="topbar_info02 fl">
|
||||
<h2>
|
||||
<a href="http://<%= Setting.host_name %>" target="_blank" class="c_blue">
|
||||
<%= l(:label_projects_community) %>
|
||||
</a>
|
||||
</h2>
|
||||
<p class="hidden">
|
||||
<%= l(:label_user_location) %> :
|
||||
<%= link_to l(:field_homepage), home_path %>
|
||||
>
|
||||
<a href="http://<%= Setting.host_name %>">
|
||||
<%=l(:label_project_hosting_platform) %>
|
||||
</a>
|
||||
>
|
||||
<%= link_to @project.name, project_path(@project.id) %>
|
||||
</p>
|
||||
</div>
|
||||
<div class="search fl">
|
||||
}
|
||||
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 => 'projects/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 => 'projects/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 => '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 %>
|
||||
<%= text_field_tag 'name', params[:name], :placeholder => "项目名称", :class => "search_text fl", :onkeyup => "regexName('#{l(:label_search_conditions_not_null)}');" %>
|
||||
<a href="#" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
|
||||
<%= l(:label_search)%>
|
||||
</a>
|
||||
<div class="cl"></div>
|
||||
<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>| </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>| </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"> 开发模式:<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"> 研讨模式:<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"> 圈子模式:<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>
|
||||
<!--TopBar begin-->
|
||||
<div id="TopBar">
|
||||
<div class="topbar_info02 fl">
|
||||
<h2>
|
||||
<a href="http://<%= Setting.host_name %>" target="_blank" class="c_blue">
|
||||
<%= l(:label_projects_community) %>
|
||||
</a>
|
||||
</h2>
|
||||
<p class="hidden">
|
||||
<%= l(:label_user_location) %> :
|
||||
<%= link_to l(:field_homepage), home_path %>
|
||||
>
|
||||
<a href="http://<%= Setting.host_name %>">
|
||||
<%=l(:label_project_hosting_platform) %>
|
||||
</a>
|
||||
>
|
||||
<%= link_to @project.name, project_path(@project.id) %>
|
||||
</p>
|
||||
</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>
|
||||
<div class="search fl">
|
||||
<%= form_tag(projects_search_path, :method => :get, :id => "project_search_form", :class => "search_form") do %>
|
||||
<%= text_field_tag 'name', params[:name], :placeholder => "项目名称", :class => "search_text fl", :onkeyup => "regexName('#{l(:label_search_conditions_not_null)}');" %>
|
||||
<a href="#" onclick="submitSerch('<%= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >
|
||||
<%= l(:label_search)%>
|
||||
</a>
|
||||
<div class="cl"></div>
|
||||
<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>| </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>| </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"> 开发模式:<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"> 研讨模式:<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"> 圈子模式:<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>
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -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 %>
|
|
@ -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%>
|
|
@ -1,6 +1,6 @@
|
|||
<script type="text/javascript">
|
||||
<%if @select_tab%>
|
||||
$(function(){
|
||||
$(function(){
|
||||
<%if @select_tab%>
|
||||
<%if @select_tab == "modules"%>
|
||||
project_setting(2);
|
||||
<% elsif @select_tab == "versions"%>
|
||||
|
@ -10,10 +10,10 @@
|
|||
project_setting(6);
|
||||
$("#pro_st_edit_ku").toggle();
|
||||
<%else%>
|
||||
|
||||
<% end%>
|
||||
});
|
||||
<% end%>
|
||||
<% end%>
|
||||
$("div[nhname='pro_setting']").show();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="project_r_h">
|
||||
|
@ -21,7 +21,7 @@
|
|||
</div>
|
||||
|
||||
<!--通过admin界面配置,不同角色显示不同的模块-->
|
||||
<div class=" pro_setting">
|
||||
<div class=" pro_setting" nhname="pro_setting" style="display:none;">
|
||||
<div id="pro_st_tb_" class="pro_st_tb_">
|
||||
<ul>
|
||||
<% show_memu = show_project_memu User.current%>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
}
|
||||
$.ajax({
|
||||
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',
|
||||
success: function(data){
|
||||
$("#schoollist").html(data);
|
||||
|
|
|
@ -5,13 +5,13 @@
|
|||
</div>
|
||||
<!-- 上左下右 -->
|
||||
<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 %>
|
||||
<span class="private_project"><%= l(:label_private) %></span>
|
||||
<% 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'>
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
<%#=course.try(:teacher).try(:name)%>
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
$('#jours_count').html("<%= @jours_count %>");
|
||||
<% elsif @course && @jours_count%>
|
||||
$('#course_jour_count').html("(<%= @jours_count %>)");
|
||||
<% elsif @user && @jours_count%>
|
||||
$('#jour_count').html("<%= @jours_count %>");
|
||||
<% end %>
|
||||
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
|
||||
destroyedItem.fadeOut(600,function(){
|
||||
|
|
|
@ -393,6 +393,7 @@ zh:
|
|||
label_document_added: 文档已添加
|
||||
label_forum_message_added: 贴吧发帖成功
|
||||
label_forum_add: 贴吧创建成功
|
||||
label_forum_reply: 贴吧回复成功
|
||||
label_message_reply: 回帖人
|
||||
label_document_public_info: (打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该文档。)
|
||||
label_role: 角色
|
||||
|
|
|
@ -715,6 +715,7 @@ RedmineApp::Application.routes.draw do
|
|||
collection do
|
||||
match "getattachtype", :via => [:get, :post]
|
||||
match "search",:via => [:post,:get]
|
||||
match "searchone4reload",:via => [:post,:get]
|
||||
match "search_tag_attachment", :via => [:post,:get]
|
||||
end
|
||||
member do
|
||||
|
|
|
@ -541,7 +541,6 @@ ActiveRecord::Schema.define(:version => 20150514133640) do
|
|||
t.integer "is_teacher_score", :default => 0
|
||||
end
|
||||
|
||||
add_index "homework_attaches", ["bid_id"], :name => "bid_id"
|
||||
add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
|
||||
|
||||
create_table "homework_evaluations", :force => true do |t|
|
||||
|
@ -556,9 +555,7 @@ ActiveRecord::Schema.define(:version => 20150514133640) do
|
|||
t.integer "bid_id"
|
||||
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", ["course_id"], :name => "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|
|
||||
|
@ -1163,14 +1160,12 @@ ActiveRecord::Schema.define(:version => 20150514133640) do
|
|||
create_table "students_for_courses", :force => true do |t|
|
||||
t.integer "student_id"
|
||||
t.integer "course_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "student_idCopy"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
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 => "student_id"
|
||||
|
||||
create_table "taggings", :force => true do |t|
|
||||
t.integer "tag_id"
|
||||
|
|
|
@ -20,8 +20,8 @@ module Redmine
|
|||
notifications << Notifiable.new('message_posted')
|
||||
notifications << Notifiable.new('wiki_content_added')
|
||||
notifications << Notifiable.new('wiki_content_updated')
|
||||
notifications << Notifiable.new('forum_add')
|
||||
notifications << Notifiable.new('forum_message_added', 'forum_add')
|
||||
notifications << Notifiable.new('forum_reply')
|
||||
notifications << Notifiable.new('forum_message_added', 'forum_reply')
|
||||
notifications
|
||||
end
|
||||
end
|
||||
|
|
|
@ -384,4 +384,45 @@ function submitProjectBoard()
|
|||
{
|
||||
$("#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
|
|
@ -1904,6 +1904,18 @@ input.autocomplete.ajax-loading {
|
|||
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 ****/
|
||||
#errorExplanation, div.flash, .nodata, .warning, .conflict {
|
||||
padding: 4px 4px 4px 30px;
|
||||
|
|
|
@ -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;}
|
||||
.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;}
|
||||
.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 */
|
||||
.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;}
|
||||
|
|
Loading…
Reference in New Issue