修改版本格式

gitlab
huang 10 years ago
parent f489512c6f
commit 94877bb353

@ -1,54 +1,53 @@
<% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %> <% show_revision_graph = ( @repository.supports_revision_graph? && path.blank? ) %>
<%= if show_revision_graph && revisions && revisions.any? <%= if show_revision_graph && revisions && revisions.any?
indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid| indexed_commits, graph_space = index_commits(revisions, @repository.branches) do |scmid|
url_for( url_for(
:controller => 'repositories', :controller => 'repositories',
:action => 'revision', :action => 'revision',
:id => project, :id => project,
:repository_id => @repository.identifier_param, :repository_id => @repository.identifier_param,
:rev => scmid) :rev => scmid)
end end
render :partial => 'revision_graph', render :partial => 'revision_graph',
:locals => { :locals => {
:commits => indexed_commits, :commits => indexed_commits,
:space => graph_space :space => graph_space
} }
end %> end %>
<%= form_tag( <%= form_tag(
{:controller => 'repositories', :action => 'diff', :id => project, {:controller => 'repositories', :action => 'diff', :id => project,
:repository_id => @repository.identifier_param, :path => to_path_param(path)}, :repository_id => @repository.identifier_param, :path => to_path_param(path)},
:method => :get :method => :get
) do %> ) do %>
<table class="list changesets"> <table class="list changesets">
<thead><tr> <thead><tr>
<th>#</th> <th>#</th>
<th></th> <th></th>
<th></th> <th></th>
<th><%= l(:label_date) %></th> <th><%= l(:label_date) %></th>
<th><%= l(:field_author) %></th> <th><%= l(:field_author) %></th>
<th><%= l(:field_comments) %></th> <th><%= l(:field_comments) %></th>
</tr></thead> </tr></thead>
<tbody> <tbody>
<% show_diff = revisions.size > 1 %> <% show_diff = revisions.size > 1 %>
<% line_num = 1 %> <% line_num = 1 %>
<% revisions.each do |changeset| %> <% revisions.each do |changeset| %>
<tr class="changeset <%= cycle 'odd', 'even' %>"> <tr class="changeset <%= cycle 'odd', 'even' %>">
<% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %> <% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %>
<%= content_tag(:td, :class => 'id', :style => id_style) do %> <%= content_tag(:td, :class => 'id', :style => id_style) do %>
<%= link_to_revision(changeset, @repository) %> <%= link_to_revision(changeset, @repository) %>
<% end %> <% end %>
<td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %></td> <td class="checkbox"><%= radio_button_tag('rev', changeset.identifier, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked',true);") if show_diff && (line_num < revisions.size) %></td>
<td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %></td> <td class="checkbox"><%= radio_button_tag('rev_to', changeset.identifier, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('#cb-#{line_num}').attr('checked')) {$('#cb-#{line_num-1}').attr('checked',true);}") if show_diff && (line_num > 1) %></td>
<td class="committed_on"><%= format_time(changeset.committed_on) %></td> <td class="committed_on"><%= format_time(changeset.committed_on) %></td>
<td class="author"><%= h truncate(changeset.author.to_s, :length => 30) %></td> <td class="author"><%= h truncate(changeset.author.to_s, :length => 30) %></td>
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td> <td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>
</tr> </tr>
<% line_num += 1 %> <% line_num += 1 %>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<p style="padding-top: 10px;"> <p style="padding-top: 10px;">
<%= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %> <%= submit_tag(l(:label_view_diff), :name => nil, :class=>"c_blue") if show_diff %>
</p> </p>
<% end %> <% end %>

@ -5,9 +5,8 @@
<div class="repository_con" style="line-height:1.9;"> <div class="repository_con" style="line-height:1.9;">
<div class="repositorytitle" style="float:left;"> <div class="repositorytitle" style="float:left;">
<%= render :partial => 'breadcrumbs', <%= render :partial => 'breadcrumbs',
:locals => {:path => @path, :kind => 'dir', :revision => @rev} %> :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
<%= render :partial => 'navigation' %> <%= render :partial => 'navigation' %>
</div> </div>
<!--contextual end--> <!--contextual end-->
<div class="cl"></div> <div class="cl"></div>
@ -25,8 +24,8 @@
link_to h(repo.name), link_to h(repo.name),
{:controller => 'repositories', :action => 'show', {:controller => 'repositories', :action => 'show',
:id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil}, :id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
:class => 'repository' + (repo == @repository ? ' selected' : ''), :class => 'repository' + (repo == @repository ? ' selected' : ''),
:class => "mb10 break_word c_orange" }.join('&nbsp|&nbsp').html_safe %>) :class => "mb10 break_word c_orange" }.join('&nbsp|&nbsp').html_safe %>)
</p> </p>
</div> </div>
</div> </div>
@ -36,7 +35,7 @@
<div class=" c_dark f14"> <div class=" c_dark f14">
<p>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码。</p> <p>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码。</p>
<p>通过cmd命令提示符进入代码对应文件夹的根目录假设当前用户的登录名为user版本库名称为demo需要操作的版本库分支为branch。 <p>通过cmd命令提示符进入代码对应文件夹的根目录假设当前用户的登录名为user版本库名称为demo需要操作的版本库分支为branch。
如果是首次提交代码,执行如下命令:</p> 如果是首次提交代码,执行如下命令:</p>
</div> </div>
<div class="repos_explain"> <div class="repos_explain">
<p>git init</p> <p>git init</p>
@ -53,7 +52,7 @@
<p>git push -u origin branch:branch</p> <p>git push -u origin branch:branch</p>
</div> </div>
<!--repos_explain end--> <!--repos_explain end-->
<div class="c_dark f14"> <div class="c_dark f14">
<p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p> <p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p>
</div> </div>
@ -68,7 +67,7 @@
<p>git push -u origin branch:branch</p> <p>git push -u origin branch:branch</p>
</div> </div>
<!--repos_explain end--> <!--repos_explain end-->
<div class="c_dark f14"> <div class="c_dark f14">
<p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p> <p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p>
</div> </div>
@ -81,7 +80,7 @@
<p>git push origin branch_name</p> <p>git push origin branch_name</p>
</div> </div>
<!--repos_explain end--> <!--repos_explain end-->
<div class="c_dark f14"> <div class="c_dark f14">
<p>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</p> <p>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</p>
</div> </div>
@ -101,56 +100,59 @@
<p><a href="/users/646" class="c_orange">李海</a>提供</p> <p><a href="/users/646" class="c_orange">李海</a>提供</p>
</div> </div>
</div> </div>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %> <!-- 代码库显示 -->
<%= render :partial => 'dir_list' %> <% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<% end %> <%= render :partial => 'dir_list' %>
<% end %>
<%= render_properties(@properties) %> <%= render_properties(@properties) %>
<% if authorize_for('repositories', 'revisions') %>
<% if @changesets && !@changesets.empty? %> <!-- 代码修订 -->
<h3> <% if authorize_for('repositories', 'revisions') %>
<%= l(:label_latest_revision_plural) %> <%# if @changesets && !@changesets.empty? %>
</h3> <h3>
<%= render :partial => 'revisions', <%= l(:label_latest_revision_plural) %>
:locals => {:project => @project, :path => @path, </h3>
:revisions => @changesets, :entry => nil} %> <%= render :partial => 'revisions',
:locals => {:project => @project, :path => @path,
:revisions => @changesets, :entry => nil} %>
<%# end %>
<p style="padding-top: 10px;">
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
sep = '' %>
<% if @repository.supports_all_revisions? && @path.blank? %>
<%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project,
:repository_id => @repository.identifier_param},
:class => "orange_u_btn" %>
<% sep = '|' %>
<% end %> <% end %>
<p style="padding-top: 10px;"> <% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0) <%= sep %>
sep = '' %> <%= link_to l(:label_view_revisions),
<% if @repository.supports_all_revisions? && @path.blank? %> {:action => 'changes',
<%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project, :path => to_path_param(@path),
:repository_id => @repository.identifier_param}, :id => @project,
:class => "orange_u_btn" %> :repository_id => @repository.identifier_param,
<% sep = '|' %> :rev => @rev},
<% end %> :class => "orange_u_btn" %>
<% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
<%= sep %>
<%= link_to l(:label_view_revisions),
{:action => 'changes',
:path => to_path_param(@path),
:id => @project,
:repository_id => @repository.identifier_param,
:rev => @rev},
:class => "orange_u_btn" %>
<% end %>
</p>
<% if @repository.supports_all_revisions? %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(
:atom, params.merge(
{:format => 'atom', :action => 'revisions',
:id => @project, :page => nil, :key => User.current.rss_key})) %>
<% end %>
<% end %> <% end %>
<% end %> </p>
<% if @repository.supports_all_revisions? %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(
:atom, params.merge(
{:format => 'atom', :action => 'revisions',
:id => @project, :page => nil, :key => User.current.rss_key})) %>
<% end %>
<% end %>
<% end %>
<!-- added by bai --> <!-- added by bai -->
<p class="fb c_dark mt10">查看如何提交代码: <p class="fb c_dark mt10">查看如何提交代码:
<%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %> <%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %>
<%= link_to('English', en_usage_path, :class => "c_blue") %> <%= link_to('English', en_usage_path, :class => "c_blue") %>
<div class="cl"></div> <div class="cl"></div>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %> <%= stylesheet_link_tag "scm" %>

Loading…
Cancel
Save