about summary refs log tree commit diff stats
path: root/app/views/admin/games
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2019-03-12 21:50:00 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2019-03-12 21:50:00 -0400
commit7789e2138fc0479846c20bc68d68973636a4a760 (patch)
treeef14af7a0a6e0de8f086a2b2db877840eb48904c /app/views/admin/games
parent7a2d945f581c8ce9e322883ec597366143fe10cb (diff)
downloadthoughts-7789e2138fc0479846c20bc68d68973636a4a760.tar.gz
thoughts-7789e2138fc0479846c20bc68d68973636a4a760.tar.bz2
thoughts-7789e2138fc0479846c20bc68d68973636a4a760.zip
Started game tracker
Diffstat (limited to 'app/views/admin/games')
-rw-r--r--app/views/admin/games/_form.html.haml23
-rw-r--r--app/views/admin/games/edit.html.haml3
-rw-r--r--app/views/admin/games/index.html.haml13
-rw-r--r--app/views/admin/games/new.html.haml3
4 files changed, 42 insertions, 0 deletions
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 @@
1%fieldset#content
2 .title-field
3 = f.label :title
4 = f.text_field :title, placeholder: "Title"
5 .description-field
6 = f.label :description
7 = f.cktext_area :description
8%fieldset#details
9 - if f.object.errors.any?
10 #errors.details-module
11 %h3 Error!
12 %ul
13 - f.object.errors.full_messages.each do |error|
14 %li= error
15 .details-module
16 .progress-field
17 = f.label :progress
18 = f.text_area :progress
19 .details-module
20 .status-field
21 = f.select :status, options_for_select(Game.status.values)
22 = f.label :status
23 .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 @@
1- title "Editing #{@game.title}"
2= form_for @game, url: admin_game_url(@game), html: { id: "entry-form" } do |f|
3 = 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 @@
1- title "Games"
2%table#entries
3 %tr
4 %th Title
5 %th Date published
6 %th
7 - @games.each do |game|
8 %tr{ class: cycle("even", "odd") }
9 %td= game.title
10 %td= game.created_at.strftime("%B %d, %Y, %l:%M%P")
11 %td
12 %ul.admin-actions
13 %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 @@
1- title "New game"
2= form_for @game, url: admin_games_url, html: { id: "entry-form" } do |f|
3 = render partial: "form", locals: { f: f }