Skip to content
Snippets Groups Projects
Commit 21272031 authored by pabois's avatar pabois
Browse files

mergre

parents 4eec7d84 3c052fae
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ class Wordpress
# https://github.com/rgrove/sanitize
def self.clean(html)
Sanitize.fragment html, Sanitize::Config::RELAXED
# html
end
def initialize(domain)
......
<h2><%= t(".resend_confirmation_instructions") %></h2>
<h2 class="mb-4"><%= t(".resend_confirmation_instructions") %></h2>
<%= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= f.error_notification %>
<%= f.full_error :confirmation_token %>
<div class="form-inputs">
<%= f.input :email,
required: true,
autofocus: true,
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email),
input_html: { autocomplete: "email" } %>
</div>
<div class="form-actions text-end mt-3">
<%= f.button :submit, t(".resend_confirmation_instructions"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
<div class="row">
<div class="col-md-6">
<%= f.input :email,
required: true,
autofocus: true,
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email),
input_html: { autocomplete: "email" } %>
</div>
<div class="col-md-6">
<label class="form-label">&nbsp;</label><br>
<%= f.button :submit, t(".resend_confirmation_instructions"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
</div>
</div>
<% end %>
<h2><%= t(".change_your_password") %></h2>
<h2 class="mb-4"><%= t(".change_your_password") %></h2>
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= f.error_notification %>
......@@ -30,9 +30,8 @@
input_html: { autocomplete: "new-password" } %>
</div>
<div class="form-actions text-end mt-3">
<div class="form-actions">
<%= f.button :submit, t(".change_my_password"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
<h2><%= t(".forgot_your_password") %></h2>
<h2 class="mb-4"><%= t(".forgot_your_password") %></h2>
<%= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :email,
required: true,
autofocus: true,
input_html: { autocomplete: "email" } %>
</div>
<div class="form-actions text-center mt-3">
<%= f.button :submit, t(".send_me_reset_password_instructions"), class: 'btn btn-primary' %>
<div class="row">
<div class="col-md-6">
<%= f.input :email,
required: true,
autofocus: true,
input_html: { autocomplete: "email" } %>
</div>
<div class="col-md-6">
<label class="form-label">&nbsp;</label><br>
<%= f.button :submit, t(".send_me_reset_password_instructions"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>
<h2><%= t(".title", resource: resource.model_name.human) %></h2>
<h2 class="mb-4"><%= t(".title", resource: resource.model_name.human) %></h2>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :first_name,
required: true,
autofocus: true,
input_html: { autocomplete: "first_name" } %>
<%= f.input :last_name,
required: true,
input_html: { autocomplete: "last_name" } %>
<%= f.input :email, required: true %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p><%= t(".currently_waiting_confirmation_for_email", email: resource.unconfirmed_email) %></p>
<% end %>
<%= f.input :mobile_phone %>
<%= f.association :language,
include_blank: false,
label_method: lambda { |l| t("languages.#{l.iso_code.to_s}") } %>
<%= f.input :picture,
as: :single_deletable_file,
input_html: { accept: '.png,.jpg' },
preview: '200x200' %>
<%= f.input :password,
hint: t(".leave_blank_if_you_don_t_want_to_change_it"),
required: false,
input_html: { autocomplete: "new-password" } %>
</div>
<div class="form-actions">
<%= f.button :submit, t(".update"), class: 'btn btn-primary' %>
<div class="row">
<div class="col-md-4">
<%= f.input :email, required: true %>
<%= f.input :first_name,
required: true,
autofocus: true,
input_html: { autocomplete: "first_name" } %>
<%= f.input :last_name,
required: true,
input_html: { autocomplete: "last_name" } %>
</div>
<div class="col-md-4">
<%= f.association :language,
include_blank: false,
label_method: lambda { |l| t("languages.#{l.iso_code.to_s}") } %>
<%= f.input :mobile_phone %>
</div>
<div class="col-md-4">
<%= f.input :password,
hint: t(".leave_blank_if_you_don_t_want_to_change_it"),
required: false,
input_html: { autocomplete: "new-password" } %>
<%= f.input :picture,
as: :single_deletable_file,
input_html: { accept: '.jpg,.jpeg,.png' },
preview: '200x200' %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<p><%= t(".currently_waiting_confirmation_for_email", email: resource.unconfirmed_email) %></p>
<% end %>
</div>
</div>
<%= f.button :submit, t(".update"), class: 'btn btn-primary' %>
<% end %>
<h3><%= t(".cancel_my_account") %></h3>
<h3 class="mt-5 mb-4"><%= t(".cancel_my_account") %></h3>
<p><%= t(".unhappy") %> <%= link_to t(".cancel_my_account"), registration_path(resource_name), data: { confirm: t(".are_you_sure") }, method: :delete %></p>
......
<h2><%= t(".sign_up") %></h2>
<h2 class="mb-4"><%= t(".sign_up") %></h2>
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= f.error_notification %>
<div class="form-inputs">
<%= f.input :first_name,
required: true,
autofocus: true,
input_html: { autocomplete: "first_name" } %>
<%= f.input :last_name,
required: true,
input_html: { autocomplete: "last_name" } %>
<%= f.input :email,
required: true,
input_html: { autocomplete: "email" } %>
<%= f.input :password,
as: :password_with_hints,
required: true,
allow_password_uncloaking: true,
validators: {
length: Devise.password_length.first,
uppercase_char: true,
lowercase_char: true,
numeric_char: true,
special_char: Rails.application.config.allowed_special_chars
},
input_html: { autocomplete: "new-password" } %>
<%= f.input :password_confirmation,
as: :password_with_sync,
required: true,
allow_password_uncloaking: true,
compare_with_field: :password,
input_html: { autocomplete: "new-password" } %>
<%= f.association :language,
required: true,
label_method: lambda { |l| t("languages.#{l.iso_code.to_s}") },
include_blank: 'Sélectionnez une langue' %>
<%= f.input :picture,
as: :single_deletable_file,
input_html: { accept: '.png' } %>
</div>
<div class="form-actions text-center mt-3">
<%= f.button :submit, t(".sign_up"), class: 'btn btn-primary' %>
<div class="row">
<div class="col-md-6">
<%= f.input :email,
required: true,
input_html: { autocomplete: "email" } %>
<%= f.input :first_name,
required: true,
autofocus: true,
input_html: { autocomplete: "first_name" } %>
<%= f.input :last_name,
required: true,
input_html: { autocomplete: "last_name" } %>
<%= f.association :language,
required: true,
label_method: lambda { |l| t("languages.#{l.iso_code.to_s}") },
include_blank: 'Sélectionnez une langue' %>
</div>
<div class="col-md-6">
<%= f.input :password,
as: :password_with_hints,
required: true,
allow_password_uncloaking: true,
validators: {
length: Devise.password_length.first,
uppercase_char: true,
lowercase_char: true,
numeric_char: true,
special_char: Rails.application.config.allowed_special_chars
},
input_html: { autocomplete: "new-password" } %>
<%= f.input :password_confirmation,
as: :password_with_sync,
required: true,
allow_password_uncloaking: true,
compare_with_field: :password,
input_html: { autocomplete: "new-password" } %>
<%= f.input :picture,
as: :single_deletable_file,
input_html: { accept: '.png' } %>
</div>
</div>
<%= f.button :submit, t(".sign_up"), class: 'btn btn-primary' %>
<% end %>
<%= render "devise/shared/links" %>
<h2><%= t('login.not_registered_yet') %></h2>
<p class="float-start"><%= t('login.not_registered_yet_details') %></p>
<div class="form-actions text-end">
<%= link_to t("devise.registrations.new.sign_up"),
new_registration_path(resource_name),
class: 'btn btn-primary' %>
</div>
<hr class="my-5">
<h2 class="mb-4"><%= t('login.already_registered') %></h2>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email,
required: false,
autofocus: true,
input_html: { autocomplete: "email" } %>
<div class="mb-3 password optional user_password">
<%= f.input :password,
as: :password_with_hints,
allow_password_uncloaking: true,
required: false,
wrapper: false,
input_html: { autocomplete: "current-password" } %>
<small>
<%= link_to t("devise.passwords.new.forgot_your_password"), new_password_path(resource_name) %>
</small>
<div class="row">
<div class="col-md-6">
<h2 class="mb-4"><%= t('login.not_registered_yet') %></h2>
<p><%= t('login.not_registered_yet_details') %></p>
<div class="form-actions">
<%= link_to t("devise.registrations.new.sign_up"),
new_registration_path(resource_name),
class: 'btn btn-primary' %>
</div>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="col-md-6">
<h2 class="mb-4"><%= t('login.already_registered') %></h2>
<%= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-inputs">
<%= f.input :email,
required: false,
autofocus: true,
input_html: { autocomplete: "email" } %>
<div class="mb-3 password optional user_password">
<%= f.input :password,
as: :password_with_hints,
allow_password_uncloaking: true,
required: false,
wrapper: false,
input_html: { autocomplete: "current-password" } %>
<small>
<%= link_to t("devise.passwords.new.forgot_your_password"), new_password_path(resource_name) %>
</small>
</div>
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
</div>
<div class="form-actions text-end">
<%= f.button :submit, t(".sign_in"), class: 'btn btn-primary align-end' %>
<%= render "devise/shared/links" %>
<div class="form-actions">
<%= f.button :submit, t(".sign_in"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
</div>
<% end %>
</div>
<% end %>
</div>
<h2><%= t(".resend_unlock_instructions") %></h2>
<h2 class="mb-4"><%= t(".resend_unlock_instructions") %></h2>
<%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= f.error_notification %>
<%= f.full_error :unlock_token %>
<div class="form-inputs">
<%= f.input :email,
required: true,
autofocus: true,
input_html: { autocomplete: "email" } %>
</div>
<div class="form-actions text-center mt-3">
<%= f.button :submit, t(".resend_unlock_instructions"), class: 'btn btn-primary' %>
<div class="row">
<div class="col-md-6">
<%= f.input :email,
required: true,
autofocus: true,
input_html: { autocomplete: "email" } %>
</div>
<div class="col-md-6">
<label class="form-label">&nbsp;</label><br>
<%= f.button :submit, t(".resend_unlock_instructions"), class: 'btn btn-primary' %>
<%= render "devise/shared/links" %>
</div>
</div>
<% end %>
<%= render "devise/shared/links" %>
......@@ -13,13 +13,10 @@
<body>
<div class="container">
<div class="row">
<div class="col-sm-10 col-md-8 col-lg-6 mx-auto">
<div class="col-sm-10 mx-auto">
<h1 class="my-5 py-5 text-center"><%= current_university %></h1>
<div class="card">
<div class="card-body text-start">
<p class="lead mb-5">
<%= t('login.subtitle') %>
</p>
<% unless notice.blank? %>
<div class="alert alert-success mt-2" role="alert"><%= notice.html_safe %></div>
<% end %>
......
require "test_helper"
class WordpressTest < ActiveSupport::TestCase
test "the truth" do
assert_equal Wordpress.clean('test'),
'test'
test "convert apostroph" do
assert_equal Wordpress.clean('Ouverture du CRM pendant les vacances d&#8217;Avril'), 'Ouverture du CRM pendant les vacances d’Avril'
end
test "convert 3 dots" do
assert_equal Wordpress.clean('Le CRM fait le tri dans ses collections &#8230; et vous propose une vente de livres'), 'Le CRM fait le tri dans ses collections … et vous propose une vente de livres'
end
test "convert double quotation marks" do
assert_equal Wordpress.clean('Conférence Joëlle Zask : &#8220;Ecologie de la participation&#8221;'), 'Conférence Joëlle Zask : “Ecologie de la participation”'
end
test "convert " do
assert_equal Wordpress.clean('TRAVAILLER DEMAIN, Débat &#8211; le 10 mai à 18h30'), 'TRAVAILLER DEMAIN, Débat – le 10 mai à 18h30'
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment