/modules/mod_development/templates/admin_development.tpl

http://github.com/zotonic/zotonic · Smarty Template · 111 lines · 90 code · 21 blank · 0 comment · 7 complexity · 8e9530af1dabe45d1ad01c5b74fd946d MD5 · raw file

  1. {% extends "admin_base.tpl" %}
  2. {% block title %} Development {% endblock %}
  3. {% block content %}
  4. <div class="admin-header">
  5. <h2>{_ Site Development _}</h2>
  6. <p>{_ Tools and settings that are useful for site development. _}</p>
  7. </div>
  8. <h3>{_ Settings _}</h3>
  9. <div class="well">
  10. <div>
  11. {% wire id="tpldbg"
  12. action={config_toggle module="mod_development" key="debug_includes"}
  13. action={admin_tasks task='flush'}
  14. %}
  15. <label class="checkbox-inline">
  16. <input type="checkbox" id="tpldbg" value="1" {% if m.config.mod_development.debug_includes.value %}checked="checked"{% endif %} />
  17. {_ Show paths to included template files in generated templates _}
  18. </label>
  19. </div>
  20. <div>
  21. {% wire id="blkdbg"
  22. action={config_toggle module="mod_development" key="debug_blocks"}
  23. action={admin_tasks task='flush'}
  24. %}
  25. <label class="checkbox-inline">
  26. <input type="checkbox" id="blkdbg" value="1" {% if m.config.mod_development.debug_blocks.value %}checked="checked"{% endif %} />
  27. {_ Show defined blocks in generated templates _}
  28. </label>
  29. </div>
  30. <div>
  31. {% wire id="libsep"
  32. action={config_toggle module="mod_development" key="libsep"}
  33. action={admin_tasks task='flush'}
  34. %}
  35. <label class="checkbox-inline">
  36. <input type="checkbox" id="libsep" value="1" {% if m.config.mod_development.libsep.value %}checked="checked"{% endif %} />
  37. {_ Download css and javascript files as separate files (ie. don’t combine them in one url). _}
  38. </label>
  39. </div>
  40. <div>
  41. {% wire id="devapi"
  42. action={config_toggle module="mod_development" key="enable_api"}
  43. %}
  44. <label class="checkbox-inline">
  45. <input type="checkbox" id="devapi" value="1" {% if m.config.mod_development.enable_api.value %}checked="checked"{% endif %} />
  46. {_ Enable API to recompile &amp; build Zotonic _}
  47. </label>
  48. </div>
  49. </div>
  50. <h3>{_ Template debugging _}</h2>
  51. <div class="well">
  52. <p>{_ Find a template, check which template will be selected _}</p>
  53. {% wire id="explain-tpl" type="submit"
  54. postback=`explain_tpl`
  55. delegate=`z_development_template`
  56. %}
  57. <form id="explain-tpl" class="form-inline" method="GET" action="postback">
  58. <select class="form-control" name="tpl_cat">
  59. <option value="">{_ Optional category for catinclude _}</option>
  60. <option disabled></option>
  61. {% for c in m.category.tree_flat %}
  62. <option value="{{ c.id.name }}">{{ c.indent }}{{ c.id.name }}</option>
  63. {% endfor%}
  64. </select>
  65. <input class="form-control" type="text" name="tpl_name" placeholder="foo.tpl" value="" />
  66. <button class="btn btn-default" type="submit">{_ Find _}</button>
  67. </form>
  68. <div id="explain-tpl-output" style="display:none"></div>
  69. <hr/>
  70. <p><a href="{% url admin_development_templates %}">Show which files are included in a template compilation</a></p>
  71. <p class="help-block">At times it can be confusing which templates are actually used during a template compilation. Here you can see which files are included whilst compiling a template.</p>
  72. </div>
  73. <h3>{_ Dispatch rule debugging _}</h3>
  74. <div class="well">
  75. <p>{_ Match a request url, display matched dispatch rule. _}</p>
  76. {% wire id="explain-dispatch" type="submit"
  77. postback=`explain_dispatch`
  78. delegate=`z_development_dispatch`
  79. %}
  80. <form id="explain-dispatch" class="form-inline" method="GET" action="postback">
  81. <select id="explain_protocol" name="explain_protocol" class="col-md-4 form-control">
  82. <option value="http">http://{{ m.site.hostname }}</option>
  83. <option value="https">https://{{ m.site.hostname }}</option>
  84. </select>
  85. <input class="form-control" type="text" id="explain_req" name="explain_req" placeholder="/foo/bar" value="" />
  86. <button class="btn btn-default" type="submit">{_ Explain _}</button>
  87. </form>
  88. <div id="explain-dispatch-output" style="display:none"></div>
  89. </div>
  90. {% endblock %}