merged
This commit is contained in:
commit
07b09e54de
1
Gemfile
1
Gemfile
@ -26,6 +26,7 @@ gem 'thredded', '~> 1.0'
|
||||
gem "simple_form" , "5.1.0"
|
||||
gem "simple_form_tailwind_css"
|
||||
gem 'kaminari'
|
||||
gem 'ransack'
|
||||
|
||||
gem "passenger" , "6.0.15" , require: "phusion_passenger/rack_handler"
|
||||
gem "bootsnap", require: false
|
||||
|
@ -306,6 +306,10 @@ GEM
|
||||
thor (~> 1.0)
|
||||
zeitwerk (~> 2.5)
|
||||
rake (13.0.6)
|
||||
ransack (3.2.1)
|
||||
activerecord (>= 6.1.5)
|
||||
activesupport (>= 6.1.5)
|
||||
i18n
|
||||
rb-fsevent (0.11.2)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
@ -429,6 +433,7 @@ DEPENDENCIES
|
||||
pg (~> 1.1)
|
||||
pundit (~> 2.3)
|
||||
rails (~> 7.0)
|
||||
ransack
|
||||
ruby2js!
|
||||
sassc-rails
|
||||
selenium-webdriver
|
||||
|
@ -2,7 +2,9 @@ class StoriesController < ApplicationController
|
||||
before_action :set_story, only: %i[ show edit update destroy ]
|
||||
|
||||
def index
|
||||
@stories = Story.all.page params[:page]
|
||||
@q = Story.ransack(params[:q])
|
||||
@q.sorts = 'created_at desc' if @q.sorts.empty?
|
||||
@stories = @q.result(distinct: true).page( params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
|
@ -9,27 +9,33 @@
|
||||
%nav.mt-6{"aria-label" => "Footer Navigation - Services"}
|
||||
%ul.space-y-4.text-sm
|
||||
%li
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/local"}
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/local_area"}
|
||||
Local Area
|
||||
%li
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/helsinki"}
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/helsinki_turku"}
|
||||
Helsinki & Turkku
|
||||
%li
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/other_sites"}
|
||||
Other Sites
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/in_summer"}
|
||||
In Summer
|
||||
%li
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/in_winter"}
|
||||
In Winter
|
||||
.col-span-2.sm:col-span-1
|
||||
%p.font-medium.text-gray-900 Information
|
||||
%nav.mt-6{"aria-label" => "Footer Navigation - Hub Feenix"}
|
||||
%ul.space-y-4.text-sm
|
||||
%li
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/info"}
|
||||
Info
|
||||
Living @ Feenix Info
|
||||
%li
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/the_deal"}
|
||||
About Volunteeing
|
||||
%li
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/arriving"}
|
||||
Arriving
|
||||
Getting here
|
||||
%li
|
||||
%a.text-gray-700.transition.hover:opacity-75{:href => "/about"}
|
||||
About
|
||||
About Hub Feenix
|
||||
.col-span-2.sm:col-span-1
|
||||
%p.font-medium.text-gray-900 People
|
||||
%nav.mt-6{"aria-label" => "Footer Navigation - Hub Feenix"}
|
||||
|
@ -32,7 +32,7 @@
|
||||
- if false
|
||||
%script{:src => "https://cdn.tailwindcss.com"}
|
||||
|
||||
%body.max-w-screen-2xl.xl:mx-auto
|
||||
%body.xl:mx-auto{class: "max-w-[1920px]"}
|
||||
= render "layouts/header"
|
||||
= render "layouts/messages"
|
||||
= yield
|
||||
|
@ -1,4 +1,10 @@
|
||||
= paginate @stories
|
||||
|
||||
.flex.justify-end
|
||||
= sort_link(@q, :happened ,class: 'flex flex-nowrap text-md')
|
||||
.border-r-4.mx-4
|
||||
= sort_link(@q, :created_at , class: 'flex flex-nowrap text-md')
|
||||
|
||||
- @stories.each do |story|
|
||||
= render_story(story)
|
||||
|
||||
|
@ -9,6 +9,7 @@ require 'mina/rbenv' # for rbenv support. (https://rbenv.org)
|
||||
# branch - Branch name to deploy. (needed by mina/git)
|
||||
|
||||
set :application_name, 'volunteers'
|
||||
#set :domain, 'www.rubydesign.fi'
|
||||
set :domain, '192.168.129.10'
|
||||
set :deploy_to, '/home/feenix/volunteers'
|
||||
set :repository, "https://github.com/HubFeenixMakers/volunteers.git"
|
||||
|
18
config/initializers/ransack.rb
Normal file
18
config/initializers/ransack.rb
Normal file
@ -0,0 +1,18 @@
|
||||
require "ransack"
|
||||
|
||||
Ransack.configure do |config|
|
||||
|
||||
config.custom_arrows = {
|
||||
up_arrow: '<div class="mt-1 ml-1 h-0 w-0 border-x-8 border-x-transparent border-b-[16px] border-b-blue-600"></div>',
|
||||
down_arrow: '<div class="mt-1 ml-1 h-0 w-0 border-x-8 border-x-transparent border-t-[16px] border-t-blue-600"></div>',
|
||||
}
|
||||
# Change default search parameter key name.
|
||||
# Default key name is :q
|
||||
config.search_key = :q
|
||||
|
||||
# Raise errors if a query contains an unknown predicate or attribute.
|
||||
# Default is true (do not raise error on unknown conditions).
|
||||
config.ignore_unknown_conditions = false
|
||||
|
||||
config.hide_sort_order_indicators = false
|
||||
end
|
@ -11,6 +11,7 @@ module.exports = {
|
||||
content: [
|
||||
'./public/*.html',
|
||||
'./app/helpers/**/*.rb',
|
||||
'./config/initializers/**/*.rb',
|
||||
'./app/javascript/**/*.js',
|
||||
'./app/views/**/*.{erb,haml,html,slim}' ,
|
||||
fullname , fullname2
|
||||
|
Loading…
Reference in New Issue
Block a user