Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject
Conflicts: db/schema.rb
This commit is contained in:
commit
d3575b288e
|
@ -11,13 +11,17 @@ class PullRequestsController < ApplicationController
|
|||
|
||||
# 返回json格式
|
||||
def index
|
||||
# 顶部导航
|
||||
# project_menu_type 为了控制base顶部导航
|
||||
@project_menu_type = 6
|
||||
# 不符合pullrequest条件的给出提示
|
||||
@allow_to_pull_request = allow_pull_request(@project) > 0 && allow_show_pull_request(@project) > 0
|
||||
|
||||
type = params[:type]
|
||||
case type
|
||||
when nil, "1"
|
||||
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "opened" || request.state == "reopened"}
|
||||
# 更新统计数字
|
||||
project_score = @project.project_score.update_column(:pull_request_num, @requests.count)
|
||||
when "2"
|
||||
@requests = @g.merge_requests(@project.gpid).select{|request| request.state == "merged"}
|
||||
when "3"
|
||||
|
|
|
@ -878,20 +878,18 @@ module ApplicationHelper
|
|||
Project.project_tree(projects, &block)
|
||||
end
|
||||
|
||||
# 项目版本库可见权限判断
|
||||
# 条件:1、modules中设置不可见或项目没有版本库;2、如果项目是私有或者项目版本库隐藏则必须是项目成员才可见
|
||||
# 项目版本库可见权限判断:
|
||||
# modules中设置可见
|
||||
# 版本库存在
|
||||
# 版本库设置了隐藏则仅仅项目成员可见(hidden_repo:1 隐藏版本库)
|
||||
# return -> true 可见
|
||||
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
|
||||
repository = Repository.where(:project_id => project.id, :type => "Repository::Gitlab").first
|
||||
if project.enabled_modules.where("name = 'repository'").empty? || repository.nil?
|
||||
result = false
|
||||
else
|
||||
result = (project.hidden_repo && !User.current.member_of?(project)) ? false : true
|
||||
end
|
||||
return @result
|
||||
end
|
||||
|
||||
def show_attachment_tip container_id, container_type
|
||||
|
@ -988,6 +986,11 @@ module ApplicationHelper
|
|||
s.html_safe
|
||||
end
|
||||
|
||||
# 判断模块是否可见
|
||||
def project_modules_allow project
|
||||
@project.enabled_modules.where("name = 'issue_tracking'").empty?
|
||||
end
|
||||
|
||||
# 计算Pull Request的请求数目
|
||||
def pull_request_count project
|
||||
g = Gitlab.client
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
<% project_issue_count = @project.issues.count %>
|
||||
<% project_acts = ForgeActivity.where("project_id = ?", @project.id).count %>
|
||||
<% raodmaps = Version.where("project_id = ?", @project.id).count %>
|
||||
<% project_score = @project.project_score %>
|
||||
<% project_modules = @project.enabled_modules.where("name = 'issue_tracking'") %>
|
||||
<%# 更新访问数,刷新的时候更新访问次数 %>
|
||||
<% update_visiti_count @project %>
|
||||
|
||||
|
@ -11,13 +13,12 @@
|
|||
<%=link_to "#{@project.owner.try(:show_name)}<span class='ml5 mr5'>/</span>".html_safe, user_path(@project.owner), :class => "pro_new_username" %>
|
||||
<%=link_to @project.name, project_path(@project), :class => "pro_new_proname" %>
|
||||
</div>
|
||||
<div class="fr clear mr15">
|
||||
<ul>
|
||||
<!--加入、退出、关注项目-->
|
||||
<span id="join_in_project_applied"><%= render :partial => "projects/applied_status" %></span>
|
||||
</ul>
|
||||
|
||||
<!--加入、退出、关注项目-->
|
||||
<div class="fr clear mr15">
|
||||
<ul><span id="join_in_project_applied"><%= render :partial => "projects/applied_status" %></span></ul>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="pro_new_topnav mt15">
|
||||
<ul>
|
||||
|
@ -40,8 +41,8 @@
|
|||
<% unless @project.enabled_modules.where("name = 'boards'").empty? %>
|
||||
<li id="project_menu_03">
|
||||
<%= link_to l(:project_module_boards), project_boards_path(@project), :class => "pro_new_proname" %>
|
||||
<% unless @project.project_score.board_num == 0 %>
|
||||
<span class="issues_nav_tag ml5"><%= @project.project_score.board_num %></span>
|
||||
<% unless project_score.board_num == 0 %>
|
||||
<span class="issues_nav_tag ml5"><%= project_score.board_num %></span>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
@ -56,26 +57,35 @@
|
|||
<% end %>
|
||||
<!--版本库-->
|
||||
<% if visible_repository?(@project) %>
|
||||
<li id="project_menu_05"><%= link_to l(:project_module_repository),({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier}), :class => "pro_new_proname" %>
|
||||
<li id="project_menu_05"><%= link_to l(:project_module_repository),({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).try(:identifier)}), :class => "pro_new_proname" %>
|
||||
<% unless @project.project_score.changeset_num == 0 %>
|
||||
<span class="issues_nav_tag ml5"><%= @project.project_score.changeset_num %></span>
|
||||
<span class="issues_nav_tag ml5"><%= project_score.changeset_num %></span>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<!--Pull Request-->
|
||||
<% if allow_pull_request(@project) > 0 && allow_show_pull_request(@project) > 0 %>
|
||||
<li id="project_menu_06">
|
||||
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "pro_new_proname" %>
|
||||
<span class="issues_nav_tag ml5"><%= pull_request_count(@project) %></span>
|
||||
</li>
|
||||
<% end %>
|
||||
<li id="project_menu_06">
|
||||
<%= link_to "Pull Requests", project_pull_requests_path(@project), :class => "pro_new_proname" %>
|
||||
<span class="issues_nav_tag ml5"><%= project_score.pull_request_num %></span>
|
||||
</li>
|
||||
<!--里程碑-->
|
||||
<li id="project_menu_07">
|
||||
<%= link_to l(:label_roadmap) ,project_roadmap_path(@project), :class => "pro_new_proname" %>
|
||||
<span class="issues_nav_tag ml5">25</span>
|
||||
</li>
|
||||
<!--日历-->
|
||||
<% unless @project.enabled_modules.where("name = 'calendar'").empty? %>
|
||||
<li id="project_menu_08">
|
||||
<%= link_to l(:project_module_calendar),project_calendar_path(@project) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<!--甘特图-->
|
||||
<% unless @project.enabled_modules.where("name = 'gantt'").empty? %>
|
||||
<li id="project_menu_09">
|
||||
<%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<li id="project_menu_08"><a href="javascript:void(0);" class=" pro_new_proname"> 更多</a></li>
|
||||
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
|
||||
<li id="project_menu_09">
|
||||
<%= link_to "#{l(:button_configure)}", settings_project_path(@project), :class => "pro_new_proname" %>
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
<% @nav_dispaly_project_label = 1
|
||||
@nav_dispaly_forum_label = 1 %>
|
||||
<%#@nav_dispaly_project_label = 1 %>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -12,36 +9,27 @@
|
|||
<%= favicon %>
|
||||
<%= javascript_heads %>
|
||||
<%= heads_for_theme %>
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','prettify','repository','css/gantt', 'css/calendar' %>
|
||||
<%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %>
|
||||
|
||||
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar' %>
|
||||
<%= call_hook :view_layouts_base_html_head %>
|
||||
<!-- page specific tags -->
|
||||
<%= yield :header_tags -%>
|
||||
<!-- MathJax的配置 -->
|
||||
<script type="text/javascript"
|
||||
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
<script type="text/javascript" src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<!-- 配置 : 在生成的公式图片上去掉Math定义的右键菜单,$$ $$ \( \) \[ \] 中的公式给予显示-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
showMathMenu: false,
|
||||
showMathMenuMSIE: false,
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
|
||||
});
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<!--add by huang-->
|
||||
<body onload="prettyPrint();">
|
||||
<div class="navContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<%= render :partial => 'layouts/logined_header' %>
|
||||
<% else%>
|
||||
<%= render :partial => 'layouts/unlogin_header' %>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="navContainer mb10"> <%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %></div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="Container">
|
||||
<div id="content" class="sy_contanier" style=" width:1000px; margin:0 auto;">
|
||||
<%= render :partial => 'layouts/base_project_top' %>
|
||||
|
@ -54,16 +42,14 @@
|
|||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div><!--Container end-->
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'layouts/footer' %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% if hidden_unproject_infos %>
|
||||
<%= render :partial => 'layouts/new_feedback' %>
|
||||
<% end %>
|
||||
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
|
@ -73,5 +59,6 @@
|
|||
</div>
|
||||
<%= call_hook :view_layouts_base_body_bottom %>
|
||||
</body>
|
||||
<%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %>
|
||||
</html>
|
||||
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
<div class="resources mt10">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word" style="width:620px">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.course), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word" >
|
||||
<%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostDeadline mr15">
|
||||
文件大小:
|
||||
<%= number_to_human_size activity.filesize%>
|
||||
</div>
|
||||
<div class="homepagePostDeadline">上传时间:<%= format_time(activity.created_on) %></div>
|
||||
</div>
|
||||
<div class="homepagePostSetting" id="act-<%= user_activity_id %>" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
user_card_show_hide();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,108 @@
|
|||
<% unless activity.author.nil? %>
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word" style="width:620px">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<% end %> TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<% if User.current.logged? %>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
|
||||
</li>
|
||||
<li>
|
||||
<% if !defined?(project_id) && !defined?(user_id) %>
|
||||
<%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
|
||||
<% elsif defined?(project_id) %>
|
||||
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
|
||||
<% elsif defined?(user_id) %>
|
||||
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<% case activity.tracker_id %>
|
||||
<% when 1%>
|
||||
<span class="fl" title="缺陷">【缺陷】</span>
|
||||
<% when 2%>
|
||||
<span class="fl" title="功能">【功能】</span>
|
||||
<% when 3%>
|
||||
<span class="fl" title="支持">【支持】</span>
|
||||
<% when 4%>
|
||||
<span class="fl" title="任务">【任务】</span>
|
||||
<% when 5%>
|
||||
<span class="fl" title="周报">【周报】</span>
|
||||
<% end %>
|
||||
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %>
|
||||
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'>
|
||||
<%= get_issue_priority(activity.priority_id)[1] %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostAssignTo"><span class="fontGrey3">指派给</span>
|
||||
<% unless activity.assigned_to_id.nil? %>
|
||||
<% if activity.try(:assigned_to).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDeadline fl">
|
||||
发布时间:
|
||||
<%=format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %>
|
||||
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<%# 局部刷新:修改xissue属性 %>
|
||||
<% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %>
|
||||
<% unless params[:action] == "index" %>
|
||||
<div id="div_user_issue_detail_<%=activity.id %>">
|
||||
<%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div id="div_user_issue_reply_<%=user_activity_id%>">
|
||||
<%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
user_card_show_hide();
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
|
||||
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word" style="width:620px">
|
||||
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
TO
|
||||
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>
|
||||
<!--<a href="javascript:void(0);" class="newsBlue ml15 mr5"><%= activity.project.name %>(项目讨论区)</a>-->
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= link_to activity.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey fl" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, board_message_path(activity.board,activity), :class=> "postGrey fl" %>
|
||||
<% end %>
|
||||
<% if activity.sticky == 1%>
|
||||
<span class="sticky_btn_cir ml10">置顶</span>
|
||||
<% end%>
|
||||
<% if activity.locked %>
|
||||
<span class="locked_btn_cir ml10 fl mt3" title="已锁定"> </span>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostDate fl">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= get_forge_act_message(activity, activity.class.to_s) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if activity.parent_id.nil? %>
|
||||
<% content = activity.content%>
|
||||
<% else %>
|
||||
<% content = activity.parent.content%>
|
||||
<% end %>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10" style="font-weight:normal;">
|
||||
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
|
||||
</div>
|
||||
<% if User.current.logged? %>
|
||||
<div class="homepagePostSetting" id="message_setting_<%= user_activity_id%>" style="display: block">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<% if activity.author.id == User.current.id%>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_edit),
|
||||
edit_board_message_path(activity.id,:board_id=>activity.board_id,:is_course=>is_course,:is_board=>is_board),
|
||||
:class => 'postOptionLink'
|
||||
) if activity.editable_by?(User.current) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to(
|
||||
l(:button_delete),
|
||||
delete_board_message_path(activity.id,:board_id=>activity.board_id,:is_course=>is_course,:is_board=>is_board),
|
||||
:method => :post,
|
||||
:data => {:confirm => l(:text_are_you_sure)},
|
||||
:class => 'postOptionLink'
|
||||
) if activity.destroyable_by?(User.current) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if hidden_unproject_infos %>
|
||||
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
|
||||
<% else %>
|
||||
<li><%= link_to "发送", "javascript:void(0);", :onclick => "show_send_hidden(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% all_comments = []%>
|
||||
<% all_replies = get_all_children(all_comments, activity) %>
|
||||
<% count = all_replies.count %>
|
||||
<%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
|
||||
<%# count = fetch_user_leaveWord_reply(activity).count %>
|
||||
<div class="homepagePostReply">
|
||||
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
|
||||
|
||||
<% comments = all_replies[0..2] %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if !activity.locked? %>
|
||||
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer mb10">
|
||||
<% if User.current.logged? %>
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id,:is_course => is_course, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= render :partial => "users/show_unlogged" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
user_card_show_hide();
|
||||
});
|
||||
</script>
|
|
@ -9,27 +9,6 @@
|
|||
$("#relateProject,.relatePInfo").mouseout(function(){
|
||||
$(".relatePInfo").css("display","none");
|
||||
});
|
||||
// $(".homepagePostPortrait").mouseover(function(){
|
||||
// onImage = true;
|
||||
// $(this).children(".userCard").css("display","block");
|
||||
// });
|
||||
// $(".homepagePostPortrait").mouseout(function(){
|
||||
// var cur = $(this);
|
||||
// onImage = false;
|
||||
// setTimeout(function(){
|
||||
// if (onUserCard == false && onImage == false) {
|
||||
// $(cur).children(".userCard").css("display", "none");
|
||||
// }
|
||||
// }, 500);
|
||||
// });
|
||||
// $(".userCard").mouseover(function(){
|
||||
// onUserCard = true;
|
||||
// $(this).css("display","block");
|
||||
// });
|
||||
// $(".userCard").mouseout(function(){
|
||||
// onUserCard = false;
|
||||
// $(this).css("display","none");
|
||||
// });
|
||||
$(".coursesLineGrey").mouseover(function(){
|
||||
$(this).css("color","#ffffff");
|
||||
});
|
||||
|
@ -60,15 +39,10 @@
|
|||
<%= render :partial => 'projects/project_create', :locals => {:activity => activity, :user_activity_id => activity.id} %>
|
||||
<!--缺陷动态-->
|
||||
<% when "Issue" %>
|
||||
<%= render :partial => 'users/project_issue', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %>
|
||||
<%= render :partial => 'projects/act_issues', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :project_id => activity.project_id} %>
|
||||
<!--message -->
|
||||
<% when "Message" %>
|
||||
<%= render :partial => 'users/project_message', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :is_course => 1, :is_board => 0} %>
|
||||
<!--new 新闻-->
|
||||
<% when "News" %>
|
||||
<% if !activity.forge_act.nil? and activity.forge_act.project %>
|
||||
<%= render :partial => 'projects/project_news', :locals => {:activity=>activity.forge_act, :user_activity_id=>activity.id} %>
|
||||
<% end %>
|
||||
<%= render :partial => 'projects/act_messages', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :is_course => 1, :is_board => 0} %>
|
||||
<!--Attachment -->
|
||||
<% when "Attachment" %>
|
||||
<%= render :partial => 'users/project_attachment', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %>
|
||||
|
|
|
@ -1,26 +1,31 @@
|
|||
<%#= render :partial => "pull_requests/pull_request_container" %>
|
||||
<ul id="mergeBanner" class="project-merge-banner">
|
||||
<li class="active"><%= link_to "待处理<span class='project-number-dot'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true %></li>
|
||||
<li><%= link_to "已处理<span class='project-number-dot'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li>
|
||||
<li><%= link_to "已关闭<span class='project-number-dot'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true %></li>
|
||||
<% if allow_pull_request(@project) && User.current.member_of?(@project) %>
|
||||
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<% if @allow_to_pull_request %>
|
||||
<%#= render :partial => "pull_requests/pull_request_container" %>
|
||||
<ul id="mergeBanner" class="project-merge-banner">
|
||||
<li class="active"><%= link_to "待处理<span class='project-number-dot'>#{@requests_opened_count}</span>".html_safe, project_pull_requests_path(:type => "1"), :remote => true %></li>
|
||||
<li><%= link_to "已处理<span class='project-number-dot'>#{@requests_merged_count}</span>".html_safe, project_pull_requests_path(:type => "2"), :remote => true %></li>
|
||||
<li><%= link_to "已关闭<span class='project-number-dot'>#{@requests_closed_count}</span>".html_safe, project_pull_requests_path(:type => "3"), :remote => true %></li>
|
||||
<% if allow_pull_request(@project) && User.current.member_of?(@project) %>
|
||||
<%= link_to "创建Pull Request", new_project_pull_request_path, :class => "BlueCirBtn fr ml10 mt10", :style => "width:110px;" %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
|
||||
<ul class="project-merge-content" id="pull_requests_list">
|
||||
<%= render "pull_requests/pull_requests_list" %>
|
||||
</ul>
|
||||
<ul class="project-merge-content" id="pull_requests_list">
|
||||
<%= render "pull_requests/pull_requests_list" %>
|
||||
</ul>
|
||||
|
||||
|
||||
<script>
|
||||
$("#mergeBanner").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
|
||||
$("#mergeBanner").parent().before("<div class='homepageRightBanner mb10'><span class='f16 fontGrey3'>Pull Request</span></div>");
|
||||
<script>
|
||||
$("#mergeBanner").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
|
||||
$("#mergeBanner").parent().before("<div class='homepageRightBanner mb10'><span class='f16 fontGrey3'>Pull Request</span></div>");
|
||||
|
||||
$(".project-merge-banner li").click(function(){
|
||||
$(".project-merge-banner li").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
</script>
|
||||
<% else %>
|
||||
<p>不符合条件,内容待补充</p>
|
||||
<% end %>
|
||||
|
||||
$(".project-merge-banner li").click(function(){
|
||||
$(".project-merge-banner li").removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,5 @@
|
|||
class AddPullRequestNumToProjectScore < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :project_scores, :pull_request_num, :integer, :default => false
|
||||
end
|
||||
end
|
|
@ -859,7 +859,7 @@ a.pro_new_topbtn{ padding: 3px 7px; font-size: 12px; line-height: 20px; color:
|
|||
a.pro_new_topbtn_left { padding: 3px 10px; font-size: 12px;line-height: 20px; background-image: linear-gradient(#fcfcfc, #eee); border: 1px solid #d5d5d5;border-radius: 3px;border-top-right-radius: 0;border-bottom-right-radius: 0; color: #333; }
|
||||
a:hover.pro_new_topbtn_left{background-image: linear-gradient(#ededed, #dddddd);}
|
||||
.pro_new_topnav ul{border-bottom: 3px solid #ddd; height: 30px; line-height: 30px;}
|
||||
.pro_new_topnav ul li{ float: left; width: 110px; height: 30px; line-height: 30px;text-align: center; }
|
||||
.pro_new_topnav ul li{ float: left;padding:0 15px; height: 30px; line-height: 30px;text-align: center; }
|
||||
.pro_new_topnav ul li:hover{border-bottom: 3px solid #3b94d6;}
|
||||
.pro_new_topnav_active{border-bottom: 3px solid #3b94d6; }
|
||||
/* 翻页 新版缺陷列表*/
|
||||
|
|
Loading…
Reference in New Issue