Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
Conflicts: app/views/layouts/base_projects.html.erb
This commit is contained in:
commit
3ee9ac2b50
|
@ -180,6 +180,7 @@ class ProjectsController < ApplicationController
|
||||||
@project = Project.new
|
@project = Project.new
|
||||||
@project.safe_attributes = params[:project]
|
@project.safe_attributes = params[:project]
|
||||||
@project.organization_id = params[:organization_id]
|
@project.organization_id = params[:organization_id]
|
||||||
|
@project.user_id = User.current.id
|
||||||
if validate_parent_id && @project.save
|
if validate_parent_id && @project.save
|
||||||
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
||||||
# Add current user as a project member if he is not admin
|
# Add current user as a project member if he is not admin
|
||||||
|
|
|
@ -382,7 +382,7 @@ class CoursesService
|
||||||
end
|
end
|
||||||
latest_bid_message = messages.first
|
latest_bid_message = messages.first
|
||||||
unless latest_bid_message.nil?
|
unless latest_bid_message.nil?
|
||||||
latest_course_dynamics << {:type => 2,:time => latest_bid_message.created_on,:message => '最近更新了留言'}#l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
latest_course_dynamics << {:type => 4,:time => latest_bid_message.created_on,:message => '最近更新了作业'}#l(:label_recently_updated_message,:locale => current_user.language.nil? ? 'zh':current_user.language)}
|
||||||
end
|
end
|
||||||
#每个作业中学生最后提交的作业
|
#每个作业中学生最后提交的作业
|
||||||
homeworks = []
|
homeworks = []
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<% if @versions.first.attachments.any?%>
|
<% if !@versions.first.nil? && @versions.first.attachments.any?%>
|
||||||
<% options = {:author => true, :deletable => true } %>
|
<% options = {:author => true, :deletable => true } %>
|
||||||
<%= render :partial => 'attachments/links', :locals => {:attachments => @versions.first.attachments, :options => options, :is_float => true} %>
|
<%= render :partial => 'attachments/links', :locals => {:attachments => @versions.first.attachments, :options => options, :is_float => true} %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<h2 class="project_h2">问题跟踪</h2>
|
<h2 class="project_h2">问题跟踪</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="problem_top">
|
<div class="problem_top">
|
||||||
<% if @project.enabled_modules.where("name = 'issue_tracking'").count > 0 %>
|
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
|
||||||
<span>
|
<span>
|
||||||
<% if User.current.member_of?(@project) %>
|
<% if User.current.member_of?(@project) %>
|
||||||
<%= link_to l(:label_issue_new), {:controller => 'issues', :action => 'new', :copy_from => nil}, :param => :project_id, :caption => :label_issue_new,
|
<%= link_to l(:label_issue_new), {:controller => 'issues', :action => 'new', :copy_from => nil}, :param => :project_id, :caption => :label_issue_new,
|
||||||
|
|
|
@ -5,4 +5,6 @@
|
||||||
per_page: number of items to fetch per page
|
per_page: number of items to fetch per page
|
||||||
remote: data-remote
|
remote: data-remote
|
||||||
-%>
|
-%>
|
||||||
|
<span class="spacer">
|
||||||
|
<%= raw(t 'views.pagination.truncate') %>
|
||||||
|
</span>
|
|
@ -137,6 +137,16 @@
|
||||||
<div class="subNav">
|
<div class="subNav">
|
||||||
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
|
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
|
||||||
</div>
|
</div>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
|
||||||
|
<div class="subNav">
|
||||||
|
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :style => "color:#3CA5C6" %><span class="subnav_num">(<%= @project.issues.count %>)</span>
|
||||||
|
<span>
|
||||||
|
<% if User.current.logged? && User.current.member_of?(@project) %>
|
||||||
|
<%= link_to "+发布问题", new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %></span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<% end%>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
|
||||||
<div class="subNav">
|
<div class="subNav">
|
||||||
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :style => "color:#3CA5C6" %><span class="subnav_num">(<%= @project.issues.count %>)</span>
|
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :style => "color:#3CA5C6" %><span class="subnav_num">(<%= @project.issues.count %>)</span>
|
||||||
<span>
|
<span>
|
||||||
|
@ -151,12 +161,16 @@
|
||||||
<%= link_to "+发贴", project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %>
|
<%= link_to "+发贴", project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end%>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'files'").empty? %>
|
||||||
<div class="subNav">
|
<div class="subNav">
|
||||||
<%= link_to l(:label_course_file), project_files_path(@project), :style => "color:#3CA5C6" %><span class="subnav_num">(<%= @project.attachments.count %>)</span>
|
<%= link_to l(:label_course_file), project_files_path(@project), :style => "color:#3CA5C6" %><span class="subnav_num">(<%= @project.attachments.count %>)</span>
|
||||||
<% if User.current.member_of?(@project) %>
|
<% if User.current.member_of?(@project) %>
|
||||||
<%= link_to "+上传资源", new_project_file_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
|
<%= link_to "+上传资源", new_project_file_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end%>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'repository'").empty? %>
|
||||||
<div class="subNav">
|
<div class="subNav">
|
||||||
<%= link_to l(:field_user_active_changeset), {:controller => 'repositories', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
|
<%= link_to l(:field_user_active_changeset), {:controller => 'repositories', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
|
||||||
<span class="subnav_num">(<%= @project.repositories.count %>)</span>
|
<span class="subnav_num">(<%= @project.repositories.count %>)</span>
|
||||||
|
@ -164,6 +178,7 @@
|
||||||
<%= link_to "+创建版本库", new_project_repository_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
|
<%= link_to "+创建版本库", new_project_repository_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div class="subNav subNav_jiantou"><%= l(:label_more) %></div>
|
<div class="subNav subNav_jiantou"><%= l(:label_more) %></div>
|
||||||
<ul class="navContent" style="padding-left: 0px">
|
<ul class="navContent" style="padding-left: 0px">
|
||||||
|
|
|
@ -4,27 +4,41 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:field_user_active_news), project_news_index_path(@project) %>
|
<% unless @project.enabled_modules.where("name = 'news'").empty? %>
|
||||||
|
<%= link_to l(:field_user_active_news), project_news_index_path(@project) %>
|
||||||
|
<% end%>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'wiki'").empty? %>
|
||||||
<%= link_to l(:project_module_wiki), project_wiki_path(@project) %>
|
<%= link_to l(:project_module_wiki), project_wiki_path(@project) %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'code_review'").empty? %>
|
||||||
<%= link_to l(:project_module_code_review), {controller: 'code_review', action: 'index', id: @project.id} %>
|
<%= link_to l(:project_module_code_review), {controller: 'code_review', action: 'index', id: @project.id} %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'calendar'").empty? %>
|
||||||
<%= link_to l(:project_module_calendar),project_calendar_path(@project) %>
|
<%= link_to l(:project_module_calendar),project_calendar_path(@project) %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'gantt'").empty? %>
|
||||||
<%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>
|
<%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'documents'").empty? %>
|
||||||
<%= link_to l(:project_module_documents), project_documents_path(@project) %>
|
<%= link_to l(:project_module_documents), project_documents_path(@project) %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_project_tool_response) ,project_feedback_path(@project)%>
|
<%= link_to l(:label_project_tool_response) ,project_feedback_path(@project)%>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
<% unless @project.enabled_modules.where("name = 'dts'").empty? %>
|
||||||
<%= link_to l(:label_module_share) ,share_show_path(@project) %>
|
<%= link_to l(:label_module_share) ,share_show_path(@project) %>
|
||||||
|
<% end %>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
|
@ -210,4 +210,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= paginate @events_pages, :window => 3%>
|
<%= paginate @events_pages, :left => 3, :right => 3%>
|
|
@ -23,7 +23,7 @@
|
||||||
Kaminari.configure do |config|
|
Kaminari.configure do |config|
|
||||||
# config.default_per_page = 25
|
# config.default_per_page = 25
|
||||||
# config.max_per_page = nil
|
# config.max_per_page = nil
|
||||||
config.window = 2
|
config.window = 0
|
||||||
# config.outer_window = 3
|
# config.outer_window = 3
|
||||||
# config.left = 2
|
# config.left = 2
|
||||||
# config.right = 2
|
# config.right = 2
|
||||||
|
|
|
@ -384,9 +384,7 @@ en:
|
||||||
# steam the student
|
# steam the student
|
||||||
label_current_group: Current group
|
label_current_group: Current group
|
||||||
# DTS Test tool
|
# DTS Test tool
|
||||||
project_module_dts: DTS Test tool
|
|
||||||
label_module_share: DTS Test tool
|
label_module_share: DTS Test tool
|
||||||
field_dts_test: DTS Test tool
|
|
||||||
# Feedback module
|
# Feedback module
|
||||||
label_technical_support: Support :
|
label_technical_support: Support :
|
||||||
label_feedback: Feedback
|
label_feedback: Feedback
|
||||||
|
|
|
@ -522,7 +522,7 @@ zh:
|
||||||
project_module_time_tracking: 时间跟踪
|
project_module_time_tracking: 时间跟踪
|
||||||
project_module_news: 新闻
|
project_module_news: 新闻
|
||||||
project_module_documents: 文档
|
project_module_documents: 文档
|
||||||
project_module_files: 作品下载
|
project_module_files: 资源库
|
||||||
project_module_attachments: 资源
|
project_module_attachments: 资源
|
||||||
project_module_wiki: Wiki
|
project_module_wiki: Wiki
|
||||||
project_module_repository: 版本库
|
project_module_repository: 版本库
|
||||||
|
@ -530,7 +530,6 @@ zh:
|
||||||
project_module_calendar: 日历
|
project_module_calendar: 日历
|
||||||
project_module_gantt: 甘特图
|
project_module_gantt: 甘特图
|
||||||
project_module_course: 课程
|
project_module_course: 课程
|
||||||
project_module_dts: DTS测试工具
|
|
||||||
label_module_share: DTS测试工具
|
label_module_share: DTS测试工具
|
||||||
project_module_code_review: 代码审查
|
project_module_code_review: 代码审查
|
||||||
label_user: 用户
|
label_user: 用户
|
||||||
|
@ -1965,8 +1964,6 @@ zh:
|
||||||
label_course_brief_introduction: 课程简介
|
label_course_brief_introduction: 课程简介
|
||||||
field_teacher_name: 教 师
|
field_teacher_name: 教 师
|
||||||
|
|
||||||
field_dts_test: DTS测试工具
|
|
||||||
|
|
||||||
label_newbie_faq: '新手指引 & 问答'
|
label_newbie_faq: '新手指引 & 问答'
|
||||||
label_hot_project: '热门项目'
|
label_hot_project: '热门项目'
|
||||||
label_borad_project: 项目讨论区
|
label_borad_project: 项目讨论区
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Time 2015-03-11 14:25:45
|
||||||
|
# Author lizanle
|
||||||
|
# Description 给每个项目添加一条初始创建信息,如果有menber,最早加进来的就算创始人,并给projects表的更新创建人
|
||||||
|
class AddProjectCreateInfoToForgeActivities < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
Project.all.each do |e|
|
||||||
|
user = e.members.order("members.created_on asc").first
|
||||||
|
next if user.nil?
|
||||||
|
execute("insert into forge_activities(forge_act_id,
|
||||||
|
forge_act_type,
|
||||||
|
project_id,
|
||||||
|
user_id,
|
||||||
|
created_at,
|
||||||
|
updated_at)
|
||||||
|
values(#{e.id},'ProjectCreateInfo',#{e.id},#{user.user_id},
|
||||||
|
'#{user.created_on.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}',
|
||||||
|
'#{user.created_on.to_s.gsub("+0800","").to_datetime.strftime("%Y-%m-%d %H:%M:%S")}')")
|
||||||
|
execute("update projects set user_id=#{user.user_id} where id =#{e.id}")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue