fields-display.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {template 'common/header'}
  2. {template 'user/user-header'}
  3. <div class="clearfix we7-margin-bottom search-box">
  4. <form action="" class="search-form" method="get">
  5. <input type="hidden" name="c" value="user">
  6. <input type="hidden" name="a" value="fields">
  7. <div class="input-group ">
  8. <input type="text" name="keyword" id="" value="{$_GPC['keyword']}" class="form-control" placeholder="请输入标题"/>
  9. <span class="input-group-btn"><button class="btn btn-default"><i class="fa fa-search"></i></button></span>
  10. </div>
  11. </form>
  12. <a href="{url 'user/fields/post'}" class="btn btn-primary">添加字段</a>
  13. </div>
  14. <form action="" method="post" id="js-fields-display" ng-controller="FieldsDisplay" ng-cloak>
  15. <table class="table we7-table table-hover vertical-middle">
  16. <col width="100px"/>
  17. <col />
  18. <col />
  19. <col />
  20. <col />
  21. <col />
  22. <tr>
  23. <th >排序</th>
  24. <th class="text-left">字段名</th>
  25. <th>标题</th>
  26. <th>是否启用</th>
  27. <th>注册页显示</th>
  28. <th>是否必填</th>
  29. <th class="text-right">操作</th>
  30. </tr>
  31. <tr ng-repeat="field in fields">
  32. <td ng-bind="field.displayorder"></td>
  33. <td class="text-left" ng-bind="field.field"></td>
  34. <td ng-bind="field.title"></td>
  35. <td>
  36. <label>
  37. <input name="" class="form-control" type="checkbox" style="display: none;">
  38. <div ng-class="field.available == 1 ? 'switch switchOn' : 'switch'" ng-click="changeStatus(field.id, 'available', field.available)"></div>
  39. </label>
  40. </td>
  41. <td>
  42. <label>
  43. <input name="" class="form-control" type="checkbox" style="display: none;">
  44. <div ng-class="field.showinregister == 1 ? 'switch switchOn' : 'switch'" ng-click="changeStatus(field.id, 'showinregister', field.showinregister)"></div>
  45. </label>
  46. </td>
  47. <td>
  48. <label>
  49. <input name="" class="form-control" type="checkbox" style="display: none;">
  50. <div ng-class="field.required == 1 ? 'switch switchOn' : 'switch'" ng-click="changeStatus(field.id, 'required', field.required)"></div>
  51. </label>
  52. </td>
  53. <td>
  54. <div class="link-group">
  55. <a href="javascript:;" data-toggle="modal" data-target="#name" ng-click="editInfo(field)">修改</a>
  56. </div>
  57. </td>
  58. </tr>
  59. </table>
  60. <!-- 编辑弹出框 start-->
  61. <div class="modal fade" id="name" role="dialog">
  62. <div class="we7-modal-dialog modal-dialog">
  63. <div class="modal-content">
  64. <div class="modal-header">
  65. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  66. <div class="modal-title">修改 {{field.title}}</div>
  67. </div>
  68. <div class="modal-body">
  69. <div class="form-group">
  70. <span class="col-xs-8 col-sm-2 col-md-2 col-lg-1 control-label">排序</span>
  71. <div class="col-sm-10 col-xs-12">
  72. <input type="text" ng-model="field.displayorder" class="form-control" placeholder="" />
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <span class="col-xs-8 col-sm-2 col-md-2 col-lg-1 control-label">字段</span>
  77. <div class="col-sm-10 col-xs-12">
  78. <input type="text" ng-model="field.field" class="form-control" placeholder="" />
  79. </div>
  80. </div>
  81. <div class="form-group">
  82. <span class="col-xs-8 col-sm-2 col-md-2 col-lg-1 control-label">名称</span>
  83. <div class="col-sm-10 col-xs-12">
  84. <input type="text" ng-model="field.title" class="form-control" placeholder="" />
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <span class="col-xs-8 col-sm-2 col-md-2 col-lg-1 control-label">描述</span>
  89. <div class="col-sm-10 col-xs-12">
  90. <textarea type="text" ng-model="field.description" class="form-control" placeholder=""></textarea>
  91. </div>
  92. </div>
  93. <div class="form-group">
  94. <span class="col-xs-8 col-sm-2 col-md-2 col-lg-1 control-label">提交后不可修改</span>
  95. <div class="col-sm-10 col-xs-12">
  96. <input id='radio-5' type="radio" ng-model="field.unchangeable" value="1" ng-checked="field.unchangeable">
  97. <label for="radio-5">是</label>
  98. <input id='radio-6' type="radio" ng-model="field.unchangeable" value="0" ng-checked="!field.unchangeable">
  99. <label for="radio-6">否</label>
  100. </div>
  101. </div>
  102. <div class="form-group">
  103. <span class="col-xs-8 col-sm-1 col-md-2 col-lg-1 control-label">字段长度</span>
  104. <div class="col-sm-10 col-xs-12">
  105. <select ng-model="field.field_length" class="we7-select">
  106. <option value="64" ng-selected="field.field_length == 64">64</option>
  107. <option value="128" ng-selected="field.field_length == 128">128</option>
  108. <option value="255" ng-selected="field.field_length == 255">255</option>
  109. </select>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="modal-footer">
  114. <button type="button" class="btn btn-primary" ng-click="saveInfo(field)">确定</button>
  115. <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <!-- 编辑弹出框 end-->
  121. </form>
  122. <script>
  123. angular.module('userManageApp').value('config', {
  124. fields: {php echo !empty($fields) ? json_encode($fields) : 'null'},
  125. links: {
  126. fieldPost: "{php echo url('user/fields/post')}",
  127. fieldDisplay: "{php echo url('user/fields/display')}",
  128. },
  129. });
  130. angular.bootstrap($('#js-fields-display'), ['userManageApp']);
  131. </script>
  132. {template 'common/footer'}