From 60130f8a1662db6688ca7607745e632796949d5d Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Sat, 26 Apr 2014 02:50:32 +0100 Subject: [PATCH] Added styling to weeks and contester form pages --- app/views/contesters/edit.html.erb | 62 +++++++++++++----------------- app/views/weeks/_form.html.erb | 50 ++++++++++++------------ app/views/weeks/edit.html.erb | 6 +-- app/views/weeks/new.html.erb | 6 +-- 4 files changed, 56 insertions(+), 68 deletions(-) diff --git a/app/views/contesters/edit.html.erb b/app/views/contesters/edit.html.erb index 2bae14c..5e90b6c 100644 --- a/app/views/contesters/edit.html.erb +++ b/app/views/contesters/edit.html.erb @@ -1,40 +1,32 @@ -

Editing: <%= h @contester.team.name %> in <%= h @contester.contest.name %>

+
+

Editing: <%= h @contester.team.name %>

+

<%= h @contester.contest.name %>

-
- <%= form_for(@contester) do |f| %> -
-
    - <% @contester.errors.full_messages.each do |msg| %> -
  • <%= msg %>
  • - <% end %> -
+ <%= form_for @contester, html: { class: 'square' } do |f| %> + <%= render 'shared/errors', messages: @contester.errors.full_messages %> + +
+ <%= f.label :extra, "Extra Points" %> + <%= f.text_field :extra %>
- -

- <%= f.label :extra, "Extra Points" %>
- <%= f.text_field :extra, :size => 5 %> -

-

- <%= f.label :score %>
- <%= f.text_field :score, :size => 5 %> -

-

- <%= f.label :win %>
- <%= f.text_field :win, :size => 5 %> -

-

- <%= f.label :loss %>
- <%= f.text_field :loss, :size => 5 %> -

-

- <%= f.label :draw %>
- <%= f.text_field :draw, :size => 5 %> -

-

+

+ <%= f.label :score %> + <%= f.text_field :score %> +
+
+ <%= f.label :win %> + <%= f.text_field :win %> +
+
+ <%= f.label :loss %> + <%= f.text_field :loss %> +
+
+ <%= f.label :draw %> + <%= f.text_field :draw %> +
+
<%= f.submit 'Update' %> -

+
<% end %>
- -<%= link_to 'Show', @contester %> | -<%= link_to 'Back', @contester.contest %> diff --git a/app/views/weeks/_form.html.erb b/app/views/weeks/_form.html.erb index 7f0ecf0..40530e4 100644 --- a/app/views/weeks/_form.html.erb +++ b/app/views/weeks/_form.html.erb @@ -1,26 +1,26 @@ -
- <%= form_for(@week) do |f| %> - <%= f.error_messages %> - <%= f.hidden_field :contest_id %> +

<%= @week.contest if @week.contest %>

-

- <%= f.label :name %>
- <%= f.text_field :name %> -

-

- <%= f.label :start_date %>
- <%= f.date_select :start_date %> -

-

- <%= f.label :map1_id, "1st map" %>
- <%= f.select :map1_id, @week.contest.maps.basic.collect{|m| [m.name, m.id]} %> -

-

- <%= f.label :map2_id, "2nd map" %>
- <%= f.select :map2_id, @week.contest.maps.basic.collect{|m| [m.name, m.id]} %> -

-

- <%= f.submit 'Save' %> -

- <% end %> -
+<%= form_for @week, html: { class: 'square' } do |f| %> + <%= render 'shared/errors', messages: @week.errors.full_messages %> + <%= f.hidden_field :contest_id %> + +
+ <%= f.label :name %> + <%= f.text_field :name %> +
+
+ <%= f.label :start_date %> + <%= f.date_select :start_date %> +
+
+ <%= f.label :map1_id, "1st map" %> + <%= f.select :map1_id, @week.contest.maps.basic.collect{|m| [m.name, m.id]} %> +
+
+ <%= f.label :map2_id, "2nd map" %> + <%= f.select :map2_id, @week.contest.maps.basic.collect{|m| [m.name, m.id]} %> +
+
+ <%= f.submit 'Save Week' %> +
+<% end %> diff --git a/app/views/weeks/edit.html.erb b/app/views/weeks/edit.html.erb index 94032f2..15dddb8 100644 --- a/app/views/weeks/edit.html.erb +++ b/app/views/weeks/edit.html.erb @@ -1,5 +1,3 @@ -

Editing week

+

Editing Week

-<%= render :partial => "form" %> - -<%= link_to 'Back', @contest %> \ No newline at end of file +<%= render partial: 'form' %> diff --git a/app/views/weeks/new.html.erb b/app/views/weeks/new.html.erb index e33b541..5317aec 100644 --- a/app/views/weeks/new.html.erb +++ b/app/views/weeks/new.html.erb @@ -1,5 +1,3 @@ -

New week

+

New Week

-<%= render :partial => "form" %> - -<%= link_to 'Back', weeks_path %> \ No newline at end of file +<%= render partial: 'form' %>