Merge remote-tracking branch 'origin/szzh' into szzh

This commit is contained in:
lizanle 2015-10-30 15:56:19 +08:00
commit a08be355ae
6 changed files with 90 additions and 12 deletions

1
.gitignore vendored
View File

@ -29,3 +29,4 @@ vendor/cache
/public/images/avatars /public/images/avatars
/public/files /public/files
/tags /tags
/config/initializers/gitlab_config.rb

View File

@ -45,6 +45,10 @@ module RepositoriesHelper
end end
end end
def user_commit_rep(mail)
user = User.find_by_mail(mail)
end
def render_properties(properties) def render_properties(properties)
unless properties.nil? || properties.empty? unless properties.nil? || properties.empty?
content = '' content = ''

View File

@ -16,15 +16,31 @@
<% 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' %>"> <div class="col-md-10 col-sm-12">
<ul class="bordered-list">
<td class="id"><%= h truncate(changeset.id.to_s, :length => 20) %></td> <li class="commit js-toggle-container">
<!--<td class="checkbox"><%#= radio_button_tag('rev_to', changeset.id, (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>--> <div class="commit-row-title">
<td class="committed_on"><%= format_time(changeset.created_at) %></td> <strong class="str-truncated">
<td class="author"><%= h truncate(changeset.author_name.to_s, :length => 30) %></td> <a class="commit-row-message"><%= textilizable(truncate_at_line_break(changeset.message)) %></a>
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.message)) %></td> </strong>
</tr> <div class="pull-right" title="修订号">
<% line_num += 1 %> <%= h truncate(changeset.short_id.to_s, :length => 20) %>
</div>
<div class="notes_count">
</div>
</div>
<div class="commit-row-info">
<a class="commit-author-link has_tooltip"> <span class="commit-author-name">
<%= image_tag(url_to_avatar(user_commit_rep(changeset.author_email)), :width => "20", :height => "20", :class => "fl portraitRadius mt2 ml4 mr5") %>
<%= link_to user_commit_rep(changeset.author_email), user_path(user_commit_rep(changeset.author_email)), :length => 30 %></span></a>
提交于
<div class="committed_ago">
<time class="time_ago js-timeago" title="<%= changeset.created_at %>"><%= time_tag(changeset.created_at) %> 前</time> &nbsp;
</div>
</div>
</li>
</ul>
</div>
<% end %> <% end %>
</tbody> </tbody>
</table> </table>

View File

@ -30,8 +30,8 @@
<div class="cl"></div> <div class="cl"></div>
<div class="recordBanner mt10"> <div class="recordBanner mt10">
<% if @changesets && !@changesets.empty? %> <% if @changesets && !@changesets.empty? %>
<%= image_tag(url_to_avatar(@changesets_latest_coimmit.author_name), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> <%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
<span class="fl"><div class="fb fontGrey3 mr5 fl"><%=link_to @changesets_latest_coimmit.author_name, user_path(@changesets_latest_coimmit.author_name) %></div> <span class="fl"><div class="fb fontGrey3 mr5 fl"><%=link_to user_commit_rep(@changesets_latest_coimmit.author_email), user_path(@changesets_latest_coimmit.author_name) %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div> <div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div> <div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span> </span>

View File

@ -1,7 +1,7 @@
Gitlab.configure do |config| Gitlab.configure do |config|
# config.endpoint = 'http://192.168.41.130:3000/trustie/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT'] # config.endpoint = 'http://192.168.41.130:3000/trustie/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
# config.private_token = 'cK15gUDwvt8EEkzwQ_63' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN'] # config.private_token = 'cK15gUDwvt8EEkzwQ_63' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
config.endpoint = 'http://git.trustie.net/trustie/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT'] config.endpoint = 'http://gitfast.trustie.net/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
config.private_token = 'fPc_gBmEiSANve8TCfxW' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN'] config.private_token = 'fPc_gBmEiSANve8TCfxW' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
# Optional # Optional
# config.user_agent = 'Custom User Agent' # user agent, default: 'Gitlab Ruby Gem [version]' # config.user_agent = 'Custom User Agent' # user agent, default: 'Gitlab Ruby Gem [version]'

View File

@ -219,3 +219,60 @@
.mt1 {margin-top:1px;} .mt1 {margin-top:1px;}
.mt2 {margin-top:2px;} .mt2 {margin-top:2px;}
.commit_content_dec{width: 300px;overflow: hidden; white-space: nowrap;text-overflow: ellipsis;} .commit_content_dec{width: 300px;overflow: hidden; white-space: nowrap;text-overflow: ellipsis;}
/*提交信息列表*/
.col-md-10 {
width: 100%;
}
ul.bordered-list {
margin: 5px 0px;
padding: 0px;
}
ul.bordered-list li {
padding: 5px 0px;
border-bottom: 1px solid #EEE;
overflow: hidden;
display: block;
margin: 0px;
}
.commits-row ul li.commit {
padding: 8px 0px;
}
li.commit .commit-row-title {
font-size: 15px;
line-height: 20px;
margin-bottom: 2px;
}
li.commit .commit-row-title .str-truncated {
max-width: 70%;
}
.str-truncated {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
white-space: nowrap;
max-width: 82%;
}
li.commit .commit-row-title .commit-row-message {
color: #444;
}
.pull-right {
float: right;
color: #777;
}
li.commit .commit-row-title .commit_short_id {
min-width: 65px;
font-family: "Menlo","Liberation Mono","Consolas","DejaVu Sans Mono","Ubuntu Mono","Courier New","andale mono","lucida console",monospace;
}
li.commit .commit-row-info {
color: #777;
line-height: 24px;
font-size: 13px;
}
li.commit .commit-row-info a {
color: #777;
}
li.commit .commit-row-info .committed_ago {
display: inline-block;
}