From dc0603153c6d1a9e05795f4c334167ce0326b82a Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Thu, 17 Apr 2014 21:26:25 +0100 Subject: [PATCH] Added teams edit page styling --- app/assets/stylesheets/components/_forms.scss | 17 ++- app/assets/stylesheets/pages/_teams.scss | 12 ++ app/views/teams/edit.html.erb | 114 ++++++++++-------- 3 files changed, 91 insertions(+), 52 deletions(-) diff --git a/app/assets/stylesheets/components/_forms.scss b/app/assets/stylesheets/components/_forms.scss index 335b219..f4d1ccf 100644 --- a/app/assets/stylesheets/components/_forms.scss +++ b/app/assets/stylesheets/components/_forms.scss @@ -46,6 +46,7 @@ form { position: relative; display: inline-block; margin-right: em(10); + float: left; select { @include appearance(none); @@ -234,18 +235,32 @@ form.square { line-height: em(16); } - .inputs, input[type=text], input[type=password], input[type=email], textarea { @include span-columns(9); } + + .inputs { + @include span-columns(9); + + input[type=text], + input[type=password], + input[type=email] { + width: 100%; + } + } } .controls { @include span-columns(9); @include shift(3); + + &.inline { + margin-left: 0; + width: auto; + } } } diff --git a/app/assets/stylesheets/pages/_teams.scss b/app/assets/stylesheets/pages/_teams.scss index 4b9c1bc..e088654 100644 --- a/app/assets/stylesheets/pages/_teams.scss +++ b/app/assets/stylesheets/pages/_teams.scss @@ -27,6 +27,18 @@ width: 20%; text-align: right; } + + &.edit { + @include span-columns(12); + + h1 { + margin-bottom: 1em; + } + + .tabbed-contents { + margin-bottom: em(20); + } + } } /* diff --git a/app/views/teams/edit.html.erb b/app/views/teams/edit.html.erb index e1a551b..b053792 100644 --- a/app/views/teams/edit.html.erb +++ b/app/views/teams/edit.html.erb @@ -1,56 +1,58 @@ -

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

+
+

Manage Team: <%=h @team.name %>

-
-
    -
  • Details
  • -
  • Members
  • -
  • Contests
  • + -
    -
    - <%= form_for @team, :html => {:multipart => true} do |f| %> +
    +
    + <%= form_for @team, html: { multipart: true, class: 'square' } do |f| %> <%= f.error_messages %> -

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

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

    -

    - <%= f.label :irc %>
    +

    +
    + <%= f.label :irc %> <%= f.text_field :irc %> -

    -

    - <%= f.label :web %>
    +

    +
    + <%= f.label :web %> <%= f.text_field :web %> -

    -

    - <%= f.label :tag %>
    +

    +
    + <%= f.label :tag %> <%= f.text_field :tag %> -

    -

    - <%= f.label :country %>
    +

    +
    + <%= f.label :country %> <%= country_code_select :team, :country %> -

    -

    - <%= f.label :comment %>
    +

    +
    + <%= f.label :comment %> <%= f.text_field :comment %> -

    -

    - <%= f.label :recruiting %>
    - <%= f.text_field :recruiting %>
    - Leave empty if you are not recruiting, otherwise write the recruiting criteria above. -

    -

    - <%= f.label :logo %>
    - <%= f.file_field :logo %>
    -

    -

    +

    +
    + <%= f.label :recruiting %> +
    + <%= f.text_field :recruiting %> +

    Leave empty if you are not recruiting, otherwise write the recruiting criteria above.

    +
    +
    +
    + <%= f.label :logo %> + <%= f.file_field :logo %> +
    +
    <%= f.submit "Update" %> -

    +
    <% end %>
    -
    +
    <%= form_for @team do |f| %> @@ -60,8 +62,8 @@ <% @team.teamers.present.each do |member| %> - - + <% end %>
    Actions
    id="teamsPrimary"<% end %>> +
    <%= link_to (h member.user.username), member.user %> @@ -71,23 +73,31 @@ <%= select_tag "rank[#{member.id}]", options_for_select(member.ranks.invert, member.rank) %> - <%= link_to 'Remove', member, :confirm => 'Are you sure?', :method => :delete%> + <%= link_to member, confirm: 'Are you sure?', method: :delete, class: 'button tiny' do %> + <%= icon 'times' %> Remove + <% end %>
    -

    +

    <%= f.submit "Update" %> -

    +
    <% end %>
    -
    +

    - <%= form_for @team.contesters.build do |f| %> + <%= form_for @team.contesters.build, html: { class: 'square' } do |f| %> <%= f.hidden_field :team_id %> - <%= f.collection_select :contest_id, Contest.active, :id, :name %> - <%= f.submit "Join" %> + +

    + <%= f.collection_select :contest_id, Contest.active, :id, :name %> +
    + +
    + <%= f.submit "Join" %> +
    <% end %>

    @@ -95,8 +105,10 @@
    -<%= link_to 'Show', @team %> | -<%= link_to 'Back', teams_path %> +<%= link_to 'Show', @team, class: 'button' %> +<%= link_to 'Back', teams_path, class: 'button' %>