diff options
Diffstat (limited to 'app/views/admin/blogs')
-rw-r--r-- | app/views/admin/blogs/_form.html.haml | 6 | ||||
-rw-r--r-- | app/views/admin/blogs/drafts.html.haml | 5 | ||||
-rw-r--r-- | app/views/admin/blogs/index.html.haml | 5 | ||||
-rw-r--r-- | app/views/admin/blogs/show.html.haml | 5 |
4 files changed, 19 insertions, 2 deletions
diff --git a/app/views/admin/blogs/_form.html.haml b/app/views/admin/blogs/_form.html.haml index 2066aed..12f7a82 100644 --- a/app/views/admin/blogs/_form.html.haml +++ b/app/views/admin/blogs/_form.html.haml | |||
@@ -15,6 +15,12 @@ | |||
15 | %ul | 15 | %ul |
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 | - unless f.object.new_record? | ||
19 | #entry-preview-link.details-module | ||
20 | - if f.object.published | ||
21 | = link_to "View post", blog_url(f.object.slug_was), target: "entry-preview" | ||
22 | - else | ||
23 | = link_to "Preview post", admin_blog_url(f.object), target: "entry-preview" | ||
18 | .details-module | 24 | .details-module |
19 | .published-field | 25 | .published-field |
20 | = f.check_box :published | 26 | = f.check_box :published |
diff --git a/app/views/admin/blogs/drafts.html.haml b/app/views/admin/blogs/drafts.html.haml index 91d3214..8f2d369 100644 --- a/app/views/admin/blogs/drafts.html.haml +++ b/app/views/admin/blogs/drafts.html.haml | |||
@@ -7,4 +7,7 @@ | |||
7 | %tr{ class: cycle("even", "odd") } | 7 | %tr{ class: cycle("even", "odd") } |
8 | %td= blog.title | 8 | %td= blog.title |
9 | %td= blog.updated_at.strftime("%B %d, %Y, %l:%M%P") | 9 | %td= blog.updated_at.strftime("%B %d, %Y, %l:%M%P") |
10 | %td= link_to "Edit", edit_admin_blog_url(blog) | 10 | %td |
11 | %ul.admin-actions | ||
12 | %li= link_to "Preview", admin_blog_url(blog) | ||
13 | %li= link_to "Edit", edit_admin_blog_url(blog) | ||
diff --git a/app/views/admin/blogs/index.html.haml b/app/views/admin/blogs/index.html.haml index c5db4f1..427d922 100644 --- a/app/views/admin/blogs/index.html.haml +++ b/app/views/admin/blogs/index.html.haml | |||
@@ -7,4 +7,7 @@ | |||
7 | %tr{ class: cycle("even", "odd") } | 7 | %tr{ class: cycle("even", "odd") } |
8 | %td= blog.title | 8 | %td= blog.title |
9 | %td= blog.published_at.strftime("%B %d, %Y, %l:%M%P") | 9 | %td= blog.published_at.strftime("%B %d, %Y, %l:%M%P") |
10 | %td= link_to "Edit", edit_admin_blog_url(blog) | 10 | %td |
11 | %ul.admin-actions | ||
12 | %li= link_to "View", blog_url(blog.slug) | ||
13 | %li= link_to "Edit", edit_admin_blog_url(blog) | ||
diff --git a/app/views/admin/blogs/show.html.haml b/app/views/admin/blogs/show.html.haml new file mode 100644 index 0000000..7875cab --- /dev/null +++ b/app/views/admin/blogs/show.html.haml | |||
@@ -0,0 +1,5 @@ | |||
1 | = render partial: "blogs/blog", object: @blog | ||
2 | %footer#blog-footer | ||
3 | This draft was last updated on | ||
4 | = succeed "." do | ||
5 | %time= @blog.updated_at.strftime("%B #{@blog.updated_at.day.ordinalize}, %Y at %-I:%M:%S%P") | ||