socialforge/app/views/projects/show.html.erb

213 lines
13 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_activity) %></h2>
</div>
<%= javascript_include_tag "jquery.infinitescroll.js" %>
<script>
/* $(document).ready(function (){ //别忘了加这句除非你没学Jquery
$("#container").infinitescroll({
navSelector: "#paginator", //页面分页元素--成功后自动隐藏
nextSelector: "#paginator a[rel='next']", //下一页的按钮,但是貌似这个选不中
itemSelector: ".scroll " ,
path: function(current){ var page = parseInt(current)+1;
var project_id = <%= @project.id %>;
return "/projects/"+project_id+"?page="+page
}, //下一页的路径
animate: true,
maxPage: 500
});
});*/
</script>
<div id="container">
<div class="scroll">
<% unless @events_pages.empty? %>
<% @events_pages.each do |e| -%>
<% if e.forge_act_type == "ProjectCreateInfo"%>
<div class="font_description">
<table width="660">
<tr>
<td>
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</td>
<td colspan="2">
<table width="580">
<tr>
<td>
<%= link_to_user(e.user)%>
<%= l(:label_project_new) %>
<%= link_to e.project.name %>
<strong> !</strong>
</td>
</tr>
<tr>
<td class="font_lighter" >
<%= l :label_create_time %>:
<%= format_time(e.created_at) %>
</table>
</td>
</tr>
</table>
</div>
<% end %>
<% next if e.forge_act_type.safe_constantize.nil?
act = e.forge_act;
next if act.nil? %>
<% if e.forge_act_type == "Issue" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;margin-top: 10px;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(act.author), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to_user(act.author) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{act.source_from}##{act.project_issues_index} (#{act.status}): #{act.tracker.name} #{act.subject}"),
{:controller => 'issues',
:action => 'show',
:id => act.id} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
<div class="" style="display:inline-block;position:absolute; right:2%;">
<span> <%= link_to l(:label_find_all_comments), issue_path(act.id) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => act.journals.count) %></span>
</div>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Journal" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %>
<%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"),
{:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:notes %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Message" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
{:controller => 'messages',
:action => 'show',
:board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:content %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% elsif e.forge_act_type == "News" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<% unless act.nil? %>
<%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %>
<% end %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
<div class="" style="display:inline-block;position:absolute; right:2%;">
<span>
<%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %>
</span>
<span class="font_lighter">
<%= l(:label_comments_count, :count => act.comments_count) %>
</span>
</div>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Document" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{l(:label_document)}: #{act.title}"), {:controller => 'documents', :action => 'show', :id => act.id} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% elsif e.forge_act_type == "Attachment" %>
<div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;width: 100%;word-wrap: break-word;word-break: break-all;">
<div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
</div>
<div class="activity-content" style="padding:5px 5px 5px 70px;">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project_id %></strong>
<span class="activity-title font_lighter">
<%= link_to(h(e.user), user_path(e.user_id)) %>
<%= l(:label_new_activity) %>
</span>
<%= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id} %>
<div class="activity_description info-break" style="font-size: 13px;width: 100%;word-break: break-all;word-wrap: break-word;">
<%= textAreailizable act,:description %>
</div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>
&nbsp; <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %></span>
</div>
</div>
</div>
<% end %>
<% end %>
<% end %>
</div>
</div>
<%= paginate @events_pages, :left => 3, :right => 3%>