start timeline view
This commit is contained in:
parent
d90ed00b71
commit
b8dc0da001
@ -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
|
||||||
|
@ -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,
|
||||||
|
9
app/views/members/timeline.haml
Normal file
9
app/views/members/timeline.haml
Normal 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
|
@ -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'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user