Browse Source

Home page

Layout
Assets
development
Cesidio Di Landa 11 years ago
parent
commit
3e96be498e
  1. 28
      README.rdoc
  2. 16
      app/assets/javascripts/application.js
  3. 32
      app/assets/javascripts/application.js.coffee.erb
  4. 5
      app/assets/javascripts/bootstrap.js.coffee
  5. 2
      app/assets/javascripts/i18n/translations.js
  6. 3
      app/assets/stylesheets/application.css.less
  7. 25
      app/assets/stylesheets/bootstrap_and_overrides.css.less
  8. 13
      app/assets/stylesheets/stubs/variables_overrides.css.less
  9. 5
      app/controllers/pages_controller.rb
  10. 7
      app/helpers/application_helper.rb
  11. 14
      app/views/layouts/application.html.erb
  12. 37
      app/views/layouts/application.html.haml
  13. 1
      app/views/pages/home.html.haml
  14. 1
      app/views/shared/_footer.html.haml
  15. 4
      app/views/shared/_navbar.html.haml
  16. 26
      config/i18n-js.yml
  17. 46
      config/routes.rb
  18. 15
      test/test_helper.rb

28
README.rdoc

@ -1,28 +0,0 @@
== README
This README would normally document whatever steps are necessary to get the
application up and running.
Things you may want to cover:
* Ruby version
* System dependencies
* Configuration
* Database creation
* Database initialization
* How to run the test suite
* Services (job queues, cache servers, search engines, etc.)
* Deployment instructions
* ...
Please feel free to use a different markup language if you do not plan to run
<tt>rake doc:app</tt>.

16
app/assets/javascripts/application.js

@ -1,16 +0,0 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .

32
app/assets/javascripts/application.js.coffee.erb

@ -0,0 +1,32 @@
#= require jquery
#= require jquery_ujs
#= require jquery.turbolinks
#= require turbolinks
# FRONT END
#= require twitter/bootstrap
# JS TEMPLATES
#= require handlebars.runtime
# I18n
#= require i18n
#= require i18n/translations
# ALL THE REST
#= require_tree .
'use strict'
I18n.defaultLocale = '<%= I18n.default_locale %>'
I18n.locale = $('html').attr 'lang'
startSpinner = ->
$('#loading-spinner').show()
stopSpinner = ->
$('#loading-spinner').fadeOut()
# Turbolinks Spinner
document.addEventListener 'page:fetch', startSpinner
document.addEventListener 'page:receive', stopSpinner

5
app/assets/javascripts/bootstrap.js.coffee

@ -0,0 +1,5 @@
'use strict'
# jQuery Turbolinks
$ ->
$('[rel~="tooltip"]').tooltip()

2
app/assets/javascripts/i18n/translations.js

@ -0,0 +1,2 @@
var I18n = I18n || {};
I18n.translations = {"en":{"date":{"formats":{"default":"%Y-%m-%d","short":"%b %d","long":"%B %d, %Y"},"day_names":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"abbr_day_names":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"month_names":[null,"January","February","March","April","May","June","July","August","September","October","November","December"],"abbr_month_names":[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"order":["year","month","day"]},"time":{"formats":{"default":"%a, %d %b %Y %H:%M:%S %z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"},"am":"am","pm":"pm"},"datetime":{"distance_in_words":{"half_a_minute":"half a minute","less_than_x_seconds":{"one":"less than 1 second","other":"less than %{count} seconds"},"x_seconds":{"one":"1 second","other":"%{count} seconds"},"less_than_x_minutes":{"one":"less than a minute","other":"less than %{count} minutes"},"x_minutes":{"one":"1 minute","other":"%{count} minutes"},"about_x_hours":{"one":"about 1 hour","other":"about %{count} hours"},"x_days":{"one":"1 day","other":"%{count} days"},"about_x_months":{"one":"about 1 month","other":"about %{count} months"},"x_months":{"one":"1 month","other":"%{count} months"},"about_x_years":{"one":"about 1 year","other":"about %{count} years"},"over_x_years":{"one":"over 1 year","other":"over %{count} years"},"almost_x_years":{"one":"almost 1 year","other":"almost %{count} years"}},"prompts":{"year":"Year","month":"Month","day":"Day","hour":"Hour","minute":"Minute","second":"Seconds"}}}};

3
app/assets/stylesheets/application.css → app/assets/stylesheets/application.css.less

@ -8,6 +8,9 @@
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= stub stubs/variables_overrides.css.less
*= require_self
*= require_tree .
*/
@import "stubs/variables_overrides.css.less";

25
app/assets/stylesheets/bootstrap_and_overrides.css.less

@ -0,0 +1,25 @@
/* ==========================================================================
Bootstrap and overrides
========================================================================== */
@import "twitter/bootstrap/bootstrap";
body {
padding-top: 60px;
}
@import "twitter/bootstrap/responsive";
/* Fontawesome Icons
========================================================================== */
@fontAwesomeEotPath: asset-path("fontawesome-webfont.eot?v=3.0.2");
@fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot?#iefix&v=3.0.2");
@fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff?v=3.0.2");
@fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf?v=3.0.2");
@import "fontawesome";
/* Overriding default variables and loading new ones
========================================================================== */
@import "stubs/variables_overrides.css.less";

13
app/assets/stylesheets/stubs/variables_overrides.css.less

@ -0,0 +1,13 @@
@import "twitter/bootstrap/variables";
/* ==========================================================================
Variables and overrides
========================================================================== */
/* New variables
========================================================================== */
/* Bootstrap variables override
========================================================================== */
@sansFontFamily: "Ubuntu", "Helvetica Neue", Helvetica, Arial, sans-serif;

5
app/controllers/pages_controller.rb

@ -0,0 +1,5 @@
class PagesController < ApplicationController
def home
end
end

7
app/helpers/application_helper.rb

@ -1,2 +1,9 @@
module ApplicationHelper
def title(page_title)
content_for(:title) { page_title.to_s }
end
def yield_or_default(section, default = '')
content_for?(section) ? content_for(section) : default
end
end

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

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Starterapp</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>

37
app/views/layouts/application.html.haml

@ -0,0 +1,37 @@
!!!
%html{ lang: I18n.locale.to_s }
%head
%meta{ charset: 'utf-8' }
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0' }
%title= yield_or_default :title, controller.action_name.titlecase
= csrf_meta_tags
= yield :head
/ Le HTML5 shim, for IE6-8 support of HTML elements
/[if lt IE 9]
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
/ Le styles
= stylesheet_link_tag 'http://fonts.googleapis.com/css?family=Ubuntu:400,500,700',
'application',
media: 'all'
/ Touch icons
%link{ href: asset_path('apple-touch-icon.png'), rel: 'apple-touch-icon' }
%link{ href: asset_path('apple-touch-icon-72x72.png'), rel: 'apple-touch-icon', sizes: '72x72' }
%link{ href: asset_path('apple-touch-icon-114x114.png'), rel: 'apple-touch-icon', sizes: '114x114' }
%link{ href: asset_path('apple-touch-icon-144x144.png'), rel: 'apple-touch-icon', sizes: '144x144' }
/
Le javascript
\==================================================
/ Placed at the top of the document 'cause of turbolinks
= javascript_include_tag 'application'
%body
= render 'shared/navbar'
#main-container.container
.content= yield
#footer
.container= render 'shared/footer'

1
app/views/pages/home.html.haml

@ -0,0 +1 @@
%h1= t('hello')

1
app/views/shared/_footer.html.haml

@ -0,0 +1 @@
%footer.text-center

4
app/views/shared/_navbar.html.haml

@ -0,0 +1,4 @@
.navbar.navbar-fixed-top
.navbar-inner
.container
= link_to Rails.application.class.parent_name, root_path, class: 'brand'

26
config/i18n-js.yml

@ -0,0 +1,26 @@
# Split context in several files.
# By default only one file with all translations is exported and
# no configuration is required. Your settings for asset pipeline
# are automatically recognized.
#
# If you want to split translations into several files or specify
# locale contexts that will be exported, just use this file to do
# so.
#
# If you're going to use the Rails 3.1 asset pipeline, change
# the following configuration to something like this:
#
# translations:
# - file: "app/assets/javascripts/i18n/translations.js"
#
# If you're running an old version, you can use something
# like this:
#
# translations:
# - file: "public/javascripts/translations.js"
# only: "*"
#
translations:
- file: 'app/assets/javascripts/i18n/translations.js'
only: ['*.date', '*.time', '*.datetime']

46
config/routes.rb

@ -1,49 +1,5 @@
Starterapp::Application.routes.draw do
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can have the root of your site routed with "root"
# root to: 'welcome#index'
root to: 'pages#home'
# Example of regular route:
# get 'products/:id' => 'catalog#view'
# Example of named route that can be invoked with purchase_url(id: product.id)
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
# Example resource route (maps HTTP verbs to controller actions automatically):
# resources :products
# Example resource route with options:
# resources :products do
# member do
# get 'short'
# post 'toggle'
# end
#
# collection do
# get 'sold'
# end
# end
# Example resource route with sub-resources:
# resources :products do
# resources :comments, :sales
# resource :seller
# end
# Example resource route with more complex sub-resources:
# resources :products do
# resources :comments
# resources :sales do
# get 'recent', on: :collection
# end
# end
# Example resource route within a namespace:
# namespace :admin do
# # Directs /admin/products/* to Admin::ProductsController
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
end

15
test/test_helper.rb

@ -1,15 +0,0 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
fixtures :all
# Add more helper methods to be used by all tests here...
end
Loading…
Cancel
Save