diff options
Diffstat (limited to 'app/views/admin')
-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 |
4 files changed, 32 insertions, 0 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 |