diff options
Diffstat (limited to 'app/views/admin/quotes')
| -rw-r--r-- | app/views/admin/quotes/_form.html.haml | 32 | ||||
| -rw-r--r-- | app/views/admin/quotes/edit.html.haml | 3 | ||||
| -rw-r--r-- | app/views/admin/quotes/index.html.haml | 21 | ||||
| -rw-r--r-- | app/views/admin/quotes/pending.html.haml | 21 |
4 files changed, 77 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..13948ca --- /dev/null +++ b/app/views/admin/quotes/_form.html.haml | |||
| @@ -0,0 +1,32 @@ | |||
| 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.image-uploads | ||
| 28 | %h4 Audio | ||
| 29 | - if f.object.audio.attached? | ||
| 30 | = audio_tag(rails_blob_url(f.object.audio), controls: true) | ||
| 31 | = f.file_field :audio | ||
| 32 | .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 new file mode 100644 index 0000000..c1a4866 --- /dev/null +++ b/app/views/admin/quotes/index.html.haml | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | - title "Quotes" | ||
| 2 | = will_paginate @quotes | ||
| 3 | %table#entries | ||
| 4 | %tr | ||
| 5 | %th ID | ||
| 6 | %th Content | ||
| 7 | %th Submitter | ||
| 8 | %th Date submitted | ||
| 9 | %th | ||
| 10 | - @quotes.each do |quote| | ||
| 11 | %tr{ class: cycle("even", "odd") } | ||
| 12 | %td= quote.id | ||
| 13 | %td= quote_format(quote.content) | ||
| 14 | %td= quote.submitter | ||
| 15 | %td= quote.created_at.strftime("%B %d, %Y, %l:%M%P") | ||
| 16 | %td | ||
| 17 | %ul.admin-actions | ||
| 18 | %li= link_to "View", quote | ||
| 19 | %li= link_to "Edit", edit_admin_quote_url(quote) | ||
| 20 | %li= link_to "Delete", admin_quote_url(quote), method: :delete, data: { confirm: "Are you sure?" } | ||
| 21 | = will_paginate @quotes | ||
| diff --git a/app/views/admin/quotes/pending.html.haml b/app/views/admin/quotes/pending.html.haml new file mode 100644 index 0000000..ef52099 --- /dev/null +++ b/app/views/admin/quotes/pending.html.haml | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | - title "Pending Quotes" | ||
| 2 | = will_paginate @quotes | ||
| 3 | %table#entries | ||
| 4 | %tr | ||
| 5 | %th ID | ||
| 6 | %th Content | ||
| 7 | %th Submitter | ||
| 8 | %th Date submitted | ||
| 9 | %th | ||
| 10 | - @quotes.each do |quote| | ||
| 11 | %tr{ class: cycle("even", "odd") } | ||
| 12 | %td= quote.id | ||
| 13 | %td= quote_format(quote.content) | ||
| 14 | %td= quote.submitter | ||
| 15 | %td= quote.created_at.strftime("%B %d, %Y, %l:%M%P") | ||
| 16 | %td | ||
| 17 | %ul.admin-actions | ||
| 18 | %li= link_to "Edit", edit_admin_quote_url(quote) | ||
| 19 | %li= link_to "Accept", accept_admin_quote_url(quote), method: :post, data: { confirm: "Are you sure you want to accept this quote?" } | ||
| 20 | %li= link_to "Reject", admin_quote_url(quote), method: :delete, data: { confirm: "Are you sure you want to reject this quote?" } | ||
| 21 | = will_paginate @quotes | ||
