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

111 lines
4.3 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.

<!--Added by nie-->
<div class="project-block">
<div class="img-tag">
<% if(@project.project_type==1)%>
<% if get_avatar?(project)%>
<%= image_tag(url_to_avatar(project), :class => "avatar2") %>
<% else %>
<%= image_tag('../images/avatars/Project/course.jpg', :class => "avatar2") %>
<% end %>
<% else %>
<%= image_tag(url_to_avatar(project), :class => "avatar2") %>
</div>
<div class="wiki-description">
<p>
<%= textilizable(project.short_description, :project => project) %>
</p>
</div>
<div class="information">
<p class="stats">
<strong><span style="font-size: 17px;margin-left: 145px"><%= link_to @project.watcher_users.count, project_watcherlist_path(project)%></span></strong>
<%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
</p>
<p class="stats">
<strong><span style="font-size: 17px;margin-left: 145px"><%= link_to "#{@project.members.count}", project_member_path(@project)%></span></strong>
<%= content_tag('span', l(:label_x_current_contributors, :count => @project.users.count)) %>
</p>
<p class="stats">
<%= 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") %><%= content_tag('span', l(:label_since_last_commits)) %>
</p>
<p class="stats">
<%= content_tag('span', "#{@project.repository.nil? || @project.project_status.nil? ? '0' : @project.project_status.changesets_count }", :class => "info") %><%= content_tag('span', l(:label_commit_on)) %>
</p>
</div>
<% end %>
<% if(@project.project_type==1)%>
</div>
<div class="wiki-description">
<p>
<%= textilizable(project.short_description, :project => project) %>
</p>
</div>
<div class="information"><!-- nyan -->
<!-- p class="stats">
<%= content_tag('span', @project.watcher_users.count, :class => "info") %><%= content_tag('span', l(:label_x_follow_people,:count =>@project.watcher_users.count)) %>
</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 %>
</div>
<div class="add-info">
<div class="main-language">
<!-- added by huang -->
<% if(@project.project_type==1)%>
<%= content_tag('span', "#{l(:field_tea_name)}: ") %>
<% else %>
<%= content_tag('span', "#{l(:default_role_manager)}: ") %>
<% end %>
<!-- end -->
<!-- <%= content_tag('span', "#{l(:default_role_manager)}: ") %> -->
<% @admin = @project.project_infos%>
<% if @admin.size > 0 %>
<%= content_tag('a', @admin.collect{|u| link_to(u.user.lastname+u.user.firstname, user_path(u.user_id))}.join(", ").html_safe) %>
<% end %>
<% if(@project.project_type==1)%>
&nbsp;&nbsp;&nbsp;<%= l(:label_course_college) %>
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
<%= @admin.first.user.user_extensions.occupation %>
<% end %>
<% end %>
</div>
<div class="licences">
<%= content_tag('span', "#{l(:label_create_time)}: ") %><%= content_tag('span', format_time(@project.created_on)) %>
</div>
<div class="grade">
<% if @project.project_type !=1 %>
<%= content_tag('span', "#{l(:label_project_grade)}: ")%><span style='color:#ec6300'><%=@project.project_status ? @project.project_status.grade : 0.0 %></span>
<% end %>
</div>
<!-- added by liuping -->
</span>
</div>
<div class="tags">
<!-- added by william -for tag -->
<div id="tags">
<%= image_tag( "/images/sidebar/tags.png") %>
<%= render :partial => 'tags/tag_name', :locals => {:obj => @project,:object_flag => "2",:non_list_all => true }%>
</div>
</div>