about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-27 23:12:33 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-27 23:12:33 +0200
commite63aebff7a4d978fddd7ed3ddc184ed300843a57 (patch)
tree959e8d048fe049fa8a69e4d0ff8acf3df2426708
parent45a96e899e96da846dbef0d39d6f02db790fccaa (diff)
Adding landing page
-rw-r--r--Gemfile.lock10
-rw-r--r--app/assets/images/background-photo.jpegbin0 -> 1741384 bytes
-rw-r--r--app/assets/images/background-photo.jpgbin1329145 -> 0 bytes
-rw-r--r--app/assets/javascripts/about.coffee3
-rw-r--r--app/assets/javascripts/components/components/button.jsx23
-rw-r--r--app/assets/stylesheets/about.scss41
-rw-r--r--app/assets/stylesheets/application.scss5
-rw-r--r--app/assets/stylesheets/components.scss17
-rw-r--r--app/controllers/about_controller.rb5
-rw-r--r--app/controllers/home_controller.rb4
-rw-r--r--app/helpers/about_helper.rb2
-rw-r--r--app/views/about/index.html.haml19
-rw-r--r--config/routes.rb2
-rw-r--r--package.json1
-rw-r--r--spec/controllers/about_controller_spec.rb12
-rw-r--r--spec/helpers/about_helper_spec.rb5
16 files changed, 141 insertions, 8 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 23bb00b64..dee1213a5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -106,9 +106,9 @@ GEM
       ruby-progressbar (~> 1.4)
     globalid (0.3.7)
       activesupport (>= 4.1.0)
-    goldfinger (1.0.3)
+    goldfinger (1.0.4)
       addressable (~> 2.4)
-      http (~> 1.0)
+      http (~> 2.0)
       nokogiri (~> 1.6)
     hamlit (2.7.2)
       temple (~> 0.7.6)
@@ -122,7 +122,7 @@ GEM
     hashdiff (0.3.0)
     hiredis (0.6.1)
     htmlentities (4.3.4)
-    http (1.0.4)
+    http (2.0.3)
       addressable (~> 2.3)
       http-cookie (~> 1.0)
       http-form_data (~> 1.0.1)
@@ -168,9 +168,9 @@ GEM
       pkg-config (~> 1.1.7)
     oj (2.17.3)
     orm_adapter (0.5.0)
-    ostatus2 (0.3)
+    ostatus2 (0.3.1)
       addressable (~> 2.4)
-      http (~> 1.0)
+      http (~> 2.0)
       nokogiri (~> 1.6)
     paperclip (4.3.7)
       activemodel (>= 3.2.0)
diff --git a/app/assets/images/background-photo.jpeg b/app/assets/images/background-photo.jpeg
new file mode 100644
index 000000000..8dad97289
--- /dev/null
+++ b/app/assets/images/background-photo.jpeg
Binary files differdiff --git a/app/assets/images/background-photo.jpg b/app/assets/images/background-photo.jpg
deleted file mode 100644
index 3f2eeb121..000000000
--- a/app/assets/images/background-photo.jpg
+++ /dev/null
Binary files differdiff --git a/app/assets/javascripts/about.coffee b/app/assets/javascripts/about.coffee
new file mode 100644
index 000000000..24f83d18b
--- /dev/null
+++ b/app/assets/javascripts/about.coffee
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://coffeescript.org/
diff --git a/app/assets/javascripts/components/components/button.jsx b/app/assets/javascripts/components/components/button.jsx
index 6f7ace323..fe36d40c5 100644
--- a/app/assets/javascripts/components/components/button.jsx
+++ b/app/assets/javascripts/components/components/button.jsx
@@ -19,8 +19,29 @@ const Button = React.createClass({
   },
 
   render () {
+    const style = {
+      fontFamily: 'Roboto',
+      display: this.props.block ? 'block' : 'inline-block',
+      width: this.props.block ? '100%' : 'auto',
+      position: 'relative',
+      boxSizing: 'border-box',
+      textAlign: 'center',
+      border: '10px none',
+      color: '#fff',
+      fontSize: '14px',
+      fontWeight: '500',
+      letterSpacing: '0',
+      textTransform: 'uppercase',
+      padding: '0 16px',
+      height: '36px',
+      cursor: 'pointer',
+      lineHeight: '36px',
+      borderRadius: '4px',
+      textDecoration: 'none'
+    };
+    
     return (
-      <button className={`button ${this.props.secondary ? 'button-secondary' : ''}`} disabled={this.props.disabled} onClick={this.handleClick} style={{ fontFamily: 'Roboto', display: this.props.block ? 'block' : 'inline-block', width: this.props.block ? '100%' : 'auto', position: 'relative', boxSizing: 'border-box', textAlign: 'center', border: '10px none', color: '#fff', fontSize: '14px', fontWeight: '500', letterSpacing: '0', textTransform: 'uppercase', padding: '0 16px', height: '36px', cursor: 'pointer', lineHeight: '36px', borderRadius: '4px', textDecoration: 'none' }}>
+      <button className={`button ${this.props.secondary ? 'button-secondary' : ''}`} disabled={this.props.disabled} onClick={this.handleClick} style={style}>
         {this.props.text || this.props.children}
       </button>
     );
diff --git a/app/assets/stylesheets/about.scss b/app/assets/stylesheets/about.scss
new file mode 100644
index 000000000..df52ec184
--- /dev/null
+++ b/app/assets/stylesheets/about.scss
@@ -0,0 +1,41 @@
+@import url(https://fonts.googleapis.com/css?family=Montserrat);
+@import url(https://fonts.googleapis.com/css?family=Judson);
+
+.about-body {
+  .wrapper {
+    width: 600px;
+    margin: 0 auto;
+    color: #9baec8;
+    padding-top: 200px;
+  }
+
+  h1 {
+    font: 46px/52px 'Roboto', sans-serif;
+    font-weight: 600;
+    margin-bottom: 20px;
+    color: #2b90d9;
+    padding: 20px 0;
+
+    img {
+      margin-bottom: -5px;
+      margin-right: 5px;
+      width: 46px;
+      height: 46px;
+    }
+  }
+
+  p {
+    font: 20px/28px 'Judson', sans-serif;
+    font-weight: 300;
+    margin-bottom: 26px;
+  }
+
+  em {
+    display: inline-block;
+    padding: 7px 7px 5px 7px;
+    background: #9baec8;
+    color: #282c37;
+    font: 16px/16px 'Montserrat', sans-serif;
+    font-weight: 300;
+  }
+}
diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss
index 84f15eaca..1bae0b44e 100644
--- a/app/assets/stylesheets/application.scss
+++ b/app/assets/stylesheets/application.scss
@@ -59,7 +59,7 @@ table {
 
 body {
   font-family: 'Roboto', sans-serif;
-  background: #282c37 image-url('background-photo.jpg');
+  background: #282c37 image-url('background-photo.jpeg');
   background-size: cover;
   background-attachment: fixed;
   font-size: 13px;
@@ -334,4 +334,5 @@ body {
 
 @import 'accounts';
 @import 'stream_entries';
-@import 'components'
+@import 'components';
+@import 'about';
diff --git a/app/assets/stylesheets/components.scss b/app/assets/stylesheets/components.scss
index cf3dc8397..134d34ccb 100644
--- a/app/assets/stylesheets/components.scss
+++ b/app/assets/stylesheets/components.scss
@@ -1,5 +1,22 @@
 .button {
   background-color: #2b90d9;
+  font-family: 'Roboto';
+  display: inline-block;
+  position: relative;
+  box-sizing: border-box;
+  text-align: center;
+  border: 10px none;
+  color: #fff;
+  font-size: 14px;
+  font-weight: 500;
+  letter-spacing: 0;
+  text-transform: uppercase;
+  padding: 0 16px;
+  height: 36px;
+  cursor: pointer;
+  line-height: 36px;
+  border-radius: 4px;
+  text-decoration: none;
 
   &:hover {
     background-color: #489fde;
diff --git a/app/controllers/about_controller.rb b/app/controllers/about_controller.rb
new file mode 100644
index 000000000..aac648d62
--- /dev/null
+++ b/app/controllers/about_controller.rb
@@ -0,0 +1,5 @@
+class AboutController < ApplicationController
+  def index
+    @body_classes = 'about-body'
+  end
+end
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index 6b52b704d..974c5f7fd 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -10,6 +10,10 @@ class HomeController < ApplicationController
   
   private
 
+  def authenticate_user!
+    redirect_to about_path unless user_signed_in?
+  end
+
   def find_or_create_access_token
     Doorkeeper::AccessToken.find_or_create_for(Doorkeeper::Application.where(superapp: true).first, current_user.id, nil, Doorkeeper.configuration.access_token_expires_in, Doorkeeper.configuration.refresh_token_enabled?)
   end
diff --git a/app/helpers/about_helper.rb b/app/helpers/about_helper.rb
new file mode 100644
index 000000000..68e69aee1
--- /dev/null
+++ b/app/helpers/about_helper.rb
@@ -0,0 +1,2 @@
+module AboutHelper
+end
diff --git a/app/views/about/index.html.haml b/app/views/about/index.html.haml
new file mode 100644
index 000000000..8e014760e
--- /dev/null
+++ b/app/views/about/index.html.haml
@@ -0,0 +1,19 @@
+.wrapper
+  %h1
+    = image_tag 'logo.png'
+    Mastodon
+
+  %p
+    Mastodon is a
+    %em free, open-source
+    social network server. A
+    %em decentralized
+    alternative to commercial platforms, it avoids the risks of a single company monopolizing your communication. Anyone can run Mastodon and participate in the
+    %em social network
+    seamlessly.
+  %p
+    %em= Rails.configuration.x.local_domain
+    is a Mastodon instance.
+
+  .actions
+    = link_to 'Get started', new_user_session_path, class: 'button'
diff --git a/config/routes.rb b/config/routes.rb
index f95ac2ab7..06e927822 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -77,6 +77,8 @@ Rails.application.routes.draw do
     end
   end
 
+  get :about, to: 'about#index'
+  
   root 'home#index'
 
   match '*unmatched_route', via: :all, to: 'application#raise_not_found'
diff --git a/package.json b/package.json
index f8df13a2f..008f66ded 100644
--- a/package.json
+++ b/package.json
@@ -23,6 +23,7 @@
     "react-redux": "^4.4.5",
     "react-redux-loading-bar": "^2.3.3",
     "react-router": "^2.8.0",
+    "react-simple-dropdown": "^1.1.4",
     "redux": "^3.5.2",
     "redux-immutable": "^3.0.8",
     "redux-thunk": "^2.1.0"
diff --git a/spec/controllers/about_controller_spec.rb b/spec/controllers/about_controller_spec.rb
new file mode 100644
index 000000000..54b552b6f
--- /dev/null
+++ b/spec/controllers/about_controller_spec.rb
@@ -0,0 +1,12 @@
+require 'rails_helper'
+
+RSpec.describe AboutController, type: :controller do
+
+  describe "GET #index" do
+    it "returns http success" do
+      get :index
+      expect(response).to have_http_status(:success)
+    end
+  end
+
+end
diff --git a/spec/helpers/about_helper_spec.rb b/spec/helpers/about_helper_spec.rb
new file mode 100644
index 000000000..6efc9f5bd
--- /dev/null
+++ b/spec/helpers/about_helper_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe AboutHelper, type: :helper do
+
+end