Hide field-head when no papers.

This commit is contained in:
邱博亞 2024-09-11 08:16:48 +08:00
parent ea6ad70e25
commit 5b5ea57582
1 changed files with 28 additions and 6 deletions

View File

@ -162,10 +162,19 @@
}
</style>
</head>
<%
have_papaers = papers_data.present?
if paper.image.present?
img_src = siteurl + "/" + paper.image.url
else
img_src = nil
end
%>
<body>
<div class="epaper-show">
<% if paper.image.present? %>
<img src="<%= siteurl + "/" + paper.image.url %>" alt="<%= paper.title %>" />
<% if have_papaers %>
<% if img_src %>
<img src="<%= img_src %>" alt="<%= paper.title %>" title="<%= paper.title %>" />
<% end %>
<div class="ep-info">
<div class="ep-info-title">
@ -181,10 +190,8 @@
<%= t('e_paper.description') %>
</span>
<span>
<% if papers_data.present? %>
<%= paper.description.html_safe %>
<br>
<% end %>
<%= paper.content.html_safe %>
</span>
</div>
@ -208,6 +215,21 @@
<% end %>
<% end %>
</div>
<% else %>
<% if img_src %>
<img src="<%= img_src %>" alt="<%= paper.title %>" title="<%= paper.title %>" />
<% end %>
<div class="ep-info">
<div class="ep-info-title">
<h3 class="epaper-show-title">
<a class="ep-content-title" href="<%= page + "/" + paper.to_param + "?method=topics" %>" target="_blank"><span><%= paper.title %></span></a>
</h3>
</div>
<div class="ep-info-description">
<%= paper.content.html_safe %>
</div>
</div>
<% end %>
</div>
</body>