Skip to content

Commit

Permalink
Merge branch 'master' into issue-15
Browse files Browse the repository at this point in the history
  • Loading branch information
Cantido committed Sep 22, 2016
2 parents 3252962 + f632945 commit bb9edc1
Show file tree
Hide file tree
Showing 34 changed files with 719 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ set_aws_credentials.sh

# Ignore map images uploaded to Locations
/locations
public/sitemap.xml.gz
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'rails-jquery-autocomplete'

# SEO
gem 'meta-tags'

# Smarts
# gem 'serendipitous', :path => "~/Code/indent/serendipitous-gem"
gem 'serendipitous', git: 'git://github.com/indentlabs/serendipitous-gem.git'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ GEM
railties (>= 3.2)
medium-editor-rails (2.2.0)
railties (>= 3.0)
meta-tags (2.2.0)
actionpack (>= 3.2.0)
method_source (0.8.2)
mime-types (3.0)
mime-types-data (~> 3.2015)
Expand Down Expand Up @@ -317,6 +319,7 @@ DEPENDENCIES
jquery-ui-rails
material_icons
medium-editor-rails
meta-tags
paperclip (~> 4.2.0)
pg
pry
Expand Down
Binary file modified app/assets/images/card-headers/characters.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/card-headers/items.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/card-headers/locations.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/assets/images/card-headers/universes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/landing/digital-notebook.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/landing/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/assets/stylesheets/landing.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.perks-section {
i[class=material-icons] {
font-size: 120%;
}
}
5 changes: 5 additions & 0 deletions app/controllers/main_controller.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Controller for top-level pages of the site that do not have
# an associated model
class MainController < ApplicationController
layout "landing", only: [:index, :about_notebook]

def index
redirect_to :dashboard if user_signed_in?
end

def about_notebook
end

def comingsoon
end

Expand Down
33 changes: 33 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ class User < ActiveRecord::Base
has_many :magics
has_many :universes

# as_json creates a hash structure, which you then pass to ActiveSupport::json.encode to actually encode the object as a JSON string.
# This is different from to_json, which converts it straight to an escaped JSON string,
# which is undesireable in a case like this, when we want to modify it
def as_json(options={})
options[:except] ||= blacklisted_attributes
super(options)
end

# Returns this object as an escaped JSON string
def to_json(options={})
options[:except] ||= blacklisted_attributes
super(options)
end

def to_xml(options={})
options[:except] ||= blacklisted_attributes
super(options)
end

def content
{
characters: characters,
Expand All @@ -37,4 +56,18 @@ def content_count
universes.length
].sum
end

private

# Attributes that are non-public, and should be blacklisted from any public
# export (ex. in the JSON api, or SEO meta info about the user)
def blacklisted_attributes
[
:password_digest,
:old_password,
:encrypted_password,
:reset_password_token,
:email
]
end
end
2 changes: 1 addition & 1 deletion app/views/cards/intros/_item_intro.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>
<div class="card-content">
<p>
Every weapon was made by someone, and every book has an owner. Keep track of every aspect of your items.
Every weapon was made by someone; every book has a story. Track of every aspect of your items.
</p>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/cards/intros/_location_intro.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>
<div class="card-content">
<p>
Upload maps, link areas, track demographics, and keep track of history.
Upload maps, link areas, track demographics, and keep track of your world's history.
</p>
</div>
</div>
13 changes: 13 additions & 0 deletions app/views/characters/show.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
<%# to_json will escape any values into unicode escape sequences, so we can call html_safe %>

<script type="application/ld+json">
<%
content_jsonld = {
'@id': character_url,
'@type': 'http://schema.org/Person',
'http://schema.org/name': @content.name
}
%>
<%= content_jsonld.to_json.html_safe %>
</script>

<%= render partial: 'content/show', locals: { content: @content } %>
12 changes: 11 additions & 1 deletion app/views/content/_show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<% title @content.name %>
<% if @content.present? && @content.respond_to?(:as_jsonld) %>
<script type="application/ld+json">
<%= @content.as_jsonld.to_json.html_safe %>
</script>
<% end %>
<%
set_meta_tags title: content.name, description: content.description
%>
<% content_for :sidebar_top do %>
<%= render partial: 'cards/serendipitous/content_question', locals: { question: @question, content: @content } %>
Expand Down
5 changes: 5 additions & 0 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>

<div class="field">
<%= f.label :promo_code %><br />
<%= f.text_field :promo_code, value: 'NANOPREP - 100% off Notebook.ai for life!', disabled: "disabled" %>
</div>

<div class="actions">
<%= f.submit "Sign up", class: 'btn' %>
</div>
Expand Down
11 changes: 11 additions & 0 deletions app/views/items/show.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
<script type="application/ld+json">
<%
content_jsonld = {
'@id': item_url,
'@type': 'http://schema.org/Thing',
'http://schema.org/name': @content.name
}
%>
<%= content_jsonld.to_json.html_safe %>
</script>

<%= render partial: 'content/show', locals: { content: @content } %>
4 changes: 2 additions & 2 deletions app/views/layouts/_ganalytics.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-39217500-1']);
_gaq.push(['_setDomainName', 'indentapp.com']);
_gaq.push(['_setDomainName', 'notebook.ai']);
_gaq.push(['_trackPageview']);

(function() {
Expand All @@ -11,4 +11,4 @@
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>
</script>
32 changes: 32 additions & 0 deletions app/views/layouts/_seo.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- SEO -->
<%=
# This belongs inside the <head> tag.
# Default values and pointers here only.
# Most content should be set in the pages themselves.
# Any values set here can be overridden.

# Default & site-wide values

display_meta_tags site: 'Notebook',
publisher: 'https://plus.google.com/118076966717703203223',
image_src: image_url('card-headers/hero.png'),
description: 'Notebook is a set of tools for writers, game designers, and roleplayers to create magnificent universes — and everything within them.',
# Recommended keywords tag length: up to 255 characters, 20 words.
keywords: %w[writing author nanowrimo novel character fiction fantasy universe creative dnd roleplay larp game design],
og: {
title: :title,
site_name: 'Notebook',
url: request.url,
image: :image_src,
description: :description,
},
twitter: {
card: 'summary',
title: :title,
site: '@IndentLabs',
image: :image_src,
url: request.url,
description: :description
}
%>
<!-- End SEO -->
5 changes: 3 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title><%= content_for?(:title) ? yield(:title) : 'Notebook' %></title>
<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag 'application' %>
<%= csrf_meta_tags %>
Expand All @@ -10,6 +9,9 @@
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/js/materialize.min.js"></script>

<%# <title> is set in _seo.html.erb %>
<%= render 'layouts/seo' %>
</head>
<body>

Expand All @@ -29,7 +31,6 @@

<%= render 'layouts/ganalytics' %>

<a href="https://plus.google.com/118076966717703203223" rel="publisher"></a>
</main>

<%= render 'layouts/footer' %>
Expand Down
27 changes: 27 additions & 0 deletions app/views/layouts/landing.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title><%= content_for?(:title) ? yield(:title) : 'Notebook' %></title>
<%= stylesheet_link_tag 'application' %>
<%= javascript_include_tag 'application' %>
<%= csrf_meta_tags %>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/js/materialize.min.js"></script>
</head>
<body>

<%= render 'layouts/navbar' %>

<main>
<%= yield %>
<%= render 'layouts/ganalytics' %>

<a href="https://plus.google.com/118076966717703203223" rel="publisher"></a>
</main>

</body>
</html>
11 changes: 11 additions & 0 deletions app/views/locations/show.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
<script type="application/ld+json">
<%
content_jsonld = {
'@id': item_url,
'@type': 'http://schema.org/Place',
'http://schema.org/name': @content.name
}
%>
<%= content_jsonld.to_json.html_safe %>
</script>

<%= render partial: 'content/show', locals: { content: @content } %>
65 changes: 65 additions & 0 deletions app/views/main/about_notebook.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<div>
<div class="card">
<div class="card-image">
<%= image_tag 'landing/digital-notebook.jpg', style: "height: 600px;" %>
<span class="card-title">Your digital notebook is here.</span>
</div>
<div class="card-content">
<h4>
Notebook is a set of tools for writers, game designers, and roleplayers to create magnificent universes &ndash; and everything within them.
</h4>
<p>
From a simple interface in your browser, on your phone, or on your tablet, you can do everything you'd ever want to do while creating your own little (or big!) world.
</p>
</div>
<div class="card-action">
<%= link_to 'Get started', new_user_registration_path %>
</div>
</div>
</div>

<div class="row">
<div class="col s3">
<%= render 'cards/intros/universe_intro' %>
</div>
<div class="col s3">
<%= render 'cards/intros/character_intro' %>
</div>
<div class="col s3">
<%= render 'cards/intros/location_intro' %>
</div>
<div class="col s3">
<%= render 'cards/intros/item_intro' %>
</div>
</div>

<h1>Pricing chart</h1>

<h1>October promotion</h1>

<h1>Second CTA</h1>


<div class="row">
<div class="col s4">
<div class="center promo promo-example">
<i class="material-icons">flash_on</i>
<p class="promo-caption">Speeds up development</p>
<p class="light center">We did most of the heavy lifting for you to provide a default stylings that incorporate our custom components.</p>
</div>
</div>
<div class="col s4">
<div class="center promo promo-example">
<i class="material-icons">group</i>
<p class="promo-caption">User Experience Focused</p>
<p class="light center">By utilizing elements and principles of Material Design, we were able to create a framework that focuses on User Experience.</p>
</div>
</div>
<div class="col s4">
<div class="center promo promo-example">
<i class="material-icons">settings</i>
<p class="promo-caption">Easy to work with</p>
<p class="light center">We have provided detailed documentation as well as specific code examples to help new users get started.</p>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion app/views/main/dashboard.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@
</div>
</div>

</div>
</div>
Loading

0 comments on commit bb9edc1

Please sign in to comment.