some improvement in templates

(now we have O(1) time for selecting the right html template)
added: winix function: template
for selecting a template for an item (file or dir)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@636 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-08-13 20:04:57 +00:00
parent 9a199cd834
commit f3cd3b88b9
40 changed files with 756 additions and 228 deletions

View File

@@ -1,5 +1,5 @@
[if mount_page_is "subject"][if mount_page_is "info"]<h1 class="withinfo">[else]<h1>[end][item_subject]</h1>[end]
[if mount_page_is "info"][item_info][end]
[if mount_page_is "info"][include "item_info.html"][end]
[if-one item_auth_is_image]
<img class="catimage" src="[item_link]/download/thumb" alt="[item_subject]">
@@ -14,6 +14,7 @@
[end]
[include "item_options.html"]

View File

@@ -0,0 +1,2 @@
[include "fun_priv.html"]

View File

@@ -0,0 +1 @@
[include "fun_priv.html"]

View File

@@ -12,7 +12,7 @@
[end]
[if mount_page_is "info"]
[item_info]
[include "item_info.html"]
[end]
[item_run]

65
html/fun_template.html Executable file
View File

@@ -0,0 +1,65 @@
<h1>{template_header}</h1>
[include "error.html"]
<p>
[if item_is]
{template_info_file}:
[if item_has_html_template]
[item_html_template]
[else]
{template_from_mount_point}
[if mount_has_html_template]
([mount_first_html_template])
[else]
([template_index])
[end]
[end]
[else]
{template_info_dir}:
[if dir_last_has_html_template]
[dir_last_html_template]
[else]
{template_from_mount_point}
[if mount_has_html_template]
([mount_first_html_template])
[else]
([template_index])
[end]
[end]
[end]
</p>
<form id="additem" method="post" action="[doc_base_url][dir][if-one item_is][item_url]/[end]template">
<fieldset>
<legend>{template_form_legend}</legend>
{template_form_info}:
<select name="template" class="template">
[# the first should be an empty string (value="") which means: a first template from the mount point]
<option value="">({template_form_from_mount_point})</option>
[for template_tab]
<option[if-one template_tab_isdefault] selected[end]>[template_tab_file_name]</option>
[end]
</select>
<input class="submit" type="submit" value="{change}">
</fieldset>
</form>

View File

@@ -1,5 +1,5 @@
[if mount_page_is "subject"]<h1[if mount_page_is "info"] class="withinfo"[end]>[dir_last_subject]</h1>[end]
[if mount_page_is "info"][dir_last_info][end]
[if mount_page_is "info"][include "dir_last_info.html"][end]
[if-one thread_can_create]
<ul class="itemmenu">
@@ -34,7 +34,7 @@
<div class="threadbox[if-index item_tab odd] threadboxcolor[end]">
[if-one item_tab_can_use_emacs]<a class="threadedit" href="[item_tab_link]/emacs">\[{edit}\]</a>[end]
[if mount_thread_is "subject"]<h2[if mount_thread_is "info"] class="withinfo"[end]>[item_tab_subject]</h2>[end]
[if mount_thread_is "info"][item_tab_info][end]
[if mount_thread_is "info"][include "item_tab_info.html"][end]
[item_tab_print_content]
</div>
[end]

View File

@@ -1,5 +1,5 @@
[if mount_page_is "subject"]<h1[if mount_page_is "info"] class="withinfo"[end]>[dir_last_subject]</h1>[end]
[if mount_page_is "info"][dir_last_info][end]
[if mount_page_is "info"][include "dir_last_info.html"][end]
[if-one ticket_can_create]
@@ -56,7 +56,7 @@
[for item_tab]
<div class="threadbox[if-index item_tab odd] threadboxcolor[end]">
[if mount_thread_is "subject"]<h2[if mount_thread_is "info"] class="withinfo"[end]>[item_tab_subject]</h2>[end]
[if mount_thread_is "info"][item_tab_info][end]
[if mount_thread_is "info"][include "item_tab_info.html"][end]
[item_tab_print_content]
</div>
[end]