From 8e15dbd73035c2a2198a2828a20ddcebe0739823 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 3 Jul 2018 13:58:57 -0400 Subject: Implemented streams Currently there are no links to the pages for editing stream updates, and the admin panel for managing streams could probably have a better look & feel, but here's some basic working functionality. refs #8 --- app/views/admin/updates/_form.html.haml | 22 ++++++++++++++++++++++ app/views/admin/updates/edit.html.haml | 2 ++ app/views/admin/updates/new.html.haml | 2 ++ 3 files changed, 26 insertions(+) create mode 100644 app/views/admin/updates/_form.html.haml create mode 100644 app/views/admin/updates/edit.html.haml create mode 100644 app/views/admin/updates/new.html.haml (limited to 'app/views/admin/updates') diff --git a/app/views/admin/updates/_form.html.haml b/app/views/admin/updates/_form.html.haml new file mode 100644 index 0000000..9dd8741 --- /dev/null +++ b/app/views/admin/updates/_form.html.haml @@ -0,0 +1,22 @@ +%fieldset#content + .title-field + = f.label :title + = f.text_field :title, value: @stream.title, readonly: true + .body-field + = f.label :body + = f.cktext_area :body +%fieldset#details + - if f.object.errors.any? + #errors.details-module + %h3 Error! + %ul + - f.object.errors.full_messages.each do |error| + %li= error + .details-module + = f.fields_for :records, Record.new do |builder| + .should-create-record-field + = builder.check_box :_destroy, {checked: false}, "0", "1" + = builder.label :_destroy, "Create record?" + .record-description-field + = builder.text_area :description, placeholder: "record text" + .details-module= f.submit diff --git a/app/views/admin/updates/edit.html.haml b/app/views/admin/updates/edit.html.haml new file mode 100644 index 0000000..5651d23 --- /dev/null +++ b/app/views/admin/updates/edit.html.haml @@ -0,0 +1,2 @@ += form_for @update, url: admin_stream_update_url(@stream, @update), html: { id: "entry-form" } do |f| + = render partial: "form", locals: { f: f } diff --git a/app/views/admin/updates/new.html.haml b/app/views/admin/updates/new.html.haml new file mode 100644 index 0000000..14c6d77 --- /dev/null +++ b/app/views/admin/updates/new.html.haml @@ -0,0 +1,2 @@ += form_for @update, url: admin_stream_updates_url(@stream), html: { id: "entry-form" } do |f| + = render partial: "form", locals: { f: f } -- cgit 1.4.1