From 74077fc416d2187eef22498b88b4f2808250363f Mon Sep 17 00:00:00 2001 From: KarishmaVanwari Date: Sun, 28 Aug 2022 05:20:05 +0530 Subject: [PATCH] Fixes #11369: Added store button to link store and wiki pages --- app/views/like/_like.html.erb | 4 + bin/bundle | 6 +- bin/rails | 8 +- bin/rake | 8 +- bin/setup | 88 +++++------ bin/webpack | 36 ++--- bin/webpack-dev-server | 36 ++--- script/mailman_server | 98 ++++++------ script/rails | 12 +- static/index.html | 280 +++++++++++++++++----------------- 10 files changed, 290 insertions(+), 286 deletions(-) mode change 100755 => 100644 bin/bundle mode change 100755 => 100644 bin/rails mode change 100755 => 100644 bin/rake mode change 100755 => 100644 bin/setup mode change 100755 => 100644 bin/webpack mode change 100755 => 100644 bin/webpack-dev-server mode change 100755 => 100644 script/mailman_server mode change 100755 => 100644 script/rails mode change 100755 => 100644 static/index.html diff --git a/app/views/like/_like.html.erb b/app/views/like/_like.html.erb index f9265c529d..b183c6d020 100644 --- a/app/views/like/_like.html.erb +++ b/app/views/like/_like.html.erb @@ -37,6 +37,10 @@ <% end %> + + + + <% if @node %> <% subpage_count = Tag.find_pages("parent:#{@node.slug}", 100).count %> <% if subpage_count > 0 %> diff --git a/bin/bundle b/bin/bundle old mode 100755 new mode 100644 index 66e9889e8b..9c6dfa016d --- a/bin/bundle +++ b/bin/bundle @@ -1,3 +1,3 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -load Gem.bin_path('bundler', 'bundle') +#!/usr/bin/env ruby +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +load Gem.bin_path('bundler', 'bundle') diff --git a/bin/rails b/bin/rails old mode 100755 new mode 100644 index 728cd85aa5..7b28f23588 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby -APP_PATH = File.expand_path('../../config/application', __FILE__) -require_relative '../config/boot' -require 'rails/commands' +#!/usr/bin/env ruby +APP_PATH = File.expand_path('../../config/application', __FILE__) +require_relative '../config/boot' +require 'rails/commands' diff --git a/bin/rake b/bin/rake old mode 100755 new mode 100644 index 17240489f6..8704afdf3a --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby -require_relative '../config/boot' -require 'rake' -Rake.application.run +#!/usr/bin/env ruby +require_relative '../config/boot' +require 'rake' +Rake.application.run diff --git a/bin/setup b/bin/setup old mode 100755 new mode 100644 index 750abb2794..2093121c5a --- a/bin/setup +++ b/bin/setup @@ -1,44 +1,44 @@ -#!/usr/bin/env ruby -require 'pathname' -require 'fileutils' -include FileUtils - -# path to your application root. -APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -chdir APP_ROOT do - # This script is a starting point to setup your application. - # Add necessary setup steps to this file. - - puts '== Installing dependencies ==' - system! 'gem install bundler --conservative' - system('bundle check') || system!('bundle install --without production mysql') - - - puts "\n== Copying sample files ==" - unless File.exist?('db/schema.rb') - cp 'db/schema.rb.example', 'db/schema.rb' - end - - unless File.exist?('config/database.yml') - cp 'config/database.yml.sqlite.example', 'config/database.yml' - end - - - puts "\n== Preparing database ==" - system! 'rake db:setup' - - - puts "\n== Installing static assets ==" - system! 'bower install' - - puts "\n== Removing old logs and tempfiles ==" - system! 'rake log:clear tmp:clear' - - puts "\n== Restarting application server ==" - system! 'passenger start' -end +#!/usr/bin/env ruby +require 'pathname' +require 'fileutils' +include FileUtils + +# path to your application root. +APP_ROOT = Pathname.new File.expand_path('../../', __FILE__) + +def system!(*args) + system(*args) || abort("\n== Command #{args} failed ==") +end + +chdir APP_ROOT do + # This script is a starting point to setup your application. + # Add necessary setup steps to this file. + + puts '== Installing dependencies ==' + system! 'gem install bundler --conservative' + system('bundle check') || system!('bundle install --without production mysql') + + + puts "\n== Copying sample files ==" + unless File.exist?('db/schema.rb') + cp 'db/schema.rb.example', 'db/schema.rb' + end + + unless File.exist?('config/database.yml') + cp 'config/database.yml.sqlite.example', 'config/database.yml' + end + + + puts "\n== Preparing database ==" + system! 'rake db:setup' + + + puts "\n== Installing static assets ==" + system! 'bower install' + + puts "\n== Removing old logs and tempfiles ==" + system! 'rake log:clear tmp:clear' + + puts "\n== Restarting application server ==" + system! 'passenger start' +end diff --git a/bin/webpack b/bin/webpack old mode 100755 new mode 100644 index 1031168d01..24c6674463 --- a/bin/webpack +++ b/bin/webpack @@ -1,18 +1,18 @@ -#!/usr/bin/env ruby - -ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" -ENV["NODE_ENV"] ||= "development" - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "bundler/setup" - -require "webpacker" -require "webpacker/webpack_runner" - -APP_ROOT = File.expand_path("..", __dir__) -Dir.chdir(APP_ROOT) do - Webpacker::WebpackRunner.run(ARGV) -end +#!/usr/bin/env ruby + +ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" +ENV["NODE_ENV"] ||= "development" + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "bundler/setup" + +require "webpacker" +require "webpacker/webpack_runner" + +APP_ROOT = File.expand_path("..", __dir__) +Dir.chdir(APP_ROOT) do + Webpacker::WebpackRunner.run(ARGV) +end diff --git a/bin/webpack-dev-server b/bin/webpack-dev-server old mode 100755 new mode 100644 index dd9662737a..5c1b83e33b --- a/bin/webpack-dev-server +++ b/bin/webpack-dev-server @@ -1,18 +1,18 @@ -#!/usr/bin/env ruby - -ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" -ENV["NODE_ENV"] ||= "development" - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require "bundler/setup" - -require "webpacker" -require "webpacker/dev_server_runner" - -APP_ROOT = File.expand_path("..", __dir__) -Dir.chdir(APP_ROOT) do - Webpacker::DevServerRunner.run(ARGV) -end +#!/usr/bin/env ruby + +ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development" +ENV["NODE_ENV"] ||= "development" + +require "pathname" +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require "bundler/setup" + +require "webpacker" +require "webpacker/dev_server_runner" + +APP_ROOT = File.expand_path("..", __dir__) +Dir.chdir(APP_ROOT) do + Webpacker::DevServerRunner.run(ARGV) +end diff --git a/script/mailman_server b/script/mailman_server old mode 100755 new mode 100644 index d25c1db42a..aadd0f6c8b --- a/script/mailman_server +++ b/script/mailman_server @@ -1,49 +1,49 @@ -#!/usr/bin/env ruby -require "rubygems" -require "bundler/setup" -require "mailman" - -Mailman.config.logger = Logger.new("log/mailman.log") - -Mailman.config.ignore_stdin = true #ignore input from STDIN - -Mailman.config.poll_interval = 20 # To poll for mails in every 5 seconds - - -# Email Configration for mailman -Mailman.config.pop3 = { - server: ENV['SERVER_ADDRESS'], # example pop.example.com - port: 995, - ssl: true, - username: ENV['USERNAME'], - password: ENV['EMAIL_PASSWORD'] -} - -Mailman::Application.run do - # routes are written here - # route for mail having node with id in their subject will only be accepted for processing - default do -# REMOVING ENTIRE 'begin/rescue' loop to try to address mailmain issues -# begin -# retries ||= 0 - # do something with the database that does not fetch mails yet (let's try to ensure we have a MySQL connection first) - puts Comment.last.inspect - Mailman.logger.info "Mail received from #{message.from.first}: '#{message.subject}' - '#{message&.html_part}'" - if message.subject == "Incoming mail parsing test" - Mailman.logger.info "Received incoming mail parsing test from #{message.from.first} at #{Time.now.to_s}" - end - last_comment = Comment.last - comment_node_id = Comment.new_comment_from_email(message) - if Comment.last.id != last_comment.id - Mailman.logger.info "Comment created from #{message.from.first}: '#{message.subject}' - https://publiclab.org/n/#{comment_node_id}" - end -# rescue Exception => e -# Mailman.logger.error "Exception occurred while receiving message:\n#{message}" -# Mailman.logger.error [e, *e.backtrace].join("\n") - # Seeing major site slowdowns; commenting out for now; - # https://github.com/publiclab/plots2/issues/5817 - # retry if (retries += 1) < 3 -# end - end - -end +#!/usr/bin/env ruby +require "rubygems" +require "bundler/setup" +require "mailman" + +Mailman.config.logger = Logger.new("log/mailman.log") + +Mailman.config.ignore_stdin = true #ignore input from STDIN + +Mailman.config.poll_interval = 20 # To poll for mails in every 5 seconds + + +# Email Configration for mailman +Mailman.config.pop3 = { + server: ENV['SERVER_ADDRESS'], # example pop.example.com + port: 995, + ssl: true, + username: ENV['USERNAME'], + password: ENV['EMAIL_PASSWORD'] +} + +Mailman::Application.run do + # routes are written here + # route for mail having node with id in their subject will only be accepted for processing + default do +# REMOVING ENTIRE 'begin/rescue' loop to try to address mailmain issues +# begin +# retries ||= 0 + # do something with the database that does not fetch mails yet (let's try to ensure we have a MySQL connection first) + puts Comment.last.inspect + Mailman.logger.info "Mail received from #{message.from.first}: '#{message.subject}' - '#{message&.html_part}'" + if message.subject == "Incoming mail parsing test" + Mailman.logger.info "Received incoming mail parsing test from #{message.from.first} at #{Time.now.to_s}" + end + last_comment = Comment.last + comment_node_id = Comment.new_comment_from_email(message) + if Comment.last.id != last_comment.id + Mailman.logger.info "Comment created from #{message.from.first}: '#{message.subject}' - https://publiclab.org/n/#{comment_node_id}" + end +# rescue Exception => e +# Mailman.logger.error "Exception occurred while receiving message:\n#{message}" +# Mailman.logger.error [e, *e.backtrace].join("\n") + # Seeing major site slowdowns; commenting out for now; + # https://github.com/publiclab/plots2/issues/5817 + # retry if (retries += 1) < 3 +# end + end + +end diff --git a/script/rails b/script/rails old mode 100755 new mode 100644 index f8da2cffd4..4276b365db --- a/script/rails +++ b/script/rails @@ -1,6 +1,6 @@ -#!/usr/bin/env ruby -# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. - -APP_PATH = File.expand_path('../../config/application', __FILE__) -require File.expand_path('../../config/boot', __FILE__) -require 'rails/commands' +#!/usr/bin/env ruby +# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. + +APP_PATH = File.expand_path('../../config/application', __FILE__) +require File.expand_path('../../config/boot', __FILE__) +require 'rails/commands' diff --git a/static/index.html b/static/index.html old mode 100755 new mode 100644 index 16e056d8e4..0b691f2a50 --- a/static/index.html +++ b/static/index.html @@ -1,140 +1,140 @@ - - - - - Public Laboratory - - - - - - -
- - - - -
- - - -
- -

BALLOON MAPPING - - Wiki pages | - People - Follow balloon-mapping - -

-
-

Balloon and kite mapping are a way to collect aerial images affordably, using a digital camera lofted to 1000ft on a tethered balloon or kite.

-

-
-
-
- -

Infrared camera rig

-

35 mins ago by Chris Fastie

-

0 comments »

-
-
- -

LEAFFEST 2012

-

35 mins ago by Chris Fastie

-

8 comments »

-
-
- -

Infrared camera rig

-

35 mins ago by Chris Fastie

-

0 comments »

-
-
- -

LEAFFEST 2012

-

35 mins ago by Chris Fastie

-

4 comments »

-
-
-
- -
- -
- - -
- - - + + + + + Public Laboratory + + + + + + +
+ + + + +
+ + + +
+ +

BALLOON MAPPING + + Wiki pages | + People + Follow balloon-mapping + +

+
+

Balloon and kite mapping are a way to collect aerial images affordably, using a digital camera lofted to 1000ft on a tethered balloon or kite.

+

+
+
+
+ +

Infrared camera rig

+

35 mins ago by Chris Fastie

+

0 comments »

+
+
+ +

LEAFFEST 2012

+

35 mins ago by Chris Fastie

+

8 comments »

+
+
+ +

Infrared camera rig

+

35 mins ago by Chris Fastie

+

0 comments »

+
+
+ +

LEAFFEST 2012

+

35 mins ago by Chris Fastie

+

4 comments »

+
+
+
+ +
+ +
+ + +
+ + +