epaper/app/views/admin/e_paper_criterias/emailer.html.erb

192 lines
4.9 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<% paper = PaperCriteria.find(@data["paper_id"]) rescue nil %>
<% paper = @data["paper"] if paper.nil? && @data["paper"] != nil %>
<% page = @data["page"] %>
<% siteurl = @data["siteurl"] %>
<% papers_data = @data["papers_data"] %>
<!DOCTYPE html>
<html>
<head>
<title><%= paper.title %></title>
<style type="text/css">
.epaper-show .epaper-show-title {
border-bottom: 2px solid #ddd;
padding: 0 0 10px;
margin: 10px 0 20px;
color: #881f05;
}
.epaper-show .ep-info {
background: #fff;
border-radius: 3px;
padding: 10px;
margin: 0 0 15px;
}
.epaper-show .ep-info-title {
border-bottom: 1px solid #eee;
padding: 0 0 5px;
margin: 0 0 8px;
font-size: 18px;
}
.epaper-show .ep-info-date {
float: left;
width: 80%;
margin: 0 0 5px;
color: #888;
}
.epaper-show .ep-info-period {
float: right;
width: 80%;
margin: 0 0 5px;
text-align: right;
padding: 0 10px 0 0;
color: #888;
}
.epaper-show .ep-info-description {
clear: both;
padding: 10px 0 0;
overflow: hidden;
}
.epaper-show .ep-info-description span {
float: right;
width: calc(100% - 90px);
line-height: 1.5;
}
.epaper-show .ep-content-item {
float: left;
width: calc(80% - 20px);
border: 1px solid #ccc;
vertical-align: top;
min-height: 200px;
padding: 20px;
margin: 10px;
}
.epaper-show .ep-content-title {
color: #881f05;
font-size: 20px;
border-left: 4px solid #881f05;
display: block;
padding: 0 0 0 10px;
margin: 0 0 10px;
}
.epaper-show p.ep-content-text {
color: #666;
font-size: 15px;
}
.epaper-show a.ep-content-more {
background: #881f05;
color: #fff;
padding: 2px 10px;
border-radius: 5px;
font-size: 12px;
}
.ep-topic-show .ep-topic-title {
margin: 10px 0;
color: #881f05;
}
.ep-topic-show .ep-topic-date {
background: #fff;
padding: 10px;
border-radius: 3px;
margin: 0 0 10px;
}
.ep-topic-show .ep-topic-content {
font-size: 15px;
line-height: 2;
}
.epaper-form {
background: #fff;
padding: 20px;
width: 100%;
max-width: 300px;
margin: auto;
border-radius: 5px;
box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
}
.epaper-form input.input-mail {
display: block;
width: 100%;
margin: 0 0 20px;
padding: 5px 10px;
border: 1px solid #ccc;
border-radius: 5px;
color: #333;
}
.epaper-form .btn-primary {
width: 80%;
float: left;
display: block;
}
.epaper-form .btn-white {
background: none;
width: 80%;
outline: none;
float: right;
color: #888;
}
.epaper-form .btn-white:active {
outline: none;
box-shadow: none;
}
.epaper-form .btn-white:hover {
text-decoration: underline;
}
.epaper-form .ep-form-title {
font-size: 20px;
margin: 0 0 15px;
}
.epaper-form h3.ep-form-title .en {
display: none;
}
.epaper-form form {
overflow: hidden;
}
.school-heading{
padding: 20px;
text-align: center;
border-bottom: 1px solid #c8c8c8;
}
.category_title{
clear: both;
margin: 50px -15px 0;
background: #96210f;
padding: 20px 10px;
text-align: center;
font-weight: 700;
border-radius: 10px 10px 0 0;
width: 80%;
margin: 10px;
}
</style>
</head>
<body>
<div class="epaper-show">
<h3 class="epaper-show-title"><%= t('e_paper.intro') %></h3>
<div class="ep-info">
<div class="ep-info-title"><%= t('e_paper.title') %><a class="ep-content-title" href="<%= page + "/" + paper.to_param + "?method=topics" %>" target="_blank"><span><%= paper.title %></span></a></div>
<div class="ep-info-description"><%= t('e_paper.description') %><span><%= paper.description %></span></div>
</div>
<div class="ep-content">
<% papers_data.each do |papers_data_hash| %>
<h3 class="category_title"><a class="category_title_link" href="<%=page + "/#{paper.to_param}?method=topics&category=#{papers_data_hash["category_id"].nil? ? papers_data_hash["category"].id : papers_data_hash["category_id"]}" %>" style="color: #fff;text-decoration: none;"><%= papers_data_hash["category_title"] %></a></h3>
<% topics = (papers_data_hash["topic_ids"].nil? ? papers_data_hash["topics"] : EPaperTopic.where(:id.in=>papers_data_hash["topic_ids"]).to_a) %>
<% topics.each do |topic| %>
<div class="ep-content-item">
<a class="ep-content-title" href="<%= page + "/" + topic.to_param %>" target="_blank"><%= topic.title %></a>
<div class="ep-img" style="width: 40%; float:left;">
<img src="<%= (siteurl + "/" + topic.image.thumb.url rescue nil) %>" style="width: 100%;">
</div>
<div class="ep-con" style="width: 58%; float: right;">
<% t = strip_tags(topic.content) %>
<%= topic.description %>
<a class="ep-content-more" href="<%= page + "/" + topic.to_param %>" target="_blank">more</a>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
</body>
</html>