merges master and fix conflicts
This commit is contained in:
11
app/controllers/users/sessions_controller.rb
Normal file
11
app/controllers/users/sessions_controller.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class Users::SessionsController < Devise::SessionsController
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
if resource.show_welcome_screen?
|
||||
welcome_path
|
||||
else
|
||||
root_path
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -1,9 +1,14 @@
|
||||
class WelcomeController < ApplicationController
|
||||
skip_authorization_check
|
||||
|
||||
layout "devise", only: :welcome
|
||||
|
||||
def index
|
||||
@featured_debates = Debate.sort_by_confidence_score.limit(3).for_render
|
||||
set_debate_votes(@featured_debates)
|
||||
end
|
||||
|
||||
def welcome
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -141,6 +141,10 @@ class User < ActiveRecord::Base
|
||||
@@username_max_length ||= self.columns.find { |c| c.name == 'username' }.limit
|
||||
end
|
||||
|
||||
def show_welcome_screen?
|
||||
sign_in_count == 1 && unverified? && !organization
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def validate_username_length
|
||||
|
||||
13
app/views/welcome/welcome.html.erb
Normal file
13
app/views/welcome/welcome.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<h2><%= t("welcome.welcome.title") %></h2>
|
||||
<p><%= t("welcome.welcome.instructions_1_html") %></p>
|
||||
<p><%= t("welcome.welcome.instructions_2_html") %></p>
|
||||
<p><%= t("welcome.welcome.instructions_3_html") %></p>
|
||||
<p>
|
||||
<%= link_to t("welcome.welcome.verify_account"),
|
||||
new_residence_path, class: "button large success radius margin-top expand" %>
|
||||
</p>
|
||||
<p class="text-center">
|
||||
<%= link_to t("welcome.welcome.go_to_index"),
|
||||
root_path, class: "small margin-top expand" %>
|
||||
</p>
|
||||
<p><%= t("welcome.welcome.instructions_4_html") %></p>
|
||||
Reference in New Issue
Block a user