From 4fa554e8b0a475052a44a46829d261bba1392af3 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Thu, 27 Mar 2014 20:51:47 +0100 Subject: [PATCH 1/2] Brand index page --- app/assets/stylesheets/application.css | 1 + .../stylesheets/jumbotron-narrow.css.scss | 71 +++++++++++++++++++ app/views/welcome/index.html.erb | 21 ++++-- 3 files changed, 89 insertions(+), 4 deletions(-) create mode 100644 app/assets/stylesheets/jumbotron-narrow.css.scss diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 1942ffb0..56ff1329 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -25,3 +25,4 @@ footer { .nowrap { white-space: nowrap; } + diff --git a/app/assets/stylesheets/jumbotron-narrow.css.scss b/app/assets/stylesheets/jumbotron-narrow.css.scss new file mode 100644 index 00000000..85f9a718 --- /dev/null +++ b/app/assets/stylesheets/jumbotron-narrow.css.scss @@ -0,0 +1,71 @@ +/* Everything but the jumbotron gets side spacing for mobile first views */ +.header, +.marketing, +.footer { + padding-right: 15px; + padding-left: 15px; +} + +/* Custom page header */ +.header { + border-bottom: 1px solid #e5e5e5; +} +/* Make the masthead heading the same height as the navigation */ +.header h3 { + padding-bottom: 19px; + margin-top: 0; + margin-bottom: 0; + line-height: 40px; +} + +/* Custom page footer */ +.footer { + padding-top: 19px; + color: #777; + border-top: 1px solid #e5e5e5; +} + +/* Customize container */ +@media (min-width: 768px) { + .container-index { + max-width: 730px; + margin: 0 auto; + } +} +.container-narrow > hr { + margin: 30px 0; +} + +/* Main marketing message and sign up button */ +.jumbotron { + text-align: center; + border-bottom: 1px solid #e5e5e5; + padding-top: 30px; +} + +/* Supporting marketing content */ +.marketing, #resultscontainer { + margin: 40px 0; +} +.marketing p + h4 { + margin-top: 28px; +} + +/* Responsive: Portrait tablets and up */ +@media screen and (min-width: 768px) { + /* Remove the padding we set earlier */ + .header, + .marketing, + .footer { + padding-right: 0; + padding-left: 0; + } + /* Space out the masthead */ + .header { + margin-bottom: 30px; + } + /* Remove the bottom border on the jumbotron for visual effect */ + .jumbotron { + border-bottom: 0; + } +} diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 7d81b2df..cfd0c347 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -1,8 +1,21 @@ - <%= render partial: 'flash' %> -

Welcome!

+
+
+

Welcome!

+

Welcome to Gandalf, an online event management service brought to you by Zeus WPI and FaculteitenKonvent Gent.

+
+ +
+
+

Guests

+

Click on <%= link_to "Events", events_path %> in the menu to register or buy tickets for an event.

+
-

Welcome to Gandalf, an online event management service brought to you by Zeus WPI and FaculteitenKonvent Gent

+
+

FK Praesidia

+

FK Praesidia can <%= link_to "log in", new_user_session_path %> using their UGent credentials and create events.

+
+
+
-

Click on <%= link_to "Events", events_path %> in the menu to register or buy tickets for an event.

From 61cdd8b65ba84a73a4aaa48fa07b65edc4733bcc Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Thu, 27 Mar 2014 21:15:57 +0100 Subject: [PATCH 2/2] Fix forms on firefox --- app/views/access_levels/_form.html.erb | 6 ++++-- app/views/access_levels/update.js.erb | 3 +++ app/views/partners/_form.html.erb | 6 ++++-- app/views/partners/update.js.erb | 3 +++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/views/access_levels/_form.html.erb b/app/views/access_levels/_form.html.erb index 33e1f29e..18c53f66 100644 --- a/app/views/access_levels/_form.html.erb +++ b/app/views/access_levels/_form.html.erb @@ -7,13 +7,15 @@ <%= form_check_box f, :member_only %>
<%= f.check_box :has_comment %>
<%= f.check_box :hidden %>
- <%= f.button button_name, class: 'btn btn-sm btn-primary' %> + <%= f.button button_name, class: 'btn btn-sm btn-primary' %> <%= javascript_tag do %> - var id = "#<%=dom_id(f.object) %>"; + var id = "#<% if button_name == 'Save' %>edit_<% end %><%= dom_id(f.object) %>"; var inputs = $(id).parent().find('input'); + $(id).parent().find('button').on('click', function(e) { e.preventDefault(); $(id).append(inputs.clone()); + $(id).append(''); $(id).submit(); }); <% end %> diff --git a/app/views/access_levels/update.js.erb b/app/views/access_levels/update.js.erb index 89d09658..89eded1f 100644 --- a/app/views/access_levels/update.js.erb +++ b/app/views/access_levels/update.js.erb @@ -3,4 +3,7 @@ <% else %> $('#access-level-errors').html('') $('#edit_<%= dom_id(@access_level) %>').parent().replaceWith("<%=j render @access_level, advanced: false %>"); + + var id = "#new_access_level"; + var inputs = $(id).parent().find('input'); <% end %> diff --git a/app/views/partners/_form.html.erb b/app/views/partners/_form.html.erb index b2f2aec0..c947d738 100644 --- a/app/views/partners/_form.html.erb +++ b/app/views/partners/_form.html.erb @@ -4,15 +4,17 @@ <%= f.email_field :email, class: 'form-control' %> <%= f.collection_select :access_level, object.event.access_levels, :id, :name_with_price, {}, { class: "form-control" } %> - <%= f.button button_name, class: 'btn btn-sm btn-primary' %> + <%= f.button button_name, class: 'btn btn-sm btn-primary' %> <%= javascript_tag do %> - var id = "#<%= dom_id(f.object) %>"; + var id = "#<% if button_name == 'Save' %>edit_<% end %><%= dom_id(f.object) %>"; var inputs = $(id).parent().find('input'); var select = $(id).parent().find('select'); + $(id).parent().find('button').on('click', function(e) { e.preventDefault(); $(id).append(inputs.clone()); $(id).append(""); + $(id).append(''); $(id).submit(); }); <% end %> diff --git a/app/views/partners/update.js.erb b/app/views/partners/update.js.erb index 6f3014be..2a4e02c6 100644 --- a/app/views/partners/update.js.erb +++ b/app/views/partners/update.js.erb @@ -3,4 +3,7 @@ <% else %> $('#partner-errors').html('') $('#edit_<%= dom_id(@partner) %>').parent().replaceWith("<%= j render @partner %>"); + + var id = "#new_partner"; + var inputs = $(id).parent().find('input'); <% end %>