Extract currently selected template from template list.

Also skip currently selected template in template list. Note to
self: this needs more styling to set it off better. (If my code
can be improved, please do so. Best I could come up with.)
This commit is contained in:
Matthias Mees 2013-05-31 14:47:38 +02:00
parent af3c686111
commit 88e5c9a1ba
2 changed files with 44 additions and 10 deletions

View File

@ -1501,6 +1501,12 @@ form > .button_link:first-of-type { margin-top: 0; }
width: 48%;
}
#template_select .current_template {
float: none;
margin: 0 0 2em;
width: 48%;
}
#mediaPropertyForm .media_file {
float: none;
margin: 1.5em 0;

View File

@ -27,13 +27,44 @@
</section>
{else}
<section id="template_select">
<h2>{$CONST.SELECT_TEMPLATE}</h2>
<h2>Current template</h2> {* i18n *}
{assign var="cur_tpl" value=$templates[$cur_template]}
<article class="clearfix current_template">
<h3>{$cur_tpl.info.name}</h3>
<script src="{serendipity_getFile file='admin/js/jquery.syncheight.js'}"></script>
<div class="clearfix">
{if $cur_tpl.fullsize_preview || $cur_tpl.preview}
<div class="preview_image">
{if $cur_tpl.fullsize_preview}<a href="{$cur_tpl.fullsize_preview}">{/if}
{if $cur_tpl.preview}<img src="{$cur_tpl.preview}" alt="{$CONST.PREVIEW}" >{/if}
{if $cur_tpl.fullsize_preview}</a>{/if}
</div>
{/if}
<details class="template_info">
<summary>Template info</summary> {* i18n *}
<dl class="clearfix">
<dt class="template_author">{$CONST.AUTHOR}:</dt>
<dd>{$cur_tpl.info.author}</dd>
<dt class="template_date">{$CONST.LAST_UPDATED}:</dt>
<dd>{$cur_tpl.info.date}</dd>
<dt class="template_admin">Admin theme:</dt> {* i18n *}
<dd>{$cur_tpl.info.custom_admin_interface}</dd>
</dl>
</details>
</div>
<div class="template_status">
<span class="installed"><span class="icon-ok-circle"></span> {$CONST.ALREADY_INSTALLED}</span>
<a class="button_link state_submit" href="?serendipity[adminModule]=templates&amp;serendipity[adminAction]=editConfiguration">{$CONST.CONFIGURATION}</a>
</div>
</article>
<h2>{$CONST.SELECT_TEMPLATE}</h2>
<ul class="plainList clearfix">
{foreach $templates as $template=>$info}
{if $info.info.engine == 'yes'}{continue}{/if}
{if $info.info.engine == 'yes' || $template == $cur_template}{continue}{/if}
{if !empty($template)}
<li><article class="clearfix {cycle values="odd,even"}">
<h3>{$info.info.name}</h3>
@ -60,15 +91,10 @@
</div>
<div class="template_status">
{if $template != $cur_template}
{if !$info.unmetRequirements}
{if !$info.unmetRequirements}
<a class="state_submit button_link" href="?serendipity[adminModule]=templates&amp;serendipity[adminAction]=install&amp;serendipity[theme]={$template}{$info.info.customURI}">{$CONST.SET_AS_TEMPLATE}</a>
{else}
<span class="unmet_requirements msg_error"><span class="icon-attention"></span> {$info.unmetRequirements}></span>
{/if}
{else}
<span class="installed"><span class="icon-ok-circle"></span> {$CONST.ALREADY_INSTALLED}</span>
<a class="button_link state_submit" href="?serendipity[adminModule]=templates&amp;serendipity[adminAction]=editConfiguration">{$CONST.CONFIGURATION}</a>
<span class="unmet_requirements msg_error"><span class="icon-attention"></span> {$info.unmetRequirements}></span>
{/if}
</div>
</article>
@ -77,4 +103,6 @@
{/foreach}
</ul>
</section>
<script src="{serendipity_getFile file='admin/js/jquery.syncheight.js'}"></script>
{/if}