app/views/members/reset_password.html.erb in admin-sys-1.0.2 vs app/views/members/reset_password.html.erb in admin-sys-1.1.0

- old
+ new

@@ -1,116 +1,116 @@ -<!-- Content Wrapper. Contains page content --> -<div class="content-wrapper"> - <!-- Content Header (Page header) --> - <section class="content-header"> - <h1> - 重置密码 - <small>重置密码 manager</small> - </h1> - <ol class="breadcrumb"> - <li><a href="/"><i class="fa fa-dashboard"></i> 首页</a></li> - <li> - <%= link_to "成员管理", members_url %> - </li> - <li> - <%= link_to @member.realname, member_url(@member) %> - </li> - <li class="active">重置密码</li> - </ol> - </section> - - <!-- Main content --> - <section class="content"> - <% if @member.errors.any? %> - <div class="alert alert-danger alert-dismissible"> - <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> - <h4><i class="icon fa fa-ban"></i> 有<%= @member.errors.count %>个错误:</h4> - <% errors = "" %> - <% @member.errors.messages.values.each_with_index { |message, index| errors = errors + - "#{index+1}.#{message.join(";")}; " } %> - <%= errors %> - </div> - <% end %> - <!-- /.row --> - <div class="row"> - <div class="col-md-12"> - <!-- Horizontal Form --> - <div class="box box-info"> - <div class="box-header with-border"> - <h3 class="box-title">重置密码</h3> - </div> - <!-- /.box-header --> - <%= form_for(@member, :html => {:class => "form-horizontal", :id => "obj_form"}) do |f| %> - <div class="box-body"> - <div class="form-group"> - <label class="col-sm-3 control-label">*密码:</label> - <div class="col-md-6"> - <%= f.password_field :password, class: "form-control", placeholder: "请输入密码" %> - </div> - </div> - </div> - <div class="form-body"> - <div class="form-group"> - <label class="col-sm-3 control-label">*重新输入密码:</label> - <div class="col-md-6"> - <%= f.password_field :password2, class: "form-control", placeholder: "重新输入密码" %> - </div> - </div> - </div> - <div class="box-footer"> - <button type="button" onclick="javascript:history.back();" class="btn btn-default">返回</button> - <button type="submit" class="btn btn-info pull-right">提交</button> - </div> - <!-- /.box-footer --> - <% end %> - </div> - <!-- /.box --> - </div> - </div> - <!-- /.row --> - </section> - <!-- /.content --> -</div> -<!-- /.content-wrapper --> -<%= content_for :js_bottom do %> - <script type="text/javascript" charset="utf-8"> - $(function () { - $("#obj_form").validate({ - errorElement: 'span', //default input error message container - errorClass: 'help-block help-block-error', // default input error message class - focusInvalid: false, // do not focus the last invalid input - ignore: "", // validate all fields including form hidden input - rules: { - "member[password]": { - required: true, - rangelength: [6, 15] - }, - "member[password2]": { - equalTo: "#member_password" - } - }, - messages: { - "member[password]": { - required: "密码不能为空", - rangelength: "密码长度必须是6-15" - }, - "member[password2]": { - equalTo: "两次输入不一致" - } - }, - highlight: function (element) { // hightlight error inputs - $(element).closest('.form-group').addClass('has-error'); // set error class to the control group - }, - unhighlight: function (element) { // revert the change done by hightlight - $(element).closest('.form-group').removeClass('has-error'); // set error class to the control group - }, - success: function (label) { - label.closest('.form-group').removeClass('has-error'); // set success class to the control group - }, - submitHandler: function (form) { - $(form).find(":submit").attr("disabled", true).text("提交中..."); - form.submit(); - } - }); - }); - </script> +<!-- Content Wrapper. Contains page content --> +<div class="content-wrapper"> + <!-- Content Header (Page header) --> + <section class="content-header"> + <h1> + 重置密码 + <small>重置密码 manager</small> + </h1> + <ol class="breadcrumb"> + <li><a href="/"><i class="fa fa-dashboard"></i> 首页</a></li> + <li> + <%= link_to "成员管理", members_url %> + </li> + <li> + <%= link_to @member.realname, member_url(@member) %> + </li> + <li class="active">重置密码</li> + </ol> + </section> + + <!-- Main content --> + <section class="content"> + <% if @member.errors.any? %> + <div class="alert alert-danger alert-dismissible"> + <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> + <h4><i class="icon fa fa-ban"></i> 有<%= @member.errors.count %>个错误:</h4> + <% errors = "" %> + <% @member.errors.messages.values.each_with_index { |message, index| errors = errors + + "#{index+1}.#{message.join(";")}; " } %> + <%= errors %> + </div> + <% end %> + <!-- /.row --> + <div class="row"> + <div class="col-md-12"> + <!-- Horizontal Form --> + <div class="box box-info"> + <div class="box-header with-border"> + <h3 class="box-title">重置密码</h3> + </div> + <!-- /.box-header --> + <%= form_for(@member, :html => {:class => "form-horizontal", :id => "obj_form"}) do |f| %> + <div class="box-body"> + <div class="form-group"> + <label class="col-sm-3 control-label">*密码:</label> + <div class="col-md-6"> + <%= f.password_field :password, class: "form-control", placeholder: "请输入密码" %> + </div> + </div> + </div> + <div class="form-body"> + <div class="form-group"> + <label class="col-sm-3 control-label">*重新输入密码:</label> + <div class="col-md-6"> + <%= f.password_field :password2, class: "form-control", placeholder: "重新输入密码" %> + </div> + </div> + </div> + <div class="box-footer"> + <button type="button" onclick="javascript:history.back();" class="btn btn-default">返回</button> + <button type="submit" class="btn btn-info pull-right">提交</button> + </div> + <!-- /.box-footer --> + <% end %> + </div> + <!-- /.box --> + </div> + </div> + <!-- /.row --> + </section> + <!-- /.content --> +</div> +<!-- /.content-wrapper --> +<%= content_for :js_bottom do %> + <script type="text/javascript" charset="utf-8"> + $(function () { + $("#obj_form").validate({ + errorElement: 'span', //default input error message container + errorClass: 'help-block help-block-error', // default input error message class + focusInvalid: false, // do not focus the last invalid input + ignore: "", // validate all fields including form hidden input + rules: { + "member[password]": { + required: true, + rangelength: [6, 15] + }, + "member[password2]": { + equalTo: "#member_password" + } + }, + messages: { + "member[password]": { + required: "密码不能为空", + rangelength: "密码长度必须是6-15" + }, + "member[password2]": { + equalTo: "两次输入不一致" + } + }, + highlight: function (element) { // hightlight error inputs + $(element).closest('.form-group').addClass('has-error'); // set error class to the control group + }, + unhighlight: function (element) { // revert the change done by hightlight + $(element).closest('.form-group').removeClass('has-error'); // set error class to the control group + }, + success: function (label) { + label.closest('.form-group').removeClass('has-error'); // set success class to the control group + }, + submitHandler: function (form) { + $(form).find(":submit").attr("disabled", true).text("提交中..."); + form.submit(); + } + }); + }); + </script> <% end %> \ No newline at end of file