From aa4710d872761fbf72a11cb67e29ecce428d0cd1 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 30 Oct 2015 15:46:06 +0800 Subject: [PATCH] =?UTF-8?q?git=E4=B8=AD=E5=BF=BD=E7=95=A5=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=20=E6=8F=90=E4=BA=A4=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=96=B0=E7=95=8C=E9=9D=A2=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + app/helpers/repositories_helper.rb | 4 ++ app/views/repositories/_revisions.html.erb | 34 +++++++++---- app/views/repositories/show.html.erb | 4 +- config/initializers/gitlab_config.rb | 2 +- public/stylesheets/repository.css | 57 ++++++++++++++++++++++ 6 files changed, 90 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index fdb7a3c6b..22d9e17e6 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ vendor/cache /public/images/avatars /public/files /tags +/config/initializers/gitlab_config.rb diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index ba99fe454..17ce33f99 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -45,6 +45,10 @@ module RepositoriesHelper end end + def user_commit_rep(mail) + user = User.find_by_mail(mail) + end + def render_properties(properties) unless properties.nil? || properties.empty? content = '' diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb index fe60f8933..837096c89 100644 --- a/app/views/repositories/_revisions.html.erb +++ b/app/views/repositories/_revisions.html.erb @@ -16,15 +16,31 @@ <% show_diff = revisions.size > 1 %> <% line_num = 1 %> <% revisions.each do |changeset| %> - - - <%= h truncate(changeset.id.to_s, :length => 20) %> - - <%= format_time(changeset.created_at) %> - <%= h truncate(changeset.author_name.to_s, :length => 30) %> - <%= textilizable(truncate_at_line_break(changeset.message)) %> - - <% line_num += 1 %> +
+ +
<% end %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 7f9f675d2..81c42c0ea 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -30,8 +30,8 @@
<% if @changesets && !@changesets.empty? %> - <%= image_tag(url_to_avatar(@changesets_latest_coimmit.author_name), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> -
<%=link_to @changesets_latest_coimmit.author_name, user_path(@changesets_latest_coimmit.author_name) %>
+ <%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %> +
<%=link_to user_commit_rep(@changesets_latest_coimmit.author_email), user_path(@changesets_latest_coimmit.author_name) %>
提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
<%= @changesets_latest_coimmit.message %>
diff --git a/config/initializers/gitlab_config.rb b/config/initializers/gitlab_config.rb index 75edc8eff..c82b2edff 100644 --- a/config/initializers/gitlab_config.rb +++ b/config/initializers/gitlab_config.rb @@ -1,7 +1,7 @@ Gitlab.configure do |config| # 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.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'] # Optional # config.user_agent = 'Custom User Agent' # user agent, default: 'Gitlab Ruby Gem [version]' diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css index 375b188d3..71cbd47b6 100644 --- a/public/stylesheets/repository.css +++ b/public/stylesheets/repository.css @@ -219,3 +219,60 @@ .mt1 {margin-top:1px;} .mt2 {margin-top:2px;} .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; +} \ No newline at end of file