|
From: Chris W. <la...@us...> - 2001-10-20 15:14:33
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/template
In directory usw-pr-cvs1:/tmp/cvs-serv13214/template
Modified Files:
edit_document_box.tmpl
Added Files:
page_directory_list.meta page_directory_list.tmpl
page_form.meta page_form.tmpl page_search_form.meta
page_search_form.tmpl
Log Message:
updated all templates
--- NEW FILE: page_directory_list.meta ---
name: page_directory_list
title: Listing of pages by directory
package: base_page
Lists the static pages by directory, with one of the directories
optionally being picked and expanded
--- NEW FILE: page_directory_list.tmpl ---
[%########################################
page_directory_list( selected_dir, dir_list, children_files )
List directories in the system, with optionally one directory
selected so that all files in it are listed.
Parameters:
selected_dir: should be set to the name of the directory selected
dir_list: should be an arrayref of arrayrefs, the first element
is the directory name, the second the number of files
in the directory.
children_files: SPOPS::Iterator object containing BasicPage objects.
These are objects in the 'selected_dir'.
########################################%]
[%########################################
MACROS
########################################-%]
[%- MACRO create_expand_choice BLOCK -%]
[%- SET is_chosen = ( dir_info.0 == selected_dir ) ? 1 : 0 -%]
[%- SET is_last = ( dir_info.0 == last_dir ) ? 1 : 0 -%]
[%- IF is_chosen -%]
[%- ( is_last ) ? '/images/file_minus_collapse_last.gif'
: '/images/file_minus_collapse.gif' -%]
[%- ELSE -%]
[%- ( is_last ) ? '/images/file_plus_expand_last.gif'
: '/images/file_plus_expand.gif' -%]
[%- END -%]
[%- END -%]
[% MACRO show_files_in_directory BLOCK -%]
[%- WHILE ( page = children_files.get_next ) -%]
[%- edit_url = OI.make_url( base = '/BasePage/show/', edit = 1,
location = page.location ) -%]
<tr bgcolor="[% PROCESS row_color %]">
<td align="right"><img src="/images/file_tree_line.gif"
height="16" width="19"></td>
<td> </td>
<td><font size="-1">
<a href="[% edit_url %]">[% page.location %]</a>
</font></td>
<td><font size="-1">[% page.title %]</font></td>
</tr>
[% END -%]
[% END -%]
[%########################################
DISPLAY START
########################################-%]
[%- DEFAULT theme = OI.theme_properties -%]
[%- PROCESS error_message -%]
<h2 align="left">Document Manager</h2>
<p align="left">Listing of all document directories. in the
system. Click on the '+' to expand a directory and see its files.</p>
<div align="center">
[% INCLUDE table_bordered_begin( table_width = '90%' ) -%]
[%- last_dir_index = dir_list.max;
last_dir = dir_list.$last_dir_index.0 -%]
[% FOREACH dir_info = dir_list -%]
[%- expand_choice = create_expand_choice();
dir_url = OI.make_url( base = '/BasePage/listing/',
selected_dir = dir_info.0 -%]
<tr bgcolor="[% PROCESS row_color( count = loop.count ) %]">
<td align="right">
<a href="[% dir_url %]"><img src="[% expand_choice %]"
height="16" width="19" border="0"></a></td>
<td colspan="2"><font size="-1">[% dir_info.0 %]</font></td>
<td><font size="-1">([% dir_info.1 %] files)</font></td>
</tr>
[%- IF is_chosen -%]
[%- show_files_in_directory( count = loop.count ) -%]
[% END -%]
[%- END -%]
[% PROCESS table_bordered_end -%]
</div>
--- NEW FILE: page_form.meta ---
name: page_form
title: Form for basic page input
package: base_page
All the information needed for a basic page; this should take the
place of static pages and enable the entire website to be editable via
the browser. Also allows file upload of content.
--- NEW FILE: page_form.tmpl ---
[%- DEFAULT theme = OI.theme_properties;
count = 0 -%]
[%- OI.box_add( 'edit_document_box', location = page.location );
[%- PROCESS error_message -%]
[%- PROCESS static_message -%]
<div align="center">
<h2>Web Page Editor</h2>
<p>Edit the page corresponding to <tt>Location</tt> below. Changes are
made instantly.</p>
<form name="page" method="POST"
action="/Page/edit/">
[% INCLUDE table_bordered_begin( table_width = '90%' ) -%]
[%- display_type = ( page.location )
? 'Edit a' : 'Create a New' -%]
[% INCLUDE label_row( color = theme.head_bgcolor,
label = "$display_type Document" ) -%]
[%- count = count + 1 -%]
[%- location_plabel = '<br><font size="-1">(must be unique)</font>' -%]
[% INCLUDE label_form_text_row( label = 'Location', is_required = 1,
required_display = theme.required,
post_label = location_plabel,
name = 'location', value = page.location,
size = 30, maxlength = 100 ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_text_row( label = 'Title',
name = 'title', value = page.title,
size = 30, maxlength = 150 ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_text_row( label = 'Author',
name = 'author', value = page.author,
size = 30, maxlength = 200 ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_text_row( label = 'Keywords',
name = 'keywords', value = page.keywords,
size = 30, maxlength = 75 ) -%]
[%- count = count + 1 -%]
[%- box_plabel = '<font size="-1"><em>Separate each box by whitespace; order is not important</em></font>' -%]
[% INCLUDE label_form_text_row( label = 'Boxes', post_label = box_plabel,
name = 'boxes', value = page.boxes,
size = 30, maxlength = 75 ) -%]
[%- count = count + 1 -%]
[%- template_plabel = '<font size="-1"><em>main template to use; blank uses the default</em></font>' -%]
[% INCLUDE label_form_text_row( label = 'Main Template', post_label = template.plabel,
name = 'main_template', value = page.main_template,
size = 30, maxlength = 40 ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_textarea_row( label = 'Document', name = 'content',
value = OI.html_encode( page.content ),
cols = 70, rows = 18,
colspan = 2, wrap = 'virtual' ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_date_row( label = 'Active On Date', name = 'active_on',
value = page.active_on ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_date_row( label = 'Expires On Date', name = 'expires_on',
value = page.expires_on ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_checkbox_row( label = 'Active?', name = 'is_active',
value = 'yes', picked = page.is_active ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_row_begin( label = 'Updates' ) -%]
<td>[%- PROCESS object_updates -%]</td>
</tr>
[%- count = count + 1 -%]
[% INCLUDE label_form_submit_row( value = 'Modify' ) -%]
[% PROCESS table_bordered_end -%]
[%- form_hidden( name = 'old_location', value = page.location ) -%]
</form>
</div>
--- NEW FILE: page_search_form.meta ---
name: page_search_form
title: Search for pages (not full-text)
package: base_page
Search form to find pages
--- NEW FILE: page_search_form.tmpl ---
[%- DEFAULT theme = OI.theme_properties;
SET count = 0;
OI.box_add( 'classified_tools_box' ); -%]
[%- PROCESS error_message -%]
[%- PROCESS status_message -%]
<div align="center">
<h2>Search Pages</h2>
<p align="left">Enter criteria below to search pages on the
system. The more criteria you enter, the more restrictive your search
and the fewer results you will retrieve.</p>
<form name="page_search" method="GET" action="/Page/search/">
[% INCLUDE table_bordered_begin( table_width = '75%' ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_text_row( label = 'Title', name = 'title' ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_text_row( label = 'Author', name = 'author' ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_text_row( label = 'Keywords', name = 'keyword' ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_select_row( label = 'Using Template', first_label = 'Templates...',
name = 'main_template', plain = 1,
value_list = template_list ) -%]
[%- count = count + 1 -%]
[% INCLUDE label_form_checkbox_row( label = 'Active?', name = 'is_active',
value = 'yes', picked = 'yes' ) -%]
[%- count = count + 1 -%]
[% INCLUDE form_submit_row( value = 'Search' ) -%]
[% INCLUDE table_bordered_end() -%]
</form>
</div>
Index: edit_document_box.tmpl
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/template/edit_document_box.tmpl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** edit_document_box.tmpl 2001/10/17 12:11:26 1.1
--- edit_document_box.tmpl 2001/10/20 15:14:30 1.2
***************
*** 6,10 ****
location = location ); -%]
<font size="-1"">
! [% theme.bullet %] <a href="[% new_url %]">Create a new document</a>
These actions apply to the document currently onscreen<br>
[% theme.bullet %] <a href="[% edit_url %]">Edit this document</a><br>
--- 6,10 ----
location = location ); -%]
<font size="-1"">
! [% theme.bullet %] <a href="[% new_url %]">Create a new document</a><br>
These actions apply to the document currently onscreen<br>
[% theme.bullet %] <a href="[% edit_url %]">Edit this document</a><br>
|