File: develui.pt

package info (click to toggle)
plone3 3.1.3-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 73,972 kB
  • ctags: 39,149
  • sloc: python: 209,481; xml: 25,065; sh: 1,395; makefile: 585; php: 129; lisp: 54
file content (156 lines) | stat: -rw-r--r-- 5,537 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:kukit="http://www.kukit.org/commands/1.0"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n">
  <head>

  	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

    <link rel="stylesheet" type="text/css"
          tal:attributes="href string:${context/@@absolute_url}/@@kss_devel_mode/ui_css"/>

    <!-- We do not use kss in this page -->
    <!--link rel="kinetic-stylesheet" type="text/kss"
          tal:attributes="href string:${context/@@absolute_url}/@@kss_devel_mode/ui_kss"/-->

    <script type="text/javascript"
      tal:attributes="src string:${context/@@absolute_url}/++resource++sarissa.js;"
      src="++resource++sarissa.js">
    </script>

    <!-- Use original cssQuery -->
    <script type="text/javascript"
      tal:attributes="src string:${context/@@absolute_url}/++resource++cssQuery.js;"
      src="++resource++cssQuery.js">
    </script>

    <!-- Use base2 cssQuery -->
    <!--script type="text/javascript"
      tal:attributes="src string:${context/@@absolute_url}/++resource++base2-dom-fp.js;"
      src="++resource++base2-dom-fp.js">
    </script-->

    <script type="text/javascript"
      tal:attributes="src string:${context/@@absolute_url}/++resource++MochiKit.js;"
      src="++resource++MochiKit.js">
    </script>

    <!-- We do not use kss in this page -->
    <!-- script tal:define="kss_devel_mode nocall:context/@@kss_devel_mode | nothing"
            tal:condition="python: not kss_devel_mode or kss_devel_mode.isoff()" type="text/javascript"
            tal:attributes="src string:${context/@@absolute_url}/++resource++kukit.js;">
    </script>

    <script tal:define="kss_devel_mode nocall:context/@@kss_devel_mode | nothing"
            tal:condition="python: kss_devel_mode and kss_devel_mode.ison()" type="text/javascript"
            tal:attributes="src string:${context/@@absolute_url}/++resource++kukit-devel.js;">
    </script-->

    <script type="text/javascript"
      tal:attributes="src string:${context/@@absolute_url}/@@kss_devel_mode/ui_js">
    </script>

</head>
  <body tal:define="devel_mode python: options.get('devel_mode', view.ison());
                    loglevel python: options.get('loglevel', view.getLogLevel());
                    referer request/referer|request/HTTP_REFERER|nothing">

    <h2>KSS mode setup</h2>
    
    <p>
      KSS is in <span class="development"
            tal:condition="devel_mode">development</span><span
            class="production" tal:condition="not: devel_mode">production</span> mode.
    </p>

    <p class="help">
        The mode is stored in a cookie that is global to the site.
    </p>
    <p class="help">
        It can be overridden by a local utility (eg. ResourceRegistries, in Plone).
    </p>
    
    <p class="help">
    	If you call <code>@@kss_devel_mode/ison</code> on the current context,
        you will get <code>True</code> in development mode, <code>False</code> in production mode.
    </p>

    <form name="edit">
      <fieldset>
        <h3>
          Set KSS mode cookie
        </h3>
        <p class="help">
            Click the button to toggle mode.
        </p>

        <div>
          <input type="hidden" name="referer" 
                 tal:attributes="value referer" />
          <input type="submit" name="prod" id="button_prod" class="clickable production"
               value="Switch to production mode." />
          <input type="submit" name="devel" id="button_devel" class="clickable development"
               value="Switch to development mode."  />
        </div>

      </fieldset>
    </form>
    
    <p tal:condition="referer">
      <a class="button" tal:attributes="href referer">Back to the referer page.</a>
    </p>

    <h2>KSS log level setup</h2>
    
    <p>
      Current KSS log level is<b>
      <span tal:attributes="class python:loglevel.lower()"
            tal:content="loglevel">DEBUG</span></b>.
    </p>

    <p class="help">
        The log level is stored in a cookie that is global to the site.
    </p>
    
    <p class="help">
        Logging is effective only in <span class="development">development</span> mode.
    </p>

    <form name="loglevel">
      <fieldset>
        <h3>
          Set KSS log level
        </h3>
        <p class="help">
            Click the button to set log level.
        </p>
        

        <div>
          <input type="hidden" name="referer" 
                 tal:attributes="value referer" />
          <tal:levels repeat="level python:['DEBUG', 'INFO', 'WARNING', 'ERROR']">
            <label tal:attributes="class python:level.lower()">
              <input type="radio" name="loglevel"
                     tal:attributes="value level;
                                     checked python: level==loglevel and 1 or None;
                                     " />
              <tal:block replace="level">DEBUG</tal:block>
            </label>
            <br />
          </tal:levels>
          <input type="submit" name="loglevel_submit" id="button_loglevel" class="clickable"
           value="Set"  />
        </div>

      </fieldset>
    </form>

    <p tal:condition="referer">
      <a class="button" tal:attributes="href referer">Back to the referer page.</a>
    </p>

  </body>
</html>