Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1b54fa1960
Fetching contributors…

Cannot retrieve contributors at this time

726 lines (657 sloc) 17.698 kb
{namespace vix.templates.editor}
/**
* Displays the default mode for the Vix Editor.
*
* @param status
* @param feed
* @param language
* @param title
* @param subtitle
* @param slug
* @param draft
*/
{template .default_mode}
<p><a href="/admin/{$language}/{$feed}/overview">Back to overview</a></p>
<div id="status-message">&nbsp;</div>
<h3 id="caption">
{if $status == 'new'}
Add Document
{else}
Edit Document
{/if}
</h3>
<div class="document-fields-row">
<label for="title" id="title-label">Title:</label>
<input type="text" id="title" name="title" class="input-field"
value="{$title}" />
<input type="checkbox" id="draft" name="draft" class="checkbox-field"
{if $draft}
checked="checked"
{/if} />
<label for="draft">Draft</label>
</div>
<div class="document-fields-row">
<label for="subtitle" id="subtitle-label">Subtitle:</label>
<input type="text" id="subtitle" name="subtitle" class="input-field"
value="{$subtitle}" />
</div>
<div class="document-fields-row">
<label for="slug" id="slug-label"
{if $status == 'edit'}
class="disabled"
{/if}>Slug:</label>
<input type="text" id="slug" name="slug" class="input-field disabled"
disabled="disabled" value="{$slug}" />
<input type="checkbox" id="custom-slug" name="custom-slug"
{if $status == 'edit'}
disabled="disabled"
{/if}
class="checkbox-field" />
<label for="custom-slug" id="custom-slug-label"
{if $status == 'edit'}
class="disabled"
{/if}>Custom</label>
</div>
<div class="document-fields-row hide" id="start-time-row">
<label for="start-time" id="start-time-label">Start:</label>
<input type="text"
id="start-time"
name="start-time"
class="input-field"
value="" />
</div>
<div class="document-fields-row hide" id="end-time-row">
<label for="end-time" id="end-time-label">End:</label>
<input type="text"
id="end-time"
name="end-time"
class="input-field"
value="" />
</div>
<div id="icon-container">
<p><a href="#" id="add-icon-image-link">Add icon image</a></p>
<div id="icon-preview-container">
</div>
</div>
<div id="document-relations">
<p><a href="#" id="add-related-page-link">Add related page</a></p>
<ul id="related-pages-container"></ul>
</div>
<div id="image-relations">
<p><a href="#" id="add-related-image-link">Add related image</a></p>
<ul id="related-images-container"></ul>
</div>
<div id="editor-images"></div>
<div style="clear: both;">&nbsp;</div>
<div id="description-container" class="hide">
<h4 class="editor-caption">Description:</h4>
<div id="description-toolbar"></div>
<div id="description-content"></div>
</div>
<div id="content-container">
<h4 class="editor-caption">Content:</h4>
<div id="toolbar"></div>
<div id="content"></div>
</div>
<p><button id="save-document">Save</button></p>
{/template}
/**
* Provides the content for the datepicker dialog.
*
* @param time
*/
{template .date_picker}
<div id="date-widget"></div>
{if $time}
<div id="datepicker-time-row">
<label for="hour">Hour:</label>
<select name="hour" id="hour">
{for $hour in range(24)}
<option>{if $hour < 10}0{/if}{$hour}</option>
{/for}
</select>
<label for="minute">Minute:</label>
<select name="minute" id="minute">
{for $minute in range(60)}
<option>{if $minute < 10}0{/if}{$minute}</option>
{/for}
</select>
</div>
{/if}
{/template}
/**
*
* @param documents
*/
{template .document_link_options}
{foreach $document in $documents}
<option value="{$document.slug}">{$document.title}</option>
{/foreach}
{/template}
/**
* Displays the menu mode for the Vix Editor.
*
* @param feeds
* @param documents
*/
{template .add_menu_item_dialog}
<form name="add-menu-item-dialog-form" id="add-menu-item-dialog-form">
<p id="add-link-status" class="hide"></p>
<table id="add-menu-item-dialog">
<tr>
<td>
Type:
</td>
<td>
<input type="radio"
name="link-type"
value="internal"
id="link-type-internal"
checked="checked" />
<label for="link-type-internal">Internal</label>
<input type="radio"
name="link-type"
value="external"
id="link-type-external" />
<label for="link-type-external">External</label>
</td>
</tr>
<tr>
<td>
<label for="link-label" id="link-label-label">Label:</label>
</td>
<td>
<input type="text" name="link-label" id="link-label" />
</td>
</tr>
<tr id="internal-link-row">
<td>
<label for="internal-link">Link:</label>
</td>
<td>
<select name="internal-link-feed" id="internal-link-feed">
{foreach $feed in $feeds}
<option value="['{$feed.language}','{$feed.name}']"
>{$feed.name}</option>
{/foreach}
</select>
<select name="internal-link" id="internal-link">
{foreach $document in $documents}
<option value="{$document.slug}">{$document.title}</option>
{/foreach}
</select>
</td>
</tr>
<tr id="external-link-row" class="hide">
<td>
<label for="external-link">URL:</label>
</td>
<td>
<input type="text" name="external-link" id="external-link" />
</td>
</tr>
</table>
</form>
{/template}
/**
* Displays the related page dialog for the Vix Editor.
*
* @param feeds
* @param documents
*/
{template .add_related_page_dialog}
<form name="add-related-page-dialog-form" id="add-related-page-dialog-form">
<p id="add-link-status" class="hide"></p>
<table id="add-related-page-dialog">
{if length($feeds) > 1 }
<tr>
<td>
<label for="internal-link-feed">Feed:</label>
</td>
<td>
<select name="internal-link-feed" id="internal-link-feed">
{foreach $feed in $feeds}
<option value="['{$feed.language}','{$feed.name}']"
>{$feed.name}</option>
{/foreach}
</select>
</td>
</tr>
{/if}
<tr id="internal-link-row">
<td>
<label for="internal-link">Link:</label>
</td>
<td>
<select name="internal-link" id="internal-link">
{foreach $document in $documents}
<option value="{$document.slug}">{$document.title}</option>
{/foreach}
</select>
</td>
</tr>
</table>
</form>
{/template}
/**
* Displays image tag for image dialogs
*
* @param image
*/
{template .related_image}
<img src="{$image.slug}"
alt="{$image.title}"
title="{$image.title}"
id="preview-image-in-dialog" />
{/template}
/**
* Displays the related image dialog for the Vix Editor.
*
* @param feeds
* @param documents
*/
{template .add_related_image_dialog}
<form name="add-related-page-dialog-form" id="add-related-page-dialog-form">
<p id="add-link-status" class="hide"></p>
<table id="add-related-image-dialog">
{if length($feeds) > 1 }
<tr>
<td>
<label for="internal-link-feed">Feed:</label>
</td>
<td>
<select name="internal-link-feed" id="internal-link-feed">
{foreach $feed in $feeds}
<option value="['{$feed.language}','{$feed.name}']"
>{$feed.name}</option>
{/foreach}
</select>
</td>
</tr>
{/if}
<tr id="internal-link-row">
<td>
<label for="internal-link">Image:</label>
</td>
<td>
<select name="internal-link" id="internal-link">
{foreach $document in $documents}
<option value="{$document.slug}">{$document.title}</option>
{/foreach}
</select>
</td>
</tr>
</table>
<div id="image-preview-in-dialog-container">
{call .related_image}
{param image: $documents[0] /}
{/call}
</div>
</form>
{/template}
/**
* Displays image preview.
*
* @param image
*/
{template .image_preview_dialog}
<div id="image-preview-in-dialog-container">
{call .related_image}
{param image: $image /}
{/call}
</div>
{/template}
/**
*
* @param documents
*/
{template .related_pages}
{foreach $document in $documents}
<option value="{$document.slug}">{$document.title}</option>
{/foreach}
{/template}
/**
*
* @param pages
*/
{template .related_page_list_items}
{foreach $page in $pages}
<li>
<input type="hidden" value="{$page.slug}" />
<span>{$page.title}</span>
&nbsp; <a href="#" class="related-page-delete-link">(delete)</a>
</li>
{/foreach}
{/template}
/**
*
* @param images
*/
{template .related_image_list_items}
{foreach $image in $images}
<li>
{call .related_image_list_item}
{param slug: $image.slug /}
{param title: $image.title /}
{/call}
</li>
{/foreach}
{/template}
/**
*
* @param slug
* @param title
*/
{template .related_image_list_item}
<input type="hidden" value="{$slug}" />
<span>{$title}</span>
&nbsp;
<a href="#" class="related-image-preview-link">(preview)</a>
&nbsp;
<a href="#" class="related-image-delete-link">(delete)</a>
{/template}
/**
* Displays the menu mode for the Vix Editor.
*
* @param status
* @param feed
* @param language
* @param title
* @param slug
* @param draft
*/
{template .menu_mode}
<p><a href="/admin/{$language}/{$feed}/overview">Back to overview</a></p>
<div id="status-message">&nbsp;</div>
<h3 id="caption">
{if $status == 'new'}
Add Navigation Menu
{else}
Edit Navigation Menu
{/if}
</h3>
<div class="document-fields-row">
<label for="title" id="title-label">Title:</label>
<input type="text" id="title" name="title" class="input-field"
value="{$title}" />
<input type="checkbox" id="draft" name="draft" class="checkbox-field"
{if $draft}
checked="checked"
{/if} />
<label for="draft">Draft</label>
</div>
<div class="document-fields-row">
<label for="slug" id="slug-label"
{if $status == 'edit'}
class="disabled"
{/if}>Slug:</label>
<input type="text" id="slug" name="slug" class="input-field disabled"
disabled="disabled" value="{$slug}" />
<input type="checkbox" id="custom-slug" name="custom-slug"
{if $status == 'edit'}
disabled="disabled"
{/if}
class="checkbox-field" />
<label for="custom-slug" id="custom-slug-label"
{if $status == 'edit'}
class="disabled"
{/if}>Custom</label>
</div>
<div style="clear: both;">&nbsp;</div>
<div id="menu-builder">
<div id="menu-top-level-drop-zone" class="invisible">
Drag here to move to top level.
</div>
<ul id="menu-container"></ul>
<p>
<a href="#" id="add-menu-item">Add Item</a>
</p>
<p>
Tip: elements can be repositioned by dragging and dropping them
into a new place.
</p>
</div>
<p><button id="save-document">Save</button></p>
{/template}
/**
* @param label
* @param uri
* @param children
* @param nested
*/
{template .menu_item_li}
<li draggable="true" class="draggable">
<span class="item-details">
<span class="link-label">{$label}</span>:
<span class="link-uri">{$uri}</span>
&nbsp;
<a href="#" class="menu-item-delete-link">(delete)</a>
&nbsp;
{if not $nested}
{if not $children}
<a href="#" class="add-sub-item">(add item)</a>
{/if}
{/if}
</span>
{if $children}
<ul draggable="false">
{call .menu_items}
{param links: $children /}
{param new_item: false /}
{param nested: true /}
{/call}
</ul>
{/if}
</li>
{/template}
/**
*
* @param links
* @param new_item
* @param nested
*/
{template .menu_items}
{foreach $item in $links}
{call .menu_item_li}
{param label: $item.label /}
{param uri: $item.uri /}
{param children: $item.children /}
{param nested: $nested /}
{/call}
{/foreach}
{if $new_item}
{call .menu_item_li}
{param label: $new_item.label /}
{param uri: $new_item.uri /}
{param nested: $nested /}
{/call}
{/if}
{if $nested}
<li class="fixed add-item-node drop-on-grandparent" draggable="false">
<a href="#" class="add-item-to-nested-menu fixed">Add Item</a>
</li>
{/if}
{/template}
/**
* @param label
* @param uri
* @param children
*/
{template .rendered_menu_li}
<li>
<a href="{$uri}">{$label}</a>
{if $children}
{call .rendered_menu}
{param links: $children /}
{/call}
{/if}
</li>
{/template}
/**
*
* @param links
*/
{template .rendered_menu}
<ul>
{foreach $item in $links}
{call .rendered_menu_li}
{param label: $item.label /}
{param uri: $item.uri /}
{param children: $item.children /}
{/call}
{/foreach}
</ul>
{/template}
/**
*
* @param hasPrev
* @param feeds
* @param feed
* @param images
*/
{template .editor_images}
<label for="image-feeds">Image feed: </label>
<select name="image-feeds" id="image-feeds">
{foreach $f in $feeds}
<option value="{$f.language}:{$f.name}"
{if $feed == $f.name}selected="selected"{/if}
>{$f.title}</option>
{/foreach}
</select>
{if length($images.documents) > 0}
<p>Drag the image you want to include into the editor box below.</p>
{/if}
<div class="editor-image-bar">
{for $i in range(3)}
{if $images.documents[$i]}
<div class="editor-image-preview-box">
<img src="{$images.documents[$i]['slug']}"
alt="{$images.documents[$i]['title']}"
title="{$images.documents[$i]['title']}" />
</div>
{/if}
{/for}
</div>
<div class="editor-image-bar">
{for $i in range(3,6)}
{if $images.documents[$i]}
<div class="editor-image-preview-box">
<img src="{$images.documents[$i]['slug']}"
alt="{$images.documents[$i]['title']}"
title="{$images.documents[$i]['title']}" />
</div>
{/if}
{/for}
<div style="clear: both;">&nbsp;</div>
<div id="editor-images-pagination-links">
{if $hasPrev}
<div id="editor-images-pagination-prev">
<a id="editor-images-pagination-prev-link" href="#">Previous</a>
</div>
{/if}
{if $images.next}
<div id="editor-images-pagination-next">
<a id="editor-images-pagination-next-link" href="#">Next</a>
</div>
{/if}
{/template}
/****/
{template .no_image_feeds_found}
<p>
There are no image feeds yet. Please make a feed with "Image file"
as the default document type and upload some images.
</p>
{/template}
/**
* Displays the image mode for the Vix Editor.
*
* @param status
* @param feed
* @param language
* @param title
* @param slug
* @param draft
* @param image
*/
{template .image_mode}
<p><a href="/admin/{$language}/{$feed}/overview">Back to overview</a></p>
<div id="status-message">&nbsp;</div>
<div id="image-drop-target">
Drag the image and drop it here.
<div id="image-preview">
{if $image}
<img src="{$image}" title="{$title}" alt="{$title}"/>
{/if}
</div>
</div>
<p id="image-information">&nbsp;</p>
<h3 id="caption">
{if $status == 'new'}
Upload Image
{else}
Edit Image
{/if}
</h3>
<div class="document-fields-row">
<label for="title" id="title-label">Title:</label>
<input type="text" id="title" name="title" class="input-field"
value="{$title}" />
<input type="checkbox" id="draft" name="draft" class="checkbox-field"
{if $draft}
checked="checked"
{/if} />
<label for="draft">Draft</label>
</div>
<div class="document-fields-row">
<label for="slug" id="slug-label"
{if $status == 'edit'}
class="disabled"
{/if}>Slug:</label>
<input type="text" id="slug" name="slug" class="input-field disabled"
disabled="disabled" value="{$slug}" />
<input type="checkbox" id="custom-slug" name="custom-slug"
{if $status == 'edit'}
disabled="disabled"
{/if}
class="checkbox-field" />
<label for="custom-slug" id="custom-slug-label"
{if $status == 'edit'}
class="disabled"
{/if}>Custom</label>
</div>
<div id="toolbar"></div>
<div id="content"></div>
<p><button id="save-document">Save</button></p>
{/template}
/**
* Displays information about images.
*
* @param filename
* @param filetype
* @param size
*/
{template .image_information}
<em>{$filename}</em> ({$filetype}; {round($size,1)} kb)
{/template}
/**
* Display image
*
* @param src
* @param title
*/
{template .image}
<img src="{$src}" alt="{$title}" title="{$title}" />
{/template}
/***/
{template .document_not_found}
<h3>
Document not found. Are you sure it hasn't been deleted?
</h3>
{/template}
/**
*
* @param message
*/
{template .error_dialog}
{$message}
{/template}
Jump to Line
Something went wrong with that request. Please try again.