start timeline view

This commit is contained in:
Torsten 2023-05-27 20:42:54 +03:00
parent d90ed00b71
commit b8dc0da001
4 changed files with 22 additions and 1 deletions

View File

@ -6,6 +6,10 @@ class MembersController < ApplicationController
@members = Member.public_scope.order(:name).page params[:page] @members = Member.public_scope.order(:name).page params[:page]
end end
def timeline
@members = Member.visible_scope.order(:name).page params[:page]
end
# GET /members/1 # GET /members/1
def show def show
end end

View File

@ -4,6 +4,10 @@ class Member < ApplicationRecord
where.not(confirmed_at: nil).where.not(picture: nil) where.not(confirmed_at: nil).where.not(picture: nil)
end end
def self.visible_scope
where.not(confirmed_at: nil).where.not(arrived: nil)
end
# Include default devise modules. Others available are: # Include default devise modules. Others available are:
# , :lockable, :timeoutable, :trackable and :omniauthable # , :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,:confirmable, devise :database_authenticatable, :registerable,:confirmable,

View File

@ -0,0 +1,9 @@
= paginate @members
.flex.flex-col.mx-10
- @members.each_with_index do |member , index|
.flex
.w-60= member.name
.mx-1= index + 1
.mx-1= distance_of_time_in_words_to_now member.arrived
.name= member.left - member.arrived

View File

@ -7,7 +7,11 @@ Rails.application.routes.draw do
get "/members/edit_email" , to: "registrations#edit_email" get "/members/edit_email" , to: "registrations#edit_email"
end end
resources :members resources :members do
collection do
get :timeline
end
end
mount Thredded::Engine => '/forum' mount Thredded::Engine => '/forum'