2020-04-20 23:03:57 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-08-01 11:47:25 +02:00
|
|
|
class StaticController < ApplicationController
|
|
|
|
def index
|
2014-12-08 14:14:13 +01:00
|
|
|
if user_signed_in?
|
2020-04-20 23:03:57 +02:00
|
|
|
@timeline = current_user.cursored_timeline(last_id: params[:last_id])
|
|
|
|
@timeline_last_id = @timeline.map(&:id).min
|
|
|
|
@more_data_available = !current_user.cursored_timeline(last_id: @timeline_last_id, size: 1).count.zero?
|
|
|
|
|
2014-12-08 14:14:13 +01:00
|
|
|
respond_to do |format|
|
|
|
|
format.html
|
2020-05-09 04:39:09 +02:00
|
|
|
format.js { render layout: false }
|
2014-12-08 14:14:13 +01:00
|
|
|
end
|
2015-08-28 16:36:49 +02:00
|
|
|
else
|
|
|
|
return render 'static/front'
|
2014-12-08 14:14:13 +01:00
|
|
|
end
|
2014-08-01 11:47:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def about
|
2021-10-03 20:40:25 +02:00
|
|
|
@users = User
|
2021-10-03 20:49:33 +02:00
|
|
|
.where.not(confirmed_at: nil)
|
2021-10-03 20:40:25 +02:00
|
|
|
.where(permanently_banned: false)
|
|
|
|
.where(banned_until: nil)
|
|
|
|
.where('answered_count > 0')
|
|
|
|
.where('asked_count > 0')
|
|
|
|
.count
|
|
|
|
|
|
|
|
@questions = Question.count
|
|
|
|
@answers = Answer.count
|
|
|
|
@comments = Comment.count
|
|
|
|
@smiles = Smile.count + CommentSmile.count
|
2014-08-01 11:47:25 +02:00
|
|
|
end
|
2015-01-07 21:30:52 +01:00
|
|
|
|
2021-12-30 17:58:15 +01:00
|
|
|
def linkfilter
|
|
|
|
redirect_to root_path unless params[:url]
|
|
|
|
|
|
|
|
@link = params[:url]
|
|
|
|
end
|
|
|
|
|
2015-01-07 21:30:52 +01:00
|
|
|
def faq
|
|
|
|
|
|
|
|
end
|
2015-01-16 22:36:39 +01:00
|
|
|
|
|
|
|
def privacy_policy
|
|
|
|
|
|
|
|
end
|
2015-01-16 23:16:28 +01:00
|
|
|
|
|
|
|
def terms
|
|
|
|
|
|
|
|
end
|
2014-08-01 11:47:25 +02:00
|
|
|
end
|