forked from liferay/liferay-portal
/
view_entry_content.jspf
167 lines (144 loc) · 4.83 KB
/
view_entry_content.jspf
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<%--
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<c:if test="<%= BlogsEntryPermission.contains(permissionChecker, entry, ActionKeys.VIEW) %>">
<div class="entry">
<%
PortletURL showErrorMessageURL = renderResponse.createRenderURL();
showErrorMessageURL.setParameter("mvcRenderCommandName", "/blogs_aggregator/view");
showErrorMessageURL.setParameter("blogsPortletFound", Boolean.FALSE.toString());
StringBundler sb = new StringBundler(5);
sb.append(themeDisplay.getPathMain());
sb.append("/blogs/find_entry?p_l_id=");
sb.append(themeDisplay.getPlid());
sb.append("&noSuchEntryRedirect=");
sb.append(URLCodec.encodeURL(showErrorMessageURL.toString()));
sb.append("&entryId=");
sb.append(entry.getEntryId());
String viewEntryURL = sb.toString();
%>
<c:if test='<%= !displayStyle.endsWith("-without-title") %>'>
<div class="entry-body">
<c:choose>
<c:when test='<%= displayStyle.endsWith("image") %>'>
<liferay-ui:user-portrait
userId="<%= entry.getUserId() %>"
/>
<div class="entry-info text-muted ">
<small>
<strong><%= HtmlUtil.escape(entry.getUserName()) %></strong>
<span> - </span>
<span class="hide-accessible"><liferay-ui:message key="published-date" /></span>
<%= dateFormatDate.format(entry.getDisplayDate()) %>
</small>
</div>
</c:when>
<c:otherwise>
<div class="entry-info text-muted ">
<small>
<strong><%= HtmlUtil.escape(entry.getUserName()) %></strong>
<span> - </span>
<span class="hide-accessible"><liferay-ui:message key="published-date" /></span>
<%= dateFormatDate.format(entry.getDisplayDate()) %>
</small>
</div>
</c:otherwise>
</c:choose>
<div class="entry-title">
<h2>
<aui:a href="<%= viewEntryURL %>">
<%= HtmlUtil.escape(entry.getTitle()) %>
</aui:a>
</h2>
</div>
</div>
</c:if>
<c:if test='<%= !displayStyle.equals("title") %>'>
<div class="entry-body">
<c:choose>
<c:when test='<%= displayStyle.startsWith("abstract") %>'>
<%
String smallImageURL = HtmlUtil.escape(entry.getSmallImageURL(themeDisplay));
%>
<c:if test="<%= Validator.isNotNull(smallImageURL) %>">
<div class="asset-small-image">
<img alt="" class="asset-small-image" src="<%= smallImageURL %>" width="150" />
</div>
</c:if>
<%
String summary = entry.getDescription();
if (Validator.isNull(summary)) {
summary = entry.getContent();
}
%>
<p>
<%= StringUtil.shorten(HtmlUtil.stripHtml(summary), 200) %>
</p>
</c:when>
<c:when test='<%= displayStyle.startsWith("quote") %>'>
<span class="quote">
<a href="<%= viewEntryURL %>">
"<%= StringUtil.shorten(StringUtil.trim(HtmlUtil.stripHtml(entry.getContent())), 100, StringPool.BLANK) + StringPool.TRIPLE_PERIOD %> "
</a>
</span>
</c:when>
<c:otherwise>
<%= entry.getContent() %>
</c:otherwise>
</c:choose>
</div>
<%
int commentsCount = BlogsUtil.getCommentsCount(entry);
%>
<div class="entry-footer">
<div class="entry-social">
<div class="comments">
<a href="<%= viewEntryURL %>">
<i class="icon-comment icon-monospaced"></i>
<span><%= String.valueOf(commentsCount) %></span>
</a>
</div>
</div>
</div>
</c:if>
<c:if test='<%= !displayStyle.endsWith("-without-title") %>'>
<liferay-asset:asset-categories-available
className="<%= BlogsEntry.class.getName() %>"
classPK="<%= entry.getEntryId() %>"
>
<span class="entry-categories">
<liferay-asset:asset-categories-summary
className="<%= BlogsEntry.class.getName() %>"
classPK="<%= entry.getEntryId() %>"
/>
</span>
</liferay-asset:asset-categories-available>
<c:if test="<%= showTags %>">
<liferay-asset:asset-tags-available
className="<%= BlogsEntry.class.getName() %>"
classPK="<%= entry.getEntryId() %>"
>
<span class="entry-tags">
<liferay-asset:asset-tags-summary
className="<%= BlogsEntry.class.getName() %>"
classPK="<%= entry.getEntryId() %>"
/>
</span>
</liferay-asset:asset-tags-available>
</c:if>
</c:if>
</div>
<div class="separator"><!-- --></div>
</c:if>