seminar2/app/views/seminars/reset_password_page.html.erb

74 lines
2.9 KiB
Plaintext
Raw Normal View History

2023-10-04 16:38:24 +00:00
<% # encoding: utf-8 %>
<%
data = action_data
@seminar = data["seminar"]
%>
<style type="text/css">
.alert-error{
color: red;
}
</style>
<section id="main-wrap">
<% if data["status"] %>
<div class="sign-in have-other-sign-in">
<% flash.each do |key, msg| %>
<%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %>
<% end %>
<div class="form">
<h2><%= @seminar.title %></h2>
<h3 class="login-logo"><%= t('seminar_signup.forgot_password') %></h3>
<div>
<input name="utf8" type="hidden" value="" />
<input name="authenticity_token" type="hidden" value="" />
</div>
<div class="form-block">
<div class="form-list clearfix">
<%= form_tag reset_confirm_password_proc_seminars_path, :class => 'content', :id =>"change-password-form" do %>
<div class="control-group clear">
<label for="user_password">
<i class="icon-user"></i><%=t('seminar_signup.password')%>
</label>
<%= password_field_tag :password, nil, :placeholder => t(:dots), :id=>"user_password", :required=> true %>
</div>
<div class="control-group clear">
<label for="confirm_user_password">
<i class="icon-user"></i><%=t('seminar_signup.confirm_password')%>
</label>
<%= password_field_tag :confirm_password, nil, :placeholder => t(:dots), :id=>"confirm_user_password", :required=> true %>
</div>
<p class="alert-error" id="confirm-error"></p>
<br/>
<input type="hidden" name="referer_url" value="<%= request.original_url.split(request.env["HTTP_HOST"]).last.split('?').first %>">
<input type="hidden" name="seminar_id" value="<%= @seminar.id %>">
<input type="hidden" name="cid" value="<%= params[:cid] %>">
<input type="hidden" name="reset_token" value="<%= data['token'] %>" />
<button class="btn btn-primary" name="button" type="submit"><%= t('seminar_signup.reset') %></button>
<% end %>
</div>
</div>
<br/>
</div>
</div>
<% else %>
<p>Invalid URL</p>
<% end %>
</section>
<script type="text/javascript">
$(document).ready(function(){
var max_width = Math.max.apply(null, $(".form .control-group label").map(function(i,el){return $(el).width()}));
$(".form .control-group label").width(max_width);
})
form = document.querySelector("#change-password-form");
form.onsubmit = function () {
var up = document.querySelector("#user_password").value,
cup = document.querySelector("#confirm_user_password").value
if(up != cup){
document.querySelector("#confirm-error").textContent = "<%= t("seminar_signup.password_mismatch") %>"
return false;
}else{
return true;
}
}
</script>