]> git.openstreetmap.org Git - rails.git/commitdiff
Refactor contributor terms using new form styles
authorThomas Levine <occurrence@thomaslevine.com>
Mon, 10 Jun 2013 19:09:38 +0000 (15:09 -0400)
committerTom Hughes <tom@compton.nu>
Mon, 8 Jul 2013 08:03:16 +0000 (09:03 +0100)
app/assets/stylesheets/common.css.scss
app/views/user/terms.html.erb

index c05262b69e004c6aa33b7156a4b30bf45a76ca78..599cce32d2908fbcbbea0ed6e779923a6a9958ae 100644 (file)
@@ -1236,45 +1236,50 @@ ul.results-list li { border-bottom: 1px solid #ccc; }
 
 /* Rules for the account confirmation page */
 
-div#contributorTerms {
-  border: 1px solid #ccc;
-  padding: 20px;
-  margin-bottom: 20px;
-  overflow: auto;
-  height: 398px;
-}
-
-div#contributorTerms p#last {
-  margin-bottom: 0px;
-}
-
-div#contributorTerms ol {
-  margin-bottom: 0px;
-}
-
-div#contributorTerms img {
-  display: block;
-  margin: 20px auto inherit auto;
-}
-
-form#termsForm div#buttons {
-  float: right;
-}
-
-form#termsForm input#agree {
-  margin-left: 40px;
-}
-
-div#slim_content form#termsForm {
-  width: auto;
-}
-
-p#contributorGuidance {
-  background-color: #f4f4ff;
-  border-radius: 4px;
-  -moz-border-radius: 4px;
-  margin-top: 20px;
-  padding: 10px;
+#terms {
+  .legale {
+    border: 1px solid #ccc;
+    padding: 20px;
+    margin-bottom: 20px;
+    overflow: auto;
+    height: 10em;
+  
+    &:p#last {
+      margin-bottom: 0px;
+    }
+    
+    &:ol {
+      margin-bottom: 0px;
+    }
+    
+    &:img {
+      display: block;
+      margin: 20px auto inherit auto;
+    }
+  }
+  
+  form.sign {
+    input[type=submit] {
+      float: left;
+    }
+    #decline {
+      background: #AAA;
+      &:hover {
+        background: #777;
+      }
+    }
+  }
+  fieldset {
+    margin-bottom: 20px;
+  }
+  #contributorGuidance {
+    background-color: #f4f4ff;
+    border-radius: 4px;
+    -moz-border-radius: 4px;
+  }
+  .signing-buttons {
+    height: 50px;
+  }
 }
 
 /* Rules for the account settings page */
index a2d33e36e55b0b9bd5af4e960807f312ed03a378..31cc605e7495c1c6bab5edf14235dfc41a90e4ae 100644 (file)
@@ -2,44 +2,44 @@
   <h1><%= t 'user.terms.heading' %></h1>
 <% end %>
 
-<p><%= t 'user.terms.read and accept' %></p>
-
-<!-- legale is <%= @legale %> -->
-<%= form_tag :action => 'terms' do %>
-  <p>
-    <%= t 'user.terms.legale_select' %>
-    <% [['france', 'FR'], ['italy', 'IT'], ['rest_of_world', 'GB']].each do |name,legale| %>
-      <%= radio_button_tag 'legale', legale, @legale == legale %>
-      <%= label_tag "legale_#{legale}", t('user.terms.legale_names.' + name) %>
-      <script type="text/javascript">
-      <!--
-        $("#legale_<%= legale %>").change(function () {
-          $("#contributorTerms").html("<%=j image_tag 'searching.gif' %>");
-          $("#contributorTerms").load("<%= url_for :legale => legale %>");
-        });
-      // -->
-      </script>
+<div id="terms">
+  <div class="directions">
+    <p><%= t 'user.terms.read and accept' %></p>
+    
+    <!-- legale is <%= @legale %> -->
+    <%= form_tag :action => 'terms' do %>
+      <p><%= t 'user.terms.legale_select' %></p>
+      <fieldset>
+      <% [['france', 'FR'], ['italy', 'IT'], ['rest_of_world', 'GB']].each do |name,legale| %>
+        <%= radio_button_tag 'legale', legale, @legale == legale %>
+        <%= label_tag "legale_#{legale}", t('user.terms.legale_names.' + name) %>
+        <script type="text/javascript">
+        <!--
+          $("#legale_<%= legale %>").change(function () {
+            $("#contributorTerms").html("<%=j image_tag 'searching.gif' %>");
+            $("#contributorTerms").load("<%= url_for :legale => legale %>");
+          });
+        // -->
+        </script>
+      <% end %>
+      </fieldset>
     <% end %>
-  </p>
-<% end %>
-
-<div id="contributorTerms">
-  <%= render :partial => "terms" %>
-</div>
-
-<%= form_tag({:action => "save"}, { :id => "termsForm" }) do %>
-  <p>
-    <label for="confirm_pd_checkbox"><%= t 'user.terms.consider_pd' %></label>
-    <%= check_box('user', 'consider_pd') %>
-    <span class="minorNote">(<%= link_to(t('user.terms.consider_pd_why'), t('user.terms.consider_pd_why_url'), :target => :new)%>)</span>
-  </p>
-  <p>
+  </div> 
+  <div class="legale">
+    <%= render :partial => "terms" %>
+  </div>
+  
+  <%= form_tag({:action => "save"}, { :class => "sign" }) do %>
+    <p>
+      <label for="confirm_pd_checkbox"><%= t 'user.terms.consider_pd' %></label>
+      <%= check_box('user', 'consider_pd') %>
+      <span class="minorNote">(<%= link_to(t('user.terms.consider_pd_why'), t('user.terms.consider_pd_why_url'), :target => :new)%>)</span>
+    </p>
     <%= hidden_field_tag('referer', h(params[:referer])) unless params[:referer].nil? %>
-    <div id="buttons">
-      <%= submit_tag(t('user.terms.decline'), :name => "decline", :id => "decline") %>
+    <div class="signing-buttons">
       <%= submit_tag(t('user.terms.agree'), :name => "agree", :id => "agree") %>
+      <%= submit_tag(t('user.terms.decline'), :name => "decline", :id => "decline") %>
     </div>
-  </p>
-  <br clear="all" />
-  <p id="contributorGuidance"><%= raw t 'user.terms.guidance', :summary => 'http://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary', :translations => 'http://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations' %></p>
-<% end %>
+    <p id="contributorGuidance"><%= raw t 'user.terms.guidance', :summary => 'http://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary', :translations => 'http://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations' %></p>
+  <% end %>
+</terms>