source: products/quintagroup.seoptimizer/branches/3.0.1-cleanup/quintagroup/seoptimizer/browser/templates/seo_context_properties.pt @ 2262

Last change on this file since 2262 was 2262, checked in by crchemist, 14 years ago

refactor seo_context from view to multiadapter

File size: 19.9 KB
Line 
1<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
2      xmlns:metal="http://xml.zope.org/namespaces/metal"
3      xmlns:tal="http://xml.zope.org/namespaces/tal"
4      lang="en-US"
5      metal:use-macro="here/main_template/macros/master"
6      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
7      i18n:domain="quintagroup.seoptimizer">
8  <metal:border fill-slot="top_slot">
9    <tal:border define="dummy python:request.set('enable_border',1)" />
10  </metal:border>
11  <metal:style_head fill-slot="style_slot">
12      <style type="text/css">
13          tr.datagridwidget-empty-row {
14              display:none;
15          }
16      </style>
17  </metal:style_head>
18
19  <metal:javascript_head fill-slot="javascript_head_slot"
20      tal:define="portal context/@@plone_portal_state/portal;">
21    <!-- // Define variables used by seo_context_properties.js -->
22    <script type="text/javascript" tal:content="string:var stop_words = ${view/getPropertyStopWords}"></script>
23    <script type="text/javascript" tal:content="string:var ids = ${view/getPropertyFields}"></script>
24    <script tal:attributes="src string:${here/absolute_url}/++resource++quintagroup.seoptimizer/seo_context_properties.js"></script>
25  </metal:javascript_head>
26
27  <body>
28    <div metal:fill-slot="main"
29        tal:define="errors python:request.get('errors', {});
30                    Iterator python:modules['Products.CMFPlone'].IndexIterator;
31                    tabindex python:Iterator(mainSlot=False);
32                    seo_context view/seo_context"><!--TODO:implement validation and errors handling-->
33      <h1 i18n:translate="heading_edit_seo_properties">Edit SEO Properties</h1>
34      <div class="documentDescription" i18n:translate="description_edit_seo_properties">
35          This form allows you to edit html header meta tags that are produced by
36          Plone CMS to incrase Search Engine visibility. The values generated by
37          Plone are present as default values in input fields. To override default
38          value, check corresponding checkbox and input value itself in the
39          corresponding field.
40        </div>
41      <form name="edit_form" action="." method="post" enctype="multipart/form-data"
42              tal:attributes="action string:${context/absolute_url}/@@seo-context-properties" >
43<!--      <form name="edit_form"
44            action=""
45            method="post"
46            tal:attributes="action string:${here/absolute_url}/${template/getId}">-->
47        <fieldset>
48          <legend i18n:domain="plone" i18n:translate="legend_item_properties">
49            Item Properties
50          </legend>
51
52          <div class="field">
53            <label i18n:translate="label_page_title_tag" for="seo_title">
54              Page Title Tag
55            </label>
56            <div class="formHelp" i18n:translate="help_seo_title">
57              Text to be present in &lt;TITLE&gt; tag. It is displayed in
58              browser title bar. Search engines display it as a title of the
59              document.
60            </div>
61            <input type="checkbox"
62                   id="seo_title_override"
63                   name="seo_title_override"
64                   tabindex=""
65                   tal:attributes="checked python:view.test(seo_context['has_seo_title'], 'on', None);
66                                   tabindex tabindex/next;"
67                   />
68            <label i18n:translate="label_override" for="seo_title_override">
69              Override
70            </label>
71            <br />
72            <input type="text"
73                   id="seo_title"
74                   name="seo_title"
75                   size="40"
76                   value=""
77                   tabindex=""
78                   tal:attributes="value request/seo_title | seo_context/seo_title;
79                                   tabindex tabindex/next;"
80                   />
81          </div>
82          <div class="field">
83            <label i18n:translate="label_meta_description_tag" for="seo_description">
84              Meta Description Tag
85            </label>
86            <div class="formHelp" i18n:translate="help_seo_description">
87              Description of the document to be indexed by Search Engines. This text will be present in meta description tag in page HTML source.
88            </div>
89            <input type="checkbox"
90                   id="seo_description_override"
91                   name="seo_description_override"
92                   tabindex=""
93                   tal:attributes="checked python:view.test(seo_context['has_seo_description'], 'on', None);
94                                   tabindex tabindex/next;"
95                   />
96            <label i18n:translate="label_override" for="seo_description_override">
97              Override
98            </label>
99            <br />
100            <textarea type="text"
101                      id="seo_description"
102                      name="seo_description"
103                      rows="5"
104                      cols="15"
105                      tabindex=""
106                      tal:attributes="tabindex tabindex/next;"
107                      tal:content="request/seo_description | seo_context/seo_description"
108                      />
109          </div>
110          <div class="field">
111            <label i18n:translate="label_meta_keywords_tag" for="seo_keywords">
112              Meta Keywords Tag
113            </label>
114            <div class="formHelp" i18n:translate="help_seo_keywords">
115              Keywords, the page will be indexed with.
116              <strong>Enter each keyword in separate line, please.</strong>
117              Though the relevance of listing meta keywords is of
118              questionable value now, it is useful to set meta keywords for
119              pages - for future reference.<br/>Use 'Check Keywords' button to check whether
120              words you entered in this block as SEO keywords are present in content.
121            </div>
122            <input type="checkbox"
123                   id="seo_keywords_override"
124                   name="seo_keywords_override"
125                   tabindex=""
126                   tal:attributes="checked python:view.test(seo_context['has_seo_keywords'], 'on', None);
127                                   tabindex tabindex/next;"
128                   />
129            <label i18n:translate="label_override" for="seo_keywords_override">
130              Override
131            </label>
132            <br />
133            <textarea id="seo_keywords"
134                      name="seo_keywords:lines"
135                      rows="11"
136                      cols="15"
137                      wrap="off"
138                      tabindex=""
139                      tal:attributes="tabindex tabindex/next;"
140                      tal:define="keywords request/seo_keywords | seo_context/seo_keywords"
141                      tal:content="python:'\n'.join(keywords)"
142                      />
143            <br />
144          </div>
145          <div class="field">
146            <label i18n:translate="label_html_comment" for="seo_html_commment">
147              HTML Comment
148            </label>
149            <div class="formHelp" i18n:translate="help_seo_html_comment">
150              Comments embedded into HTML header.
151            </div>
152            <input type="checkbox"
153                   id="seo_html_comment_override"
154                   name="seo_html_comment_override"
155                   tabindex=""
156                   tal:attributes="checked python:view.test(seo_context['has_html_comment'], 'on', None);
157                                   tabindex tabindex/next;"
158                   />
159            <label i18n:translate="label_override" for="seo_html_comment_override">
160              Override
161            </label>
162            <br />
163            <textarea id="seo_html_comment"
164                      name="seo_html_comment"
165                      rows="5"
166                      cols="15"
167                      tabindex=""
168                      tal:attributes="tabindex tabindex/next;"
169                      tal:content="request/seo_html_comment | seo_context/seo_html_comment"
170                      />
171          </div>
172          <div class="field">
173            <label i18n:translate="label_robot_tag" for="seo_robots">
174              Robot Tag
175            </label>
176            <div class="formHelp" i18n:translate="help_seo_robots">
177              Robots meta tag value. Allows or denies indexing, following
178              links, etc. for spiders indexing your content.
179            </div>
180            <input type="checkbox"
181                   id="seo_robots_override"
182                   name="seo_robots_override"
183                   tabindex=""
184                   tal:attributes="checked python:view.test(seo_context['has_seo_robots'], 'on', None);
185                                   tabindex tabindex/next;"
186                   />
187            <label i18n:translate="label_override" for="seo_robots_override">
188              Override
189            </label>
190            <br />
191            <input type="text"
192                   id="seo_robots"
193                   name="seo_robots"
194                   size="25"
195                   value=""
196                   tabindex=""
197                   tal:attributes="value request/seo_robots | seo_context/seo_robots;
198                                   tabindex tabindex/next;"
199                   />
200          </div>
201          <div class="field">
202            <label i18n:translate="label_distribution_tag" for="seo_distribution">
203              Distribution Tag
204            </label>
205            <div class="formHelp" i18n:translate="help_seo_distribution">
206              Distribution meta tag to designate time and area distribution
207              of the document.
208            </div>
209            <input type="checkbox"
210                   id="seo_distribution_override"
211                   name="seo_distribution_override"
212                   tabindex=""
213                   tal:attributes="checked python:view.test(seo_context['has_seo_distribution'], 'on', None);
214                                   tabindex tabindex/next;"
215                   />
216            <label i18n:translate="label_override" for="seo_distribution_override">
217              Override
218            </label>
219            <br />
220            <input type="text"
221                   id="seo_distribution"
222                   name="seo_distribution"
223                   size="25"
224                   value=""
225                   tabindex=""
226                   tal:attributes="value request/seo_distribution | seo_context/seo_distribution;
227                                   tabindex tabindex/next;"
228                   />
229          </div>
230          <div class="field"
231               tal:define="error errors/seo_canonical|nothing;"
232               tal:attributes="class python:view.test(error, 'field error', 'field')">
233            <label i18n:translate="label_canonical_tag" for="seo_canonical">
234              Canonical URL
235            </label>
236            <div class="formHelp" i18n:translate="help_seo_canonical">
237              Specify your canonical URL.
238              If your site has identical or vastly similar content that's accessible through multiple URLs,
239              this format provides you with more control over the URL returned in search results.
240            </div>
241            <input type="checkbox"
242                   id="seo_canonical_override"
243                   name="seo_canonical_override"
244                   tabindex=""
245                   tal:attributes="checked python:view.test(seo_context['has_seo_canonical'], 'on', None);
246                                   tabindex tabindex/next;"
247                   />
248            <label i18n:translate="label_override" for="seo_canonical_override">
249              Override
250            </label>
251            <br />
252            <div tal:content="error">Validation error output</div>
253            <input type="text"
254                   id="seo_canonical"
255                   name="seo_canonical"
256                   size="55"
257                   value=""
258                   tabindex=""
259                   tal:attributes="value request/seo_canonical | seo_context/seo_canonical;
260                                   tabindex tabindex/next;"
261                   />
262          </div>
263          <div class="field"
264               tal:define="fieldName string:seo_custommetatags;">
265            <label i18n:translate="label_custom_metatags" for="seo_custom_metatags">
266              Custom Meta Tags
267            </label>
268            <div class="formHelp" i18n:translate="help_seo_custommetatags">
269              Here you can manage your custom meta tags. Specify local Meta Tags parameters to be added to the global Meta Tags. 
270              If metacontent field is empty, then a meta tag will not be present on this page.
271            </div>
272            <input type="checkbox"
273                   id="seo_custommetatags_override"
274                   name="seo_custommetatags_override"
275                   tabindex=""
276                   tal:attributes="checked python:view.test(seo_context.seo_localCustomMetaTags(), 'on', None);
277                                   tabindex tabindex/next;"
278                   />
279            <label i18n:translate="label_override" for="seo_custommetatags_override">
280              Override
281            </label>
282            <br />
283            <table class="custom-metatags-table"
284                   id="datagridwidget-table-seo_custommetatags"
285                   style="width: 100%"
286                   tal:define="columnNames python:['meta name', 'meta content'];
287                               columnIds   python:['meta_name', 'meta_content'];
288                               globalMT    seo_context/seo_globalWithoutLocalCustomMetaTags;
289                               localMT    seo_context/seo_localCustomMetaTags;">
290                <thead>
291                    <tr>
292                        <th class="discreet" style="text-align: left"
293                            tal:repeat="columnName columnNames"
294                            tal:content="columnName"
295                            i18n:translate="">Column name</th>
296                        <th />
297                        <th />
298                    </tr>
299                </thead>
300                <tbody id="datagridwidget-tbody-seo_custommetatags">
301                    <tal:row-loop tal:repeat="row globalMT">
302                        <tr id="datagridwidget-row">
303                            <tal:vars define="fieldId string:${fieldName}_${repeat/row/number}">
304                                <td class="datagridwidget-cell"
305                                    tal:repeat="column columnIds">
306                                    <tal:cell tal:define="cell_value python:row.get(column);">
307                                        <input type="text"
308                                               id="columnId_fieldId"
309                                               value=""
310                                               name="fieldId.columnId:records"
311                                               style="width: 100%;"
312                                               tal:attributes="name string:${fieldName}.${column}:records;
313                                                               id string:${column}_${fieldId};
314                                                               value cell_value"/>
315                                    </tal:cell>
316                                </td>
317                            </tal:vars>
318                        </tr>
319                    </tal:row-loop>
320                    <tal:row-loop tal:repeat="row localMT">
321                        <tr id="datagridwidget-row">
322                            <tal:vars define="fieldId string:${fieldName}_${repeat/row/number}">
323                                <td class="datagridwidget-cell"
324                                    tal:repeat="column columnIds">
325                                    <tal:cell tal:define="cell_value python:row.get(column);">
326                                        <input type="text"
327                                               id="columnId_fieldId"
328                                               value=""
329                                               name="fieldId.columnId:records"
330                                               style="width: 100%;"
331                                               tal:attributes="name string:${fieldName}.${column}:records;
332                                                               id string:${column}_${fieldId};
333                                                               value cell_value"/>
334                                    </tal:cell>
335                                </td>
336                                <td  class="datagridwidget-manipulator">
337                                    <img alt="Delete row"
338                                         onclick="customMetaTagsFunctions.removeFieldRow(this);return false"
339                                         tal:attributes="src string:${portal_url}/delete_icon.gif;" />
340                                </td>
341                                <td class="datagridwidget-hidden-data">
342                                    <input type="hidden"
343                                           tal:attributes="name string:${fieldName}.orderindex_:records;
344                                                           id string:orderindex__${fieldId};
345                                                           value repeat/row/number;" />
346                                </td>
347                            </tal:vars>
348                        </tr>
349                    </tal:row-loop>
350                    <tr id="datagridwidget-empty-row"
351                        class="datagridwidget-empty-row"
352                        tal:define="fieldId string:${fieldName}_new">
353                        <td class="datagridwidget-cell"
354                            tal:repeat="column columnIds">
355                            <span>
356                                <input type="text"
357                                       id="columnId_fieldName_new"
358                                       value=""
359                                       name="fieldName.columnId:records"
360                                       style="width: 100%;"
361                                       tal:attributes="id string:${column}_${fieldName}_new;
362                                                       name string:${fieldName}.${column}:records;" />
363                           </span>
364                        </td>
365                        <td  class="datagridwidget-manipulator">
366                            <img alt="Delete row"
367                                 onclick="customMetaTagsFunctions.removeFieldRow(this);return false"
368                                 tal:attributes="src string:${portal_url}/delete_icon.gif;" />
369                        </td>
370                        <td class="datagridwidget-hidden-data">
371                            <input type="hidden"
372                                   value="template_row_marker"
373                                   tal:attributes="name string:${fieldName}.orderindex_:records;
374                                                  id string:orderindex__${fieldId};" />
375                        </td>
376                    </tr>
377                </tbody>
378            </table>
379            <input type="button"
380                   class="datagridwidget-add-button"
381                   id="datagridwidget-add-button"
382                   value="Add new row"
383                   tal:attributes="onclick string:customMetaTagsFunctions.addRow('${fieldName}')" />
384          </div>
385          <div class="formControls"
386               tal:define="process_creation request/process_creation|nothing;"
387               i18n:domain="plone">
388            <input class="context"
389                   tabindex=""
390                   type="submit"
391                   name="form.button.Save"
392                   value="Save"
393                   i18n:attributes="value"
394                   tal:attributes="tabindex tabindex/next;" />
395            <input class="standalone"
396                   tabindex=""
397                   type="submit"
398                   name="form.button.Cancel"
399                   value="Cancel"
400                   i18n:attributes="value"
401                   tal:attributes="tabindex tabindex/next;" />
402          </div>
403        </fieldset>
404        <input type="hidden" name="form.submitted" value="1" />
405      </form>
406    </div>
407  </body>
408</html>
Note: See TracBrowser for help on using the repository browser.