Split front page into separate actions

This commit is contained in:
Karina Kwiatek 2022-07-18 16:26:11 +02:00 committed by Karina Kwiatek
parent dda407972c
commit f3b58c1d33
9 changed files with 87 additions and 76 deletions

View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
class AboutController < ApplicationController
def index; end
end

View File

@ -1,21 +1,6 @@
# frozen_string_literal: true
class StaticController < ApplicationController
def index
if user_signed_in?
@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?
respond_to do |format|
format.html
format.js { render layout: false }
end
else
return render 'static/front'
end
end
def about
user_count = User
.where.not(confirmed_at: nil)

View File

@ -0,0 +1,16 @@
# frozen_string_literal: true
class TimelineController < ApplicationController
before_action :authenticate_user!
def index
@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?
respond_to do |format|
format.html
format.js { render layout: false }
end
end
end

View File

@ -83,5 +83,3 @@
= t(".register")
= render "shared/links"

View File

@ -1,6 +1,6 @@
.card
.list-group.list-group-horizontal-sm.text-center
= list_group_item t('views.general.timeline'), root_path
= list_group_item t('views.general.timeline'), timeline_path
- if APP_CONFIG.dig(:features, :public, :enabled)
= list_group_item t('views.general.public'), public_timeline_path
%a.list-group-item.list-group-item-action.dropdown.dropdown-toggle{ class: list ? 'active' : '',

View File

@ -1,4 +1,62 @@
en:
about:
index:
subtitle: "Ask questions, give answers and learn more about your friends."
register: "Register now"
already_member: "Already a member?"
more_features: "But wait, there's more!"
questions:
header: "Receive and ask questions"
body_html: |
<p>After registering on %{app_name} share your unique link to your profile and
receive questions in your inbox to answer
them right away.</p>
<p>You can of course also use your account to ask anyone else on the site
questions, and once you accumulated followers you can send out questions to all of them
at once.</p>
discussions:
header: "Keep the discussion going"
body_html: |
<p>Someone answered your question and maybe not everything is cleared up? Use comments!
On %{app_name} you can leave comments on answers to keep the discussion going.</p>
<p>Don't need to say anything, but still like the answer? Leave a smile (our form of likes) on an answer!</p>
share:
header: "Share your answers"
body_html: |
<p>Want your followers on another platform to see your %{app_name} answers?
You can configure automatic sharing to your favorite platforms easily.</p>
<p class="text-muted">Not sure if it's a favorite, but at the moment only
<b>Twitter</b> is supported.</p>
customize:
header: "Customize your experience"
body_html: |
<p>Make your %{app_name} profile your own with the ability to set a custom
profile picture and header image.</p>
<p>Going a step further, you can customize all colors of
%{app_name} to your own liking. Don't like purple? Make it blue, red or green!</p>
<p>For a quick demonstration, you can try this out here with a few presets:</p>
themes:
green: "Green"
orange: "Orange"
red: "Red"
reset: "Reset"
open_source:
header: "Open Source"
body: "You heard it right! %{app_name} and all of it's core components are open source! Everyone can help and improve the service!"
no_ads:
header: "No Ads"
body: "We don't like them ourselves, really. They make websites slow and are (for the most part) annoying. So there's none!"
your_data:
header: "Your data is yours"
body: "Today the most precious things on the internet is your data. %{app_name} doesn't sell any data that is collected. It remains encrypted on our servers!"
prompt:
header: "What are you waiting for?"
body: "Registering takes less than 5 minutes!"
auth:
two_factor_authentication:
heading: "Two-factor authentication"
@ -318,63 +376,6 @@ en:
statistics:
header: "Statistics"
body: "All-time statistics for %{app_name}, updated every time you refresh the page!"
front:
subtitle: "Ask questions, give answers and learn more about your friends."
register: "Register now"
already_member: "Already a member?"
more_features: "But wait, there's more!"
questions:
header: "Receive and ask questions"
body_html: |
<p>After registering on %{app_name} share your unique link to your profile and
receive questions in your inbox to answer
them right away.</p>
<p>You can of course also use your account to ask anyone else on the site
questions, and once you accumulated followers you can send out questions to all of them
at once.</p>
discussions:
header: "Keep the discussion going"
body_html: |
<p>Someone answered your question and maybe not everything is cleared up? Use comments!
On %{app_name} you can leave comments on answers to keep the discussion going.</p>
<p>Don't need to say anything, but still like the answer? Leave a smile (our form of likes) on an answer!</p>
share:
header: "Share your answers"
body_html: |
<p>Want your followers on another platform to see your %{app_name} answers?
You can configure automatic sharing to your favorite platforms easily.</p>
<p class="text-muted">Not sure if it's a favorite, but at the moment only
<b>Twitter</b> is supported.</p>
customize:
header: "Customize your experience"
body_html: |
<p>Make your %{app_name} profile your own with the ability to set a custom
profile picture and header image.</p>
<p>Going a step further, you can customize all colors of
%{app_name} to your own liking. Don't like purple? Make it blue, red or green!</p>
<p>For a quick demonstration, you can try this out here with a few presets:</p>
themes:
green: "Green"
orange: "Orange"
red: "Red"
reset: "Reset"
open_source:
header: "Open Source"
body: "You heard it right! %{app_name} and all of it's core components are open source! Everyone can help and improve the service!"
no_ads:
header: "No Ads"
body: "We don't like them ourselves, really. They make websites slow and are (for the most part) annoying. So there's none!"
your_data:
header: "Your data is yours"
body: "Today the most precious things on the internet is your data. %{app_name} doesn't sell any data that is collected. It remains encrypted on our servers!"
prompt:
header: "What are you waiting for?"
body: "Registering takes less than 5 minutes!"
linkfilter:
heading: "You're leaving %{app_name}"
subheading: "The link you are visiting is not trusted by %{app_name}"

View File

@ -34,7 +34,13 @@ Rails.application.routes.draw do
end
end
root 'static#index'
unauthenticated :user do
root to: 'about#index'
end
authenticate :user do
root to: 'timeline#index', as: :timeline
end
match '/about', to: 'static#about', via: 'get'
match '/privacy', to: 'static#privacy_policy', via: 'get', as: :privacy_policy