diff --git a/app/views/layouts/_base_project_top.html.erb b/app/views/layouts/_base_project_top.html.erb index 2400219f9..5029c8245 100644 --- a/app/views/layouts/_base_project_top.html.erb +++ b/app/views/layouts/_base_project_top.html.erb @@ -74,8 +74,19 @@ <%= link_to l(:label_roadmap) ,project_roadmap_path(@project), :class => "pro_new_proname" %> 25 + + <% unless @project.enabled_modules.where("name = 'calendar'").empty? %> +
  • + <%= link_to l(:project_module_calendar),project_calendar_path(@project) %> +
  • + <% end %> + + <% unless @project.enabled_modules.where("name = 'gantt'").empty? %> +
  • + <%= link_to l(:project_module_gantt) ,project_gantt_path(@project) %> +
  • + <% end %> -
  • 更多
  • <% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
  • <%= link_to "#{l(:button_configure)}", settings_project_path(@project), :class => "pro_new_proname" %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 1395f975f..7bdecd750 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -1,6 +1,3 @@ -<% @nav_dispaly_project_label = 1 - @nav_dispaly_forum_label = 1 %> -<%#@nav_dispaly_project_label = 1 %> @@ -13,35 +10,27 @@ <%= 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' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> - + - + - +
    +
    <%= render :partial => 'layouts/base_project_top' %> @@ -54,7 +43,7 @@
    -
    +
    <%= render :partial => 'layouts/footer' %> @@ -73,5 +62,7 @@ <%= call_hook :view_layouts_base_body_bottom %> + +<%= javascript_include_tag 'cookie','project',"avatars", 'header','prettify','select_list_move','attachments' %> diff --git a/app/views/projects/_act_attachments.html.erb b/app/views/projects/_act_attachments.html.erb new file mode 100644 index 000000000..3a5a29a6e --- /dev/null +++ b/app/views/projects/_act_attachments.html.erb @@ -0,0 +1,46 @@ +
    +
    +
    + <%= 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} %> +
    +
    +
    + <% 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" %> +
    +
    + <%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %> +
    +
    +
    + 文件大小: + <%= number_to_human_size activity.filesize%> +
    +
    上传时间:<%= format_time(activity.created_on) %>
    +
    + +
    +
    +
    +
    + diff --git a/app/views/projects/_act_issues.html.erb b/app/views/projects/_act_issues.html.erb new file mode 100644 index 000000000..db90c2f55 --- /dev/null +++ b/app/views/projects/_act_issues.html.erb @@ -0,0 +1,108 @@ +<% unless activity.author.nil? %> +
    +
    +
    + <%= 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} %> +
    +
    +
    + <% 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"%> +
    + <% if User.current.logged? %> +
    +
      +
    • +
        +
      • + <%= 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) %> +
      • +
      • + <% 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 %> +
      • +
      • + <%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %> +
      • +
      +
    • +
    +
    + <% end %> +
    + <% case activity.tracker_id %> + <% when 1%> + 【缺陷】 + <% when 2%> + 【功能】 + <% when 3%> + 【支持】 + <% when 4%> + 【任务】 + <% when 5%> + 【周报】 + <% end %> + <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %> + + <%= get_issue_priority(activity.priority_id)[1] %> + +
    +
    +
    指派给   + <% 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 %> +
    +
    + 发布时间: + <%=format_time(activity.created_on) %> +
    +
    + 更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %> +
    +
    +
    + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %> + + +
    + <%# 局部刷新:修改xissue属性 %> + <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> + <% unless params[:action] == "index" %> +
    + <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> +
    + <% end %> + <% end %> +
    +
    + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
    +
    +
    +
    +
    + <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %> +
    +
    + +<% end %> + diff --git a/app/views/projects/_act_messages.html.erb b/app/views/projects/_act_messages.html.erb new file mode 100644 index 000000000..783e740f1 --- /dev/null +++ b/app/views/projects/_act_messages.html.erb @@ -0,0 +1,129 @@ +
    +
    +
    + <%= 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} %> +
    +
    +
    + <%= 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"%> + +
    +
    + <% 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%> + 置顶 + <% end%> + <% if activity.locked %> +        + <% end%> +
    +
    +
    + 发帖时间:<%= format_time(activity.created_on) %> +
    +
    + 更新时间:<%= get_forge_act_message(activity, activity.class.to_s) %> +
    +
    + <% 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} %> +
    + + +
    +
    + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
    + <% if User.current.logged? %> +
    +
      +
    • +
        + <% if activity.author.id == User.current.id%> +
      • + <%= 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) %> +
      • +
      • + <%= 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) %> +
      • + <% end %> + <% if hidden_unproject_infos %> +
      • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
      • + <% else %> +
      • <%= link_to "发送", "javascript:void(0);", :onclick => "show_send_hidden(#{activity.id}, #{User.current.id}, 'message');", :class => "postOptionLink" %>
      • + <% end %> +
      +
    • +
    +
    + <% end %> +
    +
    +
    + <% 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 %> +
    + <%= 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 %> +
    + <%= 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}%> +
    + <% end %> + + <% if !activity.locked? %> +
    +
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
    +
    + <% if User.current.logged? %> +
    + <%= 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|%> + + +
    + + +
    +

    + <% end%> +
    + <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %> +
    +
    +
    +
    + <% end %> +
    +
    + diff --git a/app/views/projects/_project_activities.html.erb b/app/views/projects/_project_activities.html.erb index 3660b5986..c555758a3 100644 --- a/app/views/projects/_project_activities.html.erb +++ b/app/views/projects/_project_activities.html.erb @@ -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} %> <% when "Message" %> - <%= render :partial => 'users/project_message', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :is_course => 1, :is_board => 0} %> - - <% 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} %> <% when "Attachment" %> <%= render :partial => 'users/project_attachment', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %> diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index eace25316..6c9f04294 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -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; } /* 翻页 新版缺陷列表*/ @@ -911,4 +911,4 @@ a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;} .pro_newsetting_con p,.pro_newsetting_con { line-height: 30px;} .w650{ width: 650px;} .pro_new_prompt{ border:1px solid #f6d0b1; padding:10px; background: #fff9e9; color: #ee4a20; text-align: center;} -p.pro_new_grey{ line-height: 1.9; } +p.pro_new_grey{ line-height: 1.9; }