Commit 48a1e31010f331db1ec0d7947bfb10b1b3c700ec

Authored by Dmitriy Zaporozhets
1 parent 9d913789

snippet table restyle

app/assets/stylesheets/projects.css.scss
... ... @@ -622,13 +622,16 @@ body.project-page table .commit {
622 622 #notes-list .note .delete-note { display:none; }
623 623 #notes-list .note:hover .delete-note { display:block; }
624 624  
  625 +.snippet .action-links,
625 626 #issues-table-holder .issue .action-links {
626 627 display:none;
627 628 a {
628 629 margin-left:10px;
629 630 }
630 631 }
631   -
  632 +
  633 +.snippet:hover .action-links { display:block; }
  634 +
632 635 .issue-number {
633 636 float: left;
634 637 border-radius: 5px;
... ... @@ -665,6 +668,7 @@ body.project-page #notes-list .note span.note-author strong{font-weight: bold; f
665 668 //.message .note-title p { margin-bottom:0px; }
666 669  
667 670 .commit,
  671 +.snippet,
668 672 .message {
669 673 .title {
670 674 color:#666;
... ...
app/views/snippets/_snippet.html.haml
... ... @@ -2,11 +2,17 @@
2 2 %tr{ :id => dom_id(snippet), :class => "snippet", :url => project_snippet_path(@project, snippet) }
3 3 %td
4 4 = image_tag gravatar_icon(snippet.author.email), :class => "left", :width => 40, :style => "padding:0 5px;"
5   - = truncate snippet.author.name, :lenght => 20
6   - %td= html_escape snippet.title
7   - %td= html_escape snippet.file_name
8   - %td
9   - - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
10   - = link_to 'Edit', edit_project_snippet_path(@project, snippet), :class => "lbutton positive"
11   - - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
12   - = link_to 'Destroy', [@project, snippet], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{snippet.id}"
  5 + %span
  6 + %strong= html_escape snippet.title
  7 + %br
  8 + %br
  9 + %div.author
  10 + %strong= truncate snippet.author.name, :lenght => 20
  11 + %cite.cgray
  12 + = time_ago_in_words(snippet.updated_at)
  13 + ago
  14 + .right.action-links
  15 + - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
  16 + = link_to 'Edit', edit_project_snippet_path(@project, snippet), :class => "cgray"
  17 + - if can?(current_user, :admin_snippet, @project) || snippet.author == current_user
  18 + = link_to 'Destroy', [@project, snippet], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-snippet negative", :id => "destroy_snippet_#{snippet.id}"
... ...
app/views/snippets/index.html.haml
... ... @@ -3,11 +3,8 @@
3 3 .left= link_to 'New Snippet', new_project_snippet_path(@project), :class => "lbutton vm"
4 4  
5 5 %table.round-borders#snippets-table
6   - %tr
7   - %th Author
8   - %th Title
9   - %th File name
10   - %th
  6 + %thead
  7 + %th
11 8 = render @snippets.fresh
12 9 :javascript
13 10 $('.delete-snippet').live('ajax:success', function() {
... ...