addupd.blade.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. @extends('admin.frame_form')
  2. @if (!isset($role))
  3. @section('action', '添加')
  4. @else
  5. @section('action', '编辑')
  6. @endif
  7. @section('who', '角色')
  8. @section('form_content')
  9. <tr>
  10. <td class="txt-right width-20p"><i>*</i>角色名称:</td>
  11. <td class="txt-left">
  12. <input type="text" maxlength="25" placeholder="请输入小于25个字符" name="name" value="{{ old('name') ? old('name') : (isset($role->name) ? $role->name : '') }}" required="required" />
  13. &nbsp;&nbsp;&nbsp;
  14. <span class="red">{{ $errors->first('name') }}</span>
  15. </td>
  16. </tr>
  17. <tr>
  18. <td class="txt-right"><i>*</i>角色描述:</td>
  19. <td class="txt-left">
  20. <textarea rows="5" cols="60" maxlength="255" placeholder="请输入小于255个字符" name="description" required="required">{{ old('description') ? old('description') : (isset($role->description) ? $role->description : '') }}</textarea>
  21. &nbsp;&nbsp;&nbsp;
  22. <span class="red">{{ $errors->first('description') }}</span>
  23. </td>
  24. </tr>
  25. <tr>
  26. <td class="txt-right"><i>*</i>拥有权限:</td>
  27. <td class="txt-left">
  28. @foreach ($menus as $menu)
  29. @if (isset($role) && in_array($menu->id, $role->menus_id))
  30. <input type="checkbox" id="menu{{ $loop->index }}" name="menus_id[]" value="{{ $menu->id }}" checked="checked" />
  31. @else
  32. <input type="checkbox" id="menu{{ $loop->index }}" name="menus_id[]" value="{{ $menu->id }}" />
  33. @endif
  34. <label for="menu{{ $loop->index }}">{{ $menu->name }}</label>
  35. @endforeach
  36. &nbsp;&nbsp;&nbsp;
  37. <span class="red">{{ $errors->first('menu') }}</span>
  38. </td>
  39. </tr>
  40. @stop