PageRenderTime 23ms CodeModel.GetById 12ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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