Browse Source

landing, better pjax and more

pull/1/head
Nicolae Claudius 13 years ago
parent
commit
7b964d2f2f
  1. 15
      app/assets/javascripts/application.js.coffee
  2. 38
      app/assets/stylesheets/pages/home.css.scss
  3. 10
      app/controllers/pages_controller.rb
  4. 4
      app/views/layouts/application.html.erb
  5. 4
      app/views/layouts/errors.html.erb
  6. 15
      app/views/layouts/home.html.erb
  7. 21
      app/views/layouts/public.html.erb
  8. 2
      app/views/pages/about.html.erb
  9. 100
      app/views/pages/home.html.erb
  10. 0
      app/views/pages/shared/_action.html.erb
  11. 0
      app/views/pages/shared/_benefits.html.erb
  12. 0
      app/views/pages/shared/_features.html.erb
  13. 0
      app/views/shared/_analytics.html.erb
  14. 2
      app/views/shared/_bottom.html.erb
  15. 6
      app/views/shared/_navigation.html.erb
  16. 17
      app/views/shared/_public_top.html.erb
  17. 4
      app/views/shared/navigation/_application.html.erb
  18. 4
      app/views/shared/navigation/_public.html.erb

15
app/assets/javascripts/application.js.coffee

@ -18,8 +18,13 @@ $ ->
$(document).popover(selector: '[rel=popover]') $(document).popover(selector: '[rel=popover]')
$(document).tooltip(selector: '[rel=tooltip]') $(document).tooltip(selector: '[rel=tooltip]')
$('.pjax-nav a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax('[data-pjax-container]') pjaxContainer = '[data-pjax-container]'
$('.pjax-nav a:not([data-remote]):not([data-behavior]):not([data-skip-pjax])').pjax(pjaxContainer)
$(document).on 'pjax:success', (event, data, status, xhr, options) -> $pjaxContainer = $(pjaxContainer)
$('ul.pjax-nav').find('li.active').removeClass 'active' $pjaxContainer.on 'pjax:success', (event, data, status, xhr, options) ->
$("ul.pjax-nav a[href=\"#{window.location.pathname}\"]").parents('li').addClass 'active' $('.pjax-nav').find('li.active').removeClass 'active'
$(".pjax-nav a[href=\"#{window.location.pathname}\"]").parents('li').addClass 'active'
if $pjaxContainer.parent().hasClass('container') || $pjaxContainer.find('.container').length > 0
$pjaxContainer.removeClass 'container'
else
$pjaxContainer.addClass 'container'

38
app/assets/stylesheets/pages/home.css.scss

@ -14,13 +14,41 @@
font-weight: normal; font-weight: normal;
} }
.incentives-unit li, .page-home-incentives li,
.incentives-unit p .page-home-incentives p {
{
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
} }
blockquote { .page-home-header {
font-style: italic; background-color: #B9DCFF;
border-bottom: 1px solid darken(#B9DCFF, 10%);
.page-header {
small {
color: #3F3F39;
}
border-bottom: none;
padding-bottom: 0;
}
}
.page-home-incentives {
border-top: 1px solid white;
background-color: #DAFFCD;
padding-top: 17px;
padding-bottom: 17px;
border-bottom: 1px solid darken(#DAFFCD, 10%);
}
.page-home-quotes {
border-top: 1px solid white;
padding-top: 17px;
blockquote {
font-style: italic;
color: #555;
}
}
.page-home-extra {
padding-top: 17px;
} }

10
app/controllers/pages_controller.rb

@ -15,11 +15,17 @@ class PagesController < ApplicationController
def show def show
return redirect_to(domains_path) if user_signed_in? && params[:id] == "home" return redirect_to(domains_path) if user_signed_in? && params[:id] == "home"
if params[:id] == "contact"
options = {template: current_page}
case params[:id]
when "contact"
init = user_signed_in? ? {:name => current_user.name, :email => current_user.email} : {} init = user_signed_in? ? {:name => current_user.name, :email => current_user.email} : {}
@contact_form = ContactForm.new(init) @contact_form = ContactForm.new(init)
when "home"
options[:layout] = 'home' unless request.xhr?
end end
render :template => current_page
render options
end end
def contact def contact

4
app/views/layouts/application.html.erb

@ -13,14 +13,14 @@
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
</head> </head>
<body class="application"> <body class="application">
<%= render :partial => 'fragments/navigation' %> <%= render 'shared/navigation' %>
<div class="container" id="main"> <div class="container" id="main">
<div data-pjax-container="true"> <div data-pjax-container="true">
<%= flash_display 'flash' %> <%= flash_display 'flash' %>
<%= yield %> <%= yield %>
</div> </div>
<%= render :partial => 'fragments/bottom' %> <%= render 'shared/bottom' %>
</div> </div>
</body> </body>

4
app/views/layouts/errors.html.erb

@ -12,14 +12,14 @@
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
</head> </head>
<body class="errors"> <body class="errors">
<%= render :partial => 'fragments/top' %> <%= render 'shared/top' %>
<div class="container" id="main"> <div class="container" id="main">
<div data-pjax-container="true"> <div data-pjax-container="true">
<%= flash_display 'flash' %> <%= flash_display 'flash' %>
<%= yield %> <%= yield %>
</div> </div>
<%= render :partial => 'fragments/bottom' %> <%= render 'shared/bottom' %>
</div> </div>
</body> </body>

15
app/views/layouts/home.html.erb

@ -0,0 +1,15 @@
<%= render 'shared/public_top' %>
<body class="public">
<%= render 'shared/navigation' %>
<div data-pjax-container="true" id="main">
<%= flash_display 'flash' %>
<%= yield %>
</div>
<div class="container">
<%= render 'shared/bottom' %>
</div>
</body>
</html>

21
app/views/layouts/public.html.erb

@ -1,29 +1,14 @@
<!DOCTYPE html> <%= render 'shared/public_top' %>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= content_for?(:title) ? yield(:title) : "EntryDNS free DNS service and dynamic DNS" %></title>
<meta name="description" content="<%= content_for?(:description) ? yield(:description) : "EntryDNS free DNS service and dynamic DNS" %>" />
<meta name="keywords" content="<%= content_for?(:keywords) ? yield(:keywords) : "DNS, free, service, dynamic, management, hosting" %>" />
<meta name="author" content="EntryDNS Team" />
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
</head>
<body class="public"> <body class="public">
<%= render :partial => 'fragments/navigation' %> <%= render 'shared/navigation' %>
<div class="container" id="main"> <div class="container" id="main">
<div data-pjax-container="true"> <div data-pjax-container="true">
<%= flash_display 'flash' %> <%= flash_display 'flash' %>
<%= yield %> <%= yield %>
</div> </div>
<%= render :partial => 'fragments/bottom' %> <%= render 'shared/bottom' %>
</div> </div>
</body> </body>

2
app/views/pages/about.html.erb

@ -20,7 +20,7 @@
<h4>How can you benefit from this</h4> <h4>How can you benefit from this</h4>
<%= render 'pages/fragments/benefits' %> <%= render 'pages/shared/benefits' %>
<p> <p>
We are open to new ideas or suggestions how to make the service better for you to use. We are open to new ideas or suggestions how to make the service better for you to use.

100
app/views/pages/home.html.erb

@ -1,55 +1,73 @@
<div class="page-header"> <div class="page-home-section page-home-header">
<h1> <div class="container">
Free DNS management service for everyone <div class="page-header">
<small>created by Geeks</small>
<span class="pull-right"> <h1>
<%= link_to 'Tweet', "https://twitter.com/share", :class => "twitter-share-button", :data => { Free DNS management service for everyone
:url => root_url, <small>created by Geeks</small>
:text => "EntryDNS a nice free DNS service", <span class="pull-right">
:count => "horizontal", <%= link_to 'Tweet', "https://twitter.com/share", :class => "twitter-share-button", :data => {
:via => "entrydns", :url => root_url,
:related => "_clyfe:vaijab" :text => "EntryDNS a nice free DNS service",
} %> :count => "horizontal",
</span> :via => "entrydns",
</h1> :related => "_clyfe:vaijab"
</div> } %>
</span>
</h1>
<div class="row">
<div class="span6">
<div class="incentives-unit">
<%= render 'pages/home/headlines' %>
<%= render 'pages/fragments/action' %>
</div> </div>
</div> </div>
<div class="span6">
<%= render 'pages/home/slides' %>
</div>
</div> </div>
<hr /> <div class="page-home-section page-home-incentives">
<div class="container">
<div class="row">
<div class="row"> <div class="span6">
<div class="span6"> <%= render 'pages/home/headlines' %>
<blockquote>We are two geeks who built a free DNS service to fill a void in this space.The service is free <%= render 'pages/shared/action' %>
and we hope to support it on either a freemium model or some sort of affiliate sales.</blockquote> </div>
</div> <div class="span6">
<div class="span6"> <%= render 'pages/home/slides' %>
<blockquote>Note that we just started it, and there are still things to be done, it's still a work in progress. </div>
Nevertheless the service is at this point functional and there are people already using it.</blockquote>
</div>
</div> </div>
</div> </div>
<hr /> <div class="page-home-section page-home-quotes">
<div class="container">
<div class="row">
<div class="span6">
<blockquote>We are two geeks who built a free DNS service to fill a void in this space.The service is free
and we hope to support it on either a freemium model or some sort of affiliate sales.</blockquote>
</div>
<div class="span6">
<blockquote>Note that we just started it, and there are still things to be done, it's still a work in progress.
Nevertheless the service is at this point functional and there are people already using it.</blockquote>
</div>
<div class="row"> </div>
<div class="span6">
<h3>Benefits</h3>
<%= render 'pages/fragments/benefits' %>
<%= render 'pages/fragments/action' %>
</div> </div>
<div class="span6"> </div>
<h3>Features</h3>
<%= render 'pages/fragments/features' %> <div class="page-home-section page-home-extra">
<div class="container">
<div class="row">
<div class="span6">
<h3>Benefits</h3>
<%= render 'pages/shared/benefits' %>
<%= render 'pages/shared/action' %>
</div>
<div class="span6">
<h3>Features</h3>
<%= render 'pages/shared/features' %>
</div>
</div>
</div> </div>
</div> </div>

0
app/views/pages/fragments/_action.html.erb → app/views/pages/shared/_action.html.erb

0
app/views/pages/fragments/_benefits.html.erb → app/views/pages/shared/_benefits.html.erb

0
app/views/pages/fragments/_features.html.erb → app/views/pages/shared/_features.html.erb

0
app/views/fragments/_analytics.html.erb → app/views/shared/_analytics.html.erb

2
app/views/fragments/_bottom.html.erb → app/views/shared/_bottom.html.erb

@ -15,4 +15,4 @@
</div> </div>
</div> </div>
<%= render :partial => 'fragments/analytics' %> <%= render 'shared/analytics' %>

6
app/views/fragments/_navigation.html.erb → app/views/shared/_navigation.html.erb

@ -1,6 +1,6 @@
<div class="navbar navbar-fixed-top"> <div class="navbar navbar-fixed-top">
<div class="navbar-inner"> <div class="navbar-inner">
<div class="container"> <div class="container pjax-nav">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span> <span class="icon-bar"></span>
@ -12,9 +12,9 @@
<div class="nav-collapse"> <div class="nav-collapse">
<% if user_signed_in? %> <% if user_signed_in? %>
<%= render 'fragments/navigation/application' %> <%= render 'shared/navigation/application' %>
<% else %> <% else %>
<%= render 'fragments/navigation/public' %> <%= render 'shared/navigation/public' %>
<% end %> <% end %>
</div> </div>

17
app/views/shared/_public_top.html.erb

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= content_for?(:title) ? yield(:title) : "EntryDNS free DNS service and dynamic DNS" %></title>
<meta name="description" content="<%= content_for?(:description) ? yield(:description) : "EntryDNS free DNS service and dynamic DNS" %>" />
<meta name="keywords" content="<%= content_for?(:keywords) ? yield(:keywords) : "DNS, free, service, dynamic, management, hosting" %>" />
<meta name="author" content="EntryDNS Team" />
<%= stylesheet_link_tag "application" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tag %>
</head>

4
app/views/fragments/navigation/_application.html.erb → app/views/shared/navigation/_application.html.erb

@ -1,4 +1,4 @@
<% semantic_navigation :application_nav, html: { class: 'nav pjax-nav' } do |n| %> <% semantic_navigation :application_nav, html: { class: 'nav' } do |n| %>
<%#= link_to('Dashboard', dashboard_path, :data => {:pjax => '#main'}) %> <%#= link_to('Dashboard', dashboard_path, :data => {:pjax => '#main'}) %>
<%= n.item '', link: domains_path do %> <%= n.item '', link: domains_path do %>
<i class="icon-white icon-th-list"></i> My Domains <i class="icon-white icon-th-list"></i> My Domains
@ -11,7 +11,7 @@
<% end %> <% end %>
<% end %> <% end %>
<% semantic_navigation :user_nav, html: { class: 'nav pull-right pjax-nav' } do |n| %> <% semantic_navigation :user_nav, html: { class: 'nav pull-right' } do |n| %>
<%= n.item '', link: Settings.news_link, html: { rel: 'tooltip', title: Settings.news_link } do %> <%= n.item '', link: Settings.news_link, html: { rel: 'tooltip', title: Settings.news_link } do %>
<i class="icon-white icon-share-alt"></i> News <i class="icon-white icon-share-alt"></i> News
<% end %> <% end %>

4
app/views/fragments/navigation/_public.html.erb → app/views/shared/navigation/_public.html.erb

@ -1,4 +1,4 @@
<% semantic_navigation :public_nav, html: { class: 'nav pjax-nav' } do |n| %> <% semantic_navigation :public_nav, html: { class: 'nav' } do |n| %>
<%= n.item '', link: page_path('about') do %> <%= n.item '', link: page_path('about') do %>
<i class="icon-white icon-info-sign"></i> About <i class="icon-white icon-info-sign"></i> About
<% end %> <% end %>
@ -13,7 +13,7 @@
<% end %> <% end %>
<% end %> <% end %>
<% semantic_navigation :session_nav, html: { class: 'nav pull-right pjax-nav' } do |n| %> <% semantic_navigation :session_nav, html: { class: 'nav pull-right' } do |n| %>
<%= n.item '', link: Settings.news_link, html: { rel: 'tooltip', title: Settings.news_link } do %> <%= n.item '', link: Settings.news_link, html: { rel: 'tooltip', title: Settings.news_link } do %>
<i class="icon-white icon-share-alt"></i> News <i class="icon-white icon-share-alt"></i> News
<% end %> <% end %>
Loading…
Cancel
Save