Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Setting everything up with Astaire. still need to figure out how to t…

…ell Astaire and Sass where the stylesheets and other assets are.
  • Loading branch information...
commit 462d9b871aa292b04971ab5025e830928b4c03e9 1 parent f808e75
@knowtheory knowtheory authored
Showing with 79 additions and 38 deletions.
  1. +2 −1  .gitignore
  2. +27 −0 dm-www-controller.rb
  3. +0 −16 dm-www.rb
  4. +14 −0 dm-www.ru
  5. 0  {content → public}/images/home/butler.gif
  6. 0  {content → public}/images/home/tweet-bkg.gif
  7. 0  {content → public}/images/icon/bugs.gif
  8. 0  {content → public}/images/icon/community.gif
  9. 0  {content → public}/images/icon/documentation.gif
  10. 0  {content → public}/images/layout/content-bkg.gif
  11. 0  {content → public}/images/layout/header-animation.gif
  12. 0  {content → public}/images/layout/header-bkg.gif
  13. 0  {content → public}/images/layout/navigation-hover.gif
  14. 0  {content → public}/images/layout/page-bkg.gif
  15. 0  {content → public}/images/layout/splitter.gif
  16. 0  {content → public}/index.haml
  17. 0  {content → public}/javascripts/jquery-1.3.min.js
  18. 0  {content → public}/javascripts/jquery.background-position.js
  19. 0  {content → public}/javascripts/site.js
  20. 0  {content → public}/stylesheets/screen.css
  21. +0 −4 templates/_partial.haml
  22. +0 −5 templates/page.haml
  23. +27 −0 view_helpers.rb
  24. +1 −0  views/dm_www/index.html.haml
  25. +8 −12 layouts/default.haml → views/layouts/application.html.haml
View
3  .gitignore
@@ -1,2 +1,3 @@
.DS_Store
-output/*
+output/*
+tmp/*
View
27 dm-www-controller.rb
@@ -0,0 +1,27 @@
+require File.join(File.dirname(__FILE__),"view_helpers")
+class DMWwwController < ActionController::Base
+ include Astaire::DSL
+ view_paths << File.expand_path('../views', __FILE__)
+ layout 'application'
+ helper ::ViewHelpers
+
+ get "/" do
+ @page = Struct.new(:title, :url).new
+ @page.title = "Home :)"
+ @page.url = "/home"
+ render :index
+ end
+
+ get '/community' do
+ end
+
+ get '/docs' do
+ end
+
+ get 'news' do
+ end
+
+ get 'contributions' do
+ end
+
+end
View
16 dm-www.rb
@@ -1,16 +0,0 @@
-require 'sinatra'
-
-get '/' do
-end
-
-get '/about' do
-end
-
-get '/community' do
-end
-
-get '/contribute' do
-end
-
-get '/documentation' do
-end
View
14 dm-www.ru
@@ -0,0 +1,14 @@
+require 'rubygems'
+require 'astaire'
+require 'haml'
+require 'dm-core'
+require 'dm-aggregates'
+require 'dm-validations'
+
+RAILS_ROOT = File.dirname(__FILE__)
+DOCUMENT_ROOT = File.join(RAILS_ROOT, "public")
+Haml.init_rails(binding)
+
+require File.join(RAILS_ROOT, 'dm-www-controller')
+
+run DMWwwController
View
0  content/images/home/butler.gif → public/images/home/butler.gif
File renamed without changes
View
0  content/images/home/tweet-bkg.gif → public/images/home/tweet-bkg.gif
File renamed without changes
View
0  content/images/icon/bugs.gif → public/images/icon/bugs.gif
File renamed without changes
View
0  content/images/icon/community.gif → public/images/icon/community.gif
File renamed without changes
View
0  content/images/icon/documentation.gif → public/images/icon/documentation.gif
File renamed without changes
View
0  content/images/layout/content-bkg.gif → public/images/layout/content-bkg.gif
File renamed without changes
View
0  content/images/layout/header-animation.gif → public/images/layout/header-animation.gif
File renamed without changes
View
0  content/images/layout/header-bkg.gif → public/images/layout/header-bkg.gif
File renamed without changes
View
0  content/images/layout/navigation-hover.gif → public/images/layout/navigation-hover.gif
File renamed without changes
View
0  content/images/layout/page-bkg.gif → public/images/layout/page-bkg.gif
File renamed without changes
View
0  content/images/layout/splitter.gif → public/images/layout/splitter.gif
File renamed without changes
View
0  content/index.haml → public/index.haml
File renamed without changes
View
0  content/javascripts/jquery-1.3.min.js → public/javascripts/jquery-1.3.min.js
File renamed without changes
View
0  content/javascripts/jquery.background-position.js → public/javascripts/jquery.background-position.js
File renamed without changes
View
0  content/javascripts/site.js → public/javascripts/site.js
File renamed without changes
View
0  content/stylesheets/screen.css → public/stylesheets/screen.css
File renamed without changes
View
4 templates/_partial.haml
@@ -1,4 +0,0 @@
----
-filter: haml
----
-
View
5 templates/page.haml
@@ -1,5 +0,0 @@
----
-title: <%= title %>
-created_at: <%= Time.now.to_y %>
-filter: haml
----
View
27 view_helpers.rb
@@ -0,0 +1,27 @@
+module ViewHelpers
+ def body_id
+ if @page.url == "/"
+ "home"
+ else
+ @page.url.match(%r{^/(\w+)})[1]
+ end
+ end
+
+ def nav_entry(text, url, title)
+ if url == "/"
+ @page.url == url ? current_entry(text, url, title) : standard_entry(text, url, title)
+ elsif @page.url.match(url)
+ current_entry(text, url, title)
+ else
+ standard_entry(text, url, title)
+ end
+ end
+
+ def current_entry(text, url, title)
+ h "<a href='#{url}' title='#{title}' class='current'>#{text}</a>"
+ end
+
+ def standard_entry(text, url, title)
+ h "<a href='#{url}' title='#{title}'>#{text}</a>"
+ end
+end
View
1  views/dm_www/index.html.haml
@@ -0,0 +1 @@
+%h1 This is the index!
View
20 layouts/default.haml → views/layouts/application.html.haml
@@ -1,16 +1,12 @@
----
-extension: html
-filter: haml
----
!!! XML
!!! 1.1
%html
%head
%title= "DataMapper - #{@page.title}"
- %link{:href => "/stylesheets/screen.css", :type => "text/css", :media => "all", :rel => "Stylesheet"}/
- %script{:type => "text/javascript", :src => "/javascripts/jquery-1.3.min.js"}
- %script{:type => "text/javascript", :src => "/javascripts/jquery.background-position.js"}
- %script{:type => "text/javascript", :src => "/javascripts/site.js"}
+ %link{:href => "/public/stylesheets/screen.css", :type => "text/css", :media => "all", :rel => "Stylesheet"}/
+ %script{:type => "text/javascript", :src => "/public/javascripts/jquery-1.3.min.js"}
+ %script{:type => "text/javascript", :src => "/public/javascripts/jquery.background-position.js"}
+ %script{:type => "text/javascript", :src => "/public/javascripts/site.js"}
%body{:id => body_id}
%h1#heading
%a{:href => "/", :title => "Return to the homepage."} DataMapper
@@ -26,7 +22,7 @@ filter: haml
%h1#page-title= @page.title
- = @content
+ = yield
%div#footer
%h1 Site-map & Copyright
@@ -53,13 +49,13 @@ filter: haml
%h2 Source Code
%ul
%li
- %a{:href => "http://github.com/sam/dm-core/tree/master", :title => "The Git repository for DM-Core."}
+ %a{:href => "http://github.com/datamapper/dm-core", :title => "The Git repository for DM-Core."}
DM-Core
%li
- %a{:href => "http://github.com/sam/dm-more/tree/master", :title => "The Git repository for DM-More."}
+ %a{:href => "http://github.com/datamapper/dm-more", :title => "The Git repository for DM-More."}
DM-More
%li
- %a{:href => "http://github.com/sam/do/tree/master", :title => "The Git repository for DataObjects, a unified set of DB drivers used in DataMapper."}
+ %a{:href => "http://github.com/datamapper/do", :title => "The Git repository for DataObjects, a unified set of DB drivers used in DataMapper."}
DataObjects
%div
Please sign in to comment.
Something went wrong with that request. Please try again.