list.html.twig 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {% autoescape false %}
  2. {% if tags %}
  3. <div class="row">
  4. <div class="col-md-3" >
  5. <select id="tag-filter" class="chzn-select form-control">
  6. <option value="0">{{ 'PleaseSelectAChoice' | get_lang }}</option>
  7. {% for tag in tags %}
  8. <option value="{{ tag.id }}">{{ tag.tag }}</option>
  9. {% endfor %}
  10. </select>
  11. </div>
  12. <div class="col-md-3">
  13. <a id="filter-button" class="btn btn-default">{{ 'FilterByTags' | get_lang }}</a>
  14. </div>
  15. </div>
  16. <br />
  17. {% endif %}
  18. <div class="table table-responsive">
  19. <table class="table table-hover">
  20. <thead>
  21. <tr>
  22. <th>{{ "Badges" | get_lang }}</th>
  23. <th>{{ "Name" | get_lang }}</th>
  24. <th class="text-center">{{ "ShortCode" | get_lang }}</th>
  25. <th class="text-center">{{ "Description" | get_lang }}</th>
  26. <th class="text-center">{{ "Options" | get_lang }}</th>
  27. </tr>
  28. </thead>
  29. <tfoot>
  30. <tr>
  31. <th>{{ "Badges" | get_lang }}</th>
  32. <th>{{ "Name" | get_lang }}</th>
  33. <th class="text-center">{{ "ShortCode" | get_lang }}</th>
  34. <th class="text-center">{{ "Description" | get_lang }}</th>
  35. <th class="text-center">{{ "Options" | get_lang }}</th>
  36. </tr>
  37. </tfoot>
  38. <tbody>
  39. {% for skill in skills %}
  40. <tr>
  41. <td width="50">
  42. {{ skill.img_small }}
  43. </td>
  44. <td width="200">{{ skill.name }}</td>
  45. <td class="text-center">{{ skill.short_code }}</td>
  46. <td width="500">{{ skill.description }}</td>
  47. <td class="text-right">
  48. <div class="btn-group btn-group-sm" role="group" aria-label="">
  49. <a href="{{ _p.web_main }}admin/skill_edit.php?id={{ skill.id }}" class="btn btn-light btn-sm" title="{{ "Edit" | get_lang }}">
  50. <i class="fas fa-pencil-alt"></i>
  51. </a>
  52. <a href="{{ _p.web_main }}admin/skill_create.php?parent={{ skill.id }}" class="btn btn-light btn-sm" title="{{ "CreateChildSkill" | get_lang }}">
  53. <i class="fas fa-plus"></i>
  54. </a>
  55. <a href="{{ _p.web_main }}admin/skill_badge_create.php?id={{ skill.id }}" class="btn btn-light btn-sm" title="{{ "CreateBadge" | get_lang }}">
  56. <i class="fas fa-shield-alt"></i>
  57. </a>
  58. {% if skill.status == 0 %}
  59. <a href="{{ _p.web_self ~ '?' ~ {"action": "enable", "id": skill.id}|url_encode() }}" class="btn btn-success btn-sm" title="{{ 'Enable' }}">
  60. <i class="fas fa-check-circle"></i>
  61. </a>
  62. {% else %}
  63. <a href="{{ _p.web_self ~ '?' ~ {"action": "disable", "id": skill.id}|url_encode() }}" class="btn btn-danger btn-sm" title="{{ 'Disable' }}">
  64. <i class="fas fa-ban"></i>
  65. </a>
  66. {% endif %}
  67. </div>
  68. </td>
  69. </tr>
  70. {% endfor %}
  71. </tbody>
  72. </table>
  73. </div>
  74. <script>
  75. $(function() {
  76. $("#tag-filter").val("{{ current_tag_id }}");
  77. $("#filter-button").click(function() {
  78. var tagId = $( "#tag-filter option:selected" ).val();
  79. $(location).attr('href', '{{ _p.web_main }}admin/skill_list.php?tag_id='+tagId);
  80. });
  81. });
  82. </script>
  83. {% endautoescape %}