Fix different styles/button positions

This commit is contained in:
Dmitriy Zaporozhets 2011-12-08 01:35:57 +02:00
parent 72a13fcc2e
commit 23a1ba7362
7 changed files with 80 additions and 27 deletions

View file

@ -32,3 +32,5 @@
.buttons
= f.submit 'Save', :class => "grey-button"
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
.right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "grey-button delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"

View file

@ -1,9 +1,12 @@
%div
- if can? current_user, :write_snippet, @project
= link_to 'New Snippet', new_project_snippet_path(@project), :class => "grey-button append-bottom-10"
%h2.icon
%span>
Snippets
- if can? current_user, :write_snippet, @project
.right= link_to 'New Snippet', new_project_snippet_path(@project), :class => "grey-button append-bottom-10"
%table#snippets-table
= render @snippets.fresh
%table#snippets-table
= render @snippets.fresh
:javascript
$('.delete-snippet').live('ajax:success', function() {
$(this).closest('tr').fadeOut(); });

View file

@ -1,23 +1,31 @@
- if !@snippet.expired?
.ui-box.width-100p
%h3
= @snippet.title
.right= @snippet.file_name
.data.no-padding
:erb
<%= raw @snippet.colorize %>
%div
%span.entity-info
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to edit_project_snippet_path(@project, @snippet) do
.entity-button
Edit Snippet
%i
- if @snippet.author_email
= image_tag gravatar_icon(@snippet.author_email), :class => "left", :width => 40, :style => "padding-right:5px;"
- else
= image_tag "no_avatar.png", :class => "left", :width => 40, :style => "padding-right:5px;"
%span.commit-title
%strong
= truncate(@snippet.title, :length => 60)
%span.commit-author
%strong= @snippet.author_name
= @snippet.created_at.stamp("Aug 21, 2011 9:23pm")
.buttons
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "grey-button"
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
.right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "grey-button delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
.clear
%br
.snippet_notes= render "notes/notes"
%hr
.clear
.view_file
.view_file_header
%strong= @snippet.file_name
.data.no-padding
:erb
<%= raw @snippet.colorize %>
.clear
%br
.snippet_notes= render "notes/notes"
- else
%h2
Sorry, this snippet is no longer exists
.clear