Introduces New Installation Page
If there are no users signed up and no conferences we show a page informing people what they need to do.
This commit is contained in:
parent
7fd7090867
commit
0f5181ccf4
3 changed files with 29 additions and 4 deletions
|
|
@ -265,12 +265,14 @@ class User < ApplicationRecord
|
||||||
proposals(conference).count
|
proposals(conference).count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.empty?
|
||||||
|
User.count == 1 && User.first.email == 'deleted@localhost.osem'
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def setup_role
|
def setup_role
|
||||||
if User.count == 1 && User.first.email == 'deleted@localhost.osem'
|
self.is_admin = true if User.empty?
|
||||||
self.is_admin = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def touch_events
|
def touch_events
|
||||||
|
|
|
||||||
21
app/views/conferences/_new_install.html.haml
Normal file
21
app/views/conferences/_new_install.html.haml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.well
|
||||||
|
%h1
|
||||||
|
Welcome to your new
|
||||||
|
= link_to('https://osem.io') do
|
||||||
|
Open Source Event Manager
|
||||||
|
installation!
|
||||||
|
%p
|
||||||
|
The first user to
|
||||||
|
- if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
||||||
|
= link_to(new_ichain_registration_path('user')) do
|
||||||
|
sign up
|
||||||
|
- else
|
||||||
|
= link_to(new_registration_path('user')) do
|
||||||
|
sign up
|
||||||
|
will the be administrator of it.
|
||||||
|
%p
|
||||||
|
We hope you enjoy using OSEM, if you have any question don't hesitate to
|
||||||
|
= link_to('http://osem.io/#contact') do
|
||||||
|
contact us!
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
%h2 Upcoming Conferences
|
%h2 Upcoming Conferences
|
||||||
- @current.each do |conference|
|
- @current.each do |conference|
|
||||||
= render '/conferences/conference_details', conference: conference
|
= render '/conferences/conference_details', conference: conference
|
||||||
-if @antiquated and @antiquated.any?
|
- if @antiquated and @antiquated.any?
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
%p.text-right
|
%p.text-right
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
#antiquated.collapse
|
#antiquated.collapse
|
||||||
- @antiquated.each do |conference|
|
- @antiquated.each do |conference|
|
||||||
= render '/conferences/conference_details', conference: conference
|
= render '/conferences/conference_details', conference: conference
|
||||||
|
- if @antiquated.empty? && @current.empty? && User.empty?
|
||||||
|
= render partial: 'new_install'
|
||||||
|
|
||||||
-content_for :script_body do
|
-content_for :script_body do
|
||||||
:javascript
|
:javascript
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue