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) %> +
    + +
    +
    +
    +
    +