Use resourceful routes for terms view/accept/decline

This commit is contained in:
Anton Khorev 2025-01-04 14:25:47 +03:00
parent 44843c1dd7
commit 606b5c1b6a
15 changed files with 204 additions and 171 deletions

View file

@ -0,0 +1,45 @@
<p id="first">
<%= @text["intro"] %>
<%= @text["next_with_decline"] %>
</p>
<h3><%= @text["introduction"] %></h3>
<ol>
<li>
<p><%= @text["section_1"] %></p>
<% unless @text['section_1a'].nil? %>
<ol>
<li><%= @text["section_1a"] %></li>
<li><%= @text["section_1b"] %></li>
</ol>
<% end %>
</li>
</ol>
<h3><%= @text["rights_granted"] %></h3>
<ol start="2">
<li>
<p><%= @text["section_2"] %></p>
</li>
<li>
<p><%= @text["section_3"] %></p>
<p><%= @text["active_defn_1"] %></p>
<p><%= @text["active_defn_2"] %></p>
</ul>
</li>
<li>
<p><%= @text["section_4"] %></p>
</li>
<li>
<p><%= @text["section_5"] %></p>
</li>
</ol>
<h3><%= @text["limitation_of_liability"] %></h3>
<ol start="6">
<li><p><%= @text["section_6"] %></p></li>
<li><p><%= @text["section_7"] %></p></li>
</ol>
<h3><%= @text["miscellaneous"] %></h3>
<ol start="8">
<li>
<p id="last"><%= @text["section_8"] %></p>
</li>
</ol>

View file

@ -0,0 +1 @@
<%= t ".terms_declined_html", :terms_declined_link => link_to(t(".terms_declined_link"), t(".terms_declined_url")) %>

View file

@ -0,0 +1,84 @@
<% content_for :head do %>
<%= javascript_include_tag "user" %>
<% end %>
<% content_for :heading_class, "pb-0" %>
<% content_for :heading do %>
<div class='header-illustration new-user-terms'>
<h1><%= t ".heading" %></h1>
</div>
<% end %>
<%= form_tag account_terms_path, :method => :put do %>
<!-- legale is <%= @legale %> -->
<p class="text-body-secondary"><%= t ".read and accept with tou" %></p>
<h4>
<%= t ".heading_ct" %>
</h4>
<p class="text-body-secondary"><%= t ".contributor_terms_explain" %></p>
<label class="form-label">
<%= t ".legale_select" %>
</label>
<div class="mb-3">
<% [%w[france FR], %w[italy IT], %w[rest_of_world GB]].each do |name, legale| %>
<div class="form-check form-check-inline">
<%= radio_button_tag "legale", legale, @legale == legale, :data => { :url => url_for(:legale => legale) }, :class => "form-check-input" %>
<label for="legale_<%= legale %>" class="form-check-label">
<%= t(".legale_names.#{name}") %>
</label>
</div>
<% end %>
</div>
<div id="contributorTerms" class="legale border border-secondary-subtle rounded">
<%= render :partial => "terms" %>
</div>
<div>
<p id="contributorGuidance" class="text-body-secondary">
<%= t ".guidance_info_html",
:readable_summary_link => link_to(t(".readable_summary"),
"https://www.osmfoundation.org/wiki/License/Contributor_Terms_Summary"),
:informal_translations_link => link_to(t(".informal_translations"),
"https://www.osmfoundation.org/wiki/License/Contributor_Terms/Informal_Translations") %>
</p>
</div>
<div class="mb-3">
<div class="form-check">
<%= check_box_tag "read_ct", "1", false, :class => "form-check-input" %>
<label for="read_ct" class="form-check-label">
<%= t ".read_ct" %>
</label>
</div>
</div>
<h4>
<%= t "layouts.tou" %>
</h4>
<p class="text-body-secondary"><%= t ".tou_explain_html", :tou_link => link_to(t("layouts.tou"), "https://wiki.osmfoundation.org/wiki/Terms_of_Use", :target => :new) %></p>
<div class="mb-3">
<div class="form-check">
<%= check_box_tag "read_tou", "1", false, :class => "form-check-input" %>
<label for="read_tou" class="form-check-label">
<%= t ".read_tou" %>
</label>
</div>
</div>
<%= hidden_field_tag("referer", h(params[:referer])) unless params[:referer].nil? %>
<div class="mb-3">
<%= submit_tag(t(".continue"), :name => "continue", :id => "continue", :disabled => true, :class => "btn btn-primary") %>
<%= submit_tag(t(".cancel"), :name => "decline", :id => "decline", :class => "btn btn-outline-secondary") %>
</div>
<div class="mb-3">
<div class="form-check">
<%= check_box("user", "consider_pd", :class => "form-check-input") %>
<label for="user_consider_pd" class="form-check-label">
<%= t ".consider_pd" %>
</label>
<span class="minorNote">(<%= link_to(t(".consider_pd_why"), t(".consider_pd_why_url"), :target => :new) %>)</span>
</div>
<% end %>