diff options
Diffstat (limited to 'app/views/admin')
-rw-r--r-- | app/views/admin/blogs/_form.html.haml | 23 | ||||
-rw-r--r-- | app/views/admin/blogs/edit.html.haml | 2 | ||||
-rw-r--r-- | app/views/admin/blogs/index.html.haml | 10 | ||||
-rw-r--r-- | app/views/admin/blogs/new.html.haml | 2 | ||||
-rw-r--r-- | app/views/admin/dashboard/index.html.haml | 1 |
5 files changed, 38 insertions, 0 deletions
diff --git a/app/views/admin/blogs/_form.html.haml b/app/views/admin/blogs/_form.html.haml new file mode 100644 index 0000000..55a297a --- /dev/null +++ b/app/views/admin/blogs/_form.html.haml | |||
@@ -0,0 +1,23 @@ | |||
1 | - if f.object.errors.any? | ||
2 | %ul#errors | ||
3 | - f.object.errors.full_messages.each do |error| | ||
4 | %li= error | ||
5 | %fieldset#content | ||
6 | .title-field | ||
7 | = f.label :title | ||
8 | = f.text_field :title, placeholder: "Title" | ||
9 | .slug-field | ||
10 | = f.label :slug, "https://feffernoo.se/says/" | ||
11 | = f.text_field :slug, placeholder: "insert-slug-here" | ||
12 | .body-field | ||
13 | = f.label :body | ||
14 | = f.cktext_area :body | ||
15 | %fieldset#details | ||
16 | .details-module | ||
17 | = f.fields_for :records, Record.new do |builder| | ||
18 | .should-create-record-field | ||
19 | = builder.check_box :_destroy, {checked: false}, "0", "1" | ||
20 | = builder.label :_destroy, "Create record?" | ||
21 | .record-description-field | ||
22 | = builder.text_area :description, placeholder: "record text" | ||
23 | .details-module= f.submit | ||
diff --git a/app/views/admin/blogs/edit.html.haml b/app/views/admin/blogs/edit.html.haml new file mode 100644 index 0000000..3f4d412 --- /dev/null +++ b/app/views/admin/blogs/edit.html.haml | |||
@@ -0,0 +1,2 @@ | |||
1 | = form_for @blog, url: admin_blog_url(@blog), html: { id: "blog-form" } do |f| | ||
2 | = render partial: "form", locals: { f: f } | ||
diff --git a/app/views/admin/blogs/index.html.haml b/app/views/admin/blogs/index.html.haml new file mode 100644 index 0000000..448617a --- /dev/null +++ b/app/views/admin/blogs/index.html.haml | |||
@@ -0,0 +1,10 @@ | |||
1 | %table#entries | ||
2 | %tr | ||
3 | %th Title | ||
4 | %th Date created | ||
5 | %th | ||
6 | - @blogs.each do |blog| | ||
7 | %tr{ class: cycle("even", "odd") } | ||
8 | %td= blog.title | ||
9 | %td= blog.created_at.strftime("%B %d, %Y, %l:%M%P") | ||
10 | %td= link_to "Edit", edit_admin_blog_url(blog) | ||
diff --git a/app/views/admin/blogs/new.html.haml b/app/views/admin/blogs/new.html.haml new file mode 100644 index 0000000..914f27b --- /dev/null +++ b/app/views/admin/blogs/new.html.haml | |||
@@ -0,0 +1,2 @@ | |||
1 | = form_for @blog, url: admin_blogs_url, html: { id: "blog-form" } do |f| | ||
2 | = render partial: "form", locals: { f: f } | ||
diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml new file mode 100644 index 0000000..eaac627 --- /dev/null +++ b/app/views/admin/dashboard/index.html.haml | |||
@@ -0,0 +1 @@ | |||
Welcome to the the ubiquitous administration panel! | |||