diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-10-16 13:21:37 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-10-16 13:21:37 +0000 |
commit | e10f5f4f56b071f4ab456451780c4bdff942e9c4 (patch) | |
tree | d254b39b1ad4287bba59f7bdd76eb0f98f55db02 /app | |
parent | 0c2df939dff145eda4e2fe4a292793cb9571799b (diff) | |
parent | 47e17103f589b51aa2f6267f56a67c1eb400054f (diff) | |
download | gitlab-ce-e10f5f4f56b071f4ab456451780c4bdff942e9c4.tar.gz |
Merge branch 'last-commit-project-page' into 'master'
Show last commit from default branch on project home page
Implements #2705
Screenshot:
![Screenshot_2015-10-15_19.03.29](https://gitlab.com/gitlab-org/gitlab-ce/uploads/ef1cfa6764ab0ec5e7584ae61980a47d/Screenshot_2015-10-15_19.03.29.png)
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
cc @skyruler
See merge request !1610
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/framework/blocks.scss | 5 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/projects.scss | 31 | ||||
-rw-r--r-- | app/views/projects/_last_commit.html.haml | 12 | ||||
-rw-r--r-- | app/views/projects/show.html.haml | 4 |
4 files changed, 52 insertions, 0 deletions
diff --git a/app/assets/stylesheets/framework/blocks.scss b/app/assets/stylesheets/framework/blocks.scss index 6ce34b5c3e8..32d219d4d60 100644 --- a/app/assets/stylesheets/framework/blocks.scss +++ b/app/assets/stylesheets/framework/blocks.scss @@ -18,6 +18,7 @@ line-height: 36px; } +.content-block, .gray-content-block { margin: -$gl-padding; background-color: $background-color; @@ -27,6 +28,10 @@ border-bottom: 1px solid $border-color; color: $gl-gray; + &.white { + background-color: white; + } + &.top-block { border-top: none; } diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss index f7a22849003..0dddb6b6ed4 100644 --- a/app/assets/stylesheets/pages/projects.scss +++ b/app/assets/stylesheets/pages/projects.scss @@ -511,3 +511,34 @@ pre.light-well { margin-top: -1px; } } + +.project-last-commit { + margin: 0 7px; + + .ci-status { + margin-right: 16px; + } + + .commit-row-message { + color: $gl-gray; + } + + .commit_short_id { + margin-right: 5px; + color: $gl-link-color; + font-weight: 600; + } + + .commit-author-link { + margin-left: 7px; + text-decoration: none; + .avatar { + float: none; + margin-right: 4px; + } + + .commit-author-name { + font-weight: 600; + } + } +} diff --git a/app/views/projects/_last_commit.html.haml b/app/views/projects/_last_commit.html.haml new file mode 100644 index 00000000000..d7b20bfc6b1 --- /dev/null +++ b/app/views/projects/_last_commit.html.haml @@ -0,0 +1,12 @@ +.project-last-commit + - ci_commit = project.ci_commit(commit.sha) + - if ci_commit + = link_to ci_status_path(ci_commit), class: "ci-status ci-#{ci_commit.status}" do + = ci_status_icon(ci_commit) + = ci_commit.status + + = link_to commit.short_id, namespace_project_commit_path(project.namespace, project, commit), class: "commit_short_id" + = link_to_gfm commit.title, namespace_project_commit_path(project.namespace, project, commit.id), class: "commit-row-message" + · + #{time_ago_with_tooltip(commit.committed_date, skip_js: true)} by + = commit_author_link(commit, avatar: true, size: 24) diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index e95d987d74c..e20b1fc49c0 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -64,6 +64,10 @@ = icon("exclamation-triangle fw") Archived project! Repository is read-only +- if @repository.commit + .content-block.second-block.white + = render 'projects/last_commit', commit: @repository.commit, project: @project + %section - if prefer_readme? .project-show-readme |