Skip to content

Commit

Permalink
Add a basic home page, small description and prepare for other links
Browse files Browse the repository at this point in the history
  • Loading branch information
renatolond committed Nov 8, 2024
1 parent 0d7ba69 commit 0a9c414
Show file tree
Hide file tree
Showing 13 changed files with 131 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ gem "propshaft"
gem "falcon"

gem "haml" # Allows to use haml template files instead of erb
gem "haml-rails", "~> 2.0"

gem "kramdown" # Allows for markdown in haml files, look more into this

# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ GEM
temple (>= 0.8.2)
thor
tilt
haml-rails (2.1.0)
actionpack (>= 5.1)
activesupport (>= 5.1)
haml (>= 4.0.6)
railties (>= 5.1)
hashdiff (1.1.1)
httparty (0.22.0)
csv
Expand Down Expand Up @@ -412,6 +417,7 @@ DEPENDENCIES
debug
falcon
haml
haml-rails (~> 2.0)
importmap-rails
kramdown
lefthook
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/00_imports.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import "https://cdn.jsdelivr.net/npm/[email protected]/public/assets/styles/choices.min.css";
@import "https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css";
@import "https://cdn.jsdelivr.net/npm/[email protected]/css/fork-awesome.min.css";
14 changes: 11 additions & 3 deletions app/assets/stylesheets/bulma.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
@import "https://cdn.jsdelivr.net/npm/[email protected]/public/assets/styles/choices.min.css";
@import "https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css";

:root {
--bulma-primary-h: 31deg;
--bulma-primary-s: 84%;
Expand All @@ -23,3 +20,14 @@
.navbar {
--bulma-navbar-background-color: #E7D8B7;
}

.hero-body .subtitle {
padding-top: 2rem;
line-height: 1.5;
}

.card-image > .fa {
font-size: 5rem;
padding-top: 2rem;
padding-bottom: 2rem;
}
8 changes: 8 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true

class HomeController < ApplicationController
layout "home"
allow_unauthenticated_access

def index; end
end
29 changes: 29 additions & 0 deletions app/views/application/_footer.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
%footer.section
.box.cta
.container
.pb-5.is-flex.is-flex-wrap-wrap.is-justify-content-between.is-align-items-center
.mr-auto.mb-2
%a.is-inline-block{:href => "#"}
%img.image{:alt => "", :src => "https://bulma.io/images/bulma-logo.png", :width => "96px"}/
%div
%ul.is-flex.is-flex-wrap-wrap.is-align-items-center.is-justify-content-center
%li.mr-4
%a.is-white{:href => "#"} About
%li.mr-4
%a.is-white{:href => "#"} Terms
%li.mr-4
%a.is-white{:href => "#"} Privacy
%hr
.container
.is-flex-tablet.is-justify-content-between.is-align-items-center
%p
Powered by
%a{href: "https://join.retromeet.social", target: "_blank"}
RetroMeet
&#169; 2024, RetroMeet contributors.
.py-2.is-hidden-tablet
.ml-auto
%a.mr-4.is-inline-block{href: "https://github.com/retromeet", target: "_blank"}
%i.fa.fa-github{ "aria-hidden": true }
%a.mr-4.is-inline-block{href: "https://masto.donte.com.br/@retromeet", target: "_blank"}
%i.fa.fa-mastodon{ "aria-hidden": true }
5 changes: 3 additions & 2 deletions app/views/application/_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
.navbar-end
- if @basic_profile_info.present?
.navbar-item= t("welcome", display_name: @basic_profile_info.display_name)
.navbar-item= link_to t("my_profile"), profile_path
.navbar-item Settings
.navbar-item= link_to t("my_profile"), profile_path
.navbar-item Settings
- if @basic_profile_info.present?
.navbar-item= link_to t("sign_out"), destroy_session_url, data: { "turbo-method": :delete }
- else
.navbar-item= link_to t("sign_in"), new_session_url
.navbar-item= link_to t("sign_up"), new_account_session_path
35 changes: 35 additions & 0 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.hero-head
= render "header"
.hero-body
.container.has-text-centered
%h1.title
Dating online can be different: free, open-source and privacy conscious!
%h2.subtitle
RetroMeet is and always will be free, and since it's open source you can help build the best friend-finding and dating app out there!
%section.container
.columns.features
.column.is-4
.card.is-shady
.card-image.has-text-centered
%i.fa.fa-lightbulb-o
.card-content
.content
%h4 Free
%p RetroMeet is free, no more paying to maybe get in touch with people that interest you. No anxiety-inducing "someone liked you" prompt.
.column.is-4
.card.is-shady
.card-image.has-text-centered
%i.fa.fa-user-secret
.card-content
.content
%h4 Privacy conscious
%p We do not sell your data or give it to third parties. You have controls to help navigate who can see your data.
.column.is-4
.card.is-shady
.card-image.has-text-centered
%i.fa.fa-code-fork
.card-content
.content
%h4 Open-source
%p
The code for RetroMeet is available and can be modified by many hands to improve
1 change: 1 addition & 0 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@

.column.is-9
= yield
= render "footer"
20 changes: 20 additions & 0 deletions app/views/layouts/home.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
!!!
%html
%head
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
%title RetromeetWeb
%meta{:content => "width=device-width,initial-scale=1", :name => "viewport"}/
%meta{:content => "yes", :name => "apple-mobile-web-app-capable"}/
%meta{:content => "yes", :name => "mobile-web-app-capable"}/
= csrf_meta_tags
= csp_meta_tag
= yield :head
%link{:href => "/icon.png", :rel => "icon", :type => "image/png"}/
%link{:href => "/icon.svg", :rel => "icon", :type => "image/svg+xml"}/
%link{:href => "/icon.png", :rel => "apple-touch-icon"}/
= stylesheet_link_tag :app, "data-turbo-track": "reload"
= javascript_importmap_tags
%body
%section.hero.is-medium.is-bold
= yield
= render "footer"
2 changes: 2 additions & 0 deletions app/views/layouts/no_columns.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@
.notification.is-success
= flash[:success]
= yield

= render "footer"
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker

# Defines the root path route ("/")
root "profiles#index"
root "home#index"

resource :session, only: [], path: :auth do
get :new, path: :sign_in, as: :new
Expand Down
10 changes: 10 additions & 0 deletions test/controllers/home_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

require "test_helper"

class HomeControllerTest < ActionDispatch::IntegrationTest
test "should get index" do
get root_url
assert_response :success
end
end

0 comments on commit 0a9c414

Please sign in to comment.