merges master and fix conflicts

This commit is contained in:
kikito
2015-09-10 18:09:19 +02:00
9 changed files with 107 additions and 0 deletions

View 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

View File

@@ -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

View File

@@ -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

View 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>