diff options
Diffstat (limited to 'app/views/admin')
28 files changed, 300 insertions, 15 deletions
| diff --git a/app/views/admin/blogs/_form.html.haml b/app/views/admin/blogs/_form.html.haml index 12f7a82..323d499 100644 --- a/app/views/admin/blogs/_form.html.haml +++ b/app/views/admin/blogs/_form.html.haml | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | = f.text_field :slug, placeholder: "insert-slug-here" | 7 | = f.text_field :slug, placeholder: "insert-slug-here" |
| 8 | .body-field | 8 | .body-field |
| 9 | = f.label :body | 9 | = f.label :body |
| 10 | = f.cktext_area :body | 10 | = f.text_area :body |
| 11 | %fieldset#details | 11 | %fieldset#details |
| 12 | - if f.object.errors.any? | 12 | - if f.object.errors.any? |
| 13 | #errors.details-module | 13 | #errors.details-module |
| @@ -20,11 +20,18 @@ | |||
| 20 | - if f.object.published | 20 | - if f.object.published |
| 21 | = link_to "View post", blog_url(f.object.slug_was), target: "entry-preview" | 21 | = link_to "View post", blog_url(f.object.slug_was), target: "entry-preview" |
| 22 | - else | 22 | - else |
| 23 | = link_to "Preview post", admin_blog_url(f.object), target: "entry-preview" | 23 | = link_to "Preview post", admin_blog_url(f.object.id), target: "entry-preview" |
| 24 | .details-module | ||
| 25 | .tags-field | ||
| 26 | = f.label :tag_list, "Tags" | ||
| 27 | = f.text_field :tag_list, type: :tags, value: f.object.tag_list.join(",") | ||
| 24 | .details-module | 28 | .details-module |
| 25 | .published-field | 29 | .published-field |
| 26 | = f.check_box :published | 30 | = f.check_box :published |
| 27 | = f.label :published | 31 | = f.label :published |
| 32 | .datetime-field | ||
| 33 | = f.label :published_at | ||
| 34 | = f.text_field :published_at | ||
| 28 | .details-module | 35 | .details-module |
| 29 | = f.fields_for :records, Record.new do |builder| | 36 | = f.fields_for :records, Record.new do |builder| |
| 30 | .should-create-record-field | 37 | .should-create-record-field |
| @@ -32,4 +39,16 @@ | |||
| 32 | = builder.label :_destroy, "Create record?" | 39 | = builder.label :_destroy, "Create record?" |
| 33 | .record-description-field | 40 | .record-description-field |
| 34 | = builder.text_area :description, placeholder: "record text" | 41 | = builder.text_area :description, placeholder: "record text" |
| 42 | .details-module.image-uploads | ||
| 43 | %h4 Images | ||
| 44 | - f.object.images.each do |image| | ||
| 45 | - if image.representable? | ||
| 46 | = image_tag image.variant(:thumb) | ||
| 47 | - else | ||
| 48 | = image.filename.to_s | ||
| 49 | - unless image.new_record? | ||
| 50 | = f.hidden_field :images, multiple: true, value: image.signed_id | ||
| 51 | %pre= rails_blob_url(image) | ||
| 52 | %hr | ||
| 53 | = f.file_field :images, multiple: true | ||
| 35 | .details-module= f.submit | 54 | .details-module= f.submit |
| diff --git a/app/views/admin/blogs/drafts.html.haml b/app/views/admin/blogs/drafts.html.haml index 8f2d369..9deb395 100644 --- a/app/views/admin/blogs/drafts.html.haml +++ b/app/views/admin/blogs/drafts.html.haml | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | - title "Blog drafts" | ||
| 1 | %table#entries | 2 | %table#entries |
| 2 | %tr | 3 | %tr |
| 3 | %th Title | 4 | %th Title |
| @@ -9,5 +10,5 @@ | |||
| 9 | %td= blog.updated_at.strftime("%B %d, %Y, %l:%M%P") | 10 | %td= blog.updated_at.strftime("%B %d, %Y, %l:%M%P") |
| 10 | %td | 11 | %td |
| 11 | %ul.admin-actions | 12 | %ul.admin-actions |
| 12 | %li= link_to "Preview", admin_blog_url(blog) | 13 | %li= link_to "Preview", admin_blog_url(blog.id) |
| 13 | %li= link_to "Edit", edit_admin_blog_url(blog) | 14 | %li= link_to "Edit", edit_admin_blog_url(blog.id) |
| diff --git a/app/views/admin/blogs/edit.html.haml b/app/views/admin/blogs/edit.html.haml index f356069..deb9714 100644 --- a/app/views/admin/blogs/edit.html.haml +++ b/app/views/admin/blogs/edit.html.haml | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | = form_for @blog, url: admin_blog_url(@blog), html: { id: "entry-form" } do |f| | 1 | - title "Editing #{@blog.title}" |
| 2 | = form_for @blog, url: admin_blog_url(@blog.id), html: { id: "entry-form" } do |f| | ||
| 2 | = render partial: "form", locals: { f: f } | 3 | = render partial: "form", locals: { f: f } |
| diff --git a/app/views/admin/blogs/index.html.haml b/app/views/admin/blogs/index.html.haml index 427d922..ebe1b68 100644 --- a/app/views/admin/blogs/index.html.haml +++ b/app/views/admin/blogs/index.html.haml | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | - title "Blogs" | ||
| 1 | %table#entries | 2 | %table#entries |
| 2 | %tr | 3 | %tr |
| 3 | %th Title | 4 | %th Title |
| @@ -9,5 +10,5 @@ | |||
| 9 | %td= blog.published_at.strftime("%B %d, %Y, %l:%M%P") | 10 | %td= blog.published_at.strftime("%B %d, %Y, %l:%M%P") |
| 10 | %td | 11 | %td |
| 11 | %ul.admin-actions | 12 | %ul.admin-actions |
| 12 | %li= link_to "View", blog_url(blog.slug) | 13 | %li= link_to "View", blog |
| 13 | %li= link_to "Edit", edit_admin_blog_url(blog) | 14 | %li= link_to "Edit", edit_admin_blog_url(blog.id) |
| diff --git a/app/views/admin/blogs/new.html.haml b/app/views/admin/blogs/new.html.haml index 0005278..eff1f16 100644 --- a/app/views/admin/blogs/new.html.haml +++ b/app/views/admin/blogs/new.html.haml | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | - title "New blog" | ||
| 1 | = form_for @blog, url: admin_blogs_url, html: { id: "entry-form" } do |f| | 2 | = form_for @blog, url: admin_blogs_url, html: { id: "entry-form" } do |f| |
| 2 | = render partial: "form", locals: { f: f } | 3 | = render partial: "form", locals: { f: f } |
| diff --git a/app/views/admin/blogs/show.html.haml b/app/views/admin/blogs/show.html.haml index 7875cab..f50f69d 100644 --- a/app/views/admin/blogs/show.html.haml +++ b/app/views/admin/blogs/show.html.haml | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | = render partial: "blogs/blog", object: @blog | 1 | - title "Previewing #{@blog.title}" |
| 2 | = render "blogs/blog", blog: @blog, short: false | ||
| 2 | %footer#blog-footer | 3 | %footer#blog-footer |
| 3 | This draft was last updated on | 4 | This draft was last updated on |
| 4 | = succeed "." do | 5 | = succeed "." do |
| diff --git a/app/views/admin/comments/index.html.haml b/app/views/admin/comments/index.html.haml new file mode 100644 index 0000000..8cfa0bb --- /dev/null +++ b/app/views/admin/comments/index.html.haml | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | - title "Comments" | ||
| 2 | = will_paginate @comments | ||
| 3 | %table#entries | ||
| 4 | %tr | ||
| 5 | %th Text | ||
| 6 | %th Author | ||
| 7 | %th Blog post | ||
| 8 | %th Date published | ||
| 9 | %th | ||
| 10 | - @comments.each do |comment| | ||
| 11 | %tr{ class: cycle("even", "odd") } | ||
| 12 | %td= comment.body | ||
| 13 | %td | ||
| 14 | %ul | ||
| 15 | %li= comment.username | ||
| 16 | %li= comment.email | ||
| 17 | - unless comment.website.empty? | ||
| 18 | %li= comment.website | ||
| 19 | %td= link_to comment.blog.title, comment.blog | ||
| 20 | %td= comment.published_at.strftime("%B %d, %Y, %l:%M%P") | ||
| 21 | %td | ||
| 22 | %ul.admin-actions | ||
| 23 | %li= link_to "View", blog_url(comment.blog, anchor: "comment-#{comment.id}") | ||
| 24 | %li= link_to "Delete", admin_comment_url(comment), method: :delete, data: { confirm: "Are you sure?" } | ||
| 25 | = will_paginate @comments | ||
| diff --git a/app/views/admin/comments/pending.haml b/app/views/admin/comments/pending.haml new file mode 100644 index 0000000..5352b12 --- /dev/null +++ b/app/views/admin/comments/pending.haml | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | - title "Pending Comments" | ||
| 2 | = will_paginate @comments | ||
| 3 | = form_tag mass_admin_comments_url, method: :post do | ||
| 4 | #action-box | ||
| 5 | = select_tag "mass_action", options_for_select(["Delete", "Mark Spam"]), include_blank: true | ||
| 6 | = submit_tag "Mass action", data: { confirm: "Are you sure you want to do this action?" } | ||
| 7 | %table#entries | ||
| 8 | %tr | ||
| 9 | %th= check_box_tag "check_all" | ||
| 10 | %th Text | ||
| 11 | %th Author | ||
| 12 | %th Blog post | ||
| 13 | %th Date updated | ||
| 14 | %th | ||
| 15 | - @comments.each do |comment| | ||
| 16 | %tr{ class: cycle("even", "odd") } | ||
| 17 | %td= check_box_tag "comment_ids[]", comment.id, class: "comment_ids" | ||
| 18 | %td= comment.body | ||
| 19 | %td | ||
| 20 | %ul | ||
| 21 | %li= comment.username | ||
| 22 | %li= comment.email | ||
| 23 | - unless comment.website.empty? | ||
| 24 | %li= comment.website | ||
| 25 | %td= link_to comment.blog.title, comment.blog | ||
| 26 | %td= comment.created_at.strftime("%B %d, %Y, %l:%M%P") | ||
| 27 | %td | ||
| 28 | %ul.admin-actions | ||
| 29 | %li= link_to "Accept", accept_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to accept this comment?" } | ||
| 30 | %li= link_to "Reject", reject_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to reject this comment?" } | ||
| 31 | %li= link_to "Mark Spam", mark_spam_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to mark this comment as spam?" } | ||
| 32 | = will_paginate @comments | ||
| diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index eaac627..254107c 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml | |||
| @@ -1 +1,19 @@ | |||
| 1 | Welcome to the the ubiquitous administration panel! | 1 | %p Welcome to the the ubiquitous administration panel! |
| 2 | %p Stats: | ||
| 3 | %ul | ||
| 4 | %li | ||
| 5 | %strong Blog posts: | ||
| 6 | = Blog.count | ||
| 7 | %li | ||
| 8 | %strong Approved comments: | ||
| 9 | = Comment.where(status: :published).count | ||
| 10 | %li | ||
| 11 | %strong Filtered comments: | ||
| 12 | = Global.get_filtered_comments | ||
| 13 | %li | ||
| 14 | %strong Quotes: | ||
| 15 | = Quote.count | ||
| 16 | %li | ||
| 17 | %strong Votes: | ||
| 18 | = Vote.count | ||
| 19 | (+#{Vote.where(upvote: true).count} / -#{Vote.where(upvote: false).count}) | ||
| diff --git a/app/views/admin/games/_form.html.haml b/app/views/admin/games/_form.html.haml new file mode 100644 index 0000000..bc31c26 --- /dev/null +++ b/app/views/admin/games/_form.html.haml | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | %fieldset#content | ||
| 2 | .title-field | ||
| 3 | = f.label :title | ||
| 4 | = f.text_field :title, placeholder: "Title" | ||
| 5 | .description-field | ||
| 6 | = f.label :description | ||
| 7 | = f.text_area :description | ||
| 8 | %fieldset#details | ||
| 9 | - if f.object.errors.any? | ||
| 10 | #errors.details-module | ||
| 11 | %h3 Error! | ||
| 12 | %ul | ||
| 13 | - f.object.errors.full_messages.each do |error| | ||
| 14 | %li= error | ||
| 15 | .details-module | ||
| 16 | .progress-field | ||
| 17 | = f.label :progress | ||
| 18 | = f.text_area :progress | ||
| 19 | .details-module | ||
| 20 | .score-field | ||
| 21 | = f.label :score | ||
| 22 | = f.select :score, 1..10, include_blank: true | ||
| 23 | .details-module | ||
| 24 | .started-field | ||
| 25 | = f.label :started_on | ||
| 26 | = f.text_field :started_on, class: "datepicker" | ||
| 27 | .details-module | ||
| 28 | .finished-field | ||
| 29 | = f.label :finished_on | ||
| 30 | = f.text_field :finished_on, class: "datepicker" | ||
| 31 | .details-module | ||
| 32 | .status-field | ||
| 33 | = f.select :status, options_for_select(Game.status.values, f.object.status) | ||
| 34 | = f.label :status | ||
| 35 | .details-module= f.submit | ||
| diff --git a/app/views/admin/games/edit.html.haml b/app/views/admin/games/edit.html.haml new file mode 100644 index 0000000..d7a480b --- /dev/null +++ b/app/views/admin/games/edit.html.haml | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | - title "Editing #{@game.title}" | ||
| 2 | = form_for @game, url: admin_game_url(@game), html: { id: "entry-form" } do |f| | ||
| 3 | = render partial: "form", locals: { f: f } | ||
| diff --git a/app/views/admin/games/index.html.haml b/app/views/admin/games/index.html.haml new file mode 100644 index 0000000..96c69b8 --- /dev/null +++ b/app/views/admin/games/index.html.haml | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | - title "Games" | ||
| 2 | %table#entries | ||
| 3 | %tr | ||
| 4 | %th Title | ||
| 5 | %th Date published | ||
| 6 | %th | ||
| 7 | - @games.each do |game| | ||
| 8 | %tr{ class: cycle("even", "odd") } | ||
| 9 | %td= game.title | ||
| 10 | %td= game.created_at.strftime("%B %d, %Y, %l:%M%P") | ||
| 11 | %td | ||
| 12 | %ul.admin-actions | ||
| 13 | %li= link_to "Edit", edit_admin_game_url(game) | ||
| diff --git a/app/views/admin/games/new.html.haml b/app/views/admin/games/new.html.haml new file mode 100644 index 0000000..00dfb92 --- /dev/null +++ b/app/views/admin/games/new.html.haml | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | - title "New game" | ||
| 2 | = form_for @game, url: admin_games_url, html: { id: "entry-form" } do |f| | ||
| 3 | = render partial: "form", locals: { f: f } | ||
| diff --git a/app/views/admin/links/_form.html.haml b/app/views/admin/links/_form.html.haml new file mode 100644 index 0000000..c624a3d --- /dev/null +++ b/app/views/admin/links/_form.html.haml | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | %fieldset#content | ||
| 2 | .title-field | ||
| 3 | = f.label :title | ||
| 4 | = f.text_field :title, placeholder: "Title" | ||
| 5 | .url-field | ||
| 6 | = f.label :url | ||
| 7 | = f.text_field :url, placeholder: "URL" | ||
| 8 | %fieldset#details | ||
| 9 | - if f.object.errors.any? | ||
| 10 | #errors.details-module | ||
| 11 | %h3 Error! | ||
| 12 | %ul | ||
| 13 | - f.object.errors.full_messages.each do |error| | ||
| 14 | %li= error | ||
| 15 | .details-module | ||
| 16 | .tags-field | ||
| 17 | = f.label :tag_list, "Tags" | ||
| 18 | = f.text_field :tag_list, type: :tags, value: f.object.tag_list.join(",") | ||
| 19 | .details-module | ||
| 20 | = f.fields_for :records, Record.new do |builder| | ||
| 21 | .should-create-record-field | ||
| 22 | = builder.check_box :_destroy, {checked: false}, "0", "1" | ||
| 23 | = builder.label :_destroy, "Create record?" | ||
| 24 | .record-description-field | ||
| 25 | = builder.text_area :description, placeholder: "record text" | ||
| 26 | .details-module= f.submit | ||
| diff --git a/app/views/admin/links/edit.html.haml b/app/views/admin/links/edit.html.haml new file mode 100644 index 0000000..1c6c529 --- /dev/null +++ b/app/views/admin/links/edit.html.haml | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | - title "Editing #{@link.title}" | ||
| 2 | = form_for @link, url: admin_link_url(@link), html: { id: "entry-form" } do |f| | ||
| 3 | = render partial: "form", locals: { f: f } | ||
| diff --git a/app/views/admin/links/index.html.haml b/app/views/admin/links/index.html.haml new file mode 100644 index 0000000..e66d9b7 --- /dev/null +++ b/app/views/admin/links/index.html.haml | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | - title "Links" | ||
| 2 | %table#entries | ||
| 3 | %tr | ||
| 4 | %th Title | ||
| 5 | %th Date created | ||
| 6 | %th | ||
| 7 | - @links.each do |link| | ||
| 8 | %tr{ class: cycle("even", "odd") } | ||
| 9 | %td= link.title | ||
| 10 | %td= link.created_at.strftime("%B %d, %Y, %l:%M%P") | ||
| 11 | %td | ||
| 12 | %ul.admin-actions | ||
| 13 | %li= link_to "Edit", edit_admin_link_url(link) | ||
| 14 | %li= link_to "Show", link.url | ||
| diff --git a/app/views/admin/links/new.html.haml b/app/views/admin/links/new.html.haml new file mode 100644 index 0000000..accdfd9 --- /dev/null +++ b/app/views/admin/links/new.html.haml | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | - title "New link" | ||
| 2 | = form_for @link, url: admin_links_url, html: { id: "entry-form" } do |f| | ||
| 3 | = render partial: "form", locals: { f: f } | ||
| 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 | ||
| diff --git a/app/views/admin/streams/_form.html.haml b/app/views/admin/streams/_form.html.haml index ce457cb..a4d8c46 100644 --- a/app/views/admin/streams/_form.html.haml +++ b/app/views/admin/streams/_form.html.haml | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | = f.text_field :slug, placeholder: "insert-slug-here" | 7 | = f.text_field :slug, placeholder: "insert-slug-here" |
| 8 | .body-field | 8 | .body-field |
| 9 | = f.label :body | 9 | = f.label :body |
| 10 | = f.cktext_area :body | 10 | = f.text_area :body |
| 11 | %fieldset#details | 11 | %fieldset#details |
| 12 | - if f.object.errors.any? | 12 | - if f.object.errors.any? |
| 13 | #errors.details-module | 13 | #errors.details-module |
| @@ -16,6 +16,10 @@ | |||
| 16 | - f.object.errors.full_messages.each do |error| | 16 | - f.object.errors.full_messages.each do |error| |
| 17 | %li= error | 17 | %li= error |
| 18 | .details-module | 18 | .details-module |
| 19 | .tags-field | ||
| 20 | = f.label :tag_list, "Tags" | ||
| 21 | = f.text_field :tag_list, type: :tags, value: f.object.tag_list.join(",") | ||
| 22 | .details-module | ||
| 19 | = f.fields_for :records, Record.new do |builder| | 23 | = f.fields_for :records, Record.new do |builder| |
| 20 | .should-create-record-field | 24 | .should-create-record-field |
| 21 | = builder.check_box :_destroy, {checked: false}, "0", "1" | 25 | = builder.check_box :_destroy, {checked: false}, "0", "1" |
| diff --git a/app/views/admin/streams/edit.html.haml b/app/views/admin/streams/edit.html.haml index 1b58331..8c250e2 100644 --- a/app/views/admin/streams/edit.html.haml +++ b/app/views/admin/streams/edit.html.haml | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | = form_for @stream, url: admin_stream_url(@stream), html: { id: "entry-form" } do |f| | 1 | - title "Editing #{@stream.title}" |
| 2 | = form_for @stream, url: admin_stream_url(@stream.id), html: { id: "entry-form" } do |f| | ||
| 2 | = render partial: "form", locals: { f: f } | 3 | = render partial: "form", locals: { f: f } |
| diff --git a/app/views/admin/streams/index.html.haml b/app/views/admin/streams/index.html.haml index c69c6f9..a2a25d7 100644 --- a/app/views/admin/streams/index.html.haml +++ b/app/views/admin/streams/index.html.haml | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | - title "Streams" | ||
| 1 | %table#entries | 2 | %table#entries |
| 2 | %tr | 3 | %tr |
| 3 | %th Title | 4 | %th Title |
| @@ -9,5 +10,5 @@ | |||
| 9 | %td= stream.created_at.strftime("%B %d, %Y, %l:%M%P") | 10 | %td= stream.created_at.strftime("%B %d, %Y, %l:%M%P") |
| 10 | %td | 11 | %td |
| 11 | %ul.admin-actions | 12 | %ul.admin-actions |
| 12 | %li= link_to "Edit", edit_admin_stream_url(stream) | 13 | %li= link_to "Edit", edit_admin_stream_url(stream.id) |
| 13 | %li= link_to "Add Update", new_admin_stream_update_url(stream) | 14 | %li= link_to "Add Update", new_admin_stream_update_url(stream.id) |
| diff --git a/app/views/admin/streams/new.html.haml b/app/views/admin/streams/new.html.haml index 52febf5..875805a 100644 --- a/app/views/admin/streams/new.html.haml +++ b/app/views/admin/streams/new.html.haml | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | - title "New stream" | ||
| 1 | = form_for @stream, url: admin_streams_url, html: { id: "entry-form" } do |f| | 2 | = form_for @stream, url: admin_streams_url, html: { id: "entry-form" } do |f| |
| 2 | = render partial: "form", locals: { f: f } | 3 | = render partial: "form", locals: { f: f } |
| diff --git a/app/views/admin/updates/_form.html.haml b/app/views/admin/updates/_form.html.haml index 9dd8741..f20e5a0 100644 --- a/app/views/admin/updates/_form.html.haml +++ b/app/views/admin/updates/_form.html.haml | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | = f.text_field :title, value: @stream.title, readonly: true | 4 | = f.text_field :title, value: @stream.title, readonly: true |
| 5 | .body-field | 5 | .body-field |
| 6 | = f.label :body | 6 | = f.label :body |
| 7 | = f.cktext_area :body | 7 | = f.text_area :body |
| 8 | %fieldset#details | 8 | %fieldset#details |
| 9 | - if f.object.errors.any? | 9 | - if f.object.errors.any? |
| 10 | #errors.details-module | 10 | #errors.details-module |
| diff --git a/app/views/admin/updates/edit.html.haml b/app/views/admin/updates/edit.html.haml index 5651d23..3cab0b6 100644 --- a/app/views/admin/updates/edit.html.haml +++ b/app/views/admin/updates/edit.html.haml | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | = form_for @update, url: admin_stream_update_url(@stream, @update), html: { id: "entry-form" } do |f| | 1 | - title "Editing stream update" |
| 2 | = form_for @update, url: admin_stream_update_url(@stream.id, @update), html: { id: "entry-form" } do |f| | ||
| 2 | = render partial: "form", locals: { f: f } | 3 | = render partial: "form", locals: { f: f } |
| diff --git a/app/views/admin/updates/new.html.haml b/app/views/admin/updates/new.html.haml index 14c6d77..f6c1c20 100644 --- a/app/views/admin/updates/new.html.haml +++ b/app/views/admin/updates/new.html.haml | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | - title "New stream update" | ||
| 1 | = form_for @update, url: admin_stream_updates_url(@stream), html: { id: "entry-form" } do |f| | 2 | = form_for @update, url: admin_stream_updates_url(@stream), html: { id: "entry-form" } do |f| |
| 2 | = render partial: "form", locals: { f: f } | 3 | = render partial: "form", locals: { f: f } |
