BigW Consortium Gitlab

Commit 0accbaae by Dmitriy Zaporozhets

snippets restyle

parent 80c34985
......@@ -34,6 +34,9 @@
.width-65p{
width:65%;
}
.width-100p{
width:100%;
}
.append-bottom-10 {
margin-bottom:10px;
}
......@@ -43,3 +46,6 @@
.no-borders {
border:none;
}
.no-padding {
padding:0 !important;
}
......@@ -59,7 +59,11 @@
}
body.project-page .issue-form-holder table.no-borders tr,
body.project-page .issue-form-holder table.no-borders td
body.project-page .issue-form-holder table.no-borders td,
body.project-page .new_snippet table tr,
body.project-page .new_snippet table td,
body.project-page .edit_snippet table tr,
body.project-page .edit_snippet table td
{
&:hover {
background:none;
......
%div
= form_for [@project, @snippet] do |f|
-if @snippet.errors.any?
%ul
- @snippet.errors.full_messages.each do |msg|
%li= msg
.ui-box.width-100p
%h3
= @snippet.new_record? ? "New snippet" : "Edit snippet ##{@snippet.id}"
= form_for [@project, @snippet] do |f|
.data.no-padding
%table.no-borders
-if @snippet.errors.any?
%tr
%td Errors
%td
#error_explanation
- @snippet.errors.full_messages.each do |msg|
%span= msg
%br
%table.round-borders
%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
%tr
%td{:colspan => 2}
= f.label :content, "Code"
%br
%br
= f.text_area :content
%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
%tr
%td{:colspan => 2}
= f.label :content, "Code"
%br
%br
= f.text_area :content
.actions.prepend-top
= f.submit 'Save', :class => "button"
.buttons
= f.submit 'Save', :class => "grey-button"
......@@ -2,9 +2,7 @@
- if can? current_user, :write_snippet, @project
= link_to 'New Snippet', new_project_snippet_path(@project), :class => "grey-button append-bottom-10"
%table.round-borders#snippets-table
%thead
%th
%table#snippets-table
= render @snippets.fresh
:javascript
$('.delete-snippet').live('ajax:success', function() {
......
- if !@snippet.expired?
%h2
= "Snippet ##{@snippet.id} - #{@snippet.title}"
.view_file
.view_file_header
%strong
= @snippet.file_name
%br/
.view_file_content
.ui-box.width-100p
%h3
= @snippet.title
.right= @snippet.file_name
.data.no-padding
:erb
<%= raw @snippet.colorize %>
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to 'Edit', edit_project_snippet_path(@project, @snippet), :class => "lbutton positive"
- if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user
= link_to 'Destroy', [@project, @snippet], :confirm => 'Are you sure?', :method => :delete, :class => "lbutton delete-snippet negative", :id => "destroy_snippet_#{@snippet.id}"
.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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment