orange-sparkles 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/lib/orange-sparkles/assets/css/main.css +253 -0
  2. data/lib/orange-sparkles/assets/css/reset.css +102 -1
  3. data/lib/orange-sparkles/assets/css/sparkles-admin.css +12 -1
  4. data/lib/orange-sparkles/assets/images/file_icon.png +0 -0
  5. data/lib/orange-sparkles/assets/images/file_icon_small.png +0 -0
  6. data/lib/orange-sparkles/assets/images/nav_active_rpt.png +0 -0
  7. data/lib/orange-sparkles/assets/images/nav_rpt.png +0 -0
  8. data/lib/orange-sparkles/assets/images/pattern.png +0 -0
  9. data/lib/orange-sparkles/assets/images/pattern_light.png +0 -0
  10. data/lib/orange-sparkles/assets/images/pdf_icon.png +0 -0
  11. data/lib/orange-sparkles/assets/images/pdf_icon_small.png +0 -0
  12. data/lib/orange-sparkles/assets/images/yahoo-small.png +0 -0
  13. data/lib/orange-sparkles/plugin.rb +2 -0
  14. data/lib/orange-sparkles/sparkles_app.rb +17 -12
  15. data/lib/orange-sparkles/sparkles_resource.rb +12 -0
  16. data/lib/orange-sparkles/templates/home.haml +17 -14
  17. data/lib/orange-sparkles/templates/sparkles-admin.haml +3 -1
  18. data/lib/orange-sparkles/templates/subpage.haml +15 -11
  19. data/lib/orange-sparkles/views/assets/create.haml +29 -25
  20. data/lib/orange-sparkles/views/assets/insert.haml +2 -2
  21. data/lib/orange-sparkles/views/assets/list.haml +46 -19
  22. data/lib/orange-sparkles/views/assets/list_markitup.haml +17 -3
  23. data/lib/orange-sparkles/views/orange_sites/edit.haml +7 -1
  24. data/lib/orange-sparkles/views/sitemap/one_level.haml +2 -2
  25. data/lib/orange-sparkles/views/slices/administrivia.haml +5 -0
  26. data/lib/orange-sparkles/views/slices/footer.haml +7 -0
  27. data/lib/orange-sparkles/views/slices/header.haml +5 -0
  28. metadata +30 -6
  29. data/lib/orange-sparkles/assets/css/960_24_col.css +0 -1
  30. data/lib/orange-sparkles/templates/admin.haml +0 -24
@@ -0,0 +1,253 @@
1
+ /* @override
2
+ http://www.orangerb.com/assets/public/css/main.css
3
+ http://localhost:9292/assets/public/css/main.css
4
+ */
5
+
6
+ body{
7
+ background: #b6daf2 url(/assets/_sparkles_/images/pattern_light.png);
8
+ background-position: -800px 0;
9
+ font-size: 100%;
10
+ padding: 3.3em 0;
11
+ }
12
+
13
+ a{
14
+ color: #dd7200;
15
+ }
16
+
17
+ header.head .logo{
18
+ padding: 2em 0 1.2em;
19
+ }
20
+
21
+ header.head .logo h1 {
22
+ font: 2em Georgia, "Times New Roman", Times, serif;
23
+ color: #002d56;
24
+ width: 100%;
25
+ text-align: center;
26
+ margin: 0;
27
+ }
28
+
29
+ header.head nav{
30
+ margin: 0 0 1em;
31
+ text-align: center;
32
+ }
33
+
34
+ header.head nav ul{
35
+ background: #b6daf2 url(/assets/_sparkles_/images/nav_rpt.png) repeat-x;
36
+ border-width: 3px 0 1px 0;
37
+ border-color: #002d56;
38
+ border-style: solid;
39
+ list-style: none;
40
+ margin: 0;
41
+ padding: 0.3em 0 0.2em;
42
+ font-size: 1.0em;
43
+ font-weight: bold;
44
+ }
45
+
46
+ header.head nav ul li{
47
+ display: inline;
48
+ margin: 0 0.1em;
49
+ padding: 0;
50
+ }
51
+
52
+ header.head nav a{
53
+ color: #002d56;
54
+ text-decoration: none;
55
+ border-bottom: none;
56
+ padding: 9px 10px 7px;
57
+ }
58
+
59
+ header.head nav a:link{
60
+ border-bottom: none;
61
+ }
62
+
63
+ header.head nav a:hover{
64
+ background: #002d56 url(/assets/_sparkles_/images/nav_active_rpt.png) repeat-x;
65
+ color: #fff;
66
+ }
67
+
68
+
69
+ body .container{
70
+ width: 75%;
71
+ min-width: 860px;
72
+ max-width: 960px;
73
+ background-color: #FFF;
74
+ border-radius: 0.5em;
75
+ -moz-border-radius: 0.5em;
76
+ -webkit-border-radius: 0.5em;
77
+ box-shadow: 0px 1px 3px #666;
78
+ -moz-box-shadow: 0px 1px 3px #666;
79
+ -webkit-box-shadow: 0px 1px 3px #666;
80
+ margin: 0 auto;
81
+ font-family: "Myriad Pro", Myriad, Arial, Helvetica, sans-serif;
82
+ }
83
+
84
+ body .container .body{
85
+ color: #444;
86
+ margin-bottom: 1em;
87
+ padding-bottom: 0.5em;
88
+ }
89
+
90
+ body .container .body h3 {
91
+ margin-left: 0.8em;
92
+ color: #002d56;
93
+ }
94
+
95
+ body .container .body .content{
96
+ color: #444;
97
+ margin-top: 1em;
98
+ padding: 1em 1.5em 1em;
99
+ margin-bottom: 1em;
100
+ background: #fff url(/assets/_sparkles_/images/logo_wm.png) no-repeat bottom right;
101
+ width: 60%;
102
+ float: left;
103
+ border-right: 2px dotted #9cc8e6;
104
+ }
105
+
106
+ body .container .body img{
107
+ max-width: 575px;
108
+ }
109
+
110
+
111
+ body .container .body .fullwidthcontent {
112
+ width: 90%;
113
+ padding: 2em 1.5em 1em;
114
+ margin-bottom: 1em;
115
+ }
116
+
117
+ body .container .body .sidebar{
118
+ padding: 2em 0 1em;
119
+ margin-bottom: 1em;
120
+ width: 34%;
121
+ float: left;
122
+ }
123
+
124
+ body .body h1{
125
+ color: #666;
126
+ font-size: 1.8em;
127
+ border-bottom: 1px solid #bbb;
128
+ }
129
+
130
+ body .body .content>pre{
131
+ padding: 1em 1em 0.1em;
132
+ margin: 1em 3em;
133
+ font: 0.9em "Courier New", Courier, mono;
134
+ background-color: #666;
135
+ color: white;
136
+ border-radius: 1em;
137
+ -moz-border-radius: 1em;
138
+ -webkit-border-radius: 1em;
139
+ border: 0.4em solid #aaa;
140
+ }
141
+
142
+ body .body blockquote{
143
+ padding: 1em 1em 0.1em;
144
+ margin: 1em 3em;
145
+ font: italic 0.9em Georgia, "Times New Roman", Times, serif;
146
+ }
147
+
148
+ body .body p{
149
+ margin: 0 1em 1em;
150
+ }
151
+
152
+ blockquote p, .body .content>pre code{
153
+ display: block;
154
+ margin: 0 0 1.1em;
155
+ }
156
+
157
+ .body footer.footer{
158
+ border-top: 1px solid #666;
159
+ margin: 0 2em;
160
+ color: #666;
161
+ position: relative;
162
+ min-height: 30px;
163
+ text-align: center;
164
+ padding: 1em 1em 0 1em;
165
+ }
166
+
167
+ .body footer.footer .credits{
168
+ text-align:center;
169
+ }
170
+
171
+ body .container .body section.content img{
172
+ max-width: 500px;
173
+ }
174
+
175
+ .body footer.footer a.logo{
176
+ background: url(/assets/_sparkles_/images/osb_light_transparent.png);
177
+ color: #ff7e0e;
178
+ font-size: 1px;
179
+ display: block;
180
+ overflow: hidden;
181
+ height: 71px;
182
+ width: 330px;
183
+ text-decoration: none;
184
+ text-indent: -1000px;
185
+ }
186
+
187
+ span.strong {
188
+ font-weight:bold;
189
+ }
190
+
191
+ br.clearfix {
192
+ clear: both;
193
+ }
194
+
195
+ span.pdf_link, span.file_link{
196
+ display: inline-block;
197
+ min-height: 48px;
198
+ margin-bottom: 0.5em;
199
+ background: url(/assets/_sparkles_/images/pdf_icon_small.png) center left no-repeat;
200
+ }
201
+ section.content span.pdf_link, section.content span.file_link{
202
+ margin-left: 2em;
203
+ }
204
+ section.sidebar span.pdf_link, section.sidebar span.file_link{
205
+ margin-left: 1em;
206
+ margin-right: 1em;
207
+ }
208
+ section.sidebar li span.pdf_link, section.sidebar li span.file_link{
209
+ margin-left: 0;
210
+ }
211
+ .contact_form .contact_phone { display : none;}
212
+
213
+ section.sidebar img {
214
+ margin-left: 1em;
215
+ }
216
+
217
+ span.file_link{
218
+ background-image: url(/assets/_sparkles_/images/file_icon_small.png);
219
+ }
220
+
221
+ span.pdf_link a, span.file_link a{
222
+ display: inline-block;
223
+ padding-left: 62px;
224
+ padding-right: 2em;
225
+ padding-top: 0.4em;
226
+ min-height: 48px;
227
+ }
228
+ .center {
229
+ text-align: center;
230
+ }
231
+
232
+ form.contact_form {
233
+ width: 216px;
234
+ padding: 1em;
235
+ margin-left: 1em;
236
+ background: #d7f4fd;
237
+ border: 1px solid #9cc8e6;
238
+ }
239
+
240
+ .admin{
241
+ font-size: 0.7em;
242
+ color: #003a65;
243
+ text-align: center;
244
+ }
245
+
246
+ .admin a{
247
+ color: #003a65;
248
+ }
249
+
250
+ /* For email obfuscation: */
251
+ span.hideme{
252
+ display: none;
253
+ }
@@ -1 +1,102 @@
1
- html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
1
+ /*
2
+ html5doctor.com Reset Stylesheet
3
+ v1.6
4
+ Last Updated: 2010-08-18
5
+ Author: Richard Clark - http://richclarkdesign.com
6
+ Twitter: @rich_clark
7
+ */
8
+
9
+ html, body, div, span, object, iframe,
10
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
11
+ abbr, address, cite, code,
12
+ del, dfn, em, img, ins, kbd, q, samp,
13
+ small, strong, sub, sup, var,
14
+ b, i,
15
+ dl, dt, dd, ol, ul, li,
16
+ fieldset, form, label, legend,
17
+ table, caption, tbody, tfoot, thead, tr, th, td,
18
+ article, aside, canvas, details, figcaption, figure,
19
+ footer, header, hgroup, menu, nav, section, summary,
20
+ time, mark, audio, video {
21
+ margin:0;
22
+ padding:0;
23
+ border:0;
24
+ outline:0;
25
+ font-size:100%;
26
+ vertical-align:baseline;
27
+ background:transparent;
28
+ }
29
+
30
+ body {
31
+ line-height:1;
32
+ }
33
+
34
+ article,aside,details,figcaption,figure,
35
+ footer,header,hgroup,menu,nav,section {
36
+ display:block;
37
+ }
38
+
39
+ nav ul {
40
+ list-style:none;
41
+ }
42
+
43
+ blockquote, q {
44
+ quotes:none;
45
+ }
46
+
47
+ blockquote:before, blockquote:after,
48
+ q:before, q:after {
49
+ content:'';
50
+ content:none;
51
+ }
52
+
53
+ a {
54
+ margin:0;
55
+ padding:0;
56
+ font-size:100%;
57
+ vertical-align:baseline;
58
+ background:transparent;
59
+ }
60
+
61
+ /* change colours to suit your needs */
62
+ ins {
63
+ background-color:#ff9;
64
+ color:#000;
65
+ text-decoration:none;
66
+ }
67
+
68
+ /* change colours to suit your needs */
69
+ mark {
70
+ background-color:#ff9;
71
+ color:#000;
72
+ font-style:italic;
73
+ font-weight:bold;
74
+ }
75
+
76
+ del {
77
+ text-decoration: line-through;
78
+ }
79
+
80
+ abbr[title], dfn[title] {
81
+ border-bottom:1px dotted inherit;
82
+ cursor:help;
83
+ }
84
+
85
+ table {
86
+ border-collapse:collapse;
87
+ border-spacing:0;
88
+ }
89
+
90
+ /* change border colour to suit your needs */
91
+ hr {
92
+ display:block;
93
+ height:1px;
94
+ border:0;
95
+ border-top:1px solid #cccccc;
96
+ margin:1em 0;
97
+ padding:0;
98
+ }
99
+
100
+ input, select {
101
+ vertical-align:middle;
102
+ }
@@ -97,7 +97,8 @@ body#subsites a#sites-tab,
97
97
  body#events a#events-tab,
98
98
  body#news a#news-tab,
99
99
  body#blog_posts a#blog-tab,
100
- body#members a#members-tab
100
+ body#members a#members-tab,
101
+ body#assets a#assets-tab
101
102
  {
102
103
  background: #999999;
103
104
  z-index: 0;
@@ -720,6 +721,16 @@ table.tablesorter .headerSortDown {
720
721
  }
721
722
  .asset-tile img{
722
723
  max-width: 120px;
724
+ max-height: 120px;
725
+ }
726
+
727
+ .asset-tile .asset_tag{
728
+ width: 120px;
729
+ height: 120px;
730
+ }
731
+
732
+ .asset-tile .asset_name{
733
+ height: 3em;
723
734
  }
724
735
 
725
736
  .asset_preview img{
@@ -1,8 +1,10 @@
1
+ require 'orange-sparkles/sparkles_resource'
1
2
  module Orange::Plugins
2
3
  class Sparkles < Base
3
4
  assets_dir File.join(File.dirname(__FILE__), 'assets')
4
5
  views_dir File.join(File.dirname(__FILE__), 'views')
5
6
  templates_dir File.join(File.dirname(__FILE__), 'templates')
7
+ resource SparklesResource.new
6
8
  end
7
9
  end
8
10
 
@@ -12,6 +12,8 @@ require 'orange-more/subsites'
12
12
  require 'maruku'
13
13
  require 'rack/builder'
14
14
  require 'rack/abstract_format'
15
+ require 'rack/openid'
16
+ require 'openid_dm_store'
15
17
 
16
18
  require 'orange-sparkles/plugin'
17
19
 
@@ -22,37 +24,30 @@ class Orange::SparklesApp < Orange::Application
22
24
  packet.add_css('sparkles-admin.css', :position => 0, :module => '_sparkles_')
23
25
  packet.add_css('colorbox.css', :module => '_sparkles_')
24
26
  packet.add_css('smoothness/jquery-ui-1.7.2.custom.css', :module => '_sparkles_')
25
- packet.add_js('jquery-1.4.1.min.js', :module => '_sparkles_')
26
27
  packet.add_js('markitup/sets/markdown/set.js', :module => '_sparkles_')
27
28
  packet.add_js('markitup/jquery.markitup.pack.js', :module => '_sparkles_')
28
29
  packet.add_js('autoresize.jquery.min.js', :module => '_sparkles_')
29
30
  packet.add_js('jquery-ui-1.7.2.custom.min.js', :module => '_sparkles_')
30
- packet.add_js('jquery.form.js', :module => '_sparkles_')
31
- packet.add_js('jquery.colorbox.js', :module => '_sparkles_')
32
- packet.add_js('jquery.tools.min.js', :module => '_sparkles_')
33
- packet.add_js('jquery.tablesorter.js', :module => '_sparkles_')
34
- packet.add_js('jquery.tablesorter.pager.js', :module => '_sparkles_')
31
+ %w(form colorbox tools.min tablesorter tablesorter.pager).each do |js|
32
+ packet.add_js("jquery.#{js}.js", :module => '_sparkles_')
33
+ end
35
34
  packet.add_js('admin.js', :module => '_sparkles_')
36
35
  orange.fire(:view_admin, packet)
37
36
  'sparkles-admin.haml'
38
37
  elsif(packet['route.path'] == '/')
39
- # packet.add_js('jquery-1.4.1.min.js', :module => '_sparkles_')
40
- ['reset', '960_24_col', 'text', 'main'].each{|c| packet.add_css("#{c}.css", :module => '_sparkles_')}
38
+ ['reset', 'text', 'main'].each{|c| packet.add_css("#{c}.css", :module => '_sparkles_')}
41
39
  'home.haml'
42
40
  else
43
- # packet.add_js('jquery-1.4.1.min.js', :module => '_sparkles_')
44
- ['reset', '960_24_col', 'text', 'main'].each{|c| packet.add_css("#{c}.css", :module => '_sparkles_')}
41
+ ['reset', 'text', 'main'].each{|c| packet.add_css("#{c}.css", :module => '_sparkles_')}
45
42
  'subpage.haml'
46
43
  end
47
44
  end # end do
48
45
  end
49
46
 
50
47
  stack do
51
- orange.options[:development_mode] = true
52
48
  use Rack::CommonLogger
53
49
  use Rack::MethodOverride
54
50
  use Rack::Session::Cookie, :secret => (orange.options['main_user'] || 'the_secret')
55
- auto_reload!
56
51
  use_exceptions
57
52
 
58
53
  use Rack::OpenID, OpenIDDataMapper::DataMapperStore.new
@@ -89,6 +84,16 @@ class OrangeAsset
89
84
  end
90
85
  end
91
86
 
87
+ class OrangePage
88
+ admin do
89
+ fulltext :sidebar
90
+ end
91
+ end
92
+
93
+ class OrangePageVersion
94
+ fulltext :sidebar
95
+ end
96
+
92
97
 
93
98
  module SparkleHelpers
94
99
  def markdown(string)
@@ -0,0 +1,12 @@
1
+ class SparklesResource < Orange::Resource
2
+ call_me :sparkles
3
+ def stylesheets
4
+ orange.options["stylesheets"] || []
5
+ end
6
+ def javascripts
7
+ orange.options["javascripts"] || []
8
+ end
9
+ def site_name(packet, default = "An Orange Site")
10
+ packet['site'] ? packet['site'].name : default
11
+ end
12
+ end
@@ -1,22 +1,25 @@
1
1
  !!! 5
2
2
  %html{:lang => "en"}
3
3
  %head
4
- %title= packet['site'] ? packet['site'].name : "Orange Site"
4
+ %title= orange[:sparkles].site_name(packet)
5
5
  %meta{:charset => "utf-8"}
6
- /[if lt IE 9]
7
- %script{:src => "http://html5shiv.googlecode.com/svn/trunk/html5.js"}
8
- /
9
- %script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"}
10
6
  -# CSS
7
+ %script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"}
11
8
  = part[:css]
12
9
  = part[:js]
10
+ - orange[:sparkles].stylesheets.each{|css| add_css("#{css}.css") }
11
+ - orange[:sparkles].javascripts.each{|js| add_js("#{css}.js") }
12
+ /[if lt IE 9]
13
+ %script{:src => "http://html5shiv.googlecode.com/svn/trunk/html5.js"}
13
14
  %body#home
14
- .container.container_24
15
- %header.head
16
- .logo
17
- %h1= packet['site'] ? packet['site'].name : "Orange Site"
18
- %nav.clearfix
19
- = orange[:sitemap].two_level(packet)
20
- %br.clear
21
- .body.grid_22.prefix_1.suffix_1
22
- = yield
15
+ .container
16
+ %o:slice{:mode => "header"}
17
+ .body
18
+ - if(part[:sidebar]).blank?
19
+ %section.fullwidthcontent= yield
20
+ - else
21
+ %section.content= yield
22
+ %section.sidebar= part[:sidebar]
23
+ %br.clearfix
24
+ %o:slice{:mode => "footer"}
25
+ %o:slice{:mode => "administrivia"}
@@ -2,6 +2,7 @@
2
2
  %html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en"}
3
3
  %head
4
4
  %title= part[:title, 'Orange Site']
5
+ %script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"}
5
6
  %link{:rel => "stylesheet", :type => "text/css", :href => "http://yui.yahooapis.com/3.0.0/build/cssreset/reset-min.css"}
6
7
  = part[:css]
7
8
  = part[:js]
@@ -19,10 +20,11 @@
19
20
  %div#current-site-header
20
21
  %span Currently editing:
21
22
  %br
22
- %a.orange-text{:href => "/"}= packet['site'].name
23
+ %a.orange-text{:href => "/"}= orange[:sparkles].site_name(packet)
23
24
  %div.tab-container
24
25
  / %a.tab#home-tab{:href => "#"} Home
25
26
  %a.tab#sitemap-tab{:href => route_to(:sitemap)} Pages
27
+ %a.tab#assets-tab{:href => route_to(:assets)} Assets
26
28
  - for link in (orange[:admin].links(packet)["tabs"] || [])
27
29
  %style= "body##{link[:resource]} a##{link[:resource]}-tab{ background: #999999;}"
28
30
  %a.tab{:id => "#{link[:resource]}-tab", :href => route_to(link[:resource])}= link[:text]
@@ -1,20 +1,24 @@
1
1
  !!! 5
2
2
  %html{:lang => "en"}
3
3
  %head
4
- %title Orange Site
4
+ %title= part[:page_title] +" - "+ orange[:sparkles].site_name(packet)
5
5
  %meta{:charset => "utf-8"}
6
- -# CSS
6
+ %script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"}
7
7
  = part[:css]
8
8
  = part[:js]
9
+ - orange[:sparkles].stylesheets.each{|css| add_css("#{css}.css") }
10
+ - orange[:sparkles].javascripts.each{|js| add_js("#{css}.js") }
9
11
  /[if lt IE 9]
10
12
  %script{:src => "http://html5shiv.googlecode.com/svn/trunk/html5.js"}
11
13
  %body#home
12
- .container.container_24
13
- %header.head
14
- .logo
15
- %h1 Orange Site
16
- %nav.clearfix
17
- = orange[:sitemap].two_level(packet)
18
- %br.clear
19
- .body.grid_22.prefix_1.suffix_1
20
- = yield
14
+ .container
15
+ %o:slice{:mode => "header"}
16
+ .body
17
+ - if(part[:sidebar]).blank?
18
+ %section.fullwidthcontent= yield
19
+ - else
20
+ %section.content= yield
21
+ %section.sidebar= part[:sidebar]
22
+ %br.clearfix
23
+ %o:slice{:mode => "footer"}
24
+ %o:slice{:mode => "administrivia"}
@@ -1,25 +1,29 @@
1
- %form#asset-insert{:action => "#{packet.route_to(model_name, 'new')}", :method => 'post', :enctype=>"multipart/form-data"}
2
- %input{:type => 'hidden', :name => "fake_xhr", :value => "1"}
3
- - for prop in props
4
- - next if [:path, :secondary_path].include?(prop[:name])
5
- %p= view_attribute(prop, model_name, :label => true)
6
- %p
7
- %label File
8
- %br
9
- %input{:type => 'file', :name => "#{model_name}[file]"}
10
- / %p
11
- / %label Secondary File
12
- / %br
13
- / %input{:type => 'file', :name => "#{model_name}[file2]"}
14
- %input{:type => 'submit', :value => 'Save New Item'}
15
- :javascript
16
- $("#asset-insert").ajaxForm({dataType: 'json', success: function(ret){
17
- var link = $.fn.colorbox.element();
18
- var preview = link.prev();
19
- var input_name = link.attr('rel');
20
- preview.html(ret.html);
21
- $("[name*='"+input_name+"']").attr("value", ret.id);
22
- link.attr("href", "/admin/assets/"+ret.id+"/change");
23
- link.text("Change Asset");
24
- $.fn.colorbox.close();
25
- }});
1
+ - colorbox ||= false
2
+ .form-view
3
+ %form#asset-insert{:action => "#{packet.route_to(model_name, 'new')}", :method => 'post', :enctype=>"multipart/form-data"}
4
+ - if colorbox
5
+ %input{:type => 'hidden', :name => "fake_xhr", :value => "1"}
6
+ - for prop in props
7
+ - next if [:path, :secondary_path].include?(prop[:name])
8
+ %p= view_attribute(prop, model_name, :label => true)
9
+ %p
10
+ %label File
11
+ %br
12
+ %input{:type => 'file', :name => "#{model_name}[file]"}
13
+ / %p
14
+ / %label Secondary File
15
+ / %br
16
+ / %input{:type => 'file', :name => "#{model_name}[file2]"}
17
+ %input{:type => 'submit', :value => 'Save New Item'}
18
+ - if colorbox
19
+ :javascript
20
+ $("#asset-insert").ajaxForm({dataType: 'json', success: function(ret){
21
+ var link = $.fn.colorbox.element();
22
+ var preview = link.prev();
23
+ var input_name = link.attr('rel');
24
+ preview.html(ret.html);
25
+ $("[name*='"+input_name+"']").attr("value", ret.id);
26
+ link.attr("href", "/admin/assets/"+ret.id+"/change");
27
+ link.text("Change Asset");
28
+ $.fn.colorbox.close();
29
+ }});
@@ -2,11 +2,11 @@
2
2
  %h2 Upload a new image
3
3
  %hr
4
4
  .asset-upload-form
5
- = view_create(:assets)
5
+ = view_create(:assets, :colorbox => true)
6
6
  .choose-asset{:style => "display: none"}
7
7
  %h2 Choose a previously uploaded image
8
8
  %hr
9
- = view_list(:assets)
9
+ = view_list(:assets, :colorbox => true)
10
10
  .current-asset
11
11
  %hr
12
12
  %a.asset-chooser-toggle{:href => "#"} Choose a previously uploaded image instead
@@ -1,19 +1,46 @@
1
- .asset-list
2
- - for asset in list
3
- .asset-tile{:id => asset.id}
4
- %p.asset_tag= asset.to_asset_tag
5
- %p
6
- %em= asset.name
7
- :javascript
8
- $(".asset-tile").click(function(ret){
9
- var tile = $(this);
10
- var link = $.fn.colorbox.element();
11
- var preview = link.prev();
12
- var input_name = link.attr('rel');
13
- var id = tile.attr("id");
14
- preview.html(tile.children(".asset_tag").html());
15
- $("[name*='"+input_name+"']").attr("value", id);
16
- link.attr("href", "/admin/assets/"+tile.attr("id")+"/change");
17
- link.text("Change Asset");
18
- $.fn.colorbox.close();
19
- });
1
+ - packet.add_js("page-list-effects.js", :module => "_sparkles_")
2
+ - colorbox ||= false
3
+ .list-view
4
+ .asset-list
5
+ - for asset in list
6
+ .asset-tile{:id => asset.id}
7
+ %p.asset_tag
8
+ -if(asset.image?)
9
+ = asset.to_asset_tag
10
+ -elsif(asset.pdf?)
11
+ %img{:src => '/assets/_sparkles_/images/pdf_icon.png'}
12
+ -else
13
+ %img{:src => '/assets/_sparkles_/images/file_icon.png'}
14
+ %p.asset_name
15
+ - name = asset.name.size > 50 ? asset.name[0,50] + '...' : asset.name
16
+ - name = name.blank? ? "Untitled Asset ##{asset.id}" : name
17
+ - if colorbox
18
+ %em= name
19
+ - else
20
+ %em
21
+ %a{:href => route_to(:assets, asset.id, :edit)}= name
22
+ %br.clearfix
23
+ - unless colorbox
24
+ %a.button.add-button{:href => route_to(model_name, 'create'), :style => "float: right"} Upload new asset
25
+ %br.clearfix
26
+ - if colorbox
27
+ :javascript
28
+ $(".asset-tile .asset_tag a").click(function(ret){
29
+ var tile = $(this).closest('.asset-tile');
30
+ var id = tile.attr("id");
31
+ $.markItUp({ replaceWith: '<o:asset id="'+id+'" />' } );
32
+ $.fn.colorbox.close();
33
+ return false;
34
+ });
35
+ $(".asset-tile").click(function(ret){
36
+ var tile = $(this);
37
+ var link = $.fn.colorbox.element();
38
+ var preview = link.prev();
39
+ var input_name = link.attr('rel');
40
+ var id = tile.attr("id");
41
+ preview.html(tile.children(".asset_tag").html());
42
+ $("[name*='"+input_name+"']").attr("value", id);
43
+ link.attr("href", "/admin/assets/"+tile.attr("id")+"/change");
44
+ link.text("Change Asset");
45
+ $.fn.colorbox.close();
46
+ });
@@ -1,10 +1,24 @@
1
1
  .asset-list
2
2
  - for asset in list
3
3
  .asset-tile{:id => asset.id}
4
- %p.asset_tag= asset.to_asset_tag
5
- %p
6
- %em= asset.name
4
+ %p.asset_tag
5
+ -if(asset.image?)
6
+ = asset.to_asset_tag
7
+ -elsif(asset.pdf?)
8
+ %img{:src => '/assets/_sparkles_/images/pdf_icon.png'}
9
+ -else
10
+ %img{:src => '/assets/_sparkles_/images/file_icon.png'}
11
+ %p.asset_name
12
+ - name = asset.name.size > 50 ? asset.name[0,50] + '...' : asset.name
13
+ %em= name
7
14
  :javascript
15
+ $(".asset-tile .asset_tag a").click(function(ret){
16
+ var tile = $(this).closest('.asset-tile');
17
+ var id = tile.attr("id");
18
+ $.markItUp({ replaceWith: '<o:asset id="'+id+'" />' } );
19
+ $.fn.colorbox.close();
20
+ return false;
21
+ });
8
22
  $(".asset-tile").click(function(ret){
9
23
  var tile = $(this);
10
24
  var id = tile.attr("id");
@@ -9,4 +9,10 @@
9
9
  %br.clearfix
10
10
  - else
11
11
  %p Couldn't find the item you're looking for.
12
- - packet["page.title"] = "Site Settings"
12
+ - packet["page.title"] = "Site Settings"
13
+ - if orange.loaded?(:adverts)
14
+ %h2 Site Ads
15
+ = view_list(:adverts, :is_short => true)
16
+ - if orange.loaded?(:contactforms)
17
+ %h2 Contact Forms
18
+ = view_list(:contactforms, :is_short => true)
@@ -1,7 +1,7 @@
1
1
  %ul.nav
2
2
  %li.first
3
- %a{:href => "#{orange[:subsites].url_for(packet).gsub(/\/$/, '')}#{model.full_path}"}= packet["subsite"].name
3
+ %a{:href => model.full_path} Home
4
4
  - for item in model.children
5
5
  - next unless item.show_in_nav
6
6
  %li
7
- %a{:href => "#{orange[:subsites].url_for(packet).gsub(/\/$/, '')}#{item.full_path}"}= orange[:sitemap].link_text_for(item)
7
+ %a{:href => item.full_path}= orange[:sitemap].link_text_for(item)
@@ -0,0 +1,5 @@
1
+ .admin
2
+ Built on
3
+ %a{:href => "http://www.orangerb.com"} Orange
4
+ |
5
+ %a{:href => "/admin/sitemap"} Site Admin
@@ -0,0 +1,7 @@
1
+ %footer.footer
2
+ .credits
3
+ - if !orange.options["footer_text"].blank?
4
+ = markdown(orange.options["footer_text"])
5
+ - else
6
+ %p
7
+ %span.strong= packet['site'] ? packet['site'].name : "An Orange Site"
@@ -0,0 +1,5 @@
1
+ %header.head
2
+ .logo
3
+ %h1= packet['site'] ? packet['site'].name : "An Orange Site"
4
+ %nav
5
+ = orange[:sitemap].one_level(packet)
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orange-sparkles
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 25
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 5
8
- - 8
9
- version: 0.5.8
9
+ - 9
10
+ version: 0.5.9
10
11
  platform: ruby
11
12
  authors:
12
13
  - David Haslem
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-08-18 00:00:00 -04:00
18
+ date: 2010-08-20 00:00:00 -04:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: orange-core
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 5
27
30
  segments:
28
31
  - 0
29
32
  - 5
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: orange-more
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 5
41
46
  segments:
42
47
  - 0
43
48
  - 5
@@ -49,9 +54,11 @@ dependencies:
49
54
  name: maruku
50
55
  prerelease: false
51
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
52
58
  requirements:
53
59
  - - ">="
54
60
  - !ruby/object:Gem::Version
61
+ hash: 3
55
62
  segments:
56
63
  - 0
57
64
  version: "0"
@@ -61,9 +68,11 @@ dependencies:
61
68
  name: rack-abstract-format
62
69
  prerelease: false
63
70
  requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
64
72
  requirements:
65
73
  - - ">="
66
74
  - !ruby/object:Gem::Version
75
+ hash: 3
67
76
  segments:
68
77
  - 0
69
78
  version: "0"
@@ -80,7 +89,6 @@ extra_rdoc_files:
80
89
  - README.rdoc
81
90
  files:
82
91
  - lib/orange-sparkles.rb
83
- - lib/orange-sparkles/assets/css/960_24_col.css
84
92
  - lib/orange-sparkles/assets/css/border-radius.htc
85
93
  - lib/orange-sparkles/assets/css/colorbox.css
86
94
  - lib/orange-sparkles/assets/css/main.css
@@ -119,6 +127,8 @@ files:
119
127
  - lib/orange-sparkles/assets/images/expand.png
120
128
  - lib/orange-sparkles/assets/images/facebook_sticker.png
121
129
  - lib/orange-sparkles/assets/images/facebook_sticker_small.png
130
+ - lib/orange-sparkles/assets/images/file_icon.png
131
+ - lib/orange-sparkles/assets/images/file_icon_small.png
122
132
  - lib/orange-sparkles/assets/images/google-small.png
123
133
  - lib/orange-sparkles/assets/images/green-button.png
124
134
  - lib/orange-sparkles/assets/images/grey-button.png
@@ -147,6 +157,8 @@ files:
147
157
  - lib/orange-sparkles/assets/images/move-outdent-disabled.png
148
158
  - lib/orange-sparkles/assets/images/move-outdent.png
149
159
  - lib/orange-sparkles/assets/images/move-up-disabled.png
160
+ - lib/orange-sparkles/assets/images/nav_active_rpt.png
161
+ - lib/orange-sparkles/assets/images/nav_rpt.png
150
162
  - lib/orange-sparkles/assets/images/orange-button.png
151
163
  - lib/orange-sparkles/assets/images/overlay.png
152
164
  - lib/orange-sparkles/assets/images/page-list-last-child.png
@@ -158,12 +170,16 @@ files:
158
170
  - lib/orange-sparkles/assets/images/page-listing-link.png
159
171
  - lib/orange-sparkles/assets/images/page-listing-page.png
160
172
  - lib/orange-sparkles/assets/images/page-listing-subsite.png
173
+ - lib/orange-sparkles/assets/images/pattern.png
174
+ - lib/orange-sparkles/assets/images/pattern_light.png
161
175
  - lib/orange-sparkles/assets/images/payment/amex.png
162
176
  - lib/orange-sparkles/assets/images/payment/check.png
163
177
  - lib/orange-sparkles/assets/images/payment/discover.png
164
178
  - lib/orange-sparkles/assets/images/payment/mastercard.png
165
179
  - lib/orange-sparkles/assets/images/payment/paypal.png
166
180
  - lib/orange-sparkles/assets/images/payment/visa.png
181
+ - lib/orange-sparkles/assets/images/pdf_icon.png
182
+ - lib/orange-sparkles/assets/images/pdf_icon_small.png
167
183
  - lib/orange-sparkles/assets/images/popout-shadow.png
168
184
  - lib/orange-sparkles/assets/images/slider-background.png
169
185
  - lib/orange-sparkles/assets/images/slider-bg-enabled-disabled.png
@@ -185,6 +201,7 @@ files:
185
201
  - lib/orange-sparkles/assets/images/twitter_sticker_small.png
186
202
  - lib/orange-sparkles/assets/images/vimeo_sticker.png
187
203
  - lib/orange-sparkles/assets/images/vimeo_sticker_small.png
204
+ - lib/orange-sparkles/assets/images/yahoo-small.png
188
205
  - lib/orange-sparkles/assets/images/youtube_sticker.png
189
206
  - lib/orange-sparkles/assets/images/youtube_sticker_small.png
190
207
  - lib/orange-sparkles/assets/js/admin.js
@@ -257,7 +274,7 @@ files:
257
274
  - lib/orange-sparkles/assets/js/popout-effects-page-edit.js
258
275
  - lib/orange-sparkles/plugin.rb
259
276
  - lib/orange-sparkles/sparkles_app.rb
260
- - lib/orange-sparkles/templates/admin.haml
277
+ - lib/orange-sparkles/sparkles_resource.rb
261
278
  - lib/orange-sparkles/templates/home.haml
262
279
  - lib/orange-sparkles/templates/sparkles-admin.haml
263
280
  - lib/orange-sparkles/templates/subpage.haml
@@ -310,6 +327,9 @@ files:
310
327
  - lib/orange-sparkles/views/sitemap/one_level.haml
311
328
  - lib/orange-sparkles/views/sitemap/route_actions.haml
312
329
  - lib/orange-sparkles/views/sitemap/table_row.haml
330
+ - lib/orange-sparkles/views/slices/administrivia.haml
331
+ - lib/orange-sparkles/views/slices/footer.haml
332
+ - lib/orange-sparkles/views/slices/header.haml
313
333
  - lib/orange-sparkles/views/slices/lorem.haml
314
334
  - lib/orange-sparkles/views/slices/slice_helper.haml
315
335
  - lib/orange-sparkles/views/users/create.haml
@@ -326,23 +346,27 @@ rdoc_options:
326
346
  require_paths:
327
347
  - lib
328
348
  required_ruby_version: !ruby/object:Gem::Requirement
349
+ none: false
329
350
  requirements:
330
351
  - - ">="
331
352
  - !ruby/object:Gem::Version
353
+ hash: 3
332
354
  segments:
333
355
  - 0
334
356
  version: "0"
335
357
  required_rubygems_version: !ruby/object:Gem::Requirement
358
+ none: false
336
359
  requirements:
337
360
  - - ">="
338
361
  - !ruby/object:Gem::Version
362
+ hash: 3
339
363
  segments:
340
364
  - 0
341
365
  version: "0"
342
366
  requirements: []
343
367
 
344
368
  rubyforge_project:
345
- rubygems_version: 1.3.6
369
+ rubygems_version: 1.3.7
346
370
  signing_key:
347
371
  specification_version: 3
348
372
  summary: Adding some prettiness to orange-core
@@ -1 +0,0 @@
1
- .container_24{margin-left:auto;margin-right:auto;width:960px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12,.grid_13,.grid_14,.grid_15,.grid_16,.grid_17,.grid_18,.grid_19,.grid_20,.grid_21,.grid_22,.grid_23,.grid_24{display:inline;float:left;margin-left:5px;margin-right:5px}.push_1,.pull_1,.push_2,.pull_2,.push_3,.pull_3,.push_4,.pull_4,.push_5,.pull_5,.push_6,.pull_6,.push_7,.pull_7,.push_8,.pull_8,.push_9,.pull_9,.push_10,.pull_10,.push_11,.pull_11,.push_12,.pull_12,.push_13,.pull_13,.push_14,.pull_14,.push_15,.pull_15,.push_16,.pull_16,.push_17,.pull_17,.push_18,.pull_18,.push_19,.pull_19,.push_20,.pull_20,.push_21,.pull_21,.push_22,.pull_22,.push_23,.pull_23{position:relative}.alpha{margin-left:0}.omega{margin-right:0}.container_24 .grid_1{width:30px}.container_24 .grid_2{width:70px}.container_24 .grid_3{width:110px}.container_24 .grid_4{width:150px}.container_24 .grid_5{width:190px}.container_24 .grid_6{width:230px}.container_24 .grid_7{width:270px}.container_24 .grid_8{width:310px}.container_24 .grid_9{width:350px}.container_24 .grid_10{width:390px}.container_24 .grid_11{width:430px}.container_24 .grid_12{width:470px}.container_24 .grid_13{width:510px}.container_24 .grid_14{width:550px}.container_24 .grid_15{width:590px}.container_24 .grid_16{width:630px}.container_24 .grid_17{width:670px}.container_24 .grid_18{width:710px}.container_24 .grid_19{width:750px}.container_24 .grid_20{width:790px}.container_24 .grid_21{width:830px}.container_24 .grid_22{width:870px}.container_24 .grid_23{width:910px}.container_24 .grid_24{width:950px}.container_24 .prefix_1{padding-left:40px}.container_24 .prefix_2{padding-left:80px}.container_24 .prefix_3{padding-left:120px}.container_24 .prefix_4{padding-left:160px}.container_24 .prefix_5{padding-left:200px}.container_24 .prefix_6{padding-left:240px}.container_24 .prefix_7{padding-left:280px}.container_24 .prefix_8{padding-left:320px}.container_24 .prefix_9{padding-left:360px}.container_24 .prefix_10{padding-left:400px}.container_24 .prefix_11{padding-left:440px}.container_24 .prefix_12{padding-left:480px}.container_24 .prefix_13{padding-left:520px}.container_24 .prefix_14{padding-left:560px}.container_24 .prefix_15{padding-left:600px}.container_24 .prefix_16{padding-left:640px}.container_24 .prefix_17{padding-left:680px}.container_24 .prefix_18{padding-left:720px}.container_24 .prefix_19{padding-left:760px}.container_24 .prefix_20{padding-left:800px}.container_24 .prefix_21{padding-left:840px}.container_24 .prefix_22{padding-left:880px}.container_24 .prefix_23{padding-left:920px}.container_24 .suffix_1{padding-right:40px}.container_24 .suffix_2{padding-right:80px}.container_24 .suffix_3{padding-right:120px}.container_24 .suffix_4{padding-right:160px}.container_24 .suffix_5{padding-right:200px}.container_24 .suffix_6{padding-right:240px}.container_24 .suffix_7{padding-right:280px}.container_24 .suffix_8{padding-right:320px}.container_24 .suffix_9{padding-right:360px}.container_24 .suffix_10{padding-right:400px}.container_24 .suffix_11{padding-right:440px}.container_24 .suffix_12{padding-right:480px}.container_24 .suffix_13{padding-right:520px}.container_24 .suffix_14{padding-right:560px}.container_24 .suffix_15{padding-right:600px}.container_24 .suffix_16{padding-right:640px}.container_24 .suffix_17{padding-right:680px}.container_24 .suffix_18{padding-right:720px}.container_24 .suffix_19{padding-right:760px}.container_24 .suffix_20{padding-right:800px}.container_24 .suffix_21{padding-right:840px}.container_24 .suffix_22{padding-right:880px}.container_24 .suffix_23{padding-right:920px}.container_24 .push_1{left:40px}.container_24 .push_2{left:80px}.container_24 .push_3{left:120px}.container_24 .push_4{left:160px}.container_24 .push_5{left:200px}.container_24 .push_6{left:240px}.container_24 .push_7{left:280px}.container_24 .push_8{left:320px}.container_24 .push_9{left:360px}.container_24 .push_10{left:400px}.container_24 .push_11{left:440px}.container_24 .push_12{left:480px}.container_24 .push_13{left:520px}.container_24 .push_14{left:560px}.container_24 .push_15{left:600px}.container_24 .push_16{left:640px}.container_24 .push_17{left:680px}.container_24 .push_18{left:720px}.container_24 .push_19{left:760px}.container_24 .push_20{left:800px}.container_24 .push_21{left:840px}.container_24 .push_22{left:880px}.container_24 .push_23{left:920px}.container_24 .pull_1{left:-40px}.container_24 .pull_2{left:-80px}.container_24 .pull_3{left:-120px}.container_24 .pull_4{left:-160px}.container_24 .pull_5{left:-200px}.container_24 .pull_6{left:-240px}.container_24 .pull_7{left:-280px}.container_24 .pull_8{left:-320px}.container_24 .pull_9{left:-360px}.container_24 .pull_10{left:-400px}.container_24 .pull_11{left:-440px}.container_24 .pull_12{left:-480px}.container_24 .pull_13{left:-520px}.container_24 .pull_14{left:-560px}.container_24 .pull_15{left:-600px}.container_24 .pull_16{left:-640px}.container_24 .pull_17{left:-680px}.container_24 .pull_18{left:-720px}.container_24 .pull_19{left:-760px}.container_24 .pull_20{left:-800px}.container_24 .pull_21{left:-840px}.container_24 .pull_22{left:-880px}.container_24 .pull_23{left:-920px}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:after{clear:both;content:' ';display:block;font-size:0;line-height:0;visibility:hidden;width:0;height:0}* html .clearfix,*:first-child+html .clearfix{zoom:1}
@@ -1,24 +0,0 @@
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
- ORANGISH
12
- .container
13
- #inner-body
14
- .sidebar
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
- .main
23
- = yield
24
- .footer