Merge branch 'main' into staging
6
Gemfile
@ -23,8 +23,8 @@ gem "simple_form" , "5.1.0"
|
||||
gem "simple_form_tailwind_css"
|
||||
gem 'kaminari'
|
||||
|
||||
gem "merged" , git: "https://github.com/HubFeenixMakers/merged"
|
||||
#gem "merged" , path: "../merged"
|
||||
#gem "merged" , git: "https://github.com/HubFeenixMakers/merged"
|
||||
gem "merged" , path: "../merged"
|
||||
|
||||
gem "passenger" , require: "phusion_passenger/rack_handler"
|
||||
|
||||
@ -49,3 +49,5 @@ group :test do
|
||||
gem "selenium-webdriver"
|
||||
gem "webdrivers"
|
||||
end
|
||||
|
||||
gem "pundit", "~> 2.3"
|
||||
|
24
Gemfile.lock
@ -1,6 +1,14 @@
|
||||
GIT
|
||||
remote: https://github.com/HubFeenixMakers/merged
|
||||
revision: a8f5229935e22f5aa8092647ec8c610477bdaa98
|
||||
remote: https://github.com/ruby2js/ruby2js/
|
||||
revision: f204f4e8f14cde6e4d4c6aafc55251a8d488a78d
|
||||
branch: haml_fix
|
||||
specs:
|
||||
ruby2js (5.0.1)
|
||||
parser
|
||||
regexp_parser (~> 2.1.1)
|
||||
|
||||
PATH
|
||||
remote: ../merged
|
||||
specs:
|
||||
merged (0.1.0)
|
||||
active_hash
|
||||
@ -11,15 +19,6 @@ GIT
|
||||
redcarpet
|
||||
ruby2js (~> 5.0, >= 5.0.1)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/ruby2js/ruby2js/
|
||||
revision: f204f4e8f14cde6e4d4c6aafc55251a8d488a78d
|
||||
branch: haml_fix
|
||||
specs:
|
||||
ruby2js (5.0.1)
|
||||
parser
|
||||
regexp_parser (~> 2.1.1)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
@ -144,7 +143,7 @@ GEM
|
||||
formatador (1.1.0)
|
||||
friendly_id (5.5.0)
|
||||
activerecord (>= 4.0.0)
|
||||
git (1.13.0)
|
||||
git (1.13.1)
|
||||
addressable (~> 2.8)
|
||||
rchardet (~> 1.8)
|
||||
globalid (1.0.0)
|
||||
@ -427,6 +426,7 @@ DEPENDENCIES
|
||||
mina
|
||||
passenger
|
||||
pg (~> 1.1)
|
||||
pundit (~> 2.3)
|
||||
rails (~> 7.0)
|
||||
ruby2js!
|
||||
sassc-rails
|
||||
|
@ -1,9 +1,18 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
before_action :configure_permitted_parameters, if: :devise_controller?
|
||||
|
||||
include Pundit::Authorization
|
||||
alias :current_user :current_member
|
||||
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
|
||||
|
||||
protected
|
||||
|
||||
def configure_permitted_parameters
|
||||
devise_parameter_sanitizer.permit(:sign_up, keys: [:name])
|
||||
end
|
||||
|
||||
def user_not_authorized
|
||||
flash[:alert] = "You are not authorized to perform this action."
|
||||
redirect_back(fallback_location: root_path)
|
||||
end
|
||||
end
|
||||
|
@ -17,6 +17,7 @@ class StoriesController < ApplicationController
|
||||
|
||||
# GET /stories/1/edit
|
||||
def edit
|
||||
authorize @story
|
||||
end
|
||||
|
||||
# POST /stories
|
||||
|
53
app/policies/application_policy.rb
Normal file
@ -0,0 +1,53 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ApplicationPolicy
|
||||
attr_reader :member, :record
|
||||
|
||||
def initialize(member, record)
|
||||
@member = member
|
||||
@record = record
|
||||
end
|
||||
|
||||
def index?
|
||||
false
|
||||
end
|
||||
|
||||
def show?
|
||||
false
|
||||
end
|
||||
|
||||
def create?
|
||||
false
|
||||
end
|
||||
|
||||
def new?
|
||||
create?
|
||||
end
|
||||
|
||||
def update?
|
||||
false
|
||||
end
|
||||
|
||||
def edit?
|
||||
update?
|
||||
end
|
||||
|
||||
def destroy?
|
||||
false
|
||||
end
|
||||
|
||||
class Scope
|
||||
def initialize(member, scope)
|
||||
@member = member
|
||||
@scope = scope
|
||||
end
|
||||
|
||||
def resolve
|
||||
raise NotImplementedError, "You must define #resolve in #{self.class}"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
attr_reader :member, :scope
|
||||
end
|
||||
end
|
9
app/policies/story_policy.rb
Normal file
@ -0,0 +1,9 @@
|
||||
class StoryPolicy < ApplicationPolicy
|
||||
|
||||
def edit?
|
||||
(member == record.member) or member.admin?
|
||||
end
|
||||
alias :update? :edit?
|
||||
alias :destroy? :edit?
|
||||
|
||||
end
|
@ -4,6 +4,25 @@
|
||||
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
|
||||
%title Hubfeenix Volunteers
|
||||
%meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
|
||||
// https://www.favicon-generator.org/
|
||||
%link{:href => "/apple-icon-57x57.png", :rel => "apple-touch-icon", :sizes => "57x57"}/
|
||||
%link{:href => "/apple-icon-60x60.png", :rel => "apple-touch-icon", :sizes => "60x60"}/
|
||||
%link{:href => "/apple-icon-72x72.png", :rel => "apple-touch-icon", :sizes => "72x72"}/
|
||||
%link{:href => "/apple-icon-76x76.png", :rel => "apple-touch-icon", :sizes => "76x76"}/
|
||||
%link{:href => "/apple-icon-114x114.png", :rel => "apple-touch-icon", :sizes => "114x114"}/
|
||||
%link{:href => "/apple-icon-120x120.png", :rel => "apple-touch-icon", :sizes => "120x120"}/
|
||||
%link{:href => "/apple-icon-144x144.png", :rel => "apple-touch-icon", :sizes => "144x144"}/
|
||||
%link{:href => "/apple-icon-152x152.png", :rel => "apple-touch-icon", :sizes => "152x152"}/
|
||||
%link{:href => "/apple-icon-180x180.png", :rel => "apple-touch-icon", :sizes => "180x180"}/
|
||||
%link{:href => "/android-icon-192x192.png", :rel => "icon", :sizes => "192x192", :type => "image/png"}/
|
||||
%link{:href => "/favicon-32x32.png", :rel => "icon", :sizes => "32x32", :type => "image/png"}/
|
||||
%link{:href => "/favicon-96x96.png", :rel => "icon", :sizes => "96x96", :type => "image/png"}/
|
||||
%link{:href => "/favicon-16x16.png", :rel => "icon", :sizes => "16x16", :type => "image/png"}/
|
||||
%link{:href => "/manifest.json", :rel => "manifest"}/
|
||||
%meta{:content => "#ffffff", :name => "msapplication-TileColor"}/
|
||||
%meta{:content => "/ms-icon-144x144.png", :name => "msapplication-TileImage"}/
|
||||
%meta{:content => "#ffffff", :name => "theme-color"}/
|
||||
|
||||
= csrf_meta_tags
|
||||
= csp_meta_tag
|
||||
= stylesheet_link_tag "tailwind"
|
||||
|
@ -25,6 +25,8 @@ set :user, 'feenix' # Username in the server to SSH to.
|
||||
set :shared_dirs, fetch(:shared_dirs, []).push('tmp/pids' , 'tmp/sockets' , 'public/uploads')
|
||||
set :shared_files, fetch(:shared_files, []).push('config/master.key')
|
||||
|
||||
set :force_migrate , true
|
||||
|
||||
# This task is the environment that is loaded for all remote run commands, such as
|
||||
# `mina deploy` or `mina rake`.
|
||||
task :remote_environment do
|
||||
@ -53,6 +55,7 @@ task :deploy do
|
||||
invoke :'deploy:link_shared_paths'
|
||||
invoke :'bundle:install'
|
||||
invoke :'rails:assets_precompile'
|
||||
invoke :'rails:db_migrate'
|
||||
invoke :'deploy:cleanup'
|
||||
|
||||
on :launch do
|
||||
|
BIN
public/android-icon-144x144.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
public/android-icon-192x192.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
public/android-icon-36x36.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
public/android-icon-48x48.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
public/android-icon-72x72.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
public/android-icon-96x96.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
public/apple-icon-114x114.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
public/apple-icon-120x120.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
public/apple-icon-144x144.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
public/apple-icon-152x152.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
public/apple-icon-180x180.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
public/apple-icon-57x57.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
public/apple-icon-60x60.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
public/apple-icon-72x72.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
public/apple-icon-76x76.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
public/apple-icon-precomposed.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
public/apple-icon.png
Normal file
After Width: | Height: | Size: 13 KiB |
2
public/browserconfig.xml
Normal file
@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<browserconfig><msapplication><tile><square70x70logo src="/ms-icon-70x70.png"/><square150x150logo src="/ms-icon-150x150.png"/><square310x310logo src="/ms-icon-310x310.png"/><TileColor>#ffffff</TileColor></tile></msapplication></browserconfig>
|
BIN
public/favicon-16x16.png
Normal file
After Width: | Height: | Size: 842 B |
BIN
public/favicon-32x32.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
public/favicon-96x96.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 1.1 KiB |
41
public/manifest.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "App",
|
||||
"icons": [
|
||||
{
|
||||
"src": "\/android-icon-36x36.png",
|
||||
"sizes": "36x36",
|
||||
"type": "image\/png",
|
||||
"density": "0.75"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-48x48.png",
|
||||
"sizes": "48x48",
|
||||
"type": "image\/png",
|
||||
"density": "1.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image\/png",
|
||||
"density": "1.5"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image\/png",
|
||||
"density": "2.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image\/png",
|
||||
"density": "3.0"
|
||||
},
|
||||
{
|
||||
"src": "\/android-icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image\/png",
|
||||
"density": "4.0"
|
||||
}
|
||||
]
|
||||
}
|
BIN
public/ms-icon-144x144.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
public/ms-icon-150x150.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
public/ms-icon-310x310.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
public/ms-icon-70x70.png
Normal file
After Width: | Height: | Size: 2.1 KiB |