Skip to content

Commit

Permalink
Fixes publiclab#11369: Added store button to link store and wiki pages
Browse files Browse the repository at this point in the history
  • Loading branch information
KarishmaVanwari committed Aug 27, 2022
1 parent 9411c29 commit 74077fc
Show file tree
Hide file tree
Showing 10 changed files with 290 additions and 286 deletions.
4 changes: 4 additions & 0 deletions app/views/like/_like.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<% end %>
</span>

<span data-toggle="tooltip" data-placement="top" rel="tooltip" title="Store" class="btn btn-outline-secondary btn-circle">
<a><span class="fa fa-shopping-cart"></span></a>
</span>

<% if @node %>
<% subpage_count = Tag.find_pages("parent:#{@node.slug}", 100).count %>
<% if subpage_count > 0 %>
Expand Down
6 changes: 3 additions & 3 deletions bin/bundle
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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')
8 changes: 4 additions & 4 deletions bin/rails
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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'
8 changes: 4 additions & 4 deletions bin/rake
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
88 changes: 44 additions & 44 deletions bin/setup
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
36 changes: 18 additions & 18 deletions bin/webpack
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
36 changes: 18 additions & 18 deletions bin/webpack-dev-server
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
98 changes: 49 additions & 49 deletions script/mailman_server
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions script/rails
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 74077fc

Please sign in to comment.