list.tpl 4.0 KB

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