Repository navigation
Expand file tree
/
Copy pathaddLabel.blade.php
More file actions
92 lines (88 loc) · 4.03 KB
/
Copy pathaddLabel.blade.php
File metadata and controls
92 lines (88 loc) · 4.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
@extends('admin.layouts')
@section('css')
<link href="/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css" rel="stylesheet" type="text/css" />
@endsection
@section('title', '控制面板')
@section('content')
<!-- BEGIN CONTENT BODY -->
<div class="page-content" style="padding-top:0;">
<!-- BEGIN PAGE BASE CONTENT -->
<div class="row">
<div class="col-md-12">
@if (Session::has('errorMsg'))
<div class="alert alert-danger">
<button class="close" data-close="alert"></button>
<strong>错误:</strong> {{Session::get('errorMsg')}}
</div>
@endif
<!-- BEGIN PORTLET-->
<div class="portlet light form-fit bordered">
<div class="portlet-title">
<div class="caption">
<span class="caption-subject font-dark sbold uppercase">添加标签</span>
</div>
<div class="actions"></div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form action="{{url('admin/addLabel')}}" method="post" enctype="multipart/form-data" class="form-horizontal" onsubmit="return doSubmit();">
<div class="form-body">
<div class="form-group">
<label class="control-label col-md-1">名称</label>
<div class="col-md-6">
<input type="text" class="form-control" name="name" id="name" placeholder="" autofocus required>
<input type="hidden" name="_token" value="{{csrf_token()}}">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-1">排序</label>
<div class="col-md-6">
<input type="text" class="form-control" name="sort" id="sort" value="0" required />
<span class="help-block"> 值越高显示时越靠前 </span>
</div>
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-6">
<button type="submit" class="btn green">提 交</button>
</div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
<!-- END PORTLET-->
</div>
</div>
<!-- END PAGE BASE CONTENT -->
</div>
<!-- END CONTENT BODY -->
@endsection
@section('script')
<script src="/js/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript">
// ajax同步提交
function doSubmit() {
var _token = '{{csrf_token()}}';
var name = $('#name').val();
var sort = $('#sort').val();
$.ajax({
type: "POST",
url: "{{url('admin/addLabel')}}",
async: false,
data: {_token:_token, name: name, sort:sort},
dataType: 'json',
success: function (ret) {
layer.msg(ret.message, {time:1000}, function() {
if (ret.status == 'success') {
window.location.href = '{{url('admin/labelList')}}';
}
});
}
});
return false;
}
</script>
@endsection