From 82c4b8b24bbd307fd9c21d51ab1bfe696366427d Mon Sep 17 00:00:00 2001 From: rulingcom Date: Fri, 15 Nov 2024 18:20:00 +0800 Subject: [PATCH] updates --- .gitignore | 0 Gemfile | 0 MIT-LICENSE | 0 README.rdoc | 0 Rakefile | 0 app/assets/images/e_paper/.keep | 0 app/assets/javascripts/e_paper/application.js | 0 .../stylesheets/e_paper/application.css | 0 .../admin/e_paper_criterias_controller.rb | 12 +-- .../admin/e_paper_images_controller.rb | 54 ++++++++++++++ .../admin/e_paper_subscribers_controller.rb | 0 app/controllers/admin/e_papers_controller.rb | 0 app/controllers/e_papers_controller.rb | 0 app/helpers/admin/epaper_helper.rb | 0 app/helpers/admin/新文字文件.txt | 0 app/models/e_paper_image.rb | 7 ++ app/models/e_paper_subscriber.rb | 0 app/models/e_paper_topic.rb | 6 +- app/models/paper_criteria.rb | 7 +- .../admin/e_paper_criterias/_form.html.erb | 27 ++----- .../admin/e_paper_criterias/_index.html.erb | 0 .../admin/e_paper_criterias/edit.html.erb | 0 .../admin/e_paper_criterias/emailer.html.erb | 5 +- .../admin/e_paper_criterias/index.html.erb | 0 .../admin/e_paper_criterias/new.html.erb | 0 app/views/admin/e_paper_images/_form.html.erb | 70 ++++++++++++++++++ .../admin/e_paper_images/_index.html.erb | 32 ++++++++ app/views/admin/e_paper_images/edit.html.erb | 7 ++ app/views/admin/e_paper_images/index.html.erb | 4 + app/views/admin/e_paper_images/new.html.erb | 7 ++ .../admin/e_paper_subscribers/_index.html.erb | 0 .../_modal_select.html.erb | 0 .../batch_delete_subscribers.html.erb | 0 .../download_excel_format.axlsx | 0 .../export_excel.xlsx.axlsx | 0 .../admin/e_paper_subscribers/index.html.erb | 0 app/views/admin/e_papers/_form.html.erb | 3 +- app/views/admin/e_papers/_index.html.erb | 0 .../admin/e_papers/_subscriber_index.html.erb | 0 app/views/admin/e_papers/edit.html.erb | 0 app/views/admin/e_papers/index.html.erb | 0 .../admin/e_papers/instructions.html.erb | 0 app/views/admin/e_papers/new.html.erb | 0 app/views/admin/e_papers/subscribers.html.erb | 0 .../e_papers/custom_widget_data.html.erb | 0 app/views/e_papers/index.html.erb | 0 app/views/e_papers/papers.html.erb | 0 app/views/e_papers/show.html.erb | 0 app/views/e_papers/topics.html.erb | 0 config/locales/en.yml | 2 + config/locales/zh_tw.yml | 4 +- config/routes.rb | 7 +- e_paper.gemspec | 0 lib/e_paper.rb | 0 lib/e_paper/engine.rb | 7 +- lib/e_paper/version.rb | 0 lib/tasks/e_paper_tasks.rake | 0 .../e_paper/_category_wise_articles.html.erb | 0 modules/e_paper/_criteria_list.html.erb | 0 modules/e_paper/_latest_criteria.html.erb | 0 modules/e_paper/_latest_slider_aside.html.erb | 0 .../_latest_slider_full_screen.html.erb | 0 modules/e_paper/_subscriber.html.erb | 0 modules/e_paper/_widget.html.erb | 0 modules/e_paper/epaper_index1.html.erb | 0 modules/e_paper/epaper_index2.html.erb | 0 modules/e_paper/epaper_index2_latest.html.erb | 0 modules/e_paper/info.json | 0 modules/e_paper/papers.html.erb | 0 modules/e_paper/show.html.erb | 0 .../thumbs/category_wise_articles_thumb.png | Bin .../e_paper/thumbs/criteria_list_thumb.png | Bin .../e_paper/thumbs/latest_criteria_thumb.png | Bin .../thumbs/latest_slider_aside_thumb.png | Bin .../latest_slider_full_screen_thumb.png | Bin modules/e_paper/thumbs/subscriber_thumb.png | Bin modules/e_paper/thumbs/thumb.png | Bin modules/e_paper/topics.html.erb | 0 test/dummy/README.rdoc | 0 test/dummy/Rakefile | 0 test/dummy/app/assets/images/.keep | 0 .../app/assets/javascripts/application.js | 0 .../app/assets/stylesheets/application.css | 0 .../app/controllers/application_controller.rb | 0 test/dummy/app/controllers/concerns/.keep | 0 test/dummy/app/helpers/application_helper.rb | 0 test/dummy/app/mailers/.keep | 0 test/dummy/app/models/.keep | 0 test/dummy/app/models/concerns/.keep | 0 .../app/views/layouts/application.html.erb | 0 test/dummy/config.ru | 0 test/dummy/config/application.rb | 0 test/dummy/config/boot.rb | 0 test/dummy/config/database.yml | 0 test/dummy/config/environment.rb | 0 test/dummy/config/environments/development.rb | 0 test/dummy/config/environments/production.rb | 0 test/dummy/config/environments/test.rb | 0 test/dummy/config/initializers/assets.rb | 0 .../initializers/backtrace_silencers.rb | 0 .../config/initializers/cookies_serializer.rb | 0 .../initializers/filter_parameter_logging.rb | 0 test/dummy/config/initializers/inflections.rb | 0 test/dummy/config/initializers/mime_types.rb | 0 .../config/initializers/session_store.rb | 0 .../config/initializers/wrap_parameters.rb | 0 test/dummy/config/locales/en.yml | 0 test/dummy/config/routes.rb | 0 test/dummy/config/secrets.yml | 0 test/dummy/lib/assets/.keep | 0 test/dummy/log/.keep | 0 test/dummy/public/404.html | 0 test/dummy/public/422.html | 0 test/dummy/public/500.html | 0 test/dummy/public/favicon.ico | 0 test/e_paper_test.rb | 0 test/integration/navigation_test.rb | 0 test/test_helper.rb | 0 118 files changed, 220 insertions(+), 41 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 Gemfile mode change 100644 => 100755 MIT-LICENSE mode change 100644 => 100755 README.rdoc mode change 100644 => 100755 Rakefile mode change 100644 => 100755 app/assets/images/e_paper/.keep mode change 100644 => 100755 app/assets/javascripts/e_paper/application.js mode change 100644 => 100755 app/assets/stylesheets/e_paper/application.css mode change 100644 => 100755 app/controllers/admin/e_paper_criterias_controller.rb create mode 100644 app/controllers/admin/e_paper_images_controller.rb mode change 100644 => 100755 app/controllers/admin/e_paper_subscribers_controller.rb mode change 100644 => 100755 app/controllers/admin/e_papers_controller.rb mode change 100644 => 100755 app/controllers/e_papers_controller.rb mode change 100644 => 100755 app/helpers/admin/epaper_helper.rb mode change 100644 => 100755 app/helpers/admin/新文字文件.txt create mode 100644 app/models/e_paper_image.rb mode change 100644 => 100755 app/models/e_paper_subscriber.rb mode change 100644 => 100755 app/models/e_paper_topic.rb mode change 100644 => 100755 app/models/paper_criteria.rb mode change 100644 => 100755 app/views/admin/e_paper_criterias/_form.html.erb mode change 100644 => 100755 app/views/admin/e_paper_criterias/_index.html.erb mode change 100644 => 100755 app/views/admin/e_paper_criterias/edit.html.erb mode change 100644 => 100755 app/views/admin/e_paper_criterias/emailer.html.erb mode change 100644 => 100755 app/views/admin/e_paper_criterias/index.html.erb mode change 100644 => 100755 app/views/admin/e_paper_criterias/new.html.erb create mode 100644 app/views/admin/e_paper_images/_form.html.erb create mode 100644 app/views/admin/e_paper_images/_index.html.erb create mode 100644 app/views/admin/e_paper_images/edit.html.erb create mode 100644 app/views/admin/e_paper_images/index.html.erb create mode 100644 app/views/admin/e_paper_images/new.html.erb mode change 100644 => 100755 app/views/admin/e_paper_subscribers/_index.html.erb mode change 100644 => 100755 app/views/admin/e_paper_subscribers/_modal_select.html.erb mode change 100644 => 100755 app/views/admin/e_paper_subscribers/batch_delete_subscribers.html.erb mode change 100644 => 100755 app/views/admin/e_paper_subscribers/download_excel_format.axlsx mode change 100644 => 100755 app/views/admin/e_paper_subscribers/export_excel.xlsx.axlsx mode change 100644 => 100755 app/views/admin/e_paper_subscribers/index.html.erb mode change 100644 => 100755 app/views/admin/e_papers/_form.html.erb mode change 100644 => 100755 app/views/admin/e_papers/_index.html.erb mode change 100644 => 100755 app/views/admin/e_papers/_subscriber_index.html.erb mode change 100644 => 100755 app/views/admin/e_papers/edit.html.erb mode change 100644 => 100755 app/views/admin/e_papers/index.html.erb mode change 100644 => 100755 app/views/admin/e_papers/instructions.html.erb mode change 100644 => 100755 app/views/admin/e_papers/new.html.erb mode change 100644 => 100755 app/views/admin/e_papers/subscribers.html.erb mode change 100644 => 100755 app/views/e_papers/custom_widget_data.html.erb mode change 100644 => 100755 app/views/e_papers/index.html.erb mode change 100644 => 100755 app/views/e_papers/papers.html.erb mode change 100644 => 100755 app/views/e_papers/show.html.erb mode change 100644 => 100755 app/views/e_papers/topics.html.erb mode change 100644 => 100755 config/locales/en.yml mode change 100644 => 100755 config/locales/zh_tw.yml mode change 100644 => 100755 config/routes.rb mode change 100644 => 100755 e_paper.gemspec mode change 100644 => 100755 lib/e_paper.rb mode change 100644 => 100755 lib/e_paper/engine.rb mode change 100644 => 100755 lib/e_paper/version.rb mode change 100644 => 100755 lib/tasks/e_paper_tasks.rake mode change 100644 => 100755 modules/e_paper/_category_wise_articles.html.erb mode change 100644 => 100755 modules/e_paper/_criteria_list.html.erb mode change 100644 => 100755 modules/e_paper/_latest_criteria.html.erb mode change 100644 => 100755 modules/e_paper/_latest_slider_aside.html.erb mode change 100644 => 100755 modules/e_paper/_latest_slider_full_screen.html.erb mode change 100644 => 100755 modules/e_paper/_subscriber.html.erb mode change 100644 => 100755 modules/e_paper/_widget.html.erb mode change 100644 => 100755 modules/e_paper/epaper_index1.html.erb mode change 100644 => 100755 modules/e_paper/epaper_index2.html.erb mode change 100644 => 100755 modules/e_paper/epaper_index2_latest.html.erb mode change 100644 => 100755 modules/e_paper/info.json mode change 100644 => 100755 modules/e_paper/papers.html.erb mode change 100644 => 100755 modules/e_paper/show.html.erb mode change 100644 => 100755 modules/e_paper/thumbs/category_wise_articles_thumb.png mode change 100644 => 100755 modules/e_paper/thumbs/criteria_list_thumb.png mode change 100644 => 100755 modules/e_paper/thumbs/latest_criteria_thumb.png mode change 100644 => 100755 modules/e_paper/thumbs/latest_slider_aside_thumb.png mode change 100644 => 100755 modules/e_paper/thumbs/latest_slider_full_screen_thumb.png mode change 100644 => 100755 modules/e_paper/thumbs/subscriber_thumb.png mode change 100644 => 100755 modules/e_paper/thumbs/thumb.png mode change 100644 => 100755 modules/e_paper/topics.html.erb mode change 100644 => 100755 test/dummy/README.rdoc mode change 100644 => 100755 test/dummy/Rakefile mode change 100644 => 100755 test/dummy/app/assets/images/.keep mode change 100644 => 100755 test/dummy/app/assets/javascripts/application.js mode change 100644 => 100755 test/dummy/app/assets/stylesheets/application.css mode change 100644 => 100755 test/dummy/app/controllers/application_controller.rb mode change 100644 => 100755 test/dummy/app/controllers/concerns/.keep mode change 100644 => 100755 test/dummy/app/helpers/application_helper.rb mode change 100644 => 100755 test/dummy/app/mailers/.keep mode change 100644 => 100755 test/dummy/app/models/.keep mode change 100644 => 100755 test/dummy/app/models/concerns/.keep mode change 100644 => 100755 test/dummy/app/views/layouts/application.html.erb mode change 100644 => 100755 test/dummy/config.ru mode change 100644 => 100755 test/dummy/config/application.rb mode change 100644 => 100755 test/dummy/config/boot.rb mode change 100644 => 100755 test/dummy/config/database.yml mode change 100644 => 100755 test/dummy/config/environment.rb mode change 100644 => 100755 test/dummy/config/environments/development.rb mode change 100644 => 100755 test/dummy/config/environments/production.rb mode change 100644 => 100755 test/dummy/config/environments/test.rb mode change 100644 => 100755 test/dummy/config/initializers/assets.rb mode change 100644 => 100755 test/dummy/config/initializers/backtrace_silencers.rb mode change 100644 => 100755 test/dummy/config/initializers/cookies_serializer.rb mode change 100644 => 100755 test/dummy/config/initializers/filter_parameter_logging.rb mode change 100644 => 100755 test/dummy/config/initializers/inflections.rb mode change 100644 => 100755 test/dummy/config/initializers/mime_types.rb mode change 100644 => 100755 test/dummy/config/initializers/session_store.rb mode change 100644 => 100755 test/dummy/config/initializers/wrap_parameters.rb mode change 100644 => 100755 test/dummy/config/locales/en.yml mode change 100644 => 100755 test/dummy/config/routes.rb mode change 100644 => 100755 test/dummy/config/secrets.yml mode change 100644 => 100755 test/dummy/lib/assets/.keep mode change 100644 => 100755 test/dummy/log/.keep mode change 100644 => 100755 test/dummy/public/404.html mode change 100644 => 100755 test/dummy/public/422.html mode change 100644 => 100755 test/dummy/public/500.html mode change 100644 => 100755 test/dummy/public/favicon.ico mode change 100644 => 100755 test/e_paper_test.rb mode change 100644 => 100755 test/integration/navigation_test.rb mode change 100644 => 100755 test/test_helper.rb diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Gemfile b/Gemfile old mode 100644 new mode 100755 diff --git a/MIT-LICENSE b/MIT-LICENSE old mode 100644 new mode 100755 diff --git a/README.rdoc b/README.rdoc old mode 100644 new mode 100755 diff --git a/Rakefile b/Rakefile old mode 100644 new mode 100755 diff --git a/app/assets/images/e_paper/.keep b/app/assets/images/e_paper/.keep old mode 100644 new mode 100755 diff --git a/app/assets/javascripts/e_paper/application.js b/app/assets/javascripts/e_paper/application.js old mode 100644 new mode 100755 diff --git a/app/assets/stylesheets/e_paper/application.css b/app/assets/stylesheets/e_paper/application.css old mode 100644 new mode 100755 diff --git a/app/controllers/admin/e_paper_criterias_controller.rb b/app/controllers/admin/e_paper_criterias_controller.rb old mode 100644 new mode 100755 index c7ec817..67eccaa --- a/app/controllers/admin/e_paper_criterias_controller.rb +++ b/app/controllers/admin/e_paper_criterias_controller.rb @@ -5,7 +5,7 @@ def initialize super @app_title = "e_paper" end - + def index @table_fields = [t('e_paper.criteria_title'),t('e_paper.date_span')] @@ -14,10 +14,10 @@ def initialize @filter_fields.delete(:categories) @criterias = PaperCriteria.order_by(sort) # .with_tags(filters("tags")) - + @criterias = search_data(@criterias,[:title]).page(params[:page]).per(10) #@url = "/" + I18n.locale.to_s + "/" +Page.where(:module => "e_paper").first.url + "?method=papers" - render :partial => "index" if request.xhr? + render :partial => "index" if request.xhr? end def new @@ -44,7 +44,7 @@ def initialize paper_criteria.destroy redirect_to admin_e_paper_criterias_path end - + def send_test_email paper_criteria = PaperCriteria.find(params[:id]) page = Page.where(:module => "e_paper").first.url rescue "" @@ -66,7 +66,7 @@ def initialize else msg = I18n.t('e_paper.newsletter_sent') end - render :json => {"success" => true, "msg": msg}.to_json + render :json => {"success" => true, "msg" => msg}.to_json else invalid_email_list = paper.invalid_emails rescue 'can not find paper' render :json => {"success" => false,"invalid_emails"=>invalid_email_list}.to_json @@ -85,4 +85,4 @@ def initialize def paper_criteria_params params.require(:paper_criteria).permit! end -end \ No newline at end of file +end diff --git a/app/controllers/admin/e_paper_images_controller.rb b/app/controllers/admin/e_paper_images_controller.rb new file mode 100644 index 0000000..8f46af0 --- /dev/null +++ b/app/controllers/admin/e_paper_images_controller.rb @@ -0,0 +1,54 @@ +class Admin::EPaperImagesController < OrbitAdminController + + def initialize + super + @app_title = "e_paper" + end + + def index + @table_fields = [t('e_paper.banner_image')] + # @categories = @module_app.categories.enabled + # @tags = @module_app.tags + # @filter_fields = filter_fields(@categories, @tags) + # @filter_fields.delete(:status) + @images = EPaperImage.order_by(sort) + + @images = search_data(@images,[:title]).page(params[:page]).per(10) + + render :partial => "index" if request.xhr? + end + + def new + @image = EPaperImage.new + end + + def create + @image = EPaperImage.new(e_paper_image_params) + @image.save + redirect_to admin_e_paper_images_path + end + + def edit + @image = EPaperImage.find(params[:id]) + end + + def update + image = EPaperImage.find(params[:id]) + image.update_attributes(e_paper_image_params) + image.save + redirect_to admin_e_paper_images_path + end + + def destroy + image = EPaperImage.find(params[:id]) + image.destroy + redirect_to admin_e_paper_images_path + end + + private + + def e_paper_image_params + params.require(:e_paper_image).permit! + end + +end diff --git a/app/controllers/admin/e_paper_subscribers_controller.rb b/app/controllers/admin/e_paper_subscribers_controller.rb old mode 100644 new mode 100755 diff --git a/app/controllers/admin/e_papers_controller.rb b/app/controllers/admin/e_papers_controller.rb old mode 100644 new mode 100755 diff --git a/app/controllers/e_papers_controller.rb b/app/controllers/e_papers_controller.rb old mode 100644 new mode 100755 diff --git a/app/helpers/admin/epaper_helper.rb b/app/helpers/admin/epaper_helper.rb old mode 100644 new mode 100755 diff --git a/app/helpers/admin/新文字文件.txt b/app/helpers/admin/新文字文件.txt old mode 100644 new mode 100755 diff --git a/app/models/e_paper_image.rb b/app/models/e_paper_image.rb new file mode 100644 index 0000000..f1ef001 --- /dev/null +++ b/app/models/e_paper_image.rb @@ -0,0 +1,7 @@ +class EPaperImage + + include Mongoid::Document + include Mongoid::Timestamps + + mount_uploader :image, ImageUploader +end diff --git a/app/models/e_paper_subscriber.rb b/app/models/e_paper_subscriber.rb old mode 100644 new mode 100755 diff --git a/app/models/e_paper_topic.rb b/app/models/e_paper_topic.rb old mode 100644 new mode 100755 index a57e1db..64cbb6c --- a/app/models/e_paper_topic.rb +++ b/app/models/e_paper_topic.rb @@ -1,11 +1,11 @@ class EPaperTopic - + include Mongoid::Document include Mongoid::Timestamps include OrbitModel::Status include OrbitCategory::Categorizable include OrbitTag::Taggable - include Slug + include Slug field :title,as: :slug_title, localize: true field :period, type: DateTime @@ -26,4 +26,4 @@ class EPaperTopic def criteria_title PaperCriteria.where(:start_date.lte => self.period.in_time_zone(Time.zone.utc_offset / 3600), :end_date.gte => self.period.in_time_zone(Time.zone.utc_offset / 3600)).first.title rescue "" end -end \ No newline at end of file +end diff --git a/app/models/paper_criteria.rb b/app/models/paper_criteria.rb old mode 100644 new mode 100755 index b8fd8c4..8143c63 --- a/app/models/paper_criteria.rb +++ b/app/models/paper_criteria.rb @@ -1,7 +1,7 @@ class PaperCriteria include Mongoid::Document include Mongoid::Timestamps - include Slug + include Slug field :title,as: :slug_title, localize: true field :description, localize: true @@ -17,6 +17,7 @@ class PaperCriteria field :invalid_emails, type: Array, :default => [] field :send_failed_emails, type: Array, :default => [] field :email_sentdate, :type => DateTime + field :banner_image, type: BSON::ObjectId mount_uploader :image, ImageUploader @@ -41,5 +42,5 @@ class PaperCriteria end _email_sentdate end - -end \ No newline at end of file + +end diff --git a/app/views/admin/e_paper_criterias/_form.html.erb b/app/views/admin/e_paper_criterias/_form.html.erb old mode 100644 new mode 100755 index 00c01fe..962ceb1 --- a/app/views/admin/e_paper_criterias/_form.html.erb +++ b/app/views/admin/e_paper_criterias/_form.html.erb @@ -114,26 +114,13 @@
-
-
- <% if @paper_criteria.image.file %> - <%= image_tag @paper_criteria.image %> - <% else %> - - <% end %> -
-
- - <%= t(:select_image) %> - <%= t(:change) %> - <%= f.file_field :image %> - - <%= t(:cancel) %> -
- -
+
+ <% EPaperImage.all.each do |image| %> +
+ <%= f.radio_button :banner_image, image.id %> + <%= image_tag image.image %> +
+ <% end %>
diff --git a/app/views/admin/e_paper_criterias/_index.html.erb b/app/views/admin/e_paper_criterias/_index.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_paper_criterias/edit.html.erb b/app/views/admin/e_paper_criterias/edit.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_paper_criterias/emailer.html.erb b/app/views/admin/e_paper_criterias/emailer.html.erb old mode 100644 new mode 100755 index 2ff68ed..5bf35c8 --- a/app/views/admin/e_paper_criterias/emailer.html.erb +++ b/app/views/admin/e_paper_criterias/emailer.html.erb @@ -187,8 +187,9 @@ end have_papaers = papers_data.present? - if paper.image.present? - img_src = siteurl + paper.image.url + if paper.banner_image.present? + img = EPaperImage.find(paper.banner_image) + img_src = siteurl + img.image.url else img_src = nil end diff --git a/app/views/admin/e_paper_criterias/index.html.erb b/app/views/admin/e_paper_criterias/index.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_paper_criterias/new.html.erb b/app/views/admin/e_paper_criterias/new.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_paper_images/_form.html.erb b/app/views/admin/e_paper_images/_form.html.erb new file mode 100644 index 0000000..2393922 --- /dev/null +++ b/app/views/admin/e_paper_images/_form.html.erb @@ -0,0 +1,70 @@ +<% content_for :page_specific_css do %> + <%= stylesheet_link_tag "lib/main-forms" %> + <%= stylesheet_link_tag "lib/fileupload" %> + <%= stylesheet_link_tag "lib/main-list" %> +<% end %> +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "lib/bootstrap-fileupload" %> +<% end %> +<%#= f.error_messages %> +
+ +
+ + + + + + +
+
+ +
+ +
+
+
+ <% if @image.image.file %> + <%= image_tag @image.image %> + <% else %> + + <% end %> +
+
+ + <%= t(:select_image) %> + <%= t(:change) %> + <%= f.file_field :image %> + + <%= t(:cancel) %> +
+ +
+
+
+
+
+
+ + +
+ + <%= f.submit t('submit'), class: 'btn btn-primary' %> +
+ + + +
+ diff --git a/app/views/admin/e_paper_images/_index.html.erb b/app/views/admin/e_paper_images/_index.html.erb new file mode 100644 index 0000000..95ea700 --- /dev/null +++ b/app/views/admin/e_paper_images/_index.html.erb @@ -0,0 +1,32 @@ + + + + <% @table_fields.each do |f| %> + <%= thead(f) %> + <% end %> + + + + <% @images.each do |image| %> + + + + <% end %> + +
+ +
+ +
+
+<%= + content_tag :div, class: "bottomnav clearfix" do + content_tag(:div, paginate(@images), class: "pagination pagination-centered") + + content_tag(:div, link_to(t(:new_),new_admin_e_paper_image_path, :class=>"btn btn-primary"), class: "pull-right") + end +%> \ No newline at end of file diff --git a/app/views/admin/e_paper_images/edit.html.erb b/app/views/admin/e_paper_images/edit.html.erb new file mode 100644 index 0000000..938f221 --- /dev/null +++ b/app/views/admin/e_paper_images/edit.html.erb @@ -0,0 +1,7 @@ +
+<%= form_for @image, :url => {:action=>"update"}, :html => {:class => 'form-horizontal main-forms'} do |f| %> +
+ <%= render :partial => 'form', :locals => {:f => f} %> +
+<% end %> +
\ No newline at end of file diff --git a/app/views/admin/e_paper_images/index.html.erb b/app/views/admin/e_paper_images/index.html.erb new file mode 100644 index 0000000..80f6fa7 --- /dev/null +++ b/app/views/admin/e_paper_images/index.html.erb @@ -0,0 +1,4 @@ +<%= render_filter @filter_fields, "index_table" %> +
+ <%= render 'index'%> +
\ No newline at end of file diff --git a/app/views/admin/e_paper_images/new.html.erb b/app/views/admin/e_paper_images/new.html.erb new file mode 100644 index 0000000..ebf5e22 --- /dev/null +++ b/app/views/admin/e_paper_images/new.html.erb @@ -0,0 +1,7 @@ +
+<%= form_for @image, :url => {:action=>"create"}, :html => {:class => 'form-horizontal main-forms'} do |f| %> +
+ <%= render :partial => 'form', :locals => {:f => f} %> +
+<% end %> +
\ No newline at end of file diff --git a/app/views/admin/e_paper_subscribers/_index.html.erb b/app/views/admin/e_paper_subscribers/_index.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_paper_subscribers/_modal_select.html.erb b/app/views/admin/e_paper_subscribers/_modal_select.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_paper_subscribers/batch_delete_subscribers.html.erb b/app/views/admin/e_paper_subscribers/batch_delete_subscribers.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_paper_subscribers/download_excel_format.axlsx b/app/views/admin/e_paper_subscribers/download_excel_format.axlsx old mode 100644 new mode 100755 diff --git a/app/views/admin/e_paper_subscribers/export_excel.xlsx.axlsx b/app/views/admin/e_paper_subscribers/export_excel.xlsx.axlsx old mode 100644 new mode 100755 diff --git a/app/views/admin/e_paper_subscribers/index.html.erb b/app/views/admin/e_paper_subscribers/index.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_papers/_form.html.erb b/app/views/admin/e_papers/_form.html.erb old mode 100644 new mode 100755 index e775b98..d57b997 --- a/app/views/admin/e_papers/_form.html.erb +++ b/app/views/admin/e_papers/_form.html.erb @@ -55,9 +55,8 @@
+
- -
diff --git a/app/views/admin/e_papers/_index.html.erb b/app/views/admin/e_papers/_index.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_papers/_subscriber_index.html.erb b/app/views/admin/e_papers/_subscriber_index.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_papers/edit.html.erb b/app/views/admin/e_papers/edit.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_papers/index.html.erb b/app/views/admin/e_papers/index.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_papers/instructions.html.erb b/app/views/admin/e_papers/instructions.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_papers/new.html.erb b/app/views/admin/e_papers/new.html.erb old mode 100644 new mode 100755 diff --git a/app/views/admin/e_papers/subscribers.html.erb b/app/views/admin/e_papers/subscribers.html.erb old mode 100644 new mode 100755 diff --git a/app/views/e_papers/custom_widget_data.html.erb b/app/views/e_papers/custom_widget_data.html.erb old mode 100644 new mode 100755 diff --git a/app/views/e_papers/index.html.erb b/app/views/e_papers/index.html.erb old mode 100644 new mode 100755 diff --git a/app/views/e_papers/papers.html.erb b/app/views/e_papers/papers.html.erb old mode 100644 new mode 100755 diff --git a/app/views/e_papers/show.html.erb b/app/views/e_papers/show.html.erb old mode 100644 new mode 100755 diff --git a/app/views/e_papers/topics.html.erb b/app/views/e_papers/topics.html.erb old mode 100644 new mode 100755 diff --git a/config/locales/en.yml b/config/locales/en.yml old mode 100644 new mode 100755 index a2231ff..3e5b577 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -54,3 +54,5 @@ en: email_sentdate: Email Time newsletter_sent: "Newsletter sent." newsletter_will_be_sent: "Newsletter will be sent at %{time}." + banner_images: Banner Images + banner_image: Banner Image diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml old mode 100644 new mode 100755 index e156e03..0998c57 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -54,4 +54,6 @@ zh_tw: language_to_send: 開放訂閱語系 email_sentdate: 寄送時間 newsletter_sent: "電子報已寄送!" - newsletter_will_be_sent: "電子報會於%{time}寄送!" \ No newline at end of file + newsletter_will_be_sent: "電子報會於%{time}寄送!" + banner_images: Banner Images + banner_image: Banner Image \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb old mode 100644 new mode 100755 index c0fbd0a..ac46e13 --- a/config/routes.rb +++ b/config/routes.rb @@ -18,7 +18,7 @@ Rails.application.routes.draw do end end locales = Site.first.in_use_locales rescue I18n.available_locales - + scope "(:locale)", locale: Regexp.new(locales.join("|")) do namespace :admin do resources :e_paper_criterias do @@ -29,6 +29,7 @@ Rails.application.routes.draw do get "get_invalid_emails" end end + resources :e_paper_images get 'e_paper_subscribers/export_excel', to: 'e_paper_subscribers#export_excel' get 'e_paper_subscribers/download_excel_format', to: 'e_paper_subscribers#download_excel_format' post 'e_paper_subscribers/import_from_excel', to: 'e_paper_subscribers#import_from_excel' @@ -37,7 +38,7 @@ Rails.application.routes.draw do post 'e_paper_subscribers/delete_subscribers', to: 'e_paper_subscribers#delete_subscribers' resources :e_paper_subscribers resources :e_papers do - member do + member do get :send_email_to_subscribers delete "delete_subscriber" get "send_test_email" @@ -45,7 +46,7 @@ Rails.application.routes.draw do collection do get "instructions" get "subscribers" - end + end end end diff --git a/e_paper.gemspec b/e_paper.gemspec old mode 100644 new mode 100755 diff --git a/lib/e_paper.rb b/lib/e_paper.rb old mode 100644 new mode 100755 diff --git a/lib/e_paper/engine.rb b/lib/e_paper/engine.rb old mode 100644 new mode 100755 index a8b0559..8578d3c --- a/lib/e_paper/engine.rb +++ b/lib/e_paper/engine.rb @@ -37,7 +37,7 @@ module EPaper :priority=>1, :active_for_action=>{'admin/e_papers'=>'index'}, :available_for => 'users' - context_link 'new_', + context_link 'new_', :link_path=>"new_admin_e_paper_path" , :priority=>2, :active_for_action=>{'admin/e_papers'=>'new'}, @@ -76,6 +76,11 @@ module EPaper :priority=>8, :active_for_action=>{'admin/e_paper'=>'instructions'}, :available_for => 'users' + context_link 'e_paper.banner_images', + :link_path=>"admin_e_paper_images_path" , + :priority=>9, + :active_for_action=>{'admin/e_paper_images'=>'index'}, + :available_for => 'managers' end end end diff --git a/lib/e_paper/version.rb b/lib/e_paper/version.rb old mode 100644 new mode 100755 diff --git a/lib/tasks/e_paper_tasks.rake b/lib/tasks/e_paper_tasks.rake old mode 100644 new mode 100755 diff --git a/modules/e_paper/_category_wise_articles.html.erb b/modules/e_paper/_category_wise_articles.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/_criteria_list.html.erb b/modules/e_paper/_criteria_list.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/_latest_criteria.html.erb b/modules/e_paper/_latest_criteria.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/_latest_slider_aside.html.erb b/modules/e_paper/_latest_slider_aside.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/_latest_slider_full_screen.html.erb b/modules/e_paper/_latest_slider_full_screen.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/_subscriber.html.erb b/modules/e_paper/_subscriber.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/_widget.html.erb b/modules/e_paper/_widget.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/epaper_index1.html.erb b/modules/e_paper/epaper_index1.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/epaper_index2.html.erb b/modules/e_paper/epaper_index2.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/epaper_index2_latest.html.erb b/modules/e_paper/epaper_index2_latest.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/info.json b/modules/e_paper/info.json old mode 100644 new mode 100755 diff --git a/modules/e_paper/papers.html.erb b/modules/e_paper/papers.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/show.html.erb b/modules/e_paper/show.html.erb old mode 100644 new mode 100755 diff --git a/modules/e_paper/thumbs/category_wise_articles_thumb.png b/modules/e_paper/thumbs/category_wise_articles_thumb.png old mode 100644 new mode 100755 diff --git a/modules/e_paper/thumbs/criteria_list_thumb.png b/modules/e_paper/thumbs/criteria_list_thumb.png old mode 100644 new mode 100755 diff --git a/modules/e_paper/thumbs/latest_criteria_thumb.png b/modules/e_paper/thumbs/latest_criteria_thumb.png old mode 100644 new mode 100755 diff --git a/modules/e_paper/thumbs/latest_slider_aside_thumb.png b/modules/e_paper/thumbs/latest_slider_aside_thumb.png old mode 100644 new mode 100755 diff --git a/modules/e_paper/thumbs/latest_slider_full_screen_thumb.png b/modules/e_paper/thumbs/latest_slider_full_screen_thumb.png old mode 100644 new mode 100755 diff --git a/modules/e_paper/thumbs/subscriber_thumb.png b/modules/e_paper/thumbs/subscriber_thumb.png old mode 100644 new mode 100755 diff --git a/modules/e_paper/thumbs/thumb.png b/modules/e_paper/thumbs/thumb.png old mode 100644 new mode 100755 diff --git a/modules/e_paper/topics.html.erb b/modules/e_paper/topics.html.erb old mode 100644 new mode 100755 diff --git a/test/dummy/README.rdoc b/test/dummy/README.rdoc old mode 100644 new mode 100755 diff --git a/test/dummy/Rakefile b/test/dummy/Rakefile old mode 100644 new mode 100755 diff --git a/test/dummy/app/assets/images/.keep b/test/dummy/app/assets/images/.keep old mode 100644 new mode 100755 diff --git a/test/dummy/app/assets/javascripts/application.js b/test/dummy/app/assets/javascripts/application.js old mode 100644 new mode 100755 diff --git a/test/dummy/app/assets/stylesheets/application.css b/test/dummy/app/assets/stylesheets/application.css old mode 100644 new mode 100755 diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb old mode 100644 new mode 100755 diff --git a/test/dummy/app/controllers/concerns/.keep b/test/dummy/app/controllers/concerns/.keep old mode 100644 new mode 100755 diff --git a/test/dummy/app/helpers/application_helper.rb b/test/dummy/app/helpers/application_helper.rb old mode 100644 new mode 100755 diff --git a/test/dummy/app/mailers/.keep b/test/dummy/app/mailers/.keep old mode 100644 new mode 100755 diff --git a/test/dummy/app/models/.keep b/test/dummy/app/models/.keep old mode 100644 new mode 100755 diff --git a/test/dummy/app/models/concerns/.keep b/test/dummy/app/models/concerns/.keep old mode 100644 new mode 100755 diff --git a/test/dummy/app/views/layouts/application.html.erb b/test/dummy/app/views/layouts/application.html.erb old mode 100644 new mode 100755 diff --git a/test/dummy/config.ru b/test/dummy/config.ru old mode 100644 new mode 100755 diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/boot.rb b/test/dummy/config/boot.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/database.yml b/test/dummy/config/database.yml old mode 100644 new mode 100755 diff --git a/test/dummy/config/environment.rb b/test/dummy/config/environment.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/environments/development.rb b/test/dummy/config/environments/development.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/environments/production.rb b/test/dummy/config/environments/production.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/initializers/assets.rb b/test/dummy/config/initializers/assets.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/initializers/backtrace_silencers.rb b/test/dummy/config/initializers/backtrace_silencers.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/initializers/cookies_serializer.rb b/test/dummy/config/initializers/cookies_serializer.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/initializers/filter_parameter_logging.rb b/test/dummy/config/initializers/filter_parameter_logging.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/initializers/inflections.rb b/test/dummy/config/initializers/inflections.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/initializers/mime_types.rb b/test/dummy/config/initializers/mime_types.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/initializers/session_store.rb b/test/dummy/config/initializers/session_store.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/initializers/wrap_parameters.rb b/test/dummy/config/initializers/wrap_parameters.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/locales/en.yml b/test/dummy/config/locales/en.yml old mode 100644 new mode 100755 diff --git a/test/dummy/config/routes.rb b/test/dummy/config/routes.rb old mode 100644 new mode 100755 diff --git a/test/dummy/config/secrets.yml b/test/dummy/config/secrets.yml old mode 100644 new mode 100755 diff --git a/test/dummy/lib/assets/.keep b/test/dummy/lib/assets/.keep old mode 100644 new mode 100755 diff --git a/test/dummy/log/.keep b/test/dummy/log/.keep old mode 100644 new mode 100755 diff --git a/test/dummy/public/404.html b/test/dummy/public/404.html old mode 100644 new mode 100755 diff --git a/test/dummy/public/422.html b/test/dummy/public/422.html old mode 100644 new mode 100755 diff --git a/test/dummy/public/500.html b/test/dummy/public/500.html old mode 100644 new mode 100755 diff --git a/test/dummy/public/favicon.ico b/test/dummy/public/favicon.ico old mode 100644 new mode 100755 diff --git a/test/e_paper_test.rb b/test/e_paper_test.rb old mode 100644 new mode 100755 diff --git a/test/integration/navigation_test.rb b/test/integration/navigation_test.rb old mode 100644 new mode 100755 diff --git a/test/test_helper.rb b/test/test_helper.rb old mode 100644 new mode 100755