diff options
Diffstat (limited to 'app/views/admin/blogs')
| -rw-r--r-- | app/views/admin/blogs/_form.html.haml | 23 | ||||
| -rw-r--r-- | app/views/admin/blogs/drafts.html.haml | 5 | ||||
| -rw-r--r-- | app/views/admin/blogs/edit.html.haml | 3 | ||||
| -rw-r--r-- | app/views/admin/blogs/index.html.haml | 5 | ||||
| -rw-r--r-- | app/views/admin/blogs/new.html.haml | 1 | ||||
| -rw-r--r-- | app/views/admin/blogs/show.html.haml | 3 |
6 files changed, 32 insertions, 8 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 |
