mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 08:29:53 +01:00
Add advanced frontpage layout config option
This commit is contained in:
parent
66a1998957
commit
7c475b5ff3
7 changed files with 136 additions and 93 deletions
|
@ -1,7 +1,11 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class AboutController < ApplicationController
|
class AboutController < ApplicationController
|
||||||
def index; end
|
def index
|
||||||
|
if Retrospring::Config.advanced_frontpage_enabled?
|
||||||
|
render template: "about/index_advanced"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def about
|
def about
|
||||||
@users = Rails.cache.fetch("about_count_users", expires_in: 1.hour) { user_count - current_ban_count }
|
@users = Rails.cache.fetch("about_count_users", expires_in: 1.hour) { user_count - current_ban_count }
|
||||||
|
|
|
@ -1,95 +1,32 @@
|
||||||
- provide(:title, APP_CONFIG["site_name"])
|
|
||||||
.container
|
.container
|
||||||
.card.bg-primary.my-3.text-bg-primary.text-center
|
.py-3.py-sm-5
|
||||||
.card-body.py-4
|
.row.d-sm-flex
|
||||||
= render "layouts/messages"
|
.col-md-8.align-self-center.text-center.text-md-start
|
||||||
%h1= APP_CONFIG["site_name"]
|
%h1
|
||||||
%p= APP_CONFIG["site_tagline"]
|
- if APP_CONFIG["use_svg_logo"]
|
||||||
- if Retrospring::Config.registrations_enabled?
|
.d-inline-block.w-50
|
||||||
%p
|
= render inline: Rails.application.config.justask_svg_logo
|
||||||
%a.btn.btn-outline-light.btn-lg{ href: url_for(new_user_registration_path) }
|
- else
|
||||||
= t(".register")
|
= APP_CONFIG["site_name"]
|
||||||
%small
|
- if Rails.env.development?
|
||||||
= t(".already_member")
|
%span.badge.rounded-pill.bg-warning.text-bg-warning
|
||||||
= link_to t("voc.login"), new_user_session_path
|
DEV
|
||||||
- else
|
%p.lead= APP_CONFIG["site_tagline"]
|
||||||
%p
|
.col-md-4
|
||||||
%a.btn.btn-outline-light.btn-lg{ href: url_for(new_user_session_path) }
|
%a.btn.btn-primary.d-grid{ href: url_for(new_user_registration_path) }
|
||||||
= t("voc.login")
|
= t("voc.register_now")
|
||||||
|
.d-block.text-center.py-2.text-secondary
|
||||||
|
= t(".or")
|
||||||
|
.card
|
||||||
|
.card-body
|
||||||
|
= bootstrap_form_for(User.new, as: :user, url: session_path(:user), data: { turbo: false }) do |f|
|
||||||
|
|
||||||
.row.my-5.my-sm-10
|
= f.text_field :login, autofocus: true, autocomplete: :username
|
||||||
.col-sm-6.order-5.order-sm-1.text-center.text-sm-right
|
= f.password_field :password, autocomplete: "current-password"
|
||||||
%h2.mb-4= t(".questions.header")
|
|
||||||
= t(".questions.body_html", app_name: APP_CONFIG["site_name"])
|
|
||||||
.col-sm-6.order-1.order-sm-5
|
|
||||||
.text-center.text-primary.d-flex.h-100.justify-content-center.fs-10
|
|
||||||
%i.fa.fa-envelope.align-self-center.mb-5.mb-sm-0
|
|
||||||
|
|
||||||
.row.my-5.my-sm-10
|
- if Devise.mappings[:user].rememberable?
|
||||||
.col-sm-6
|
= f.check_box :remember_me
|
||||||
.text-center.text-primary.d-flex.h-100.justify-content-center.fs-10
|
|
||||||
%i.fa.fa-comments.align-self-center.mb-5.mb-sm-0
|
|
||||||
.col-sm-6.text-center.text-sm-left
|
|
||||||
%h2.mb-4= t(".discussions.header")
|
|
||||||
= t(".discussions.body_html", app_name: APP_CONFIG["site_name"])
|
|
||||||
|
|
||||||
.row.my-5.my-sm-10
|
= f.primary t("voc.login"), class: "btn btn-primary d-grid w-100"
|
||||||
.col-sm-6.order-5.order-sm-1.text-center.text-sm-right
|
|
||||||
%h2.mb-4= t(".share.header")
|
= render "shared/links"
|
||||||
= t(".share.body_html", app_name: APP_CONFIG["site_name"])
|
|
||||||
.col-sm-6.order-1.order-sm-5
|
|
||||||
.text-center.text-primary.d-flex.h-100.justify-content-center.fs-10
|
|
||||||
%i.fa.fa-share.align-self-center.mb-5.mb-sm-0
|
|
||||||
|
|
||||||
.row.my-5.my-sm-10
|
|
||||||
.col-sm-6
|
|
||||||
.text-center.text-primary.d-flex.h-100.justify-content-center.fs-10
|
|
||||||
%i.fa.fa-paint-brush.align-self-center.mb-5.mb-sm-0
|
|
||||||
.col-sm-6.text-center.text-sm-left
|
|
||||||
%h2.mb-4= t(".customize.header")
|
|
||||||
= t(".customize.body_html", app_name: APP_CONFIG["site_name"])
|
|
||||||
.card
|
|
||||||
.card-body
|
|
||||||
.row.mx-n2
|
|
||||||
.col.px-2
|
|
||||||
.d-grid
|
|
||||||
%button.btn.btn-success.js-theme-button{ data: { theme: "theme-success" } }= t(".customize.themes.green")
|
|
||||||
.col.px-2
|
|
||||||
.d-grid
|
|
||||||
%button.btn.btn-warning.js-theme-button{ data: { theme: "theme-warning" } }= t(".customize.themes.orange")
|
|
||||||
.col.px-2
|
|
||||||
.d-grid
|
|
||||||
%button.btn.btn-danger.js-theme-button{ data: { theme: "theme-danger" } }= t(".customize.themes.red")
|
|
||||||
.col.px-2
|
|
||||||
.d-grid
|
|
||||||
%button.btn.btn-default.js-theme-button{ data: { theme: "reset" } }= t(".customize.themes.reset")
|
|
||||||
|
|
||||||
.container.text-center
|
|
||||||
%h2.mb-4= t(".more_features")
|
|
||||||
.row.my-5
|
|
||||||
.col-sm-4
|
|
||||||
%h3.mb-3
|
|
||||||
%i.fa.fa-fw.fa-globe.text-primary
|
|
||||||
= t(".open_source.header")
|
|
||||||
%p= t(".open_source.body", app_name: APP_CONFIG["site_name"])
|
|
||||||
.col-sm-4
|
|
||||||
%h3.mb-3
|
|
||||||
%i.fa.fa-fw.fa-eye-slash.text-primary
|
|
||||||
= t(".no_ads.header")
|
|
||||||
%p= t(".no_ads.body")
|
|
||||||
.col-sm-4
|
|
||||||
%h3.mb-3
|
|
||||||
%i.fa.fa-fw.fa-user-secret.text-primary
|
|
||||||
= t(".your_data.header")
|
|
||||||
%p= t(".your_data.body", app_name: APP_CONFIG["site_name"])
|
|
||||||
|
|
||||||
- if APP_CONFIG.dig(:features, :registration, :enabled)
|
|
||||||
.card
|
|
||||||
.card-body
|
|
||||||
%h2= t(".prompt.header")
|
|
||||||
%p= t(".prompt.body")
|
|
||||||
%p
|
|
||||||
%a.btn.btn-primary.btn-lg{ href: url_for(new_user_registration_path) }
|
|
||||||
= t(".register")
|
|
||||||
|
|
||||||
= render "shared/links"
|
|
||||||
|
|
95
app/views/about/index_advanced.html.haml
Normal file
95
app/views/about/index_advanced.html.haml
Normal file
|
@ -0,0 +1,95 @@
|
||||||
|
- provide(:title, APP_CONFIG["site_name"])
|
||||||
|
.container
|
||||||
|
.card.bg-primary.my-3.text-bg-primary.text-center
|
||||||
|
.card-body.py-4
|
||||||
|
= render "layouts/messages"
|
||||||
|
%h1= APP_CONFIG["site_name"]
|
||||||
|
%p= APP_CONFIG["site_tagline"]
|
||||||
|
- if Retrospring::Config.registrations_enabled?
|
||||||
|
%p
|
||||||
|
%a.btn.btn-outline-light.btn-lg{ href: url_for(new_user_registration_path) }
|
||||||
|
= t("voc.register_now")
|
||||||
|
%small
|
||||||
|
= t(".already_member")
|
||||||
|
= link_to t("voc.login"), new_user_session_path
|
||||||
|
- else
|
||||||
|
%p
|
||||||
|
%a.btn.btn-outline-light.btn-lg{ href: url_for(new_user_session_path) }
|
||||||
|
= t("voc.login")
|
||||||
|
|
||||||
|
.row.my-5.my-sm-10
|
||||||
|
.col-sm-6.order-5.order-sm-1.text-center.text-sm-right
|
||||||
|
%h2.mb-4= t(".questions.header")
|
||||||
|
= t(".questions.body_html", app_name: APP_CONFIG["site_name"])
|
||||||
|
.col-sm-6.order-1.order-sm-5
|
||||||
|
.text-center.text-primary.d-flex.h-100.justify-content-center.fs-10
|
||||||
|
%i.fa.fa-envelope.align-self-center.mb-5.mb-sm-0
|
||||||
|
|
||||||
|
.row.my-5.my-sm-10
|
||||||
|
.col-sm-6
|
||||||
|
.text-center.text-primary.d-flex.h-100.justify-content-center.fs-10
|
||||||
|
%i.fa.fa-comments.align-self-center.mb-5.mb-sm-0
|
||||||
|
.col-sm-6.text-center.text-sm-left
|
||||||
|
%h2.mb-4= t(".discussions.header")
|
||||||
|
= t(".discussions.body_html", app_name: APP_CONFIG["site_name"])
|
||||||
|
|
||||||
|
.row.my-5.my-sm-10
|
||||||
|
.col-sm-6.order-5.order-sm-1.text-center.text-sm-right
|
||||||
|
%h2.mb-4= t(".share.header")
|
||||||
|
= t(".share.body_html", app_name: APP_CONFIG["site_name"])
|
||||||
|
.col-sm-6.order-1.order-sm-5
|
||||||
|
.text-center.text-primary.d-flex.h-100.justify-content-center.fs-10
|
||||||
|
%i.fa.fa-share.align-self-center.mb-5.mb-sm-0
|
||||||
|
|
||||||
|
.row.my-5.my-sm-10
|
||||||
|
.col-sm-6
|
||||||
|
.text-center.text-primary.d-flex.h-100.justify-content-center.fs-10
|
||||||
|
%i.fa.fa-paint-brush.align-self-center.mb-5.mb-sm-0
|
||||||
|
.col-sm-6.text-center.text-sm-left
|
||||||
|
%h2.mb-4= t(".customize.header")
|
||||||
|
= t(".customize.body_html", app_name: APP_CONFIG["site_name"])
|
||||||
|
.card
|
||||||
|
.card-body
|
||||||
|
.row.mx-n2
|
||||||
|
.col.px-2
|
||||||
|
.d-grid
|
||||||
|
%button.btn.btn-success.js-theme-button{ data: { theme: "theme-success" } }= t(".customize.themes.green")
|
||||||
|
.col.px-2
|
||||||
|
.d-grid
|
||||||
|
%button.btn.btn-warning.js-theme-button{ data: { theme: "theme-warning" } }= t(".customize.themes.orange")
|
||||||
|
.col.px-2
|
||||||
|
.d-grid
|
||||||
|
%button.btn.btn-danger.js-theme-button{ data: { theme: "theme-danger" } }= t(".customize.themes.red")
|
||||||
|
.col.px-2
|
||||||
|
.d-grid
|
||||||
|
%button.btn.btn-default.js-theme-button{ data: { theme: "reset" } }= t(".customize.themes.reset")
|
||||||
|
|
||||||
|
.container.text-center
|
||||||
|
%h2.mb-4= t(".more_features")
|
||||||
|
.row.my-5
|
||||||
|
.col-sm-4
|
||||||
|
%h3.mb-3
|
||||||
|
%i.fa.fa-fw.fa-globe.text-primary
|
||||||
|
= t(".open_source.header")
|
||||||
|
%p= t(".open_source.body", app_name: APP_CONFIG["site_name"])
|
||||||
|
.col-sm-4
|
||||||
|
%h3.mb-3
|
||||||
|
%i.fa.fa-fw.fa-eye-slash.text-primary
|
||||||
|
= t(".no_ads.header")
|
||||||
|
%p= t(".no_ads.body")
|
||||||
|
.col-sm-4
|
||||||
|
%h3.mb-3
|
||||||
|
%i.fa.fa-fw.fa-user-secret.text-primary
|
||||||
|
= t(".your_data.header")
|
||||||
|
%p= t(".your_data.body", app_name: APP_CONFIG["site_name"])
|
||||||
|
|
||||||
|
- if APP_CONFIG.dig(:features, :registration, :enabled)
|
||||||
|
.card
|
||||||
|
.card-body
|
||||||
|
%h2= t(".prompt.header")
|
||||||
|
%p= t(".prompt.body")
|
||||||
|
%p
|
||||||
|
%a.btn.btn-primary.btn-lg{ href: url_for(new_user_registration_path) }
|
||||||
|
= t(".register")
|
||||||
|
|
||||||
|
= render "shared/links"
|
|
@ -58,6 +58,9 @@ features:
|
||||||
# Registrations
|
# Registrations
|
||||||
registration:
|
registration:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
# Advanced (marketing) frontpage layout
|
||||||
|
advanced_frontpage:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
# Redis
|
# Redis
|
||||||
redis_url: "redis://localhost:6379"
|
redis_url: "redis://localhost:6379"
|
||||||
|
|
|
@ -2,7 +2,8 @@ en:
|
||||||
language: "English"
|
language: "English"
|
||||||
about:
|
about:
|
||||||
index:
|
index:
|
||||||
register: "Register now"
|
or: "or"
|
||||||
|
index_advanced:
|
||||||
already_member: "Already a member?"
|
already_member: "Already a member?"
|
||||||
more_features: "But wait, there's more!"
|
more_features: "But wait, there's more!"
|
||||||
questions:
|
questions:
|
||||||
|
|
|
@ -24,6 +24,7 @@ en:
|
||||||
subscribe: "Subscribe"
|
subscribe: "Subscribe"
|
||||||
unsubscribe: "Unsubscribe"
|
unsubscribe: "Unsubscribe"
|
||||||
register: "Sign up"
|
register: "Sign up"
|
||||||
|
register_now: "Register now"
|
||||||
remove: "Remove"
|
remove: "Remove"
|
||||||
report: "Report"
|
report: "Report"
|
||||||
terms: "Terms of Service"
|
terms: "Terms of Service"
|
||||||
|
|
|
@ -23,5 +23,7 @@ module Retrospring
|
||||||
end
|
end
|
||||||
|
|
||||||
def registrations_enabled? = APP_CONFIG.dig(:features, :registration, :enabled)
|
def registrations_enabled? = APP_CONFIG.dig(:features, :registration, :enabled)
|
||||||
|
|
||||||
|
def advanced_frontpage_enabled? = APP_CONFIG.dig(:features, :advanced_frontpage, :enabled)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue