From e47e83cf6bded3d1924b4d500193e7876833ef83 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 2 Jul 2017 13:03:43 -0400 Subject: Created admin panel Currently allows you to create and edit blogs, including associated records. Uses a WYSIWYG editor that allows uploading images. Also included jQuery :( --- app/views/admin/blogs/_form.html.haml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/views/admin/blogs/_form.html.haml (limited to 'app/views/admin/blogs/_form.html.haml') 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 @@ +- if f.object.errors.any? + %ul#errors + - f.object.errors.full_messages.each do |error| + %li= error +%fieldset#content + .title-field + = f.label :title + = f.text_field :title, placeholder: "Title" + .slug-field + = f.label :slug, "https://feffernoo.se/says/" + = f.text_field :slug, placeholder: "insert-slug-here" + .body-field + = f.label :body + = f.cktext_area :body +%fieldset#details + .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 -- cgit 1.4.1