diff options
Diffstat (limited to 'app/views/admin/streams')
-rw-r--r-- | app/views/admin/streams/_form.html.haml | 25 | ||||
-rw-r--r-- | app/views/admin/streams/edit.html.haml | 2 | ||||
-rw-r--r-- | app/views/admin/streams/index.html.haml | 13 | ||||
-rw-r--r-- | app/views/admin/streams/new.html.haml | 2 |
4 files changed, 42 insertions, 0 deletions
diff --git a/app/views/admin/streams/_form.html.haml b/app/views/admin/streams/_form.html.haml new file mode 100644 index 0000000..ce457cb --- /dev/null +++ b/app/views/admin/streams/_form.html.haml | |||
@@ -0,0 +1,25 @@ | |||
1 | %fieldset#content | ||
2 | .title-field | ||
3 | = f.label :title | ||
4 | = f.text_field :title, placeholder: "Title" | ||
5 | .slug-field | ||
6 | = f.label :slug, "https://feffernoo.se/thinks/" | ||
7 | = f.text_field :slug, placeholder: "insert-slug-here" | ||
8 | .body-field | ||
9 | = f.label :body | ||
10 | = f.cktext_area :body | ||
11 | %fieldset#details | ||
12 | - if f.object.errors.any? | ||
13 | #errors.details-module | ||
14 | %h3 Error! | ||
15 | %ul | ||
16 | - f.object.errors.full_messages.each do |error| | ||
17 | %li= error | ||
18 | .details-module | ||
19 | = f.fields_for :records, Record.new do |builder| | ||
20 | .should-create-record-field | ||
21 | = builder.check_box :_destroy, {checked: false}, "0", "1" | ||
22 | = builder.label :_destroy, "Create record?" | ||
23 | .record-description-field | ||
24 | = builder.text_area :description, placeholder: "record text" | ||
25 | .details-module= f.submit | ||
diff --git a/app/views/admin/streams/edit.html.haml b/app/views/admin/streams/edit.html.haml new file mode 100644 index 0000000..1b58331 --- /dev/null +++ b/app/views/admin/streams/edit.html.haml | |||
@@ -0,0 +1,2 @@ | |||
1 | = form_for @stream, url: admin_stream_url(@stream), html: { id: "entry-form" } do |f| | ||
2 | = render partial: "form", locals: { f: f } | ||
diff --git a/app/views/admin/streams/index.html.haml b/app/views/admin/streams/index.html.haml new file mode 100644 index 0000000..c69c6f9 --- /dev/null +++ b/app/views/admin/streams/index.html.haml | |||
@@ -0,0 +1,13 @@ | |||
1 | %table#entries | ||
2 | %tr | ||
3 | %th Title | ||
4 | %th Date created | ||
5 | %th | ||
6 | - @streams.each do |stream| | ||
7 | %tr{ class: cycle("even", "odd") } | ||
8 | %td= stream.title | ||
9 | %td= stream.created_at.strftime("%B %d, %Y, %l:%M%P") | ||
10 | %td | ||
11 | %ul.admin-actions | ||
12 | %li= link_to "Edit", edit_admin_stream_url(stream) | ||
13 | %li= link_to "Add Update", new_admin_stream_update_url(stream) | ||
diff --git a/app/views/admin/streams/new.html.haml b/app/views/admin/streams/new.html.haml new file mode 100644 index 0000000..52febf5 --- /dev/null +++ b/app/views/admin/streams/new.html.haml | |||
@@ -0,0 +1,2 @@ | |||
1 | = form_for @stream, url: admin_streams_url, html: { id: "entry-form" } do |f| | ||
2 | = render partial: "form", locals: { f: f } | ||