socialforge/app/views/projects/settings/_new_repositories.html.erb

55 lines
2.7 KiB
Plaintext

<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path-->
<% if @project.repositories.any? %>
<table class="pro_table">
<tbody>
<tr class="pro_table_tit">
<td class=" w150"><%= l(:field_identifier) %></td>
<td class="w150"> <%= l(:field_repository_is_default) %></td>
<td class="w150"><%= l(:label_scm) %> </td>
<td class="w150" ><%= l(:label_repository_path) %> </td>
<td class="w150"> </td>
<td class="w150"> </td>
</tr>
<% @project.repositories.sort.each do |repository| %>
<tr class="pro_table_on">
<td><a href="javascript:viod(0)" title="<%= repository.identifier %>">
<%= link_to repository.identifier, ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?), :class =>"c_blue" %></a></td>
<td> <%= checked_image repository.is_default? %></td>
<td><%=h repository.scm_name %></td>
<%if repository.scm_name=="Git"%>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" class="c_blue" title="http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %>
<%=h repository.url.slice(project_path_cut, repository.url.length) %>">http://<%= repository.login.to_s %>_<%= repository.identifier.to_s%>@<%= ip %>
<%=h repository.url.slice(project_path_cut, repository.url.length) %></td><!--Modified by tanxianbo-->
<%else %>
<td style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h repository.url %></td>
<% end %>
<td><a href="javascript:viod(0)" class="c_blue" >
<% if repository.scm_name=="Git"%>
<%if User.current.allowed_to?(:manage_repository, @project) %>
<%= link_to(l(:label_user_plural), committers_repository_path(repository),
:class => 'c_blue') %>
<% end %>
<% end %>
</a></td>
<td>
<% if repository.login.to_s==User.current.login.to_s %>
<%= delete_new_link repository_path(repository) %>
<% end %></td>
</tr>
<% end %>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
</tbody>
</table>
<a href="javascript:viod(0)" class="pic_add fl mr5" onclick="pro_st_show_ku();"></a>
<a href="javascript:viod(0)" class="c_blue fl" onclick="pro_st_show_ku();">
<% course_tag = @project.project_type %>
<% if User.current.allowed_to?(:manage_repository, @project) %>
<%= link_to l(:label_repository_new_repos), newrepo_project_repository_path(@project, :course => course_tag), :class => 'c_blue fl' %></p>
<% end %>
</a>
<div class="cl"></div>