diff --git a/app/assets/images/e_paper/AAAAAA.png b/app/assets/images/e_paper/AAAAAA.png
new file mode 100755
index 0000000..772a39b
Binary files /dev/null and b/app/assets/images/e_paper/AAAAAA.png differ
diff --git a/app/models/paper_criteria.rb b/app/models/paper_criteria.rb
index cb83668..283f131 100644
--- a/app/models/paper_criteria.rb
+++ b/app/models/paper_criteria.rb
@@ -5,6 +5,7 @@ class PaperCriteria
field :title,as: :slug_title, localize: true
field :description, localize: true
+ field :content, localize: true
field :start_date, type: DateTime
field :end_date, type: DateTime
field :sending_time, type: DateTime
@@ -15,6 +16,9 @@ class PaperCriteria
field :other_emails
field :invalid_emails, type: Array, :default => []
field :send_failed_emails, type: Array, :default => []
+
+ mount_uploader :image, ImageUploader
+
def epaper_topics
tmp = EPaperTopic.where(:period.gte => self.start_date.in_time_zone(Time.zone.utc_offset / 3600), :period.lte => self.end_date.in_time_zone(Time.zone.utc_offset / 3600)).can_display
tmp = EPaperTopic.where(:period.gte => self.start_date.in_time_zone(Time.zone.utc_offset / 3600), :period.lte => self.end_date.in_time_zone(Time.zone.utc_offset / 3600)).limit(1) if tmp.first.nil?
diff --git a/app/views/admin/e_paper_criterias/_form.html.erb b/app/views/admin/e_paper_criterias/_form.html.erb
index 79cf65a..42ca732 100644
--- a/app/views/admin/e_paper_criterias/_form.html.erb
+++ b/app/views/admin/e_paper_criterias/_form.html.erb
@@ -19,7 +19,7 @@
<%= t(:basic) %>
<%= t("e_paper.email_setting") %>
<%= t("e_paper.email_record") %>
-
+ <%= t('e_paper.image') %>
@@ -99,6 +99,37 @@
+
+
+
+
+
+
+
+
+
+ <% if @paper_criteria.image.file %>
+ <%= image_tag @paper_criteria.image %>
+ <% else %>
+
+ <% end %>
+
+
+
+ <%= t(:select_image) %>
+ <%= t(:change) %>
+ <%= f.file_field :image %>
+
+
<%= t(:cancel) %>
+
+
+
+
+
+
+
<%= t(:language) %>
@@ -135,10 +166,29 @@
+
+
+
+
+
+ <%= f.fields_for :content_translations do |f| %>
+ <%= f.cktext_area locale, rows: 5, class: "input-block-level", :value => @paper_criteria.content_translations[locale] %>
+ <% end %>
+
+
+
<% end %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/app/views/admin/e_paper_criterias/emailer.html.erb b/app/views/admin/e_paper_criterias/emailer.html.erb
index eebadcd..6c4ea87 100644
--- a/app/views/admin/e_paper_criterias/emailer.html.erb
+++ b/app/views/admin/e_paper_criterias/emailer.html.erb
@@ -17,8 +17,7 @@
.epaper-show .ep-info {
background: #fff;
border-radius: 3px;
- padding: 10px;
- margin: 0 0 15px;
+ margin: 10px 0 25px;
}
.epaper-show .ep-info-title {
border-bottom: 1px solid #eee;
@@ -44,10 +43,14 @@
clear: both;
padding: 10px 0 0;
overflow: hidden;
+ width: 80%;
+ }
+ .epaper-show .field-head {
+ font-size: 18px;
+ margin-right: 2em;
}
.epaper-show .ep-info-description span {
- float: right;
- width: calc(100% - 90px);
+ float: left;
line-height: 1.5;
}
.epaper-show .ep-content-item {
@@ -161,10 +164,30 @@
-
<%= t('e_paper.intro') %>
+ <% if paper.image.present? %>
+
" alt="<%= paper.title %>" />
+ <% end %>
-
-
<%= t('e_paper.description') %><%= paper.description %>
+
+
+ <%= t('e_paper.title') %>:
+
+
+
+
+
+ <%= t('e_paper.description') %>:
+
+
+ <%= paper.description.html_safe %>
+ <% if papers_data.present? %>
+
+ <%= paper.content.html_safe %>
+ <% end %>
+
+
@@ -178,7 +201,6 @@
" style="width: 100%;">
diff --git a/app/views/admin/e_papers/_form.html.erb b/app/views/admin/e_papers/_form.html.erb
index 9076ee5..e775b98 100644
--- a/app/views/admin/e_papers/_form.html.erb
+++ b/app/views/admin/e_papers/_form.html.erb
@@ -66,7 +66,7 @@
<% if @paper.image.file %>
<%= image_tag @paper.image %>
<% else %>
-
+
<% end %>
@@ -145,5 +145,13 @@
<%= f.submit t('submit'), class: 'btn btn-primary' %>
+
+
diff --git a/config/locales/en.yml b/config/locales/en.yml
index bbfa445..b13930a 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -4,6 +4,7 @@ en:
restful_actions:
batch_delete_subscribers: "Batch Delete Subscribers"
e_paper:
+ image: Cover Image
all_criteria: All Issue
show_progress: "Show Progress"
delete_subscribers_hint2: "Delete Subscribers below forever."
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index 7340f9d..d95c325 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -4,6 +4,7 @@ zh_tw:
restful_actions:
batch_delete_subscribers: "批次刪除訂閱者"
e_paper:
+ image: 封面圖片
all_criteria: 所有電子報
show_progress: "顯示進度"
delete_subscribers_hint2: "永久刪除以下訂閱者"