From e274470d55b52f41f6c877985347e664977161c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Sat, 28 Mar 2015 23:03:28 +0100 Subject: [PATCH] Replace default.html with a regular view So we can correctly reference the images --- app/assets/stylesheets/home.scss | 84 +++++++++++++++ app/controllers/home_controller.rb | 10 +- app/views/home/default.haml | 64 ++++++++++++ config/application.rb | 1 + public/default.html | 158 ----------------------------- 5 files changed, 154 insertions(+), 163 deletions(-) create mode 100644 app/assets/stylesheets/home.scss create mode 100644 app/views/home/default.haml delete mode 100644 public/default.html diff --git a/app/assets/stylesheets/home.scss b/app/assets/stylesheets/home.scss new file mode 100644 index 000000000..acb3e9195 --- /dev/null +++ b/app/assets/stylesheets/home.scss @@ -0,0 +1,84 @@ +body { + margin-top: 50px; + background-color: white; + background-image : none; +} + +li { + list-style: none; +} + +footer h3 { + margin-bottom: 25px; + text-align: center; +} + +footer { + margin-bottom: 12px; + padding: 42px; + border-top: 1px solid #ccc; + border-bottom: 1px solid #ccc; + width: auto +} + +#header { + /* Hack to hide the header */ + box-shadow:none; + border:none; + background:none; + + left: 0px; + padding: 15px 0px; +} + +#header img { + margin-left: 15px; +} + +#login-link { + float: right; + margin-right: 15px; +} + +#steps { + text-align: center; +} + +#banner { + border-bottom : 1px solid #ccc; + border-top : 1px solid #eee; + padding : 30px; + margin-top: 20px; + text-align: center; + + box-shadow : 0 9px 15px -10px rgba(0,0,0,0.7); +} + +#links { + margin: 0; + padding: 0; + text-align: center; +} + +#links .section { + margin: 0; + padding: 0; + display: inline-block; + vertical-align: top; + width: 24%; + max-width: 24%; +} + +#change-page { + color: #999; + text-align: center; + font-style: italic; +} + +.helpful { + cursor: help; +} + +.row { + margin-bottom: 60px; +} diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 5c42e09b5..0c455737b 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -4,12 +4,12 @@ class HomeController < ApplicationController def show - partial_dir = Rails.root.join('app', 'views', 'home') + partial_dir = Rails.root.join("app", "views", "home") if user_signed_in? redirect_to stream_path elsif is_mobile_device? - if partial_dir.join('_show.mobile.haml').exist? || - partial_dir.join('_show.mobile.erb').exist? + if partial_dir.join("_show.mobile.haml").exist? || + partial_dir.join("_show.mobile.erb").exist? render :show else redirect_to user_session_path @@ -18,8 +18,8 @@ class HomeController < ApplicationController partial_dir.join("_show.html.erb").exist? render :show else - render file: Rails.root.join("public", "default.html"), - layout: 'application' + render :default, + layout: "application" end end diff --git a/app/views/home/default.haml b/app/views/home/default.haml new file mode 100644 index 000000000..e2ba79087 --- /dev/null +++ b/app/views/home/default.haml @@ -0,0 +1,64 @@ +- content_for(:head) do + = stylesheet_link_tag :home, media: "all" + +#page.container + %header#header + %a#login-link.btn{href: "login"} Log In + = image_tag "branding/logo.png" + + #banner.row + %h1 Welcome, friend. + %h3 You're about to change the Internet. Let's get you set up, shall we? + + #steps.row + .span4 + %h2 + Configure your + %abbr.helpful{title: "A Diaspora installation"} pod + = image_tag "icons/cog.png" + + %p + Look at + %code.helpful{title: "General pod configuration (location to upload photos, SSL certs, etc.)"} + config/diaspora.yml.example + and + %code.helpful{title: "MySQL username/password"} + config/database.yml.example + for help. + + .span4 + %h2 Try it out + = image_tag "icons/smiley_laughing.png" + + %p + Start by + = link_to "creating an account", new_user_registration_path + + .span4 + %h2 Make a contribution! + = image_tag "icons/pen_write.png" + + %p + Make Diaspora even better! Fork the project on + = link_to "Github", "http://github.com/diaspora/diaspora" + make some changes, and submit a pull request. + + %footer + %h3 Useful Resources + %ul#links + %ul.section + %li= link_to "Codebase", "http://github.com/diaspora/diaspora", title: "Git repository" + %li= link_to "Documentation", "http://wiki.diasporafoundation.org", title: "Wiki on github" + %ul.section + %li= link_to "IRC - General", "http://webchat.freenode.net/?channels=diaspora", title: "#diaspora" + %li= link_to "IRC - Development", "http://webchat.freenode.net/?channels=diaspora-dev", title: "#diaspora-dev" + %ul.section + %li= link_to "Discussion - General", "http://groups.google.com/group/diaspora-discuss", title: "General discussion mailing list" + %li= link_to "Discussion - Development", "http://groups.google.com/group/diaspora-dev", title: "Dev mailing list" + %ul.section + %li= link_to "Find & Report bugs", "https://github.com/diaspora/diaspora/issues", title: "Bug tracker" + %li= link_to "Learn more about Ruby On Rails!", "http://guides.rubyonrails.org/" + + #change-page + This page can be changed to a custom landing page by creating + %code app/views/home/_show.html.haml diff --git a/config/application.rb b/config/application.rb index 2ea9c6555..d98ab57e4 100644 --- a/config/application.rb +++ b/config/application.rb @@ -88,6 +88,7 @@ module Diaspora admin.css mobile/mobile.css rtl.css + home.css } # Version of your assets, change this if you want to expire all your assets diff --git a/public/default.html b/public/default.html deleted file mode 100644 index aeb5cc587..000000000 --- a/public/default.html +++ /dev/null @@ -1,158 +0,0 @@ - - -
- - - - -
-
-

Configure your pod

- - -

Look at - - config/diaspora.yml.example and - config/database.yml.example for help.

-
- -
-

Try it out

- - -

Start by creating an account.

-
- -
-

Make a contribution!

- - -

Make Diaspora even better! Fork the project on - github, - make some changes, and submit a pull request.

-
-
- - - -
- This page can be changed to a custom landing page by creating app/views/home/_show.html.haml -
-