From 7789e2138fc0479846c20bc68d68973636a4a760 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Tue, 12 Mar 2019 21:50:00 -0400 Subject: Started game tracker --- app/views/admin/games/_form.html.haml | 23 +++++++++++++++++++++++ app/views/admin/games/edit.html.haml | 3 +++ app/views/admin/games/index.html.haml | 13 +++++++++++++ app/views/admin/games/new.html.haml | 3 +++ 4 files changed, 42 insertions(+) create mode 100644 app/views/admin/games/_form.html.haml create mode 100644 app/views/admin/games/edit.html.haml create mode 100644 app/views/admin/games/index.html.haml create mode 100644 app/views/admin/games/new.html.haml (limited to 'app/views/admin/games') diff --git a/app/views/admin/games/_form.html.haml b/app/views/admin/games/_form.html.haml new file mode 100644 index 0000000..4b17664 --- /dev/null +++ b/app/views/admin/games/_form.html.haml @@ -0,0 +1,23 @@ +%fieldset#content + .title-field + = f.label :title + = f.text_field :title, placeholder: "Title" + .description-field + = f.label :description + = f.cktext_area :description +%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 + .progress-field + = f.label :progress + = f.text_area :progress + .details-module + .status-field + = f.select :status, options_for_select(Game.status.values) + = f.label :status + .details-module= f.submit diff --git a/app/views/admin/games/edit.html.haml b/app/views/admin/games/edit.html.haml new file mode 100644 index 0000000..d7a480b --- /dev/null +++ b/app/views/admin/games/edit.html.haml @@ -0,0 +1,3 @@ +- title "Editing #{@game.title}" += form_for @game, url: admin_game_url(@game), html: { id: "entry-form" } do |f| + = render partial: "form", locals: { f: f } diff --git a/app/views/admin/games/index.html.haml b/app/views/admin/games/index.html.haml new file mode 100644 index 0000000..96c69b8 --- /dev/null +++ b/app/views/admin/games/index.html.haml @@ -0,0 +1,13 @@ +- title "Games" +%table#entries + %tr + %th Title + %th Date published + %th + - @games.each do |game| + %tr{ class: cycle("even", "odd") } + %td= game.title + %td= game.created_at.strftime("%B %d, %Y, %l:%M%P") + %td + %ul.admin-actions + %li= link_to "Edit", edit_admin_game_url(game) diff --git a/app/views/admin/games/new.html.haml b/app/views/admin/games/new.html.haml new file mode 100644 index 0000000..00dfb92 --- /dev/null +++ b/app/views/admin/games/new.html.haml @@ -0,0 +1,3 @@ +- title "New game" += form_for @game, url: admin_games_url, html: { id: "entry-form" } do |f| + = render partial: "form", locals: { f: f } -- cgit 1.4.1