diff options
Diffstat (limited to 'app/views/admin/blogs/_form.html.haml')
| -rw-r--r-- | app/views/admin/blogs/_form.html.haml | 23 |
1 files changed, 21 insertions, 2 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 |
