plugins/report/app/views/series/_form.html.erb in admin-sys-1.0.2 vs plugins/report/app/views/series/_form.html.erb in admin-sys-1.1.0
- old
+ new
@@ -1,113 +1,113 @@
-<!-- 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 "报表", reports_path %></li>
- <li><%= link_to "系列", report_series_index_url(@report) %></li>
- <li class="active">系列新增/修改</li>
- </ol>
- </section>
-
- <!-- Main content -->
- <section class="content">
- <% if @series.errors.any? %>
- <div class="alert alert-danger alert-dismissible">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
- <h4><i class="icon fa fa-ban"></i> 有<%= @series.errors.count %>个错误:</h4>
- <% errors = "" %>
- <% @series.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 start -->
- <%= form_for(@series, url: (@series.id ? report_series_path(@report, @series) : report_series_index_path(@report)), :html => {:class => "form-horizontal", :id => "obj_form"}) do |f| %>
- <div class="box-body">
- <div class="form-group">
- <label class="col-sm-3 control-label"> name </label>
- <div class="col-md-6">
- <%= f.text_field :name, class: "form-control", placeholder: "name" %>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label"> sql_key </label>
- <div class="col-md-6">
- <%= f.text_field :sql_key, class: "form-control", placeholder: "sql_key" %>
- </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: {
- "series[name]": {
- required: true,
- rangelength: [1, 50]
- },
- "series[sql_key]": {
- required: true,
- rangelength: [1, 50]
- }
- },
- messages: {
- "series[name]": {
- required: "请输入name",
- rangelength: "name长度必须是1~50"
- },
- "series[sql_key]": {
- required: "请输入sql_key",
- rangelength: "sql_key长度必须是1~50"
- }
- },
- 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 %>
+<!-- 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 "报表", reports_path %></li>
+ <li><%= link_to "系列", report_series_index_url(@report) %></li>
+ <li class="active">系列新增/修改</li>
+ </ol>
+ </section>
+
+ <!-- Main content -->
+ <section class="content">
+ <% if @series.errors.any? %>
+ <div class="alert alert-danger alert-dismissible">
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
+ <h4><i class="icon fa fa-ban"></i> 有<%= @series.errors.count %>个错误:</h4>
+ <% errors = "" %>
+ <% @series.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 start -->
+ <%= form_for(@series, url: (@series.id ? report_series_path(@report, @series) : report_series_index_path(@report)), :html => {:class => "form-horizontal", :id => "obj_form"}) do |f| %>
+ <div class="box-body">
+ <div class="form-group">
+ <label class="col-sm-3 control-label"> name </label>
+ <div class="col-md-6">
+ <%= f.text_field :name, class: "form-control", placeholder: "name" %>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-3 control-label"> sql_key </label>
+ <div class="col-md-6">
+ <%= f.text_field :sql_key, class: "form-control", placeholder: "sql_key" %>
+ </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: {
+ "series[name]": {
+ required: true,
+ rangelength: [1, 50]
+ },
+ "series[sql_key]": {
+ required: true,
+ rangelength: [1, 50]
+ }
+ },
+ messages: {
+ "series[name]": {
+ required: "请输入name",
+ rangelength: "name长度必须是1~50"
+ },
+ "series[sql_key]": {
+ required: "请输入sql_key",
+ rangelength: "sql_key长度必须是1~50"
+ }
+ },
+ 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 %>