Difference between revisions of "Custom splash page"

From diaspora* project wiki
Jump to: navigation, search
m
(Update examples for 0.5.0.0, add screenshots)
Line 8: Line 8:
  
 
<pre>
 
<pre>
#content
+
.text-center
  .center
+
  %h2 Welcome to my pod!
    %h2 Welcome to my pod!
 
 
</pre>
 
</pre>
 +
 +
 +
[https://wiki.diasporafoundation.org/File:Custom_splash_example1.png screenshot]
 +
  
 
A detailed example of a HTML based <tt>_show.html.erb</tt> landing page would be:
 
A detailed example of a HTML based <tt>_show.html.erb</tt> landing page would be:
 
 
<pre>
 
<pre>
 
<div class="container">
 
<div class="container">
<div class="span-24 last">
+
  <div class="row">
<div id="landing_content">
+
    <div class="span12 text-center">
<div class="span-22 prepend-1 append-1 last">
+
      <h1>Welcome to diaspora*</h1>
<div class="section" id="diaspora_description">
+
      <h3>Social Networking with <em>actual</em> privacy</h3>
<p>Welcome to Diaspora*<br />Social Networking with <em>actual</em> privacy</p>
+
    </div>
</div>
+
  </div>
</div>
+
  <div class="row">
<div class="prepend-1 span-22 append-1 last" id="info_links">
+
    <div class="span12 text-center">
<h2><a href="/users/sign_up">Sign up </a> or <a href="/users/sign_in">sign in</a></h2>
+
      <h2><a href="/users/sign_up">Sign up </a> or <a href="/users/sign_in">sign in</a></h2>
</div>
+
    </div>
</div>
+
  </div>
</div>
 
 
</div>
 
</div>
 +
</pre>
  
</pre>
+
 
 +
 
 +
[https://wiki.diasporafoundation.org/File:Custom_splash_example2.png screenshot]
  
 
A more complete example using the Twitter Bootstrap "Hero" template would look like the following:
 
A more complete example using the Twitter Bootstrap "Hero" template would look like the following:
  
 
<pre>
 
<pre>
.navbar.navbar-fixed-top
+
.container{style: "padding-top: 5%;"}
   .navbar-inner
+
   .hero-unit
     .container-fluid
+
     = image_tag "branding/logo.png"
       %a.btn.btn-navbar{"data-target" => ".nav-collapse", "data-toggle" => "collapse"}
+
    %hr/
        %span.icon-bar
+
    %p 
        %span.icon-bar
+
       %b You're about to change the Internet. Let's get you set up, shall we?
        %span.icon-bar
+
    %p 
       %a.btn.btn-success.pull-left{:href => "/users/sign_in"} Login
+
      = link_to "Start an account! »", new_user_registration_path, class: "btn btn-primary btn-large"
       %a.brand{:href => "/"} Diaspora*
+
  .row
       .nav-collapse
+
    .span4
        %ul.nav
+
      %h2 Heading
          %li
+
       %p Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.
            %a{:href => "/about.html"} About
+
       %p 
          %li
+
        %a.btn{:href => "#"} View details »
            %a{:href => "/privacy.html"} Privacy
+
    .span4
          %li
+
       %h2 Heading
            %a{:href => "/terms.html"} Terms
+
      %p Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum ni.  
 +
      %
 +
        %a.btn{:href => "#"} View details »
 +
    .span4
 +
      %h2 Heading
 +
      %p Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis.
 +
      %
 +
        %a.btn{:href => "#"} View details »
 +
</pre>
  
  .subnav
+
[https://wiki.diasporafoundation.org/File:Custom_splash_example3.png screenshot]
    %ul.nav.nav-pills
 
      %li
 
        %a{:href => "https://twitter.com/joindiaspora"} @joindiaspora
 
      %li
 
        %a{:href => "https://github.com/diaspora/diaspora"} GitHub
 
      %li
 
        %a{:href => "/source.tar.gz"} Code
 
      %li
 
        %a{:href => "https://github.com/diaspora/diaspora/tree/master/Changelog.md"} What's New?
 
  
 
 
  .container{:style => "padding-top: 5%;"}
 
    .hero-unit
 
      %img{:alt => "Logo", :src => "/assets/branding/logo_caps.png"}/
 
      %hr/
 
      %p
 
        %b You're about to change the Internet. Let's get you set up, shall we?
 
      %p
 
        %a.btn.btn-primary.btn-large{:href => "/users/sign_up"} Start an account! &raquo;
 
    .row
 
      .span4
 
        %h2 Heading
 
        %p Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.
 
        %p
 
          %a.btn{:href => "#"} View details &raquo;
 
      .span4
 
        %h2 Heading
 
        %p Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum ni.
 
        %p
 
          %a.btn{:href => "#"} View details &raquo;
 
      .span4
 
        %h2 Heading
 
        %p Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis.
 
        %p
 
          %a.btn{:href => "#"} View details &raquo;
 
 
  %script{:src => "/js/jquery.js"}
 
  %script{:src => "/js/bootstrap.js"}
 
</pre>
 
  
 
Diaspora already uses [http://twitter.github.com/bootstrap/ Bootstrap] CSS so no need to add it yourself, and examples of use are readily available in the previous link. More examples can be found [https://github.com/czarneckid/twitter-bootstrap-examples-haml/tree/master/views here.] but will need to be tweaked similar to the one below. (Linked JS files need to be added yourself. download [http://twitter.github.com/bootstrap/ here.])
 
Diaspora already uses [http://twitter.github.com/bootstrap/ Bootstrap] CSS so no need to add it yourself, and examples of use are readily available in the previous link. More examples can be found [https://github.com/czarneckid/twitter-bootstrap-examples-haml/tree/master/views here.] but will need to be tweaked similar to the one below. (Linked JS files need to be added yourself. download [http://twitter.github.com/bootstrap/ here.])

Revision as of 18:03, 5 April 2015

Template:Languages

All you have to do is to create a app/views/home/_show.html.haml to define your own splash page for your Diaspora pod. Or app/views/home/_show.html.erb if you prefer to write plain HTML instead of HAML. Do not copy or overwrite app/views/home/show.html.haml (note the missing underscore) or public/default.html!

If you create or change this file, be sure to restart Diaspora, you will get server errors or simply no effect otherwise.

A very basic example of a _show.html.haml would be something like:

.text-center
  %h2 Welcome to my pod!


screenshot


A detailed example of a HTML based _show.html.erb landing page would be:

<div class="container">
  <div class="row">
    <div class="span12 text-center">
      <h1>Welcome to diaspora*</h1>
      <h3>Social Networking with <em>actual</em> privacy</h3>
    </div>
  </div>
  <div class="row">
    <div class="span12 text-center">
      <h2><a href="/users/sign_up">Sign up </a> or <a href="/users/sign_in">sign in</a></h2>
    </div>
  </div>
</div>


screenshot

A more complete example using the Twitter Bootstrap "Hero" template would look like the following:

.container{style: "padding-top: 5%;"}
  .hero-unit
    = image_tag "branding/logo.png"
    %hr/
    %p  
      %b You're about to change the Internet. Let's get you set up, shall we? 
    %p  
      = link_to "Start an account! »", new_user_registration_path, class: "btn btn-primary btn-large"
  .row
    .span4
      %h2 Heading
      %p Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.
      %p  
        %a.btn{:href => "#"} View details »
    .span4
      %h2 Heading
      %p Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum ni. 
      %p  
        %a.btn{:href => "#"} View details »
    .span4
      %h2 Heading
      %p Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis.
      %p  
        %a.btn{:href => "#"} View details »

screenshot


Diaspora already uses Bootstrap CSS so no need to add it yourself, and examples of use are readily available in the previous link. More examples can be found here. but will need to be tweaked similar to the one below. (Linked JS files need to be added yourself. download here.)

Notice the examples above do not include the “head” & “html” elements, those are rendered by Diaspora. For your landing page you just need to provide the body section, and anything else you chose to include.

Ensure that public/ doesn’t contain any index.html or another file that would be used as index file by your Webserver. If such a file exists it’s given precedence by your Webserver and can break the log in.