Commit 23a1ba7362a13dfcde05d158f2d2237351090730

Authored by Dmitriy Zaporozhets
1 parent 72a13fcc

Fix different styles/button positions

app/assets/stylesheets/projects.css.scss
... ... @@ -476,3 +476,33 @@ body.project-page table.no-borders td{
476 476 }
477 477  
478 478 #tree-content-holder { float:left; width:100%; }
  479 +
  480 +
  481 +
  482 +/* Commit Page */
  483 +.entity-info {float: right;}
  484 +.entity-button{
  485 + background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.192, #fff), to(#f4f4f4));
  486 + background-image: -webkit-linear-gradient(#fff 19.2%, #f4f4f4);
  487 + background-image: -moz-linear-gradient(#fff 19.2%, #f4f4f4);
  488 + background-image: -o-linear-gradient(#fff 19.2%, #f4f4f4);
  489 + box-shadow: 0 -1px 0 white inset;
  490 + display: block;
  491 + border: 1px solid #eee;
  492 + border-radius: 5px;
  493 + margin-bottom: 2px;
  494 + position: relative;
  495 + padding: 4px 10px;
  496 + font-size: 11px;
  497 + padding-right: 20px;
  498 +}
  499 +
  500 +.entity-button i{
  501 + background: url('images.png') no-repeat -138px -27px;
  502 + width: 6px;
  503 + height: 9px;
  504 + float: right;
  505 + position: absolute;
  506 + top: 6px;
  507 + right: 5px;
  508 +}
... ...
app/models/snippet.rb
... ... @@ -5,6 +5,10 @@ class Snippet < ActiveRecord::Base
5 5 belongs_to :author, :class_name => "User"
6 6 has_many :notes, :as => :noteable
7 7  
  8 + delegate :name,
  9 + :email,
  10 + :to => :author,
  11 + :prefix => true
8 12 attr_protected :author, :author_id, :project, :project_id
9 13  
10 14 validates_presence_of :project_id
... ...
app/views/merge_requests/index.html.haml
  1 +%h2.icon
  2 + %span>
  3 + Merge Requests
  4 +.right= link_to 'New Merge request', new_project_merge_request_path(@project), :class => "grey-button"
1 5 - if @merge_requests.opened.count > 0
2 6 %div{ :class => "update-data ui-box ui-box-small ui-box-big" }
3 7 %h3
... ... @@ -17,4 +21,3 @@
17 21 .clear
18 22 %br
19 23  
20   -= link_to 'New Merge request', new_project_merge_request_path(@project), :class => "grey-button"
... ...
app/views/projects/_team.html.haml
  1 +%h2.icon
  2 + %span>
  3 + Team
1 4 - if can? current_user, :admin_team_member, @project
2 5 %div#new-member-holder
3   - = link_to "Add new", new_project_team_member_path(@project), :remote => true, :class => "grey-button"
  6 + .right= link_to "Add new", new_project_team_member_path(@project), :remote => true, :class => "grey-button"
4 7 %br
5 8 %table.round-borders#team-table
6 9 %thead
... ...
app/views/snippets/_form.html.haml
... ... @@ -32,3 +32,5 @@
32 32  
33 33 .buttons
34 34 = f.submit 'Save', :class => "grey-button"
  35 + - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
  36 + .right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "grey-button delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
... ...
app/views/snippets/index.html.haml
1   -%div
2   - - if can? current_user, :write_snippet, @project
3   - = link_to 'New Snippet', new_project_snippet_path(@project), :class => "grey-button append-bottom-10"
  1 +%h2.icon
  2 + %span>
  3 + Snippets
  4 +- if can? current_user, :write_snippet, @project
  5 + .right= link_to 'New Snippet', new_project_snippet_path(@project), :class => "grey-button append-bottom-10"
  6 +
  7 +%table#snippets-table
  8 + = render @snippets.fresh
4 9  
5   - %table#snippets-table
6   - = render @snippets.fresh
7 10 :javascript
8 11 $('.delete-snippet').live('ajax:success', function() {
9 12 $(this).closest('tr').fadeOut(); });
... ...
app/views/snippets/show.html.haml
1   -- if !@snippet.expired?
2   - .ui-box.width-100p
3   - %h3
4   - = @snippet.title
5   - .right= @snippet.file_name
6   - .data.no-padding
7   - :erb
8   - <%= raw @snippet.colorize %>
  1 +%div
  2 + %span.entity-info
  3 + - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
  4 + = link_to edit_project_snippet_path(@project, @snippet) do
  5 + .entity-button
  6 + Edit Snippet
  7 + %i
  8 + - if @snippet.author_email
  9 + = image_tag gravatar_icon(@snippet.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
  10 + - else
  11 + = image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
  12 + %span.commit-title
  13 + %strong
  14 + = truncate(@snippet.title, :length => 60)
  15 + %span.commit-author
  16 + %strong= @snippet.author_name
  17 + = @snippet.created_at.stamp("Aug 21, 2011 9:23pm")
9 18  
10   - .buttons
11   - - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
12   - = link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "grey-button"
13   - - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
14   - .right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "grey-button delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
15   - .clear
16   - %br
17   - .snippet_notes= render "notes/notes"
  19 +%hr
18 20  
19   - .clear
  21 +.view_file
  22 + .view_file_header
  23 + %strong= @snippet.file_name
  24 + .data.no-padding
  25 + :erb
  26 + <%= raw @snippet.colorize %>
  27 +.clear
  28 +%br
  29 +.snippet_notes= render "notes/notes"
20 30  
21   -- else
22   - %h2
23   - Sorry, this snippet is no longer exists
  31 +.clear
... ...