recentposts.tpl 3.3 KB
Newer Older
Naomi Guyer's avatar
Naomi Guyer committed
1
{if ($editing)}
2
    {if (count($blogs) == 1)}
3
        <a class="card-footer {if (count($blogs) != 1)} d-none{/if}">
4
            <span id="blog_{$blogs[0]->id}" class="icon icon-plus left" role="presentation" aria-hidden="true"></span>
5 6
            {str tag='shortcutnewentry' section='artefact.blog'}
        </a>
7
    {elseif (count($blogs) > 1)}
Liam's avatar
Liam committed
8
    <div class="card-footer">
9 10
        <label class="text" for="blogselect_{$blockid}">{str tag='shortcutaddpost' section='artefact.blog'}</label>
        <div class="input-group">
11

12
            <select id="blogselect_{$blockid}" class="select form-control">
Naomi Guyer's avatar
Naomi Guyer committed
13 14 15 16
            {foreach from=$blogs item=blog}
                <option value="{$blog->id}"> {$blog->title} </option>
            {/foreach}
            </select>
17
            <span class="input-group-append">
Liam's avatar
Liam committed
18
                <a class="btn btn-secondary btnshortcut">
19
                    <span class="icon icon-plus text-success left" role="presentation" aria-hidden="true"></span> {str tag='shortcutadd' section='artefact.blog'}
20 21
                </a>
            </span>
Naomi Guyer's avatar
Naomi Guyer committed
22 23
        </div>
    </div>
24
    {/if}
Naomi Guyer's avatar
Naomi Guyer committed
25
{/if}
26 27
<div class="recentblogpost list-group">
{foreach from=$mostrecent item=post}
Lisa Seeto's avatar
Lisa Seeto committed
28 29 30 31 32 33 34 35 36 37 38 39 40
    {if !($editing)}
        {if !$post->allowcomments}
            {assign var="justdetails" value=true}
        {/if}
        {include
            file='header/block-comments-details-header.tpl'
            artefactid=$post->id
            blockid=$blockid
            commentcount=$post->commentcount
            allowcomments=$post->allowcomments
            justdetails=$justdetails
            displayiconsonly=true}
    {/if}
41
    <div class="list-group-item">
Lisa Seeto's avatar
Lisa Seeto committed
42
        <a class="outer-link collapsed" data-toggle="collapse" href="#recent_post_{$post->id}" aria-expanded="false">
43 44
            <span class="sr-only">{$post->title}</span>
        </a>
Lisa Seeto's avatar
Lisa Seeto committed
45 46 47 48 49 50 51 52
        <h4 class={if !($editing)}"list-group-item-heading text-inline"{else}"title"{/if}>
            {if !($editing)}
                 <a class="modal_link inner-link" data-toggle="modal-docked" data-target="#configureblock" href="#" data-blockid="{$blockid}" data-artefactid="{$post->id}">
                     {$post->title}
                 </a>
            {else}
                {$post->title}
            {/if}
53
        </h4>
Lisa Seeto's avatar
Lisa Seeto committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
        <div>
            <span class="text-small">
                {str tag='postedin' section='blocktype.blog/recentposts'}
                {if $canviewblog}
                    <a href="{$WWWROOT}artefact/blog/view/index.php?id={$post->parent}" class="inner-link">
                        {$post->parenttitle}
                    </a>
                {else}
                    {$post->parenttitle}
                {/if}
            </span>
            <span class="metadata">
                {str tag='postedon' section='blocktype.blog/recentposts'}
                {$post->displaydate}
                <br>
                {if $post->updateddate}
                    {str tag='updatedon' section='blocktype.blog/recentposts'}
                    {$post->updateddate}
                {/if}
            </span>
        </div>
        <span class="icon icon-chevron-down collapse-indicator float-right" role="presentation" aria-hidden="true"></span>
    </div>
    <div  id="recent_post_{$post->id}" class="collapse content-text">
        <span>{$post->description|safe}</span>
79 80 81
    </div>
{/foreach}
</div>