diff --git a/app/controllers/about_controller.rb b/app/controllers/about_controller.rb new file mode 100644 index 00000000..ae1b2efb --- /dev/null +++ b/app/controllers/about_controller.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class AboutController < ApplicationController + def index; end +end diff --git a/app/controllers/static_controller.rb b/app/controllers/static_controller.rb index abea2047..06885b2b 100644 --- a/app/controllers/static_controller.rb +++ b/app/controllers/static_controller.rb @@ -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) diff --git a/app/controllers/timeline_controller.rb b/app/controllers/timeline_controller.rb new file mode 100644 index 00000000..b0eb549d --- /dev/null +++ b/app/controllers/timeline_controller.rb @@ -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 diff --git a/app/views/static/front.haml b/app/views/about/index.haml similarity index 99% rename from app/views/static/front.haml rename to app/views/about/index.haml index 1a6a9172..10508f9f 100644 --- a/app/views/static/front.haml +++ b/app/views/about/index.haml @@ -83,5 +83,3 @@ = t(".register") = render "shared/links" - - diff --git a/app/views/tabs/_feed.haml b/app/views/tabs/_feed.haml index 334bf797..ace55ec7 100644 --- a/app/views/tabs/_feed.haml +++ b/app/views/tabs/_feed.haml @@ -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' : '', diff --git a/app/views/static/index.haml b/app/views/timeline/index.haml similarity index 100% rename from app/views/static/index.haml rename to app/views/timeline/index.haml diff --git a/app/views/static/index.js.erb b/app/views/timeline/index.js.erb similarity index 100% rename from app/views/static/index.js.erb rename to app/views/timeline/index.js.erb diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 2917a828..9a626672 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -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: | +

After registering on %{app_name} share your unique link to your profile and + receive questions in your inbox to answer + them right away.

+ +

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.

+ discussions: + header: "Keep the discussion going" + body_html: | +

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.

+ +

Don't need to say anything, but still like the answer? Leave a smile (our form of likes) on an answer!

+ share: + header: "Share your answers" + body_html: | +

Want your followers on another platform to see your %{app_name} answers? + You can configure automatic sharing to your favorite platforms easily.

+ +

Not sure if it's a favorite, but at the moment only + Twitter is supported.

+ customize: + header: "Customize your experience" + body_html: | +

Make your %{app_name} profile your own with the ability to set a custom + profile picture and header image.

+ +

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!

+ +

For a quick demonstration, you can try this out here with a few presets:

+ 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: | -

After registering on %{app_name} share your unique link to your profile and - receive questions in your inbox to answer - them right away.

- -

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.

- discussions: - header: "Keep the discussion going" - body_html: | -

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.

- -

Don't need to say anything, but still like the answer? Leave a smile (our form of likes) on an answer!

- share: - header: "Share your answers" - body_html: | -

Want your followers on another platform to see your %{app_name} answers? - You can configure automatic sharing to your favorite platforms easily.

- -

Not sure if it's a favorite, but at the moment only - Twitter is supported.

- customize: - header: "Customize your experience" - body_html: | -

Make your %{app_name} profile your own with the ability to set a custom - profile picture and header image.

- -

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!

- -

For a quick demonstration, you can try this out here with a few presets:

- 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}" diff --git a/config/routes.rb b/config/routes.rb index b4d192e7..f83ce3a9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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