Snippets - fixed after bootstrap
Project - restyled show page, removed info page Repository - restyled show page, added download option Tags - added download options
This commit is contained in:
parent
3d77183c16
commit
4d89322d67
37 changed files with 298 additions and 333 deletions
|
@ -1,48 +1,31 @@
|
|||
%h3= @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}"
|
||||
%hr
|
||||
= form_for [@project, @snippet] do |f|
|
||||
%div
|
||||
%span.entity-info
|
||||
- if @snippet.new_record?
|
||||
= link_to project_snippets_path(@project) do
|
||||
.entity-button
|
||||
Snippets
|
||||
%i
|
||||
- else
|
||||
= link_to project_snippet_path(@project, @snippet) do
|
||||
.entity-button
|
||||
Show Snippet
|
||||
%i
|
||||
%h2= @snippet.new_record? ? "New Snippet" : "Edit Snippet ##{@snippet.id}"
|
||||
|
||||
%hr
|
||||
%table.no-borders
|
||||
-if @snippet.errors.any?
|
||||
%tr
|
||||
%td{:colspan => 2}
|
||||
#error_explanation
|
||||
- @snippet.errors.full_messages.each do |msg|
|
||||
%span= msg
|
||||
%br
|
||||
.alert-message.block-message.error
|
||||
%ul
|
||||
- @snippet.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
%tr
|
||||
%td= f.label :title
|
||||
%td= f.text_field :title, :placeholder => "Example Snippet"
|
||||
%tr
|
||||
%td= f.label :file_name
|
||||
%td= f.text_field :file_name, :placeholder => "example.rb"
|
||||
%tr
|
||||
%td= f.label "Lifetime"
|
||||
%td= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;"
|
||||
%tr
|
||||
%td{:colspan => 2}
|
||||
= f.label :content, "Code"
|
||||
%br
|
||||
%br
|
||||
= f.text_area :content
|
||||
.clearfix
|
||||
= f.label :title
|
||||
.input= f.text_field :title, :placeholder => "Example Snippet"
|
||||
.clearfix
|
||||
= f.label :file_name
|
||||
.input= f.text_field :file_name, :placeholder => "example.rb"
|
||||
.clearfix
|
||||
= f.label "Lifetime"
|
||||
.input= f.select :expires_at, lifetime_select_options, {}, :style => "width:200px;"
|
||||
.clearfix
|
||||
= f.label :content, "Code"
|
||||
= f.text_area :content, :class => "xxlarge"
|
||||
|
||||
.merge-tabs
|
||||
= f.submit 'Save', :class => "positive-button"
|
||||
.actions
|
||||
= f.submit 'Save', :class => "primary btn"
|
||||
= link_to "Cancel", project_snippets_path(@project), :class => " btn"
|
||||
- unless @snippet.new_record?
|
||||
.right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "red-button delete-snippet", :id => "destroy_snippet_#{@snippet.id}"
|
||||
.right= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "btn right danger delete-snippet", :id => "destroy_snippet_#{@snippet.id}"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
%a.update-item{:href => project_snippet_path(snippet.project, snippet)}
|
||||
= image_tag gravatar_icon(snippet.author_email), :class => "left", :width => 40
|
||||
%span.update-title
|
||||
= truncate(snippet.title, :length => 60)
|
||||
%span.update-author
|
||||
%strong= snippet.author_name
|
||||
authored
|
||||
= time_ago_in_words(snippet.created_at)
|
||||
ago
|
||||
.right
|
||||
%span.tag.commit= snippet.file_name
|
||||
|
||||
%li.entry
|
||||
%a{:href => project_snippet_path(snippet.project, snippet)}
|
||||
%p
|
||||
%strong
|
||||
= truncate(snippet.title, :length => 60)
|
||||
%span.right.cgray
|
||||
= snippet.file_name
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
= render "projects/project_head"
|
||||
= render "snippets/form"
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
= render "projects/project_head"
|
||||
|
||||
- if can? current_user, :write_snippet, @project
|
||||
.alert-message.block-message
|
||||
= link_to new_project_snippet_path(@project), :class => "btn small add_new right", :title => "New Snippet" do
|
||||
Add new snippet
|
||||
Share code pastes with others if it cant be in a git repository
|
||||
%br
|
||||
To add new snippet - click on button.
|
||||
|
||||
- unless @snippets.fresh.empty?
|
||||
%div{ :class => "update-data ui-box ui-box-small ui-box-big" }
|
||||
.data
|
||||
= render @snippets.fresh
|
||||
- else
|
||||
.notice_holder
|
||||
%li Snippets do not exist yet.
|
||||
- if can? current_user, :write_snippet, @project
|
||||
%li You can add a new one by clicking on "Add New" button
|
||||
|
||||
%ul.unstyled= render @snippets.fresh
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
= render "projects/project_head"
|
||||
= render "snippets/form"
|
||||
|
|
|
@ -1,20 +1,10 @@
|
|||
%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")
|
||||
= render "projects/project_head"
|
||||
|
||||
%h3
|
||||
= @snippet.title
|
||||
%small= @snippet.file_name
|
||||
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
|
||||
= link_to "Edit", edit_project_snippet_path(@project, @snippet), :class => "btn small right"
|
||||
|
||||
%hr
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue