orange 0.0.8 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,7 @@ module Orange
32
32
  string ||= read_if_exists(views_dir, resource, file) if resource
33
33
  string ||= read_if_exists(views_dir, 'default_resource', file)
34
34
  string ||= read_if_exists(views_dir, file)
35
- raise LoadError, "Couldn't find haml file '#{file}" unless string
35
+ raise LoadError, "Couldn't find haml file '#{file}'" unless string
36
36
 
37
37
  haml_engine = Haml::Engine.new(string)
38
38
  out = haml_engine.render(packet, opts, &block)
@@ -0,0 +1,25 @@
1
+ !!! xml
2
+ !!!
3
+ %html
4
+ %head
5
+ %title= part[:title, 'Orange Site']
6
+ = part[:css]
7
+ = part[:js]
8
+ %body
9
+ #body
10
+ .header
11
+ ORANGE
12
+ .container
13
+ #inner-body
14
+ .sidebar.span_5
15
+ - orange[:admin].links(packet).each do |k, section|
16
+ .sidebar_section
17
+ %h3= k
18
+ %ul
19
+ - for link in section
20
+ %li
21
+ %a{:href => link[:href], :style => "background-image: url(#{link[:icon]})"}= link[:text]
22
+ .span_7.last
23
+ = yield
24
+ .footer
25
+ %banana
@@ -0,0 +1,111 @@
1
+ -# adapted from Django <djangoproject.com>
2
+ -# Copyright (c) 2005, the Lawrence Journal-World
3
+ -# Used under the modified BSD license:
4
+ -# http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
5
+ !!!
6
+ %html
7
+ %head
8
+ %meta{:name=>"robots", :content=>"NONE,NOARCHIVE"}
9
+ %title Orange rasied #{h exception.class} at #{h path}
10
+ %link{:rel=>"stylesheet", :href=>"/assets/_orange_/css/exceptions.css", :type=>"text/css"}
11
+ %script{:type=>"text/javascript", :src=>"/assets/_orange_/js/exceptions.js"}
12
+ %body
13
+ #summary
14
+ %h1 #{h exception.class} at #{h path}
15
+ %h2 #{h exception.message}
16
+ %table
17
+ %tr
18
+ %th Ruby
19
+ %td= "<code>#{h frames.first.filename}</code>: in <code>#{h frames.first.function}</code>, line #{h frames.first.lineno }"
20
+ %tr
21
+ %th Web
22
+ %td= "<code>#{h req.request_method} #{h(req.host + path)}</code>"
23
+ %h3= "Jump to:"
24
+ %ul#quicklinks
25
+ %li
26
+ %a{:href=>"#get-info"} GET
27
+ %li
28
+ %a{:href=>"#post-info"} POST
29
+ %li
30
+ %a{:href=>"#cookie-info"} Cookies
31
+ %li
32
+ %a{:href=>"#env-info"} ENV
33
+ %li
34
+ %a{:href=>"#orange-info"} Orange
35
+ #traceback
36
+ %h2= "Traceback <span>(innermost first)</span>"
37
+ %ul.traceback
38
+ - frames.each do |frame|
39
+ %li.frame
40
+ = "<code>#{h frame.filename}</code>: in <code>#{h frame.function}</code>"
41
+ - if frame.context_line
42
+ .context{:id => "c#{frame.object_id}"}
43
+ - if frame.pre_context
44
+ %ol.pre-context{:start=>"#{h frame.pre_context_lineno+1}", :id=>"pre#{h frame.object_id }"}
45
+ - frame.pre_context.each do |line|
46
+ %li{:onclick=>"toggle('pre#{h frame.object_id}', 'post#{h frame.object_id }')"} #{h line}
47
+ %ol.context-line{:start=>"#{h frame.lineno}"}
48
+ %li{ :onclick=>"toggle('pre#{h frame.object_id}', 'post#{h frame.object_id }')"}= "#{h frame.context_line} <span>...</span>"
49
+ - if frame.post_context
50
+ %ol.post-context{ :start=>"#{h frame.lineno+1 }", :id=>"post#{h frame.object_id}"}
51
+ - frame.post_context.each do |line|
52
+ %li{:onclick=>"toggle('pre#{h frame.object_id}', 'post#{h frame.object_id }')"} #{h line}
53
+ #requestinfo
54
+ %h2 Request information
55
+ - for var in [:GET, :POST, :cookies]
56
+ %h3{:id => "#{var.to_s.downcase}-info"}= "#{var.to_s}"
57
+ - unless req.__send__(var).empty?
58
+ %table.req
59
+ %thead
60
+ %tr
61
+ %th Variable
62
+ %th Value
63
+ %tbody
64
+ - req.__send__(var).sort_by { |k, v| k.to_s }.each do |key, val|
65
+ %tr
66
+ %td #{h key}
67
+ %td.code
68
+ %div #{h val.inspect}
69
+ - else
70
+ %p No #{var.to_s} data.
71
+ %h3#env-info Rack ENV
72
+ %table.req
73
+ %thead
74
+ %tr
75
+ %th Variable
76
+ %th Value
77
+ %tbody
78
+ - env.sort_by { |k, v| k.to_s }.each do |key, val|
79
+ - unless key =~ /^orange\./
80
+ %tr
81
+ %td #{h key}
82
+ %td.code
83
+ %div #{h val}
84
+ %h3#orange-info Orange ENV
85
+ %table.req
86
+ %thead
87
+ %tr
88
+ %th Variable
89
+ %th Value
90
+ %tbody
91
+ - env['orange.env'].sort_by { |k, v| k.to_s }.each do |key, val|
92
+ - if(![:request, :headers, :content].include?(key))
93
+ %tr
94
+ %td #{h key}
95
+ %td.code
96
+ %div #{h val}
97
+ %h3#orange-info= 'Orange<br /> Response'
98
+ %table.req
99
+ %thead
100
+ %tr
101
+ %th Variable
102
+ %th Value
103
+ %tbody
104
+ - env['orange.env'].sort_by { |k, v| k.to_s }.each do |key, val|
105
+ - if([:request, :headers, :content].include?(key))
106
+ %tr
107
+ %td #{h key}
108
+ %td.code
109
+ %div #{h val}
110
+ #explanation
111
+ %p= "You're seeing this error because you use <code>Orange::Middleware::ShowExceptions</code>."
@@ -0,0 +1,13 @@
1
+ %form{:action => "#{packet.route_to(model_name, 'new')}", :method => 'post', :enctype=>"multipart/form-data"}
2
+ - for prop in props
3
+ - next if [:path, :secondary_path].include?(prop[:name])
4
+ %p= view_attribute(prop, model_name, :label => true)
5
+ %p
6
+ %label File
7
+ %br
8
+ %input{:type => 'file', :name => "#{model_name}[file]"}
9
+ %p
10
+ %label Secondary File
11
+ %br
12
+ %input{:type => 'file', :name => "#{model_name}[file2]"}
13
+ %input{:type => 'submit', :value => 'Save New Item'}
@@ -0,0 +1,14 @@
1
+ %html
2
+ %head
3
+ %title Woah.
4
+ %body
5
+ %h2 Wait a minute...
6
+ %p You'll need to log in before you can continue. Use your OpenID.
7
+ %p (You can use a Google account to log in. Put https://www.google.com/accounts/o8/id in the box below.)
8
+ - if(session['flash.error'])
9
+ .error= session['flash.error']
10
+ %form{:action => '', :method => 'POST'}
11
+ %input{:type => 'text', :name => 'openid_identifier'}
12
+ %input{:type => 'submit', :value => 'Log in'}
13
+
14
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orange
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Haslem
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-17 00:00:00 -05:00
12
+ date: 2010-02-19 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -175,6 +175,10 @@ files:
175
175
  - lib/orange/resources/slices.rb
176
176
  - lib/orange/resources/user_resource.rb
177
177
  - lib/orange/stack.rb
178
+ - lib/orange/templates/admin.haml
179
+ - lib/orange/templates/exceptions.haml
180
+ - lib/orange/views/assets/create.haml
181
+ - lib/orange/views/openid_login.haml
178
182
  - README.markdown
179
183
  has_rdoc: true
180
184
  homepage: http://github.com/therabidbanana/orange