diff options
| author | Christian Fowler <spider@viovio.com> | 2005-12-11 06:34:19 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2005-12-11 06:34:19 +0000 |
| commit | 643f1d7f43ef14bb415fd69ba435035d1426a3a9 (patch) | |
| tree | c89b28e45811025af6a1ad684b6b6e7df5ea96a4 /templates | |
| parent | c0ede787f79de2f5ff07146148676e102d12ba23 (diff) | |
| download | newsletters-643f1d7f43ef14bb415fd69ba435035d1426a3a9.tar.gz newsletters-643f1d7f43ef14bb415fd69ba435035d1426a3a9.tar.bz2 newsletters-643f1d7f43ef14bb415fd69ba435035d1426a3a9.zip | |
add edition saving and listing, almost to the point of getting send working
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/admin_newsletters.tpl | 8 | ||||
| -rw-r--r-- | templates/edit_edition.tpl | 93 | ||||
| -rw-r--r-- | templates/edit_newsletter.tpl | 28 | ||||
| -rw-r--r-- | templates/list_editions.tpl | 16 | ||||
| -rw-r--r-- | templates/list_editions_inc.tpl | 24 | ||||
| -rw-r--r-- | templates/menu_newsletters.tpl | 4 | ||||
| -rw-r--r-- | templates/newsletters.tpl | 2 | ||||
| -rw-r--r-- | templates/send_newsletters.tpl | 68 | ||||
| -rw-r--r-- | templates/view_edition.tpl | 26 | ||||
| -rw-r--r-- | templates/view_newsletter.tpl | 33 |
10 files changed, 219 insertions, 83 deletions
diff --git a/templates/admin_newsletters.tpl b/templates/admin_newsletters.tpl index 88c27fc..b9cd035 100644 --- a/templates/admin_newsletters.tpl +++ b/templates/admin_newsletters.tpl @@ -1,7 +1,7 @@ {strip} <div class="floaticon">{bithelp}</div> -<div class="edit ___"> +<div class="edit newsletters"> <div class="header"> <h1>{tr}Newsletter Settings{/tr}</h1> </div> @@ -79,19 +79,17 @@ <th>{smartlink ititle="Description" isort=description offset=$offset}</th> <th>{smartlink ititle="Created" isort=last_sent offset=$offset}</th> <th>{smartlink ititle="Last Sent" isort=created offset=$offset}</th> - <th>{smartlink ititle="Users [ Confirmed ]" isort=users offset=$offset}</th> - <th>{smartlink ititle="Editions" isort=editions offset=$offset}</th> + <th>{smartlink ititle="Users Unsubscribed" isort=users offset=$offset}</th> <th>{tr}Action{/tr}</th> </tr> {foreach key=nlId from=$newsletters item=nl} <tr class="{cycle values='odd,even'}"> - <td>{$nl.title}</td> + <td><a href="{$smarty.const.NEWSLETTERS_PKG_URL}index.php?nl_id={$nlId}">{$nl.title}</a></td> <td>{$nl.data}</td> <td>{$nl.created|bit_short_date}</td> <td>{$nl.last_sent|bit_short_date}</td> <td style="text-align:right;"><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/admin_newsletter_subscriptions.php?nl_id={$nlId}">{$nl.users|default:0} [ {$channels[user].confirmed|default:0} ]</a></td> - <td style="text-align:right;">{$nl.editions|default:0}</td> <td style="text-align:right;"> <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={$sort_mode}&remove=1&nl_id={$nlId}">{biticon ipackage=liberty iname=delete iexplain=Remove}</a> <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?offset={$offset}&sort_mode={$sort_mode}&nl_id={$nlId}">{biticon ipackage=liberty iname=edit iexplain=Edit}</a> diff --git a/templates/edit_edition.tpl b/templates/edit_edition.tpl index 70305d0..7b2b151 100644 --- a/templates/edit_edition.tpl +++ b/templates/edit_edition.tpl @@ -2,7 +2,7 @@ <div class="edit newsletters"> <div class="header"> - <h1>{tr}Prepare a newsletter to be sent{/tr}</h1> + <h1>{if $gContent->isValid()}{tr}Edit Edition{/tr}: {$gContent->getTitle()}{else}{tr}Create New Edition{/tr}{/if}</h1> </div> {if $preview eq 'y'} @@ -16,43 +16,82 @@ {/if} <div class="body"> - {form legend="Newsletter" id="editpageform"} - <div class="row"> - {formlabel label="Subject" for="subject"} - {forminput} - <input type="text" maxlength="250" size="40" name="title" value="{$info.subject|escape}" /> - {formhelp note=""} - {/forminput} - </div> - - <div class="row"> - {formlabel label="" for=""} - {forminput} - <select name="nl_id"> - {foreach from=$newsletters item=nl key=nlId} - <option value="{$nlId|escape}" {if $nlId eq $nl_id}selected="selected"{/if}>{$nl.title}</option> - {/foreach} - </select> - {formhelp note=""} - {/forminput} - </div> + {formfeedback success=$success error=$gContent->mErrors} + {form enctype="multipart/form-data" id="editpageform"} + <input type="hidden" name="edition_id" value="{$gContent->mEditionId}" /> + {jstabs} + {jstab title="Edition Body"} + {legend legend="Edition Body"} + <div class="row"> + {formlabel label="Subject" for="subject"} + {forminput} + <input type="text" maxlength="250" size="40" name="title" value="{$gContent->getTitle()|escape}" /> + {formhelp note=""} + {/forminput} + </div> - {if $tiki_p_use_content_templates eq 'y'} <div class="row"> {formlabel label="" for=""} {forminput} - <select name="template_id" onchange="javascript:document.getElementById('editpageform').submit();"> - <option value="0">{tr}none{/tr}</option> - {section name=ix loop=$templates} - <option value="{$templates[ix].template_id|escape}">{$templates[ix].name}</option> - {/section} + <select name="nl_id"> + {foreach from=$newsletters item=nl key=nlId} + <option value="{$nlId|escape}" {if $nlId eq $nl_id}selected="selected"{/if}>{$nl.title}</option> + {/foreach} </select> {formhelp note=""} {/forminput} </div> + + {if $gBitUser->hasPermission( 'bit_p_use_content_templates' ) && $templates} + <div class="row"> + {formlabel label="Template" for=""} + {forminput} + <select name="template_id" onchange="javascript:document.getElementById('editpageform').submit();"> + <option value="0">{tr}none{/tr}</option> + {section name=ix loop=$templates} + <option value="{$templates[ix].template_id|escape}">{$templates[ix].name}</option> + {/section} + </select> + {formhelp note=""} + {/forminput} + </div> + {/if} + + {include file="bitpackage:liberty/edit_services_inc.tpl serviceFile=content_edit_mini_tpl} + + <div class="row"> + {formlabel label="Draft" for="draft"} + {forminput} + <input type="checkbox" name="is_draft" value="y" {if $gContent->getField('is_draft')}checked="checked"{/if}" /> + {formhelp note=""} + {/forminput} + </div> + + <div class="row"> + {formlabel label="Body" for="body"} + {forminput} + <textarea name="edit" rows="25" cols="60">{$gContent->getField('data')|escape}</textarea> + {formhelp note=""} + {/forminput} + </div> + + {/legend} + {/jstab} + + {include file="bitpackage:liberty/edit_services_inc.tpl serviceFile=content_edit_tab_tpl} + + {if $gBitUser->hasPermission('bit_p_content_attachments')} + {jstab title="Attachments"} + {legend legend="Attachments"} + {include file="bitpackage:liberty/edit_storage.tpl"} + {/legend} + {/jstab} {/if} + {/jstabs} + <div class="row submit"> + <input type="submit" name="cancel" value="{tr}Cancel{/tr}" /> <input type="submit" name="preview" value="{tr}Preview{/tr}" /> <input type="submit" name="save" value="{tr}Save Edition{/tr}" /> </div> diff --git a/templates/edit_newsletter.tpl b/templates/edit_newsletter.tpl new file mode 100644 index 0000000..84876be --- /dev/null +++ b/templates/edit_newsletter.tpl @@ -0,0 +1,28 @@ +<h2>{tr}Prepare a newsletter to be sent{/tr}</h2> +<form action="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php" method="post" id='editpageform'> +<table class="panel"> +<tr><td>{tr}Subject{/tr}:</td><td><input type="text" maxlength="250" size="40" name="title" value="{$info.subject|escape}" /></td></tr> +<tr><td>{tr}Newsletter{/tr}:</td><td> + <select name="nl_id"> + {foreach from=$newsletters item=nl key=nlId} + <option value="{$nlId|escape}" {if $nlId eq $nl_id}selected="selected"{/if}>{$nl.title}</option> + {/foreach} + </select> +</td></tr> +{if $tiki_p_use_content_templates eq 'y'} +<tr><td>{tr}Apply template{/tr}</td><td> +<select name="template_id" onchange="javascript:document.getElementById('editpageform').submit();"> +<option value="0">{tr}none{/tr}</option> +{section name=ix loop=$templates} +<option value="{$templates[ix].template_id|escape}">{$templates[ix].name}</option> +{/section} +</select> +</td></tr> +{/if} +<tr><td>{tr}Data{/tr}:</td><td><textarea name="edit" rows="25" cols="60">{$info.data|escape}</textarea></td></tr> +<tr class="panelsubmitrow"><td colspan="2"> +<input type="submit" name="preview" value="{tr}Preview{/tr}" /> <input type="submit" name="save" value="{tr}Send Newsletters{/tr}" /> +</td></tr> +</table> +</form> +{/if} diff --git a/templates/list_editions.tpl b/templates/list_editions.tpl new file mode 100644 index 0000000..b611701 --- /dev/null +++ b/templates/list_editions.tpl @@ -0,0 +1,16 @@ +{strip} +<div class="listing fisheye"> + <div class="header"> + <h1>{tr}Newsletter Editions{/tr}</h1> + </div> + + <div class="body"> + {minifind} + + {include file='bitpackage:newsletters/list_editions_inc.tpl'} + + <div class="clear"></div> + {libertypagination page=$curPage numPages=$numPages find=$find} + </div> <!-- end .body --> +</div> <!-- end .fisheye --> +{/strip} diff --git a/templates/list_editions_inc.tpl b/templates/list_editions_inc.tpl new file mode 100644 index 0000000..5a783bc --- /dev/null +++ b/templates/list_editions_inc.tpl @@ -0,0 +1,24 @@ + <ul class="clear data"> + {foreach from=$editionList key=editionId item=ed} + <li class="item {cycle values='odd,even'} {$ed.content_type_guid}"> + <div class="floaticon"> + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?edition_id={$ed.edition_id}">{biticon ipackage=liberty iname="mail_send" iexplain="Send"}</a> + </div> + <h2><a href="{$ed.display_url}">{$ed.title}</a></h2> + {if $ed.newsletter_title} + {tr}in{/tr} <a href="{$smarty.const.NEWSLETTERS_PKG_URL}?nl_id={$ed.nl_id}">{$ed.newsletter_title}</a></h3> + {/if} + + {if $fisheye_list_description eq 'y'} + <p>{$ed.data|truncate:200}</p> + {/if} + + <div class="clear"></div> + </li> + {foreachelse} + <li class="item norecords"> + {tr}No editions{/tr} + </li> + {/foreach} + </ul> + diff --git a/templates/menu_newsletters.tpl b/templates/menu_newsletters.tpl index dbcca5d..0d85717 100644 --- a/templates/menu_newsletters.tpl +++ b/templates/menu_newsletters.tpl @@ -1,6 +1,10 @@ {strip} <ul> <li><a class="item" href="{$smarty.const.NEWSLETTERS_PKG_URL}index.php">{tr}List newsletters{/tr}</a></li> + <li><a class="item" href="{$smarty.const.NEWSLETTERS_PKG_URL}edition.php">{tr}List editions{/tr}</a></li> + {if $gBitUser->hasPermission( 'tiki_p_admin_newsletters' )} + <li><a class="item" href="{$smarty.const.NEWSLETTERS_PKG_URL}edition_edit.php">{tr}Create Edition{/tr}</a></li> + {/if} {if $gBitUser->hasPermission( 'tiki_p_admin_newsletters' )} <li><a class="item" href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php">{tr}Send newsletters{/tr}</a></li> <li><a class="item" href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php">{tr}Admin newsletters{/tr}</a></li> diff --git a/templates/newsletters.tpl b/templates/newsletters.tpl index d5f8368..0ae8124 100644 --- a/templates/newsletters.tpl +++ b/templates/newsletters.tpl @@ -60,7 +60,7 @@ {foreach from=$newsletters item=nl key=nlId} {if $newsletters.individual ne 'y' or $newsletters.individual_bit_p_subscribe_newsletters eq 'y'} <tr class="{cycle values='odd,even'}"> - <td><a href="{$smarty.const.NEWSLETTERS_PKG_URL}index.php?nl_id={$nl.nl_id}&info=1">{$nl.title}</a></td> + <td><a href="{$smarty.const.NEWSLETTERS_PKG_URL}index.php?nl_id={$nl.nl_id}">{$nl.title}</a></td> <td>{$nl.data}</td> </tr> {/if} diff --git a/templates/send_newsletters.tpl b/templates/send_newsletters.tpl index 33c010a..76db98a 100644 --- a/templates/send_newsletters.tpl +++ b/templates/send_newsletters.tpl @@ -1,5 +1,12 @@ -<a class="pagetitle" href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php">{tr}Send newsletters{/tr}</a> -<br /><br /> +{strip} +<div class="floaticon">{bithelp}</div> + +<div class="edit newsletters"> + <div class="header"> + <h1>{tr}Send newsletters{/tr}</h1> + </div> + + <div class="body"> {if $emited eq 'y'} {tr}The newsletter was sent to {$sent} email addresses{/tr}<br /><br /> @@ -20,55 +27,16 @@ {else} <h2>{tr}Sent editions{/tr}</h2> -<table class="find"> -<tr><td>{tr}Find{/tr}</td> - <td> - <form method="get" action="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php"> - <input type="text" name="find" value="{$find|escape}" /> - <input type="submit" value="{tr}find{/tr}" name="search" /> - <input type="hidden" name="sort_mode" value="{$sort_mode|escape}" /> - </form> - </td> -</tr> -</table> -<table> -<tr> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}name{/tr}</a></th> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={if $sort_mode eq 'subject_desc'}subject_asc{else}subject_desc{/if}">{tr}subject{/tr}</a></th> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={if $sort_mode eq 'users_desc'}users_asc{else}users_desc{/if}">{tr}users{/tr}</a></th> -<th><a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={if $sort_mode eq 'sent_desc'}sent_asc{else}sent_desc{/if}">{tr}sent{/tr}</a></th> -<th>{tr}action{/tr}</th> -</tr> -{cycle values="even,odd" print=false} -{foreach from=$editions key=edId item=ed} -<tr class="{cycle}"> -<td>{$ed.title}</td> -<td>{$ed.subject}</td> -<td>{$ed.users}</td> -<td>{$ed.sent|bit_short_datetime}</td> -<td> - <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={$sort_mode}&remove={$ed.edition_id}">{tr}remove{/tr}</a> - <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?offset={$offset}&sort_mode={$sort_mode}&edition_id={$ed.edition_id}">{tr}use{/tr}</a> -</td> -</tr> -{/foreach} -</table> +{include file="bitpackage:newsletters/list_editions_inc.tpl"} + +{pagination} + +{minifind} -<div class="pagination"> -{if $prev_offset >= 0} -[<a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?find={$find}&offset={$prev_offset}&sort_mode={$sort_mode}">{tr}prev{/tr}</a>] -{/if} -{tr}Page{/tr}: {$actual_page}/{$cant_pages} -{if $next_offset >= 0} - [<a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?find={$find}&offset={$next_offset}&sort_mode={$sort_mode}">{tr}next{/tr}</a>] -{/if} -{if $direct_pagination eq 'y'} -<br /> -{section loop=$cant_pages name=foo} -{assign var=selector_offset value=$smarty.section.foo.index|times:$maxRecords} -<a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/send.php?find={$find}&offset={$selector_offset}&sort_mode={$sort_mode}"> -{$smarty.section.foo.index_next}</a> -{/section} {/if} + + + </div> </div> +{/strip}
\ No newline at end of file diff --git a/templates/view_edition.tpl b/templates/view_edition.tpl new file mode 100644 index 0000000..16da88d --- /dev/null +++ b/templates/view_edition.tpl @@ -0,0 +1,26 @@ +<div class="display blogs"> + <div class="floaticon"> + {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='icon'} + + {if $gContent->isOwner() || $gBitUser->hasPermission( 'bit_p_newsletter_admin' )} + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}edition_edit.php?edition_id={$gContent->mEditionId}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}edition_edit.php?edition_id={$gContent->mEditionId}&remove=1">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> + {/if} + + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}send_newsletter.php?edition_id={$gContent->mEditionId}">{biticon ipackage=liberty iname="mail_send" iexplain="email this post"}</a> + </div> + + <div class="header"> + <h1>{$gContent->getTitle()}</h1> + {if $gContent->mNewsletter} + <h2>{$gContent->mNewsletter->getTitle()}</h2> + {/if} + </div> + + {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='nav'} + + <div class="body"> + <div class="content"> + {$gContent->parseData()} + </div> <!-- end .content --> + </div> <!-- end .body --> diff --git a/templates/view_newsletter.tpl b/templates/view_newsletter.tpl new file mode 100644 index 0000000..cd17436 --- /dev/null +++ b/templates/view_newsletter.tpl @@ -0,0 +1,33 @@ +<div class="display blogs"> + <div class="floaticon"> + {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='icon'} + + {if $gContent->isOwner() || $gBitUser->hasPermission( 'bit_p_newsletter_admin' )} + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?nl_id={$gContent->mNlId}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}admin/index.php?nl_id={$gContent->mNlId}&remove=1">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> + {/if} + + {if $gBitUser->hasPermission( 'bit_p_print' )} + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}print_blog_post.php?post_id={$post_id}">{biticon ipackage=liberty iname="print" iexplain="print"}</a> + {/if} + <a href="{$smarty.const.NEWSLETTERS_PKG_URL}send_newsletter.php?post_id={$post_id}">{biticon ipackage=liberty iname="mail_send" iexplain="email this post"}</a> + </div> + + <div class="header"> + <h1>{$gContent->getTitle()}</h1> + {if $gContent->getField('description')} + <h2>{$gContent->getField('description')}</h2> + {/if} + </div> + + {include file="bitpackage:liberty/services_inc.tpl" serviceLocation='nav'} + + <div class="body"> + <div class="content"> + + {$gContent->parseData()} + + {include file="bitpackage:newsletters/list_editions_inc.tpl" editionList=$gContent->getEditions()} + + </div> <!-- end .content --> + </div> <!-- end .body --> |
