diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/quotes/_form.html.haml | 27 | ||||
-rw-r--r-- | app/views/admin/quotes/edit.html.haml | 3 | ||||
-rw-r--r-- | app/views/admin/quotes/index.html.haml | 1 | ||||
-rw-r--r-- | app/views/admin/quotes/pending.html.haml | 1 | ||||
-rw-r--r-- | app/views/layouts/quotes.html.haml | 4 | ||||
-rw-r--r-- | app/views/quotes/_quote.html.haml | 2 |
6 files changed, 37 insertions, 1 deletions
diff --git a/app/views/admin/quotes/_form.html.haml b/app/views/admin/quotes/_form.html.haml new file mode 100644 index 0000000..920835b --- /dev/null +++ b/app/views/admin/quotes/_form.html.haml | |||
@@ -0,0 +1,27 @@ | |||
1 | %fieldset#content | ||
2 | %h2 Quote ##{f.object.id} | ||
3 | .halfbody-field | ||
4 | = f.label :content | ||
5 | = f.text_area :content | ||
6 | %h3 Notes | ||
7 | .halfbody-field | ||
8 | = f.label :notes | ||
9 | = f.text_area :notes | ||
10 | %fieldset#details | ||
11 | - if f.object.errors.any? | ||
12 | #errors.details-module | ||
13 | %h3 Error! | ||
14 | %ul | ||
15 | - f.object.errors.full_messages.each do |error| | ||
16 | %li= error | ||
17 | - unless f.object.new_record? | ||
18 | #entry-preview-link.details-module= link_to "View quote", quote_url(f.object.id), target: "entry-preview" | ||
19 | .details-module | ||
20 | .tags-field | ||
21 | = f.label :tag_list, "Tags" | ||
22 | = f.text_field :tag_list, type: :tags, value: f.object.tag_list.join(",") | ||
23 | .details-module | ||
24 | .published-field | ||
25 | = f.label :state | ||
26 | = f.select :state, Quote.state.options | ||
27 | .details-module= f.submit | ||
diff --git a/app/views/admin/quotes/edit.html.haml b/app/views/admin/quotes/edit.html.haml new file mode 100644 index 0000000..47ff2d1 --- /dev/null +++ b/app/views/admin/quotes/edit.html.haml | |||
@@ -0,0 +1,3 @@ | |||
1 | - title "Editing Quote \##{@quote.id}" | ||
2 | = form_for @quote, url: admin_quote_url(@quote.id), html: { id: "entry-form" } do |f| | ||
3 | = render partial: "form", locals: { f: f } | ||
diff --git a/app/views/admin/quotes/index.html.haml b/app/views/admin/quotes/index.html.haml index afe2c20..c1a4866 100644 --- a/app/views/admin/quotes/index.html.haml +++ b/app/views/admin/quotes/index.html.haml | |||
@@ -16,5 +16,6 @@ | |||
16 | %td | 16 | %td |
17 | %ul.admin-actions | 17 | %ul.admin-actions |
18 | %li= link_to "View", quote | 18 | %li= link_to "View", quote |
19 | %li= link_to "Edit", edit_admin_quote_url(quote) | ||
19 | %li= link_to "Delete", admin_quote_url(quote), method: :delete, data: { confirm: "Are you sure?" } | 20 | %li= link_to "Delete", admin_quote_url(quote), method: :delete, data: { confirm: "Are you sure?" } |
20 | = will_paginate @quotes | 21 | = will_paginate @quotes |
diff --git a/app/views/admin/quotes/pending.html.haml b/app/views/admin/quotes/pending.html.haml index 14d6cf8..ef52099 100644 --- a/app/views/admin/quotes/pending.html.haml +++ b/app/views/admin/quotes/pending.html.haml | |||
@@ -15,6 +15,7 @@ | |||
15 | %td= quote.created_at.strftime("%B %d, %Y, %l:%M%P") | 15 | %td= quote.created_at.strftime("%B %d, %Y, %l:%M%P") |
16 | %td | 16 | %td |
17 | %ul.admin-actions | 17 | %ul.admin-actions |
18 | %li= link_to "Edit", edit_admin_quote_url(quote) | ||
18 | %li= link_to "Accept", accept_admin_quote_url(quote), method: :post, data: { confirm: "Are you sure you want to accept this quote?" } | 19 | %li= link_to "Accept", accept_admin_quote_url(quote), method: :post, data: { confirm: "Are you sure you want to accept this quote?" } |
19 | %li= link_to "Reject", admin_quote_url(quote), method: :delete, data: { confirm: "Are you sure you want to reject this quote?" } | 20 | %li= link_to "Reject", admin_quote_url(quote), method: :delete, data: { confirm: "Are you sure you want to reject this quote?" } |
20 | = will_paginate @quotes | 21 | = will_paginate @quotes |
diff --git a/app/views/layouts/quotes.html.haml b/app/views/layouts/quotes.html.haml index f42eee0..98a7a86 100644 --- a/app/views/layouts/quotes.html.haml +++ b/app/views/layouts/quotes.html.haml | |||
@@ -11,7 +11,7 @@ | |||
11 | %body | 11 | %body |
12 | #wrap | 12 | #wrap |
13 | %header#banner | 13 | %header#banner |
14 | %h1#banner-title= link_to "The Four Island Quotes DB", root_path | 14 | %h1#banner-title= link_to "The Four Island Quotes DB", quotes_url |
15 | #banner-abbr FIQDB | 15 | #banner-abbr FIQDB |
16 | .cleardiv | 16 | .cleardiv |
17 | %nav#top-bar | 17 | %nav#top-bar |
@@ -25,6 +25,8 @@ | |||
25 | %li= link_to_unless_current "Tags", tags_quotes_url | 25 | %li= link_to_unless_current "Tags", tags_quotes_url |
26 | %li= link_to_unless_current "Stats", stats_quotes_url | 26 | %li= link_to_unless_current "Stats", stats_quotes_url |
27 | %li= link_to_unless_current "Feed", latest_quotes_url(:atom) | 27 | %li= link_to_unless_current "Feed", latest_quotes_url(:atom) |
28 | - if user_signed_in? | ||
29 | %li= link_to_unless_current "Admin", admin_url | ||
28 | .cleardiv | 30 | .cleardiv |
29 | #page-body | 31 | #page-body |
30 | - if flash[:notice] | 32 | - if flash[:notice] |
diff --git a/app/views/quotes/_quote.html.haml b/app/views/quotes/_quote.html.haml index 2a9fb37..46b0266 100644 --- a/app/views/quotes/_quote.html.haml +++ b/app/views/quotes/_quote.html.haml | |||
@@ -5,6 +5,8 @@ | |||
5 | %span.quote-rating{ :id => "quote-rating-#{quote.id}" }= "+#{quote.upvotes}/-#{quote.downvotes}" | 5 | %span.quote-rating{ :id => "quote-rating-#{quote.id}" }= "+#{quote.upvotes}/-#{quote.downvotes}" |
6 | %span.vote-link{ :id => "quote-downvote-link-#{quote.id}" }= link_to_unless (quote.new_record? or quote.already_downvoted?(request.remote_ip)), "Down", downvote_quote_path(quote.id), :remote => true, :rel => "nofollow", :class => "quote-downvote-link", method: :post | 6 | %span.vote-link{ :id => "quote-downvote-link-#{quote.id}" }= link_to_unless (quote.new_record? or quote.already_downvoted?(request.remote_ip)), "Down", downvote_quote_path(quote.id), :remote => true, :rel => "nofollow", :class => "quote-downvote-link", method: :post |
7 | %datetime= quote.published_date | 7 | %datetime= quote.published_date |
8 | - if user_signed_in? and !quote.new_record? | ||
9 | = link_to "Edit", edit_admin_quote_path(quote), :class => "quote-edit-link" | ||
8 | %blockquote.quote-body= raw quote_format(h(quote.content)) | 10 | %blockquote.quote-body= raw quote_format(h(quote.content)) |
9 | - if !quote.new_record? and quote.has_extra? | 11 | - if !quote.new_record? and quote.has_extra? |
10 | .quote-footer | 12 | .quote-footer |