Commit 7999c2065ebb0dfabd9b152c5e9726c797982773

Authored by Dmitriy Zaporozhets
1 parent e660da4f

Redesign project home page

app/assets/stylesheets/sections/projects.scss
... ... @@ -14,25 +14,67 @@
14 14 }
15 15 }
16 16  
17   -.project_clone_panel {
18   - @include border-radius(4px);
19   - @include bg-gray-gradient;
20   - padding: 4px 7px;
21   - border: 1px solid #CCC;
22   - margin-bottom: 20px;
  17 +.project-home-panel {
  18 + .project-home-title {
  19 + font-size: 18px;
  20 + color: #777;
  21 + margin: 0;
  22 + line-height: 2;
  23 + }
  24 + .project-home-dropdown {
  25 + margin-left: 10px;
  26 + float: right;
  27 + }
  28 + .project-home-extra {
  29 + margin-top: 10px;
23 30  
24   - .btn {
25   - padding: 4px 12px;
  31 + .project-home-desc {
  32 + float: left;
  33 + color: #999;
  34 + }
  35 +
  36 + .project-home-links {
  37 + float: right;
  38 + a {
  39 + margin-left: 10px;
  40 + }
  41 + }
  42 + }
  43 +
  44 + .public-label {
  45 + font-size: 14px;
  46 + background: #f1f1f1;
  47 + padding: 6px 10px;
  48 + border-radius: 4px;
  49 + margin-left: 10px;
  50 + color: #888;
  51 + text-shadow: 0 1px 1px #FFF;
26 52 }
27 53 }
28 54  
29   -.project_clone_holder {
  55 +.git-clone-holder {
  56 + float: right;
  57 +
  58 + .btn {
  59 + border: none;
  60 + background: none;
  61 + box-shadow: none;
  62 + color: #29b;
  63 + padding: 6px;
  64 +
  65 + &.active {
  66 + color: #333;
  67 + font-weight: bold;
  68 + }
  69 + }
  70 +
30 71 input[type="text"] {
  72 + margin-left: 5px;
31 73 @extend .monospace;
32   - border: 1px solid #BBB;
  74 + border: 1px solid #E1E1E1;
33 75 box-shadow: none;
34   - margin-left: -1px;
35   - background: #FFF;
  76 + background: #FAFAFA;
  77 + padding: 6px 10px;
36 78 }
37 79 }
38 80  
... ...
app/views/projects/show.html.haml
1   -= render 'clone_panel'
  1 +.project-home-panel
  2 + .row
  3 + .span4
  4 + %h4.project-home-title
  5 + = @project.name_with_namespace
  6 + - if @project.public
  7 + %span.public-label Public
  8 + .span8
  9 + .project-home-dropdown
  10 + = render "dropdown"
  11 + .form-horizontal
  12 + = render "shared/clone_panel"
2 13  
  14 + .project-home-extra.clearfix
  15 + .project-home-desc
  16 + - if @project.description.present?
  17 + = @project.description
  18 + - if can?(current_user, :admin_project, @project)
  19 + –
  20 + %strong= link_to 'Edit', edit_project_path
  21 +
  22 + .project-home-links
  23 + = link_to pluralize(@repository.round_commit_count, 'commit'), project_commits_path(@project, @ref || @repository.root_ref)
  24 + = link_to pluralize(@repository.branch_names.count, 'branch'), project_branches_path(@project)
  25 + = link_to pluralize(@repository.tag_names.count, 'tag'), project_tags_path(@project)
  26 + %span.light.prepend-left-20= repository_size
  27 +
  28 +%hr
3 29 .row
4 30 .span9
5 31 = render "events/event_last_push", event: @last_push
... ... @@ -7,17 +33,29 @@
7 33 .content_list
8 34 .loading.hide
9 35 .span3
10   - .light-well
11   - %h3.page-title
12   - = @project.name
13   - - if @project.description.present?
14   - %p.light= @project.description
  36 + .clearfix
  37 + - if @project.forked_from_project
  38 + .alert.alert-success
  39 + %i.icon-code-fork
  40 + Forked from:
  41 + = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
  42 + - unless @project.empty_repo?
  43 + - if current_user && can?(current_user, :fork_project, @project) && @project.namespace != current_user.namespace
  44 + - if current_user.already_forked?(@project)
  45 + = link_to project_path(current_user.fork_of(@project)), class: 'btn btn-block' do
  46 + %i.icon-ok
  47 + Already forked
  48 + - else
  49 + = link_to fork_project_path(@project), title: "Fork", class: "btn btn-block", method: "POST" do
  50 + %i.icon-code-fork
  51 + Fork repository
15 52  
16   - %hr
17   - %p
18   - %p
19   - %span.light Repo size is
20   - = repository_size
  53 + - if can? current_user, :download_code, @project
  54 + = link_to archive_project_repository_path(@project), class: "btn btn-block" do
  55 + %i.icon-download-alt
  56 + %span Download
  57 + %br
  58 + .light-well
21 59 %p
22 60 %span.light Created at
23 61 #{@project.created_at.stamp('Aug 22, 2013')}
... ... @@ -27,19 +65,7 @@
27 65 #{link_to @project.group.name, @project.group} Group
28 66 - else
29 67 #{link_to @project.owner_name, @project.owner}
30   - - if @project.forked_from_project
31   - %p
32   - %i.icon-code-fork
33   - Forked from:
34   - = link_to @project.forked_from_project.name_with_namespace, project_path(@project.forked_from_project)
35 68  
36   - %hr
37   - %p
38   - = link_to pluralize(@repository.round_commit_count, 'commit'), project_commits_path(@project, @ref || @repository.root_ref)
39   - %p
40   - = link_to pluralize(@repository.branch_names.count, 'branch'), project_branches_path(@project)
41   - %p
42   - = link_to pluralize(@repository.tag_names.count, 'tag'), project_tags_path(@project)
43 69  
44 70 - if @project.gitlab_ci?
45 71 %hr
... ...