[limb-svn] r6246 - in 3.x/examples/cms/template: . _include admin_feedback_message admin_news admin_poll poll

svn at limb-project.com svn at limb-project.com
Thu Aug 30 15:46:26 MSD 2007


Author: serega
Date: 2007-08-30 15:46:26 +0400 (Thu, 30 Aug 2007)
New Revision: 6246
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6246

Added:
   3.x/examples/cms/template/_include/
   3.x/examples/cms/template/_include/pager.html
   3.x/examples/cms/template/admin_feedback_message/
   3.x/examples/cms/template/admin_feedback_message/delete.html
   3.x/examples/cms/template/admin_feedback_message/display.html
   3.x/examples/cms/template/admin_feedback_message/edit.html
   3.x/examples/cms/template/admin_feedback_message/filter_form.html
   3.x/examples/cms/template/admin_feedback_message/form_fields.html
   3.x/examples/cms/template/admin_news/
   3.x/examples/cms/template/admin_news/create.html
   3.x/examples/cms/template/admin_news/delete.html
   3.x/examples/cms/template/admin_news/display.html
   3.x/examples/cms/template/admin_news/edit.html
   3.x/examples/cms/template/admin_news/filter_form.html
   3.x/examples/cms/template/admin_news/form_fields.html
   3.x/examples/cms/template/admin_poll/
   3.x/examples/cms/template/admin_poll/create.html
   3.x/examples/cms/template/admin_poll/delete.html
   3.x/examples/cms/template/admin_poll/detail.html
   3.x/examples/cms/template/admin_poll/display.html
   3.x/examples/cms/template/admin_poll/edit.html
   3.x/examples/cms/template/admin_poll/filter_form.html
   3.x/examples/cms/template/admin_poll/form_fields.html
   3.x/examples/cms/template/poll/
   3.x/examples/cms/template/poll/archive.html
   3.x/examples/cms/template/poll/display.html
   3.x/examples/cms/template/poll/front_poll.html
   3.x/examples/cms/template/poll/results.html
Log:
-- added some initial templates to CMS example application

Added: 3.x/examples/cms/template/_include/pager.html
===================================================================
--- 3.x/examples/cms/template/_include/pager.html	                        (rev 0)
+++ 3.x/examples/cms/template/_include/pager.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,22 @@
+
+  <core:optional for='HasMoreThanOnePage'>
+    <table class='pager'>
+    <tr>
+      <td class='prev'>
+        <pager:prev><a href='{$href}' >&laquo; Previous</a></pager:prev>
+        <pager:prev:DISABLED><span>&laquo; Previous</span></pager:prev:DISABLED>
+      </td>  
+      <td class='pager_list'>
+        <pager:LIST>
+          <pager:current> <span class="active">{$number}</span> </pager:current>
+          <pager:number> <a href="{$href}">{$number}</a> </pager:number>
+          <pager:separator> </pager:separator>
+        </pager:LIST>
+      </td>
+      <td class='next'>
+        <pager:next><a href="{$href}">Next &raquo;</a></pager:next>
+        <pager:next:DISABLED><span>Next &raquo;</span></pager:next:DISABLED>
+      </td>
+    </tr>
+    </table>
+  </core:optional>

Added: 3.x/examples/cms/template/admin_feedback_message/delete.html
===================================================================
--- 3.x/examples/cms/template/admin_feedback_message/delete.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_feedback_message/delete.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,34 @@
+<core:wrap file="_cms/popup.html" in="content_zone">
+
+<h1>Delete feedback messaged</h1>
+
+<form id='delete_form' name='delete_form' method='post' runat='server'>
+
+  <active_record:fetch class_path='FeedbackMessage' target="items_to_delete">
+    <fetch:param record_ids="{$#request.ids}">
+  </active_record:fetch>
+
+  <list:list id='items_to_delete'>
+  <table cellspacing=0 cellpadding=0 class='list'>
+  <thead>
+  <tr>
+    <th>Select</th>
+    <th>Message</th>
+  </tr>
+  </thead>
+  <tbody>
+    <list:ITEM>
+    <tr>
+      <td><input type='checkbox' name='ids[]' value='{$id}' checked='true' class='input'/></td>
+      <td>{$message}</td>
+    </tr>
+    </list:ITEM>
+  </tbody>
+  </table>
+  </list:LIST>
+
+  <core:include file='_cms/delete_common_elements.html'>
+
+</form>
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_feedback_message/display.html
===================================================================
--- 3.x/examples/cms/template/admin_feedback_message/display.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_feedback_message/display.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,104 @@
+<core:wrap file="_cms/page.html" in="content_zone">
+
+<div class="header_context">
+
+  <core:datasource id='feedback'>
+  <h1>Feedback messages</h1>
+
+  <active_record:fetch using='FeedbackMessage' find='for_admin' target='messages' order='date_created=DESC' navigator="pager"/>
+
+  <core:include file='_cms/pager.html'/>
+
+  <core:INCLUDE file='_cms/notify_zone.html'/>
+
+  <core:include file='admin_feedback_message/filter_form.html' />
+
+</div>
+
+<div class="list">
+
+  <form name='list_form' method='post'>
+
+     <div class='list_actions_top'>
+        <route_url_set field='delete_url' params="action:delete" />
+        <input type="image" src="/shared/cms/images/button/delete.gif" width='54' height='19' alt='Удалить' onclick='Limb.Form.submitPopup(this.form, "{$delete_url}");return false;'/>
+
+        <route_url_set field='publish_url' params="action:publish" />
+        <input type="image" src="/shared/cms/images/button/published.gif" width='77' height='19' alt='Публиковать' onclick='Limb.Form.submit(this.form, "{$publish_url}");return false;'/>
+
+        <route_url_set field='unpublish_url' params="action:unpublish" />
+        <input type="image" src="/shared/cms/images/button/unpublished.gif" width='113' height='19' alt='Снять с публикации' onclick='Limb.Form.submit(this.form, "{$unpublish_url}");return false;'/>
+      </div>
+
+     <table>
+     <tr>
+       <th><input type='checkbox' onclick='MarkAll(checked);' name='mark_all' /></th>
+       <th>#ID</th>
+       <th>Данные</th>
+       <th>Сообщение</th>
+       <th>Статус</th>
+       <th>Действия</th>
+     </tr>
+
+      <list:list id='messages'>
+      <list:item>
+        <tr class='{$Parity}'>
+          <td><input type='checkbox' name='ids[]' value='{$id}' runat='client'/></td>
+          <td>#{$id}</td>
+          <td>
+            <ul>
+              <li>Автор: <core:optional for='email'><a href='mailto:{$email}'>{$full_name}</a></core:optional>
+                <core:default for='email'>{$full_name}</core:default>
+              </li>
+              <li>Дата: {$date_created.stamp|date:"d.m.y H:m"}</li>
+              <li>
+                <core:default for='comment'>Не отвечен</core:default>
+                <core:optional for='comment'>Отвечен<br/>
+                  Дата ответа: {$date_commented.stamp|date:"d.m.y H:m"}
+                </core:optional>
+              </li>
+            </ul>
+          </td>
+          <td>{$message}</td>
+          <td>
+            <core:optional for='is_published'>
+              <img alt="published" src="/shared/cms/images/icon/published.gif"/>
+            </core:optional>
+            <core:default for='is_published'>
+              <img alt="published" src="/shared/cms/images/icon/unpublished.gif"/>
+            </core:default>
+          </td>
+          <td class='actions'>
+            <route_url params="action:edit,id:{$id}" extra='?popup=1' alt='Редактировать' title='Редактировать'><img src='/shared/cms/images/icon/action/edit.gif' width='16' height='17' /></route_url>
+            <core:optional for='is_published'>
+              <route_url params="action:unpublish,id:{$id}" extra='?refresh=1&feedback_id={$^id}' title='Снять с публикации'><img alt="Снять с публикации" src="/shared/cms/images/icon/unpublished.gif"/></route_url>
+            </core:optional>
+            <core:default for='is_published'>
+              <route_url params="action:publish,id:{$id}" extra='?refresh=1&feedback_id={$^id}' title='Публиковать'><img alt="Публиковать" src="/shared/cms/images/icon/published.gif"/></route_url>
+            </core:default>
+
+            <route_url params="action:delete,id:{$id}" extra='?feedback_id={$^id}' alt='Удалить' title='Удалить'><img src='/shared/cms/images/icon/action/delete.gif' width='14' height='17' /></route_url>
+          </td>
+        </tr>
+      </list:item>
+      </list:list>
+      </table>
+
+      <div class='list_actions'>
+        <route_url_set field='delete_url' params="action:delete" />
+        <input type="image" src="/shared/cms/images/button/delete.gif" width='54' height='19' alt='Удалить' onclick='Limb.Form.submitPopup(this.form, "{$delete_url}");return false;'/>
+
+        <route_url_set field='publish_url' params="action:publish" />
+        <input type="image" src="/shared/cms/images/button/published.gif" width='77' height='19' alt='Публиковать' onclick='Limb.Form.submit(this.form, "{$publish_url}");return false;'/>
+
+        <route_url_set field='unpublish_url' params="action:unpublish" />
+        <input type="image" src="/shared/cms/images/button/unpublished.gif" width='113' height='19' alt='Снять с публикации' onclick='Limb.Form.submit(this.form, "{$unpublish_url}");return false;'/>
+      </div>
+
+  </form>
+
+</div>
+
+</core:datasource>
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_feedback_message/edit.html
===================================================================
--- 3.x/examples/cms/template/admin_feedback_message/edit.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_feedback_message/edit.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,13 @@
+<core:wrap file="_cms/popup.html" in="content_zone">
+
+<form id='feedback_form' name='feedback_form' method='post' runat='server'>
+
+   <h1>Edit message</h1>
+
+   <core:include file='admin_feedback_message/form_fields.html'>
+
+   <core:include file='_cms/edit_common_elements.html'>
+
+</form>
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_feedback_message/filter_form.html
===================================================================
--- 3.x/examples/cms/template/admin_feedback_message/filter_form.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_feedback_message/filter_form.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,22 @@
+<div id="filter">
+  <a class='active_filter'><span>Show/hide filter</span></a>
+  <form id='filter_form' name='filter_form' runat='server' method='post' class='filter'>
+    <div class="fields">
+      <label for='start_date'>Created after:</label> <datetime format="%Y-%m-%d %H:%M" id="start_date" name="start_date" size="20" title="Created after" src='/shared/cms/images/icon/calendar.gif'/>  &nbsp;&nbsp;
+      <label for='finish_date'>Created before:</label> <datetime format="%Y-%m-%d %H:%M" id="finish_date" name="finish_date" size="20" title="Created before" src='/shared/cms/images/icon/calendar.gif'/>
+    </div>
+
+    <div class="fields">
+      <label for='status'>Published?:</label>
+      <select name='status' id='status'>
+        <option value=''>Don't care</option>
+        <option value='0'>No</option>
+        <option value='1'>Yes</option>
+      </select>
+      &nbsp;&nbsp;&nbsp;
+      <input type="image" src="/shared/cms/images/button/apply.gif"  name='submitted' width='69' height='19' alt='Apply' class='button' style='vertical-align:bottom'>
+
+    <input type='hidden' name='uncommented'>
+    </div>
+  </form>
+</div>

Added: 3.x/examples/cms/template/admin_feedback_message/form_fields.html
===================================================================
--- 3.x/examples/cms/template/admin_feedback_message/form_fields.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_feedback_message/form_fields.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,56 @@
+<core:INCLUDE file='_cms/form_errors.html'>
+
+  <ul class="bookmarks">
+    <li id='properties_link'><a>Properties</a></li>
+    <li id='message_link'><a>Message</a></li>
+    <li id='comment_link'><a>Comment</a></li>
+  </ul>
+
+  <div id="bookmark_properties" class='bookmarks_content'>
+
+    <div class="required fields">
+      <label for="first_name" runat="server">First name</label>
+      <input type="text" name="first_name" size="40" title='First name'/>
+    </div>
+
+    <div class="required fields">
+      <label for="last_name" runat="server">Last name</label>
+      <input type="text" name="last_name" size="40" title='Last name'/>
+    </div>
+
+    <div class="fields">
+      <label for="email" runat="server">E-mail</label>
+      <input type="text" name="email" size="40" title='E-mail'/>
+    </div>
+
+    <div>
+      <b>IP адрес: {$ip_address}</b>
+    </div>
+
+  </div>
+
+  <div id="bookmark_message" class='bookmarks_content'>
+
+    <div class="required field">
+      <textarea name="message" class='width100' style='height:300px' title='Message'></textarea>
+    </div>
+  </div>
+
+  <div id="bookmark_comment" class='bookmarks_content'>
+    <div class="field">
+      <textarea name="comment" class='width100' style='height:300px' title='Comment'></textarea>
+    </div>
+  </div>
+
+<script type="text/javascript">
+function initTabs()
+{
+  var tabs = [];
+  tabs.push(new CMS.Tab('properties_link', 'bookmark_properties'));
+  tabs.push(new CMS.Tab('message_link', 'bookmark_message'));
+  tabs.push(new CMS.Tab('comment_link', 'bookmark_comment'));
+  var container = new CMS.TabsContainer(tabs);
+}
+
+initTabs();
+</script>
\ No newline at end of file

Added: 3.x/examples/cms/template/admin_news/create.html
===================================================================
--- 3.x/examples/cms/template/admin_news/create.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_news/create.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,37 @@
+<core:wrap file="_cms/popup.html" in="content_zone">
+
+<script>
+ LIMB_WINDOW_WIDTH = 1000;
+ LIMB_WINDOW_HEIGHT = 750;
+</script>
+
+  <form id='news_form' name='news_form' method='post' enctype="multipart/form-data" runat='server'>
+
+    <h1>Create news</h1>
+
+    <core:INCLUDE file='_cms/form_errors.html'>
+
+    <ul class="bookmarks">
+      <li id='properties_link'><a>Properties</a></li>
+      <li id='content_link'><a>Text</a></li>
+    </ul>
+
+    <core:include file='admin_news/form_fields.html'>
+
+    <core:include file='_cms/create_common_elements.html'>
+  </form>
+  <script type="text/javascript">
+    function initTabs()
+    {
+      var tabs = [];
+      tabs.push(new CMS.Tab('properties_link', 'bookmark_properties'));
+      tabs.push(new CMS.Tab('content_link', 'bookmark_content'));
+      var container = new CMS.TabsContainer(tabs);
+    }
+
+    initTabs();
+  </script>
+
+
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_news/delete.html
===================================================================
--- 3.x/examples/cms/template/admin_news/delete.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_news/delete.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,33 @@
+<core:wrap file="_cms/popup.html" in="content_zone">
+
+  <h1 class='delete'>Delete news</h1>
+
+  <active_record:fetch class_path='News' target="items_to_delete">
+    <fetch:param record_ids="{$#request.ids}">
+  </active_record:fetch>
+
+  <div class="list">
+
+    <form id='news_form' name='news_form' method='post' runat='server'>
+
+      <table>
+      <tr>
+        <th class="selector"><core:INCLUDE file='_cms/selector.html'></th>
+        <th>Title</th>
+      </tr>
+      <list:list id='items_to_delete'>
+        <list:ITEM>
+        <tr class='{$Parity}'>
+          <td><input type='checkbox' name='ids[]' value='{$id}' checked='true'/></td>
+          <td>{$title}</td>
+        </tr>
+        </list:ITEM>
+      </list:LIST>
+      </table>
+
+      <core:include file='_cms/delete_common_elements.html'>
+
+    </form>
+
+  </div>
+</core:wrap>

Added: 3.x/examples/cms/template/admin_news/display.html
===================================================================
--- 3.x/examples/cms/template/admin_news/display.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_news/display.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,73 @@
+<core:wrap file="_cms/page.html" in="content_zone">
+
+  <div class="header_context">
+
+        <h1>News</h1>
+
+        <div class='actions'>
+          <route_url params="action:create" extra='?popup=1'  class='create'>Create news</route_url>
+        </div>
+
+        <active_record:fetch class_path='News' target="news" find='for_admin' order="date=DESC" navigator="pager"/>
+
+        <core:include file='_cms/pager.html'/>
+
+        <core:INCLUDE file='_cms/notify_zone.html'/>
+
+        <core:include file='admin_news/filter_form.html' />
+
+  </div>
+
+  <div class="list">
+
+    <form name='list_form' method='post'>
+
+        <div class='list_actions_top'>
+          <route_url_set field='delete_url' params="action:delete" />
+          <input type="image" src="/shared/cms/images/button/delete.gif" width='54' height='19' alt='Удалить' onclick='Limb.Form.submitPopup(this.form, "{$delete_url}");return false;'/>
+          <route_url_set field='approve_url' params="action:approve" />
+          <input type="image" src="/shared/cms/images/button/confirm.gif" width='68' height='19' alt='Подтвердить' onclick='Limb.Form.submit(this.form, "{$approve_url}");return false;'/>
+        </div>
+
+        <table>
+          <tr>
+            <th class='selector'><core:INCLUDE file='_cms/selector.html'></th>
+            <th>Is published?</th>
+            <th width='100%'>News info</th>
+            <th>Actions</th>
+          </tr>
+        <list:LIST id='news'>
+
+        <list:ITEM>
+            <tr class='{$Parity}'>
+              <td>
+                <input type='checkbox' name='ids[]' value='{$id}' runat='client'/>
+              </td>
+              <td align="center"><core:INCLUDE file='_cms/approved.html'></td>
+              <td>
+                <core:OPTIONAL for='small_image_id'><img alt="" src="{$small_image_url}" class='liquid_right'></core:OPTIONAL>
+                <b>Date:</b> {$iso_date}<br/>
+                <b>Title:</b> {$title}<br/>
+                <b>Front URL:</b> <a href='{$url}'>{$url}</a><br/>
+              <td class='actions'>
+                  <route_url params="action:edit,id:{$id}" extra='?popup=1' title="Edit"><img src='/shared/cms/images/icon/action/edit.gif' width='16' height='17' alt='Edit'/></route_url>
+                  <route_url params="action:delete" extra='?ids[]={$id}&popup=1' title="Delete"><img src='/shared/cms/images/icon/action/delete.gif' width='14' height='17'  alt='Delete'/></route_url>
+              </td>
+            </tr>
+          </list:ITEM>
+        </list:LIST>
+      </table>
+
+      <div class='list_actions'>
+        <route_url_set field='delete_url' params="action:delete" />
+        <input type="image" src="/shared/cms/images/button/delete.gif" width='54' height='19' alt='Delete' onclick='Limb.Form.submitPopup(this.form, "{$delete_url}");return false;'/>
+        <route_url_set field='approve_url' params="action:approve" />
+        <input type="image" src="/shared/cms/images/button/confirm.gif" width='68' height='19' alt='Publish' onclick='Limb.Form.submit(this.form, "{$approve_url}");return false;'/>
+      </div>
+
+    </form>
+
+  </div>
+
+</core:wrap>
+

Added: 3.x/examples/cms/template/admin_news/edit.html
===================================================================
--- 3.x/examples/cms/template/admin_news/edit.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_news/edit.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,36 @@
+<core:wrap file="_cms/popup.html" in="content_zone">
+
+  <form id='news_form' name='news_form' method='post' enctype="multipart/form-data" runat='server'>
+
+    <h1>Edit news</h1>
+
+    <core:INCLUDE file='_cms/form_errors.html'>
+
+    <ul class="bookmarks">
+      <li id='properties_link'><a>Properties</a></li>
+      <li id='content_link'><a>Text</a></li>
+    </ul>
+
+    <core:include file='admin_news/form_fields.html'/>
+
+      <input id='edit'  type="image" src="/shared/cms/images/button/apply.gif" width='69' height='19' class='action'  alt='Save' runat='client'/>
+      <input id='cancel' type="image" src="/shared/cms/images/button/cancel.gif" width='64' height='19' onclick='if(confirm("Are you sure?")){window.close();}return false;' alt='Cancel' runat='client'/>
+
+    </div>
+
+  </form>
+
+  <script type="text/javascript">
+    function initTabs()
+    {
+      var tabs = [];
+      tabs.push(new CMS.Tab('properties_link', 'bookmark_properties'));
+      tabs.push(new CMS.Tab('content_link', 'bookmark_content'));
+      var container = new CMS.TabsContainer(tabs);
+    }
+
+    initTabs();
+  </script>
+
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_news/filter_form.html
===================================================================
--- 3.x/examples/cms/template/admin_news/filter_form.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_news/filter_form.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,22 @@
+<div id="filter">
+  <a class='active_filter'><span>Show/hide filter</span></a>
+  <form id='filter_form' name='filter_form' runat='server' method='post' class='filter'>
+    <div class="fields">
+        <label for='start_date' style='margin-right:8px'>Date after:</label> <datetime format="%Y-%m-%d %H:%M" id="start_date" name="start_date" size="20" title="Date after" class='input' src='/shared/cms/images/icon/calendar.gif'/>  &nbsp;&nbsp;
+        <label for='finish_date' >Date beforeо:</label> <datetime format="%Y-%m-%d %H:%M" id="finish_date" name="finish_date" size="20" title="Date before" class='input' src='/shared/cms/images/icon/calendar.gif'/>
+    </div>
+
+    <div class="fields">
+
+    <label for='status' style='margin-left:25px'>Published?:</label>
+    <select name='status' id='status'  style='margin-right:10px'>
+      <option value=''>Don't care</option>
+      <option value='0'>No</option>
+      <option value='1'>Yes</option>
+    </select>
+
+    <input type="image" src="/shared/cms/images/button/apply.gif"  name='submitted' width='69' height='19' alt='Apply' class='button'>
+    </div>
+  </form>
+</div>
+

Added: 3.x/examples/cms/template/admin_news/form_fields.html
===================================================================
--- 3.x/examples/cms/template/admin_news/form_fields.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_news/form_fields.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,45 @@
+<div id="bookmark_properties" class='bookmarks_content'>
+
+  <div class="left_side">
+
+    <div class="required fields">
+      <label for="title" runat="server">Title</label>
+      <input type="text" id="title" name="title" title='Title' class='input width100' runat="server"/>
+    </div>
+
+    <div class="required fields">
+      <label for="iso_date" runat="server">Date</label>
+      <datetime format="%Y-%m-%d %H:%M" id="iso_date" name="iso_date" size="20" title='Дата' runat="server" src='/shared/cms/images/icon/calendar.gif'/>
+      &nbsp;&nbsp;<small>Date in ISO format <b>YYYY-MM-DD (HH:MM)</b></small>
+    </div>
+
+    <div class="required field">
+      <label for="annotation" runat="server">Annotation</label>
+      <textarea name="annotation" id="annotation" title='Annotation' class='width100' style='height:145'></textarea>
+    </div>
+
+  </div>
+
+  <div class="right_side">
+
+    <span class='border_h'><span class='l'></span><span class='r'></span></span>
+    <div class="border_c">
+      <div class="content">
+        <core:optional for='small_image_id'><img src='{$small_image_url}' id='large_image_preview' /></core:optional>
+        <label for="large_image" runat="server" class='title'>Image</label><br />
+        <input type='file' name="large_image" id="large_image" title='Image' />
+      </div>
+    </div>
+    <span class='border_b'><span class='l'></span><span class='r'></span></span>
+
+   </div>
+
+</div>
+
+<div id="bookmark_content" class='bookmarks_content'>
+
+  <div class="required">
+    <wysiwyg id='content' name='content' width='100%' height='310' title="Text"></wysiwyg>
+  </div>
+
+</div>

Added: 3.x/examples/cms/template/admin_poll/create.html
===================================================================
--- 3.x/examples/cms/template/admin_poll/create.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_poll/create.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,13 @@
+<core:wrap file="_cms/popup.html" in="content_zone">
+
+<form id='poll_form' name='poll_form' method='post' runat='server'>
+
+   <h1>Create poll</h1>
+
+   <core:include file='admin_poll/form_fields.html'>
+
+   <core:include file='_cms/create_common_elements.html'>
+
+</form>
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_poll/delete.html
===================================================================
--- 3.x/examples/cms/template/admin_poll/delete.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_poll/delete.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,34 @@
+<core:wrap file="_cms/popup.html" in="content_zone">
+
+<h1 class='delete'>Delete polls</h1>
+
+<div class='list'>
+
+  <form id='poll_form' name='poll_form' method='post' runat='server'>
+
+    <active_record:fetch class_path='Poll' target="items_to_delete">
+      <fetch:param record_ids="{$#request.ids}">
+    </active_record:fetch>
+
+    <table>
+    <tr>
+      <th class="selector"><core:INCLUDE file='_cms/selector.html'></th>
+      <th>Question</th>
+    </tr>
+    <list:list id='items_to_delete'>
+      <list:ITEM>
+        <tr>
+          <td><input type='checkbox' name='ids[]' value='{$id}' checked='true' /></td>
+          <td>{$question}</td>
+        </tr>
+      </list:ITEM>
+    </list:LIST>
+    </table>
+
+    <core:include file='_cms/delete_common_elements.html'>
+
+  </form>
+
+</div>
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_poll/detail.html
===================================================================
--- 3.x/examples/cms/template/admin_poll/detail.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_poll/detail.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,47 @@
+<core:wrap file="_cms/page.html" in="content_zone">
+
+<ar:fetch using='Poll' target='poll' first='true'>
+ <fetch:param record_id='{$#request.id}'/>
+</ar:fetch>
+
+<core:datasource id='poll'>
+
+<div class="header_context">
+
+<h1>Опрос детально</h1>
+
+<div class='actions'>
+  <route_url alt='Back'><img alt="Back" title="Back" src="/shared/cms/images/icon/action/back.gif"/></route_url>&nbsp;&nbsp;&nbsp;
+  <route_url params="action:edit,id:{$id}" extra='?popup=1' alt='Edit poll'>Edit poll</route_url>
+</div>
+
+<b>Question</b>: {$question|raw}<br/>
+<b>Status</b>: {$status_title}<br/>
+<b>Total votes</b>: {$total_count}<br/>
+
+</div>
+
+<div class="list">
+
+  <list:list from='rounded_answers'>
+  <table>
+    <tr>
+      <th>Answer variant</th>
+      <th width='100%'>Percentage graphically</th>
+      <th>Percentage</th>
+    </tr>
+  <list:item>
+  <tr>
+    <td><b>{$title}</b></td>
+    <td width='200'><img src='/images/1x1.gif' width='{$percentage}%' height='10' style='background-color:#e60000' /></td>
+    <td width='1'><nobr>{$count} ({$percentage}%)</nobr></td>
+  </tr>
+  </list:item>
+  </table>
+  </list:list>
+
+</div>
+
+</core:datasource>
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_poll/display.html
===================================================================
--- 3.x/examples/cms/template/admin_poll/display.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_poll/display.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,73 @@
+<core:wrap file="_cms/page.html" in="content_zone">
+
+  <div class="header_context">
+
+    <h1>Polls</h1>
+
+    <div class="actions">
+      <route_url params="action:create" extra='?popup=1' alt='Create poll' class='create'>Create poll</route_url>
+    </div>
+
+    <core:INCLUDE file='_cms/notify_zone.html'/>
+
+    <core:include file='admin_poll/filter_form.html' />
+
+  </div>
+
+  <active_record:fetch class_path='src/model/rtPoll' find='for_admin' target='messages'/>
+
+  <div class="list">
+
+    <form name='list_form' method='post'>
+
+        <table>
+          <tr>
+            <th class='selector'><core:INCLUDE file='_cms/selector.html'></th>
+            <th>#ID</th>
+            <th>Date created</th>
+            <th width='100%'>Question</th>
+            <th>Answers</th>
+            <th>Status</th>
+            <th>Действия</th>
+          </tr>
+          <list:list id='messages'>
+            <list:item>
+              <tr class='{$Parity}'>
+                <td class='selector'><input type='checkbox' name='ids[]' value='{$id}' runat='client'/></td>
+                <td>{$signature}</td>
+                <td>{$date_created|date:"d.m.y H:m"}</td>
+                <td><route_url params="controller:admin_poll,action:detail,id:{$id}">{$question}</route_url></td>
+                <td style='white-space:nowrap'>
+                  <list:list from='answers'><ul><list:item><li>{$title}</li></list:item></ul></list:list>
+                </td>
+                <td>{$status_title}</td>
+                <td class='actions'>
+                  <route_url params="controller:admin_poll,action:edit,id:{$id}" extra='?popup=1' alt='Edit poll'><img src='/shared/cms/images/icon/action/edit.gif' width='16' height='17' alt='Edit'/></route_url>
+                  <route_url params="controller:admin_poll,action:delete" extra='?popup=1&ids[]={$id}' alt='Delete poll'><img src='/shared/cms/images/icon/action/delete.gif' width='14' height='17'  alt='Delete'/></route_url>
+                </td>
+              </tr>
+            </list:item>
+          </list:list>
+        </table>
+
+        <div class='list_actions'>
+
+          <route_url_set field='delete_url' params="controller:admin_poll,action:delete" />
+          <input type="image" src="/shared/cms/images/button/delete.gif" width='54' height='19' alt='Delete' onclick='Limb.Form.submitPopup(this.form, "{$delete_url}");return false;'/>
+
+          <route_url_set field='activate_url' params="controller:admin_poll,action:activate" />
+          <input type="image" src="/shared/cms/images/button/active.gif" width='88' height='19' alt='Activate' onclick='Limb.Form.submit(this.form, "{$activate_url}");return false;'/>
+
+          <route_url_set field='deactivate_url' params="controller:admin_poll,action:deactivate" />
+          <input type="image" src="/shared/cms/images/button/unactive.gif" width='98' height='19' alt='Deactivate' onclick='Limb.Form.submit(this.form, "{$deactivate_url}");return false;'/>
+
+          <route_url_set field='to_archive_url' params="controller:admin_poll,action:archive" />
+          <input type="image" src="/shared/cms/images/button/archive.gif" width='112' height='19' alt='Move to archive' onclick='Limb.Form.submit(this.form, "{$to_archive_url}");return false;'/>
+
+        </div>
+
+    </form>
+
+  </div>
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_poll/edit.html
===================================================================
--- 3.x/examples/cms/template/admin_poll/edit.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_poll/edit.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,13 @@
+<core:wrap file="_cms/popup.html" in="content_zone">
+
+<form id='poll_form' name='poll_form' method='post' runat='server'>
+
+   <h1>Edit poll</h1>
+
+   <core:include file='admin_poll/form_fields.html'>
+
+   <core:include file='_cms/edit_common_elements.html'>
+
+</form>
+
+</core:wrap>

Added: 3.x/examples/cms/template/admin_poll/filter_form.html
===================================================================
--- 3.x/examples/cms/template/admin_poll/filter_form.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_poll/filter_form.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,20 @@
+<div id="filter">
+  <a class='active_filter'><span>Show/hide filter</span></a>
+  <form id='filter_form' name='filter_form' runat='server' method='post' class='filter'>
+
+    <div class="fields">
+        <label for='start_date'>Created after:</label> <datetime format="%Y-%m-%d %H:%M" id="start_date" name="start_date" size="20" title="Created after" src='/shared/cms/images/icon/calendar.gif'/>
+        <label for='finish_date'>Created before:</label> <datetime format="%Y-%m-%d %H:%M" id="finish_date" name="finish_date" size="20" title="Created before" src='/shared/cms/images/icon/calendar.gif'/>
+    </div>
+
+    <div class="fields">
+      <?php
+        $select = $template->getChild('status');
+        $select->setChoices(rtPoll :: getStatuses());
+      ?>
+      <label for='status'>Status:</label> <select id='status' name='status' runat='server'><option value='0'>--Select--</option></select>
+
+      <input type="image" src="/shared/cms/images/button/apply.gif"  name='submitted' width='69' height='19' alt='Apply' class='button'>
+    </div>
+  </form>
+</div>
\ No newline at end of file

Added: 3.x/examples/cms/template/admin_poll/form_fields.html
===================================================================
--- 3.x/examples/cms/template/admin_poll/form_fields.html	                        (rev 0)
+++ 3.x/examples/cms/template/admin_poll/form_fields.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,89 @@
+<core:INCLUDE file='_cms/form_errors.html'>
+
+
+<ul class="bookmarks">
+  <li id='properties_link'><a>Properties</a></li>
+</ul>
+
+<div id="bookmark_properties" class='bookmarks_content'>
+
+   <span class='border_h'><span class='l'></span><span class='r'></span></span>
+    <div class="border_c">
+      <div class="content">
+        <label for="question" runat="server" class='title'>Question</label><br/>
+        <textarea name="question" title='Вопрос' cols='70' rows='4'></textarea>
+      </div>
+    </div>
+    <span class='border_b'><span class='l'></span><span class='r'></span></span>
+
+   <span class='border_h'><span class='l'></span><span class='r'></span></span>
+    <div class="border_c">
+      <div class="content">
+        <label for="status" runat="server" class='title'>Status</label><br/>
+        <?php $template->getChild('status')->setChoices(rtPoll :: getStatuses()); ?>
+        <select name="status" id='status' title='Статус'></select>
+      </div>
+    </div>
+    <span class='border_b'><span class='l'></span><span class='r'></span></span>
+
+    <span class='border_h'><span class='l'></span><span class='r'></span></span>
+    <div class="border_c">
+      <div class="content">
+      <label class='title'>Answer variants:</label>
+        <div id='variants_info'>
+          <div id='variant_container'>
+            <div id='variant_sample'>
+              <label for="answers_titles[]">Variant:</label>
+              <input class="input" name="answers_titles" type="text" size='60' runat="client"/>
+
+              <input type="hidden" name="answers_ids" runat="client"/>
+
+              <a id="del" href='javascript:void();' style="text-decoration:none" title="Удалить"><input type='button' value='x' runat='client' /></a>
+
+              <input id="up" type="hidden" runat="client"/>
+              <input id="add" type="hidden" runat="client"/>
+              <input id="down" type="hidden" runat="client"/><br /><br />
+
+            </div>
+          </div>
+        </div>
+        <a href='javascript:void();' id='add_variant'>Add new variant</a>
+      </div>
+    </div>
+    <span class='border_b'><span class='l'></span><span class='r'></span></span>
+
+  <script>
+  function init_variant_sample(obj, index, init_arr)
+  {
+    var inputs = obj.getElementsByTagName('input')
+    var title_input = inputs[0];
+    var id_input = inputs[1];
+    title_input.id = title_input.id + index;
+    title_input.name = title_input.name + '[' + index + ']';
+    id_input.id = id_input.id + index;
+    id_input.name = id_input.name + '[' + index + ']';
+
+    if(init_arr[index])
+    {
+      title_input.value = init_arr[index]['title'];
+      id_input.value = init_arr[index]['id'];
+    }
+  }
+
+  <iterator:transfer from='answers' target="answers" />
+  var init_variants_arr = [
+  <list:LIST id='answers'>
+  <list:ITEM>{title: '{$title}', id: '{$id}'}<list:SEPARATOR>,</list:SEPARATOR></list:ITEM>
+  <list:DEFAULT>{title: '', id: ''}</list:DEFAULT>
+  </list:LIST>
+  ];
+
+  function create_variants_list()
+  {
+    var pc = new Limb.DynamicList('add_variant', 'variant_sample', 'variant_container', init_variants_arr, init_variant_sample)
+  }
+
+  jQuery(window).ready(create_variants_list);
+  </script>
+
+</div>
\ No newline at end of file

Added: 3.x/examples/cms/template/poll/archive.html
===================================================================
--- 3.x/examples/cms/template/poll/archive.html	                        (rev 0)
+++ 3.x/examples/cms/template/poll/archive.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,29 @@
+<core:wrap file="page.html" in="content_zone">
+
+<active_record:fetch class_path='Poll' find='archived' target='polls' order='date_created=DESC' navigator='pager'/>
+
+<strong class='title'>Previous polls</strong>
+
+<list:list id='polls'>
+  <list:item>
+    <b>{$question}</b>
+
+    <list:list from='rounded_answers'>
+    <table class='poll_result'>
+    <list:item>
+    <tr>
+      <td>{$title}</td>
+      <td width='200' class='percent'><img src='/images/1x1.gif' width='{$percentage + 1}%' height='10' style='background-color:#7ac142' /></td>
+      <td width='1'><nobr>{$percentage}%</nobr></td>
+    </tr>
+    </list:item>
+    </table>
+    </list:list>
+  </list:item>
+</list:list>
+
+<pager:navigator id="pager" items="10">
+         <core:include file='_include/pager.html' />
+</pager:navigator>
+
+</core:wrap>

Added: 3.x/examples/cms/template/poll/display.html
===================================================================
--- 3.x/examples/cms/template/poll/display.html	                        (rev 0)
+++ 3.x/examples/cms/template/poll/display.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,45 @@
+<core:wrap file="page.html" in="content_zone">
+
+<active_record:fetch class_path='Poll' target='active_poll' first='true'>
+  <fetch:param find='active'/>
+</active_record:fetch>
+
+<h1>{$title}</h1>
+
+<core:datasource id='active_poll'>
+{$question}
+<core:OPTIONAL for='can_vote'>
+<form name='poll_form' method='post'>
+  <input type='hidden' name='poll_id' value='{$id}'/>
+  <input type='hidden' name='action' value='vote'/>
+  <list:list from='answers'>
+    <list:item>
+        <input type='radio' id='variant_{$id}' name='answer' value='{$id}' runat='client'/>
+        <label for='variant_{$id}'>{$title}</label><br/>
+    </list:item>
+  </list:list>
+
+  <input type='submit' value='Голосовать'/>
+</form>
+</core:OPTIONAL>
+
+<core:DEFAULT for='can_vote'>
+  <list:list from='rounded_answers'>
+  <table>
+  <list:item>
+  <tr>
+    <td>{$title}</td>
+    <td width='200'><img src='/images/1x1.gif' width='{$percentage}%' height='10' style='background-color:#e60000' /></td>
+    <td width='1'><nobr>{$count} ({$percentage}%)</nobr></td>
+  </tr>
+  </list:item>
+  </table>
+  </list:list>
+
+</core:DEFAULT>
+
+</core:datasource>
+
+<a href='?action=archive'>Все опросы</a>
+
+</core:wrap>

Added: 3.x/examples/cms/template/poll/front_poll.html
===================================================================
--- 3.x/examples/cms/template/poll/front_poll.html	                        (rev 0)
+++ 3.x/examples/cms/template/poll/front_poll.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,24 @@
+<core:datasource id='front_active_poll'>
+<core:optional for='id'>
+<strong class='title'>Poll</strong>
+
+<h2>Question:</h2>
+<strong>{$question}</strong>
+<form name='poll_form' method='post' action='/poll/vote/{$id}' target='poll_popup'>
+  <input type='hidden' name='poll_id' value='{$id}'/>
+  <input type='hidden' name='action' value='vote'/>
+
+  <list:list from='answers'>
+    <list:item>
+      <label for='variant_{$id}'><input type="radio" id='variant_{$id}' name='answer' value='{$id}' runat='client'>{$title}</label>
+    </list:item>
+  </list:list>
+
+  <input type="image" src="/images/button/vote.gif" onclick='new Limb.Window(this.href, "poll_popup", {width: 300, height: 300, noautoresize: true});' alt='VOTE' width='85' height='21' class='button'>
+ <a href="/poll/results/{$id}" onclick='new Limb.Window(this.href, "poll_popup", {width: 300, height: 300, noautoresize: true}); return false;' class='view_result'>View results without voting &raquo;</a>
+ <a href="/poll/archive" class='view_result'>Archive &raquo; </a>
+</form>
+
+</core:optional>
+</core:datasource>
+

Added: 3.x/examples/cms/template/poll/results.html
===================================================================
--- 3.x/examples/cms/template/poll/results.html	                        (rev 0)
+++ 3.x/examples/cms/template/poll/results.html	2007-08-30 11:46:26 UTC (rev 6246)
@@ -0,0 +1,35 @@
+<html>
+<core:include file='_include/head.html' />
+<body id='poll_result'>
+<div class="content">
+
+  <ar:fetch using='Poll' target='poll' first='true'>
+   <fetch:param record_id='{$#request.id}'/>
+  </ar:fetch>
+
+  <h1>Poll results</h1>
+
+  <core:datasource id='poll'>
+      <core:optional for='#vote_restrict'>
+        <font color='#7ac142'><b>You already voted for this poll!</b></font>
+      </core:optional>
+
+      <strong class='title'>question:</strong>
+      <b>{$question|raw}</b>
+
+      <list:list from='rounded_answers'>
+      <table>
+      <list:item>
+      <tr>
+        <td>{$title}</td>
+        <td width='200' class='percent'><img src='/images/1x1.gif' width='{$percentage + 1}%' height='10' style='background-color:#7ac142' /></td>
+        <td width='1'><nobr>{$percentage}%</nobr></td>
+      </tr>
+      </list:item>
+      </table>
+      </list:list>
+
+  </core:datasource>
+</div>
+</body>
+</html>



More information about the limb-svn mailing list