posts.tpl 4.43 KB
Newer Older
Naomi Guyer's avatar
Naomi Guyer committed
1
{foreach from=$posts item=post}
2
3
4
5
6
7
8
9
    <div id="posttitle_{$post->id}" class="{if $post->published} published{else} draft{/if} list-group-item list-group-item-lite">
        <div class="clearfix ptm pbm">
            <h2 class="list-group-item-heading pull-left mt0">
                {$post->title}
            </h2>
            
            <div class="pull-right">
                <span id="poststatus{$post->id}" class="poststatus inline">
10
11
12
13
14
15
                    {if $post->published}
                        {str tag=published section=artefact.blog}
                    {else}
                        {str tag=draft section=artefact.blog}
                    {/if}
                </span>
16
17
                
                <span id="changepoststatus{$post->id}" class="changepoststatus inline">
18
19
20
21
                    {if !$post->locked}
                        {$post->changepoststatus|safe}
                    {/if}
                </span>
22
23
24
25

                {if $post->locked}
                <span>
                    {str tag=submittedforassessment section=view}
Pat Kira's avatar
Pat Kira committed
26
                </span>
27
28
29
30
31
32
33
34
35
36
37
38
39
                {else}
                <div class="btn-group postcontrols">
                    <form name="edit_{$post->id}" action="{$WWWROOT}artefact/blog/post.php" class="form-as-button pull-left">
                        <input type="hidden" name="id" value="{$post->id}">
                        <button type="submit" class="submit btn btn-default btn-sm" title="{str(tag=edit)|escape:html|safe}">
                            <span class="fa fa-pencil"></span>
                            <span class="btn-title pls">
                                {str(tag=edit)|escape:html|safe}
                            </span>
                        </button>
                    </form>
                    {$post->delete|safe}
                </div>
Pat Kira's avatar
Pat Kira committed
40
                {/if}
41
            </div>
Naomi Guyer's avatar
Naomi Guyer committed
42
        </div>
43
44
45
46
47
48
49
50
51
52
53
54
55
56
        <div id="postdetails_{$post->id}" class="postdetails postdate">
            <span class="fa fa-calendar mrs"></span>
            <strong>
                {str tag=postedon section=artefact.blog}: 
            </strong> 
            {$post->ctime}
            
            {if $post->tags}
            <p id="posttags_{$post->id}" class="tags mrs">
                <span class="fa fa-tags"></span>
                <strong>{str tag=tags}:</strong> 
                {list_tags owner=$post->author tags=$post->tags}
            </p>
            {/if}
Naomi Guyer's avatar
Naomi Guyer committed
57
        </div>
58
59
60
61
        <p id="postdescription_{$post->id}" class="postdescription">
            {$post->description|clean_html|safe}
        </p>
        
Naomi Guyer's avatar
Naomi Guyer committed
62
        {if $post->files}
Pat Kira's avatar
Pat Kira committed
63
64
65
66
67
68
69
70
71
72
73
74
        <div class="has-attachment panel panel-default collapsible mbm" id="postfiles_{$post->id}">
            <h5 class="panel-heading">
                <a class="text-left pts pbm collapsed" data-toggle="collapse" href="#attach_{$post->id}" aria-expanded="false">
                    <span class="fa fa-lg prm fa-paperclip"></span>
                   
                    <span class="text-small"> {str tag=attachedfiles section=artefact.blog} </span>
                     <span class="metadata">
                        ({$post->files|count})
                    </span>
                    <span class="pts fa fa-chevron-down collapse-indicator pull-right"></span>
                </a>
            </h5>
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
            <div class="collapse" id="attach_{$post->id}">
                <ul class="list-group list-unstyled mb0">
                {foreach from=$post->files item=file}
                    <li class="list-group-item-link">
                        <a href="{$WWWROOT}artefact/file/download.php?file={$file->attachment}" {if $file->description} title="{$file->description}" data-toggle="tooltip"{/if}>
                            <div class="file-icon mrs">
                                {if $file->icon}
                                <img src="{$file->icon}" alt="">
                                {else}
                                <span class="fa fa-{$file->artefacttype} fa-lg text-default"></span>
                                {/if}
                            </div>
                            <span class="file-title">{$file->title|truncate:40}</span>
                            <span class="file-size pls">
                            ({$file->size|display_size})
Pat Kira's avatar
Pat Kira committed
90
                            </span>
91
                        </a>
92
93
94
                    </li>
                {/foreach}
                </ul>
Naomi Guyer's avatar
Naomi Guyer committed
95
            </div>
96
        </div>
Naomi Guyer's avatar
Naomi Guyer committed
97
98
99
        {/if}
    </div>
{/foreach}