list.tpl 3.5 KB

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