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

180 lines
6.9 KiB
Plaintext
Raw Normal View History

<!--Added by nie-->
2013-08-01 10:33:49 +08:00
<div class="project-block">
<div class="img-tag">
<% if(@project.project_type==1)%>
2013-10-15 11:06:19 +08:00
<% if get_avatar?(project)%>
2013-11-01 15:48:23 +08:00
<%= image_tag(url_to_avatar(project), :class => "avatar2") %>
2013-10-15 11:06:19 +08:00
<% else %>
2013-11-01 15:48:23 +08:00
<%= image_tag('../images/avatars/Project/course.jpg', :class => "avatar2") %>
2013-10-15 11:06:19 +08:00
<% end %>
<% else %>
2013-11-01 15:48:23 +08:00
<%= image_tag(url_to_avatar(project), :class => "avatar2") %>
2013-08-01 10:33:49 +08:00
</div>
<div class="wiki-description">
<p>
<%= textilizable(project.short_description, :project => project) %>
</p>
</div>
2013-08-01 10:33:49 +08:00
<div class="information">
<p class="stats">
2014-07-11 14:51:33 +08:00
<table style="padding-left: 100px">
<tr>
<td style="width: 40%;text-align: right;font-size: 17px;">
<strong><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></strong>
</td>
<td style="width: 60%;text-align: left">
<%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
</td>
</tr>
<tr>
<td style="width: 40%;text-align: right;font-size: 17px;">
<strong><%= link_to "#{@project.members.count}", project_member_path(@project)%></strong>
</td>
<td style="width: 60%;text-align: left">
<%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
</td>
</tr>
<tr>
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
<strong><%= content_tag('span', "#{(@project.repository.nil? || @project.repository.changesets[0].nil?) ? '0' : distance_of_time_in_words(Time.now, @project.repository.changesets[0].committed_on)}", :class => "info") %></strong>
</td>
<td style="width: 60%;text-align: left">
<%= content_tag('span', l(:label_since_last_commits)) %>
</td>
</tr>
<tr>
<td style="width: 40%;text-align: right;font-size: 17px;color: rgb(17, 102, 153)">
<strong><%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %></strong>
</td>
<td style="width: 60%;text-align: left">
<%= content_tag('span', l(:label_commit_on)) %>
</td>
</tr>
</table>
2013-08-01 10:33:49 +08:00
</p>
</div>
<% end %>
<% if(@project.project_type==1)%>
</div>
<div class="wiki-description">
<p>
<%= textilizable(project.short_description, :project => project) %>
</p>
</div>
2014-05-22 15:33:38 +08:00
<div class="information">
2013-10-15 11:06:19 +08:00
<!-- p class="stats">
2014-05-22 15:33:38 +08:00
<%#= content_tag('span', @project.watcher_users.count, :class => "info") %>
<%#= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
2013-10-15 11:06:19 +08:00
</p -->
<p class="stats">
<%= content_tag('span', link_to("#{@project.homeworks.count}", homework_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_task, :count => @project.homeworks.count)) %>
</p>
<p class="stats">
<%= content_tag('span', link_to("#{@project.members.count}", member_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_member, :count => @project.members.count)) %>
</p>
<p class="stats">
<% files_count = @project.attachments.count %>
<% @project.versions.each do |version| %>
<% files_count += version.attachments.count %>
<% end %>
<%= content_tag('span', link_to(files_count, file_project_path(@project)), :class => "info") %><%= content_tag('span', l(:label_x_data,:count => files_count)) %>
</p>
</div>
<% end %>
2013-08-01 10:33:49 +08:00
</div>
<div class="add-info">
<div class="main-language">
<!-- added by huang -->
<% if(@project.project_type==1)%>
<%= content_tag('span', "#{l(:field_tea_name)}: ") %>
2013-09-12 10:41:15 +08:00
<% else %>
<%= content_tag('span', "#{l(:default_role_manager)}: ") %>
<% end %>
<% @admin = @project.project_infos%>
<% if @admin.size > Setting.show_tags_length.to_i then %>
<% i = 0 %>
<% until i>Setting.show_tags_length.to_i do %>
<%= link_to @admin[i].user.name, user_path(@admin[i].user_id) %>
<% i += 1 %>
<% end %>
<%= link_to l(:label_more_tags), member_project_path(@project) %>
<% else %>
<%= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %>
<% end %>
<%# if @admin.size > 0 %>
<%#= content_tag('a', @admin.collect{|u| link_to(u.user.name, user_path(u.user_id))}.join(", ").html_safe) %>
<%# end %>
<% if(@project.project_type==1)%>
2013-10-10 17:06:46 +08:00
&nbsp;&nbsp;&nbsp;<%= l(:label_course_college) %>
2013-10-10 10:22:32 +08:00
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
<%= @admin.first.user.user_extensions.occupation %>
<% end %>
<% end %>
2013-08-01 10:33:49 +08:00
</div>
<div class="licences">
<%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %>
</div>
<!-- added by bai -->
<div class="grade">
<% issue_count = @project.issues.count %>
<% issue_journal_count = @project.issue_changes.count %>
<% issue_score = issue_count * 0.2 %>
<% issue_journal_score = issue_journal_count * 0.1 %>
<% finall_issue_score = issue_score + issue_journal_score %>
<% new_count = @project.news.count %>
<% new_score = new_count * 0.1 %>
<% finall_new_score = new_score %>
<% document_count = @project.documents.count %>
<% file_score = document_count * 0.1 %>
<% finall_file_score = file_score %>
<% changeset_count = @project.changesets.count %>
<% code_submit_score = changeset_count * 0.3 %>
<% finall_code_submit_score = code_submit_score %>
<% board_message_count = 0 %>
<% @project.boards.each do |board| %>
<% board_message_count += board.messages_count %>
<% end %>
<% topic_score = board_message_count * 0.1 %>
<% finall_topic_score = topic_score %>
<% finall_project_score = finall_issue_score + finall_new_score + finall_file_score + finall_code_submit_score + topic_score %>
<% if @project.project_type !=1 %>
<%= l(:label_project_grade)%>:
<span >
<%= link_to(format("%.2f" , finall_project_score ).to_f,
2014-07-11 14:51:33 +08:00
{:controller => 'projects',
:action => 'show_projects_score',
:remote => true, :id => @project.id}, :style=>"color: #EC6300;") %>
</span>
<% end %>
</div>
<!-- end -->
2013-10-15 11:06:19 +08:00
<!-- added by liuping -->
</span>
2013-08-01 10:33:49 +08:00
</div>
<div class="tags">
<!-- added by william -for tag -->
<div id="tags">
<%= image_tag( "/images/sidebar/tags.png") %>
2013-08-12 20:18:10 +08:00
<%= render :partial => 'tags/tag_name', :locals => {:obj => @project,:object_flag => "2",:non_list_all => true }%>
2013-08-01 10:33:49 +08:00
</div>
</div>