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> </style>
</head> </head>
<%
have_papaers = papers_data.present?
if paper.image.present?
img_src = siteurl + "/" + paper.image.url
else
img_src = nil
end
%>
<body> <body>
<div class="epaper-show"> <div class="epaper-show">
<% if paper.image.present? %> <% if have_papaers %>
<img src="<%= siteurl + "/" + paper.image.url %>" alt="<%= paper.title %>" /> <% if img_src %>
<img src="<%= img_src %>" alt="<%= paper.title %>" title="<%= paper.title %>" />
<% end %> <% end %>
<div class="ep-info"> <div class="ep-info">
<div class="ep-info-title"> <div class="ep-info-title">
@ -181,10 +190,8 @@
<%= t('e_paper.description') %> <%= t('e_paper.description') %>
</span> </span>
<span> <span>
<% if papers_data.present? %> <%= paper.description.html_safe %>
<%= paper.description.html_safe %> <br>
<br>
<% end %>
<%= paper.content.html_safe %> <%= paper.content.html_safe %>
</span> </span>
</div> </div>
@ -208,6 +215,21 @@
<% end %> <% end %>
<% end %> <% end %>
</div> </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> </div>
</body> </body>