Skip to content

Commit

Permalink
Adding sinatra + angularjs + bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
cachiconato committed Jul 20, 2013
1 parent 6f10d4c commit db0836e
Show file tree
Hide file tree
Showing 11 changed files with 330 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source 'https://rubygems.org'

gem 'thin'
gem 'sinatra'
gem 'foreman'
gem 'sass'
gem 'compass'

group :development do
gem 'pry'
gem 'shotgun'
end
50 changes: 50 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
GEM
remote: https://rubygems.org/
specs:
chunky_png (1.2.8)
coderay (1.0.9)
compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
daemons (1.1.9)
dotenv (0.8.0)
eventmachine (1.0.3)
foreman (0.63.0)
dotenv (>= 0.7)
thor (>= 0.13.6)
fssm (0.2.10)
method_source (0.8.1)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
rack (1.5.2)
rack-protection (1.5.0)
rack
sass (3.2.9)
shotgun (0.9)
rack (>= 1.0)
sinatra (1.4.3)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
slop (3.4.5)
thin (1.5.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.18.1)
tilt (1.4.1)

PLATFORMS
ruby

DEPENDENCIES
compass
foreman
pry
sass
shotgun
sinatra
thin
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'lib/tasks/download_csv.rake'
import 'lib/tasks/import_csv.rake'
import 'lib/tasks/generate_data.rake'
9 changes: 9 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'rubygems'
require 'bundler'

Bundler.require
Dir["./app/model/*.rb"].each {|file| require file }

require './orcamento_app'

run OrcamentoApp
10 changes: 10 additions & 0 deletions orcamento_app.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class OrcamentoApp < Sinatra::Base
configure do
set :views, Proc.new { File.join(root, "public/views") }
end

get '/' do
erb :index
end

end
9 changes: 9 additions & 0 deletions public/css/bootstrap-responsive.min.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions public/css/bootstrap.min.css

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions public/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

var app = angular.module('orcamentoapp', ['$strap.directives']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/', {templateUrl: 'views/home.html', controller: HomeController}).
otherwise({redirectTo: '/'});
}]);

});
159 changes: 159 additions & 0 deletions public/js/lib/angular.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/js/lib/underscore-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions public/views/index.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en" ng-app="orcamento">
<head>
<meta charset="utf-8">
<title>Teste</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/bootstrap-responsive.min.css" rel="stylesheet">


<script src="/js/lib/angular.min.js"></script>
<script src="/js/lib/underscore-min.js"></script>
<script src="/js/app.js"></script>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>

<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
</button>
<a class="brand" href="/#/">OrcamentoPOA<span>BR</span></a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="home selected"><a href="/#/"><i class="icon-home"></i>Página Inicial</a></li>
</ul>

<ul class="navbar-search pull-right" ng-controller="EmpresaSearchController">
<li>
<i class="icon-search"></i>
<input type="text" ng-model="typeaheadValue" bs-typeahead="typeahead" type-ahead-selected="loadGroup()" class="search-query input-xxlarge" id="typeaheadValue" placeholder="Buscar Algo">
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>

<div id="main-container" class="container">
<div>
<div ng-view></div>
</div>
</div> <!-- /container -->
<footer>
<p>Dados obtidos em <a href="www.seila.com.br" target="_blank">dados.gov.br</a>.
<a href="https://github.com/cachiconato/orcamento-poa" target="_blank">Código no GitHub</a>
</p>
</footer>
</body>
</html>

0 comments on commit db0836e

Please sign in to comment.