-
Notifications
You must be signed in to change notification settings - Fork 0
/
newsview.tpl
104 lines (97 loc) · 4.34 KB
/
newsview.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<style>
.newscontent pre,.newscontent .newscontent{
max-width: 100%;
word-break: break-all;
white-space: pre-wrap;
}
.newscontent img {
width: 90%;
height: 50%;
}
.newscontent p {
display: block!important;
white-space: normal;
}
</style>
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-body">
<div class="pt-3">
<div class="row justify-content-center">
<div class="col-xl-8">
<div>
<div class="text-center">
<div class="mb-4">
<span class="badge badge-light font-size-12">
<i
class="bx bx-purchase-tag-alt align-middle text-muted mr-1"></i>{$ViewAnnouncement.cate_name}
</span>
</div>
<h4>{$ViewAnnouncement.title}</h4>
<p class="text-muted mb-4"><i class="mdi mdi-calendar mr-1"></i>
{$ViewAnnouncement.push_time | date='Y-m-d H:i'}</p>
</div>
<hr>
<div class="mt-4">
<div class="text-muted font-size-14">
<div class="mb-4">
<pre class="newscontent">
{$ViewAnnouncement.content|raw}
</pre>
</div>
</div>
<hr>
</div>
{if $ViewAnnouncement.label}
<div class="mt-4">
<h5 class="mb-3">标签: </h5>
<div>
<div class="row">
<ul class=" row w-100">
{foreach $ViewAnnouncement.label as $label}
<li class="py-1 col-sm-6">{$label}</li>
{/foreach}
</ul>
</div>
</div>
</div>
{/if}
<div
class="mt-4 d-flex {if !$ViewAnnouncement.prev && $ViewAnnouncement.next}justify-content-end{else}justify-content-between{/if}">
{if $ViewAnnouncement.prev}
<a href="newsview?id={$ViewAnnouncement.prev.id}" class="btn btn-primary"><i
class="bx bx-left-arrow-alt font-size-16 align-middle mr-2"></i> {$ViewAnnouncement.prev.title}</a>
{/if}
{if $ViewAnnouncement.next}
<a href="newsview?id={$ViewAnnouncement.next.id}" class="btn btn-primary"> {$ViewAnnouncement.next.title}<i
class="bx bx-right-arrow-alt font-size-16 align-middle mr-2"></i></a>
{/if}
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end card body -->
</div>
<!-- end card -->
</div>
<!-- end col -->
</div>
<!-- end row -->
<script>
$(function(){
$(".newscontent").find("*").css({margin:'0px',display:"inline-block"});
$(".newscontent").find("p").each(function(){
if($(this).html() == ' '){
$(this).remove();
}
})
$(".newscontent").find("span").each(function(){
if($(this).html() == ' '){
$(this).remove();
}
})
})
</script>