Redesign default.haml and add a podmin welcome page

parent 03f6420f
......@@ -5,7 +5,7 @@
@import 'mixins';
/* core */
// core
@import 'media-box';
@import 'entypo';
@import 'icons';
......@@ -24,59 +24,62 @@
@import 'colors';
@import 'card-footer';
/* font overrides */
// font overrides
@import 'typography';
// layout
@import 'sidebar';
/* login */
// home
@import 'home';
// login
@import 'login';
@import 'registration';
@import 'forms';
/* terms */
// terms
@import 'terms';
/* profile and settings pages */
// profile and settings pages
@import 'settings';
/* new SPV */
// new SPV
@import 'header';
@import 'footer';
@import 'opengraph';
@import 'single-post-view';
@import 'poll';
/* map*/
// map
@import 'leaflet';
@import 'map';
/* conversations */
// conversations
@import 'conversations';
/* publisher */
// publisher
@import 'publisher';
@import 'aspects';
/* bookmarklet */
// bookmarklet
@import 'bookmarklet';
/* notifications */
// notifications
@import 'notifications';
/* help */
// help
@import 'help';
/* getting started */
// getting started
@import 'getting-started';
/* people */
// people
@import 'people';
@import 'invitations';
@import 'profile';
/* stream */
// stream
@import 'tag';
@import 'stream';
@import 'stream_element';
......@@ -87,18 +90,18 @@
@import 'oembed';
@import 'post-content';
/* contacts */
// contacts
@import 'contacts';
@import 'navbar_left';
/* code */
// code
@import 'code';
@import 'highlightjs/github';
/* statistics */
// statistics
@import 'statistics';
/* gallery */
// gallery
@import 'blueimp-gallery';
@import 'blueimp-gallery/blueimp-gallery-indicator';
@import 'gallery';
@import 'color-variables';
@import 'bootstrap-variables';
body {
margin-top: $navbar-height;
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 */
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;
.page-home {
background-color: $main-background;
h3 {
border-bottom: 1px dashed $border-grey;
font-weight: bold;
margin: 0 0 15px;
padding-bottom: 15px;
.container-fluid.home-user {
padding-bottom: 75px;
padding-top: 75px;
.dandelion-background {
background: image-url('dandelion.jpg');
background-position: center;
background-repeat: no-repeat;
background-size: cover;
.jumbotron {
background-color: rgba($black, .4);
margin-bottom: 0;
h2 {
color: $white;
font-weight: bold;
text-shadow: 0 2px 2px $black;
.landing-info-card {
background-color: $white;
border: 1px solid $light-grey;
box-shadow: $card-shadow;
margin-bottom: 25px;
margin-top: 25px;
min-height: 150px;
padding: 15px;
.login-form {
fieldset { background: none; }
.block-form {
background-color: rgba($white, .25);
border-radius: 5px;
margin: 0;
max-width: 400px;
padding: 1em;
......@@ -19,12 +19,17 @@ class HomeController < ApplicationController
partial_dir.join("_show.html.erb").exist? ||
render :show
elsif User.count > 1 && Role.where(name: "admin").any?
render :default
render :default,
layout: "application"
redirect_to podmin_path
def podmin
render :podmin
def toggle_mobile
session[:mobile_view] = session[:mobile_view].nil? ? true : !session[:mobile_view]
- content_for(:head) do
= stylesheet_link_tag :home, media: "all"
%a#login-link.btn.btn-default{href: "login"} Log In
= image_tag "branding/logos/logo.png"
%h1 Welcome, friend.
%h3 You're about to change the Internet. Let's get you set up, shall we?
%h1= t("home.default.headline", pod_name: pod_name)
%h2= t("home.default.byline")
= render partial: "sessions/form", locals: {mobile: false, resource:, resource_name: :user}
Configure your
%abbr.helpful{title: "A Diaspora installation"} pod
= image_tag "landing/cog.png"
Look at
%code.helpful{title: "General pod configuration (location to upload photos, SSL certs, etc.)"}
%code.helpful{title: "MySQL username/password"}
for help.
= t(".own_your_data")
= t(".own_your_data_info")
%h2 Try it out
= image_tag "landing/smiley_laughing.png"
Start by
= link_to "creating an account", new_user_registration_path
= t(".choose_your_audience")
= t(".choose_your_audience_info")
%h2 Make a contribution!
= image_tag "landing/pen_write.png"
Make Diaspora even better! Fork the project on
= link_to "Github", ""
make some changes, and submit a pull request.
%h3 Useful Resources
%li= link_to "Codebase", "", title: "Git repository"
%li= link_to "Documentation", "", title: "Project wiki"
%li= link_to "IRC - General", "", title: "#diaspora"
%li= link_to "IRC - Development", "", title: "#diaspora-dev"
%li= link_to "Discussion - General", "", title: "General discussion mailing list"
%li= link_to "Discussion - Development", "", title: "Dev mailing list"
%li= link_to "Find & Report bugs", "", title: "Bug tracker"
%li= link_to "Learn more about Ruby On Rails!", ""
This page can be changed to a custom landing page by creating
%code app/views/home/_show.html.haml
= t(".be_who_you_want_to_be")
= t(".be_who_you_want_to_be_info")
%h1= t(".headline")
%h2= t(".byline")
= t(".configure_your_pod")
!= t(".configuration_info",
database_path: content_tag(:code, "config/database.yml"),
diaspora_path: content_tag(:code, "config/diaspora.yml"))
= t(".create_an_account")
!= t(".create_an_account_info",
sign_up_link: link_to(t("devise.shared.links.sign_up"), new_user_registration_path))
= t(".make_yourself_an_admin")
!= t(".make_yourself_an_admin_info",
wiki: link_to("diaspora* wiki", ""),
admin_panel: link_to(t(".admin_panel"), "/admin_panel"))
= t(".update_your_pod")
!= t(".update_your_pod_info",
update_instructions: link_to(t(".update_instructions"), ""))
= t(".getting_help")
!= t(".getting_help_info",
faq: link_to(t(".faq_for_podmins"), ""),
irc: link_to(t(".contact_irc"), ""))
= t(".contribute")
!= t(".contribute_info",
report_bugs: link_to(t(".report_bugs"), ""))
......@@ -32,10 +32,8 @@
= jquery_include_tag
- unless @landing_page
= javascript_include_tag :main, :templates
= load_javascript_locales
= javascript_include_tag :main, :templates
= load_javascript_locales
= translation_missing_warnings
= current_user_atom_tag
......@@ -84,7 +84,6 @@ module Diaspora
......@@ -3,6 +3,5 @@ if AppConfig.environment.image_redirect_url.present?
Rails.application.config.middleware.insert(0, Rack::Rewrite) do
r301 %r{/uploads/images/(.*)}, "#{AppConfig.environment.image_redirect_url}/uploads/images/$1"
r301 %r{/landing/(.*)}, "#{AppConfig.environment.image_redirect_url}/landing/$1"
......@@ -592,6 +592,37 @@ en:
diaspora_app_q: "Is there a diaspora* app for Android or iOS?"
diaspora_app_a: "There have been several Android apps in development by community members. Some are long-abandoned projects and so do not work well with the current version of diaspora*. Don’t expect much from these apps at the moment. There is currently no app for iOS. The best way to access diaspora* from your mobile device is through a browser, because we’ve designed a mobile version of the site which should work well on all devices, although it does not yet have complete functionality."
headline: "Welcome to %{pod_name}"
byline: "The online social world where you are in control"
be_who_you_want_to_be: "Be who you want to be"
be_who_you_want_to_be_info: "A lot of networks insist that you use your real identity. Not diaspora*. Here you can choose who you want to be, and share as much or as little about yourself as you want. It really is up to you how you want to interact with other people."
choose_your_audience: "Choose your audience"
choose_your_audience_info: "diaspora*’s aspects allow you to share with just those people you want to. You can be as public or as private as you like. Share a funny photo with the whole world, or a deep secret just with your closest friends. You’re in control."
own_your_data: "Own your own data"
own_your_data_info: "Many networks use your data to make money by analysing your interactions and using this information to advertise things to you. diaspora* doesn’t use your data for any purpose other than allowing you to connect and share with others."
headline: "Welcome, friend."
byline: "You’re about to change the Internet. Let’s get you set up, shall we?"
configure_your_pod: "Configure your pod"
create_an_account: "Create an account"
make_yourself_an_admin: "Make yourself an admin"
update_your_pod: "Update your pod"
getting_help: "Getting help"
contribute: "Contribute"
configuration_info: "Open %{database_path} and %{diaspora_path} in your favourite text editor and carefully review them, they are extensively commented."
create_an_account_info: "%{sign_up_link} for a new account."
make_yourself_an_admin_info: "You can find instructions in the %{wiki}. This should add an “Admin” link to your user menu in the header when you are logged in. It gives you stuff like user search and stats for your pod. For intense detail on the operational aspects of your pod, go to the %{admin_panel}."
admin_panel: "admin panel"
update_your_pod_info: "You can find %{update_instructions}."
update_instructions: "update instructions in the diaspora* wiki"
getting_help_info: "We listed some %{faq} including some additional tips and tricks and solutions for the most common problems. Also feel free to %{irc}."
faq_for_podmins: "FAQ for pod maintainers in our wiki"
contact_irc: "contact us on IRC"
contribute_info: "Make diaspora* even better! If you find any bugs please %{report_bugs}."
report_bugs: "report them"
excited: "%{name} is excited to see you here."
not_valid: "That invite code is no longer valid"
......@@ -229,6 +229,7 @@ Diaspora::Application.routes.draw do
# Startpage
root :to => 'home#show'
get "podmin", to: "home#podmin"
api_version(module: "Api::V0", path: {value: "api/v0"}, default: true) do
match "user", to: "users#show", via: %i(get post)
......@@ -3,3 +3,7 @@ the Diaspora frontend. This includes GIMP files, Photoshop files, SVG
files, and all other image files of this sort. They are not shown directly
to end users, but are used to generate the actual graphics used in the
frontend (PNGs, etc.). They can be scaled, tinted, shaded, etc.
## License
[dandelion.jpg]( by pixagraphic has been released under [CC-BY-ND](
......@@ -6,25 +6,56 @@ require "spec_helper"
describe HomeController, type: :controller do
describe "#show" do
it "does not redirect for :html" do
it "does not redirect for :html if there are at least 2 users and an admin" do
allow(User).to receive(:count).and_return(2)
allow(Role).to receive_message_chain(:where, :any?).and_return(true)
allow(Role).to receive_message_chain(:where, :exists?).and_return(true)
get :show
expect(response).not_to be_redirect
it "redirects for :mobile" do
it "redirects to the podmin page for :html if there are less than 2 users" do
allow(User).to receive(:count).and_return(1)
allow(Role).to receive_message_chain(:where, :any?).and_return(true)
get :show
expect(response).to redirect_to(podmin_path)
it "redirects to the podmin page for :html if there is no admin" do
allow(User).to receive(:count).and_return(2)
allow(Role).to receive_message_chain(:where, :any?).and_return(false)
get :show
expect(response).to redirect_to(podmin_path)
it "redirects to the podmin page for :html if there are less than 2 users and no admin" do
allow(User).to receive(:count).and_return(0)
allow(Role).to receive_message_chain(:where, :any?).and_return(false)
get :show
expect(response).to redirect_to(podmin_path)
it "redirects to the sign in page for :mobile" do
get :show, format: :mobile
expect(response).to redirect_to(user_session_path)
context "redirection" do
before do
sign_in alice
it "redirects to the stream if the user is signed in" do
sign_in alice
get :show, home: true
expect(response).to redirect_to(stream_path)
describe "#podmin" do
it "succeeds" do
get :podmin
expect(response).to be_success
it "points to the stream if a user has contacts" do
get :show, home: true
expect(response).to redirect_to(stream_path)
it "succeeds on mobile" do
get :podmin, format: :mobile
expect(response).to be_success
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment