cortex-reaver 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. data/README +1 -1
  2. data/bin/cortex_reaver +3 -4
  3. data/lib/cortex_reaver.rb +270 -110
  4. data/lib/cortex_reaver/cache.rb +23 -0
  5. data/lib/cortex_reaver/config.rb +178 -74
  6. data/lib/cortex_reaver/controller/admin.rb +64 -4
  7. data/lib/cortex_reaver/controller/comment.rb +4 -4
  8. data/lib/cortex_reaver/controller/controller.rb +3 -3
  9. data/lib/cortex_reaver/controller/journal.rb +4 -2
  10. data/lib/cortex_reaver/controller/main.rb +117 -26
  11. data/lib/cortex_reaver/controller/page.rb +7 -0
  12. data/lib/cortex_reaver/controller/photograph.rb +12 -10
  13. data/lib/cortex_reaver/controller/tag.rb +1 -1
  14. data/lib/cortex_reaver/controller/user.rb +7 -2
  15. data/lib/cortex_reaver/helper/attachments.rb +2 -2
  16. data/lib/cortex_reaver/helper/crud.rb +7 -7
  17. data/lib/cortex_reaver/helper/feeds.rb +56 -38
  18. data/lib/cortex_reaver/helper/form.rb +12 -16
  19. data/lib/cortex_reaver/helper/navigation.rb +35 -16
  20. data/lib/cortex_reaver/helper/photographs.rb +2 -2
  21. data/lib/cortex_reaver/helper/sidebar.rb +44 -0
  22. data/lib/cortex_reaver/helper/tags.rb +32 -9
  23. data/lib/cortex_reaver/helper/workflow.rb +2 -14
  24. data/lib/cortex_reaver/layout/blank.rhtml +27 -31
  25. data/lib/cortex_reaver/layout/text.rhtml +54 -67
  26. data/lib/cortex_reaver/migrations/014_convert_projects_to_pages.rb +79 -0
  27. data/lib/cortex_reaver/model/comment.rb +7 -8
  28. data/lib/cortex_reaver/model/page.rb +5 -3
  29. data/lib/cortex_reaver/model/photograph.rb +57 -13
  30. data/lib/cortex_reaver/model/tag.rb +1 -4
  31. data/lib/cortex_reaver/model/user.rb +6 -3
  32. data/lib/cortex_reaver/plugin.rb +1 -1
  33. data/lib/cortex_reaver/plugins/twitter.rb +185 -0
  34. data/lib/cortex_reaver/public/css/actions.css +31 -0
  35. data/lib/cortex_reaver/public/css/admin.css +50 -27
  36. data/lib/cortex_reaver/public/css/attachments.css +11 -0
  37. data/lib/cortex_reaver/public/css/autotags.css +38 -0
  38. data/lib/cortex_reaver/public/css/code.css +10 -2
  39. data/lib/cortex_reaver/public/css/colophon.css +10 -0
  40. data/lib/cortex_reaver/public/css/commments.css +7 -0
  41. data/lib/cortex_reaver/public/css/custom.css +1 -0
  42. data/lib/cortex_reaver/public/css/flash.css +17 -0
  43. data/lib/cortex_reaver/public/css/fonts.css +22 -0
  44. data/lib/cortex_reaver/public/css/form.css +15 -3
  45. data/lib/cortex_reaver/public/css/generics.css +39 -0
  46. data/lib/cortex_reaver/public/css/icons.css +4 -0
  47. data/lib/cortex_reaver/public/css/journals.css +3 -0
  48. data/lib/cortex_reaver/public/css/main.css +30 -312
  49. data/lib/cortex_reaver/public/css/pagination.css +50 -0
  50. data/lib/cortex_reaver/public/css/photo-show.css +87 -0
  51. data/lib/cortex_reaver/public/css/photo.css +28 -97
  52. data/lib/cortex_reaver/public/css/progress.css +35 -0
  53. data/lib/cortex_reaver/public/css/sidebar.css +83 -0
  54. data/lib/cortex_reaver/public/css/table-of-contents.css +26 -0
  55. data/lib/cortex_reaver/public/css/table.css +3 -0
  56. data/lib/cortex_reaver/public/css/tags.css +29 -0
  57. data/lib/cortex_reaver/public/css/text.css +19 -1
  58. data/lib/cortex_reaver/public/css/top_actions.css +50 -0
  59. data/lib/cortex_reaver/public/css/users.css +3 -0
  60. data/lib/cortex_reaver/public/images/admin/icons.png +0 -0
  61. data/lib/cortex_reaver/public/images/admin/icons.xcf +0 -0
  62. data/lib/cortex_reaver/public/images/background_tile.png +0 -0
  63. data/lib/cortex_reaver/public/images/edit_34.png +0 -0
  64. data/lib/cortex_reaver/public/images/edit_34_prelight.png +0 -0
  65. data/lib/cortex_reaver/public/images/elided.png +0 -0
  66. data/lib/cortex_reaver/public/images/grid_34.png +0 -0
  67. data/lib/cortex_reaver/public/images/grid_34_prelight.png +0 -0
  68. data/lib/cortex_reaver/public/images/next_11.png +0 -0
  69. data/lib/cortex_reaver/public/images/next_34.png +0 -0
  70. data/lib/cortex_reaver/public/images/next_34_prelight.png +0 -0
  71. data/lib/cortex_reaver/public/images/prev_11.png +0 -0
  72. data/lib/cortex_reaver/public/images/prev_34.png +0 -0
  73. data/lib/cortex_reaver/public/images/prev_34_prelight.png +0 -0
  74. data/lib/cortex_reaver/public/js/admin.js +15 -22
  75. data/lib/cortex_reaver/public/js/autotags.js +120 -0
  76. data/lib/cortex_reaver/public/js/jquery.autocomplete.js +135 -176
  77. data/lib/cortex_reaver/public/js/jquery.color.js +124 -0
  78. data/lib/cortex_reaver/public/js/jquery.corners.min.js +7 -0
  79. data/lib/cortex_reaver/public/js/jquery.hotkeys-0.7.9.js +244 -0
  80. data/lib/cortex_reaver/public/js/jquery.js +4361 -4
  81. data/lib/cortex_reaver/public/js/jquery.periodicalupdater.js +98 -0
  82. data/lib/cortex_reaver/public/js/photo.js +3 -32
  83. data/lib/cortex_reaver/public/robots.txt +3 -0
  84. data/lib/cortex_reaver/snippets/ramaze/cache/memcached.rb +13 -10
  85. data/lib/cortex_reaver/snippets/range.rb +9 -0
  86. data/lib/cortex_reaver/support/attachments.rb +12 -0
  87. data/lib/cortex_reaver/support/comments.rb +1 -3
  88. data/lib/cortex_reaver/support/renderer.rb +20 -17
  89. data/lib/cortex_reaver/support/sequenceable.rb +6 -6
  90. data/lib/cortex_reaver/support/tags.rb +15 -7
  91. data/lib/cortex_reaver/version.rb +1 -1
  92. data/lib/cortex_reaver/view/admin/configuration.rhtml +7 -0
  93. data/lib/cortex_reaver/view/admin/index.rhtml +3 -0
  94. data/lib/cortex_reaver/view/admin/regenerate_photo_sizes.rhtml +16 -0
  95. data/lib/cortex_reaver/view/adminbox.rhtml +34 -44
  96. data/lib/cortex_reaver/view/comments/comment.rhtml +1 -1
  97. data/lib/cortex_reaver/view/comments/form.rhtml +1 -2
  98. data/lib/cortex_reaver/view/comments/post_form.rhtml +2 -10
  99. data/lib/cortex_reaver/view/head.rhtml +11 -0
  100. data/lib/cortex_reaver/view/journals/journal.rhtml +3 -3
  101. data/lib/cortex_reaver/view/journals/show.rhtml +0 -4
  102. data/lib/cortex_reaver/view/js.rhtml +1 -0
  103. data/lib/cortex_reaver/view/pages/list.rhtml +3 -23
  104. data/lib/cortex_reaver/view/pages/row.rhtml +13 -0
  105. data/lib/cortex_reaver/view/photographs/grid.rhtml +30 -36
  106. data/lib/cortex_reaver/view/photographs/show.rhtml +42 -108
  107. data/lib/cortex_reaver/view/sidebar/explore_photos.rhtml +7 -0
  108. data/lib/cortex_reaver/view/sidebar/photographs.rhtml +15 -0
  109. data/lib/cortex_reaver/view/sidebar/sections.rhtml +4 -0
  110. data/lib/cortex_reaver/view/sidebar/twitter.rhtml +12 -0
  111. data/lib/cortex_reaver/view/tags/show.rhtml +0 -10
  112. data/lib/cortex_reaver/view/tracker.rhtml +0 -0
  113. data/lib/cortex_reaver/view/users/list.rhtml +1 -7
  114. data/lib/cortex_reaver/view/users/login.rhtml +1 -1
  115. metadata +103 -43
  116. data/lib/cortex_reaver/controller/project.rb +0 -53
  117. data/lib/cortex_reaver/helper/template.rb +0 -37
  118. data/lib/cortex_reaver/model/project.rb +0 -57
  119. data/lib/cortex_reaver/public/css/ramaze_error.css +0 -90
  120. data/lib/cortex_reaver/public/images/atom-xml-icon.png +0 -0
  121. data/lib/cortex_reaver/public/images/body.png +0 -0
  122. data/lib/cortex_reaver/public/images/border_bottom.png +0 -0
  123. data/lib/cortex_reaver/public/images/border_bottom_left.png +0 -0
  124. data/lib/cortex_reaver/public/images/border_bottom_right.png +0 -0
  125. data/lib/cortex_reaver/public/images/border_left.png +0 -0
  126. data/lib/cortex_reaver/public/images/border_right.png +0 -0
  127. data/lib/cortex_reaver/public/images/border_top.png +0 -0
  128. data/lib/cortex_reaver/public/images/border_top_left.png +0 -0
  129. data/lib/cortex_reaver/public/images/border_top_right.png +0 -0
  130. data/lib/cortex_reaver/public/images/header.png +0 -0
  131. data/lib/cortex_reaver/public/images/header.xcf +0 -0
  132. data/lib/cortex_reaver/public/images/indicator.gif +0 -0
  133. data/lib/cortex_reaver/public/images/rss-xml-icon.png +0 -0
  134. data/lib/cortex_reaver/public/images/sections.png +0 -0
  135. data/lib/cortex_reaver/public/images/sections_highlight.png +0 -0
  136. data/lib/cortex_reaver/public/js/jquery.autocompletefb.js +0 -125
  137. data/lib/cortex_reaver/view/photographs/sidebar.rhtml +0 -7
  138. data/lib/cortex_reaver/view/projects/form.rhtml +0 -14
  139. data/lib/cortex_reaver/view/projects/list.rhtml +0 -31
  140. data/lib/cortex_reaver/view/projects/show.rhtml +0 -42
  141. data/lib/proto/cortex_reaver.yaml +0 -47
@@ -8,7 +8,10 @@ module Ramaze
8
8
  unless model.errors.empty?
9
9
  s = "<div class=\"form-errors\">\n<h3>Errors</h3>\n<ul>\n"
10
10
  model.errors.each do |attribute, error|
11
- s << "<li>#{attribute} #{error}</li>\n"
11
+ if error.kind_of? Array
12
+ error = error.join(', ')
13
+ end
14
+ s << "<li>#{attribute.to_s.titleize} #{error}.</li>\n"
12
15
  end
13
16
  s << "</ul></div>"
14
17
  end
@@ -25,17 +28,11 @@ module Ramaze
25
28
 
26
29
  f = ''
27
30
 
28
- unless model.errors.empty?
29
- f << "<div class=\"form-errors\">\n"
30
- f << "<ul>\n"
31
- model.errors.each do |attribute, error|
32
- f << "<li>#{attribute} #{error}\n</li>"
33
- end
34
- f << "</ul>\n"
35
- f << "</div>\n"
31
+ if model
32
+ f << errors_on(model)
36
33
  end
37
34
 
38
- f = "<form action=\"#{action}\" method=\"post\" class=\"edit-form\">"
35
+ f << "<form action=\"#{action}\" method=\"post\" class=\"edit-form\">"
39
36
 
40
37
  fields.each do |field|
41
38
  case field
@@ -58,7 +55,7 @@ module Ramaze
58
55
  # :default => The default value for the field (inferred from model and id)
59
56
  # :p_class => Class attached to the paragraph
60
57
  def form_p(id, params = {})
61
- type = params[:type]
58
+ type = params[:type].to_s
62
59
  p_class = params[:p_class]
63
60
  description = params[:description] || id.to_s.titleize
64
61
  model = params[:model]
@@ -79,14 +76,13 @@ module Ramaze
79
76
  end
80
77
 
81
78
  f = "<p #{p_class.nil? ? '' : 'class="' + attr_h(p_class) + '"'}>"
82
- unless type == 'checkbox' or type == 'hidden'
79
+ if type == 'checkbox' or type == 'hidden'
80
+ elsif type == 'textarea'
81
+ f << "<label class=\"textarea\" for=\"#{id}\">#{description}</label><br />"
82
+ else
83
83
  f << "<label for=\"#{id}\">#{description}</label>"
84
84
  end
85
85
 
86
- if type == 'textarea'
87
- f << '<br />'
88
- end
89
-
90
86
  case type
91
87
  when 'textarea'
92
88
  f << "<textarea name=\"#{id}\" id=\"#{id}\">#{Rack::Utils::escape_html default}</textarea>"
@@ -39,17 +39,32 @@ module Ramaze
39
39
  s << '</span>'
40
40
  end
41
41
 
42
- # Returns a div with next/up/previous links for the record.
42
+ # Returns a full URL from a relative one.
43
+ def full_url(relative)
44
+ "#{CortexReaver.config.site.url.chomp('/')}#{relative}"
45
+ end
46
+
47
+ # Returns a list with next/up/previous links for the record.
43
48
  def model_nav(model)
44
- n = '<div class="navigation actions">'
49
+ if not model.respond_to? :next
50
+ # Not applicable
51
+ return
52
+ elsif CortexReaver::User === model or CortexReaver::Page === model
53
+ return
54
+ end
55
+
56
+ n = '<ul class="' + model.class.to_s.underscore + ' navigation actions">'
45
57
  if model.previous
46
- n << ' <a class="previous" href="' + model.previous.url + '">&laquo; Previous ' + model.class.to_s.demodulize + '</a>'
58
+ n << ' <li><a class="previous" href="' + model.previous.url + '">&laquo; Previous ' + model.class.to_s.demodulize + '</a></li>'
59
+ end
60
+ n << ' <li><a class="up" href="' + model.absolute_window_url + '">Back to ' + model.class.to_s.demodulize.pluralize + '</a></li>'
61
+ if user.can_edit? model
62
+ n << ' <li><a class="edit" href="' + r(:edit, model.id).to_s + '">Edit</a></li>'
47
63
  end
48
- n << ' <a class="up" href="' + model.absolute_window_url + '">Back to ' + model.class.to_s.demodulize.pluralize + '</a>'
49
64
  if model.next
50
- n << ' <a class="next" href="' + model.next.url + '">Next ' + model.class.to_s.demodulize + ' &raquo;</a>'
65
+ n << ' <li><a class="next" href="' + model.next.url + '">Next ' + model.class.to_s.demodulize + ' &raquo;</a></li>'
51
66
  end
52
- n << '</div>'
67
+ n << '</ul>'
53
68
  end
54
69
 
55
70
  # Generate pagination links from a Sequenceable class and index.
@@ -104,12 +119,14 @@ module Ramaze
104
119
  pages = [0] + (first_page..last_page).to_a + [window_count - 1]
105
120
  else
106
121
  # The window encompasses the entire set of pages
107
- pages = (0 .. window_count - 1).to_a
122
+ pages = (0 ... window_count).to_a
108
123
  end
109
124
 
110
125
  if page > 0
111
126
  # Add "previous page" link.
112
- links << "<li><a href=\"#{klass.url}/page/#{page - 1}\">&laquo; Previous</a></li>"
127
+ links << "<li><a class=\"previous\" href=\"#{klass.url}/page/#{page - 1}\">&laquo; Previous</a></li>"
128
+ else
129
+ links << "<li class=\"placeholder\"><span class=\"previous\"></span></li>"
113
130
  end
114
131
 
115
132
  # Convert pages to links
@@ -117,12 +134,12 @@ module Ramaze
117
134
  pages.inject(pages.first - 1) do |previous, i|
118
135
  if (i - previous) > 1
119
136
  # These pages are not side-by-side.
120
- links << '<li>&hellip;</li>'
137
+ links << '<li class="elided"><span>&hellip;</span></li>'
121
138
  end
122
139
 
123
140
  if i == page
124
141
  # This is a link to the current page.
125
- links << "<li class=\"current\">#{i + 1}</li>"
142
+ links << "<li class=\"current\"><span>#{i + 1}</span></li>"
126
143
  else
127
144
  # This is a link to a different page.
128
145
  links << "<li><a href=\"#{klass.url}/page/#{i}\">#{i + 1}</a></li>"
@@ -135,7 +152,9 @@ module Ramaze
135
152
 
136
153
  if page < klass.window_count - 1
137
154
  # Add "next page" link.
138
- links << "<li><a href=\"#{klass.url}/page/#{page + 1}\">Next &raquo;</a></li>"
155
+ links << "<li><a class=\"next\" href=\"#{klass.url}/page/#{page + 1}\">Next &raquo;</a></li>"
156
+ else
157
+ links << "<li class=\"placeholder\"><span class=\"next\"></span></li>"
139
158
  end
140
159
 
141
160
  links << '</ol>'
@@ -143,14 +162,14 @@ module Ramaze
143
162
 
144
163
  # Produces a section navigation list from an array of titles to urls.
145
164
  def section_nav(sections)
146
- s = "<ul>\n"
165
+ s = "<ul class=\"actions\">\n"
147
166
  sections.each do |section|
148
167
  title = section.first
149
- url = section.last
168
+ url = section.last.to_s
150
169
  klass = url.gsub(/\//, '').gsub(/_/, '-')
151
- s << '<li><a class="' + klass
152
- s << ' selected' if request.request_uri == url
153
- s << '" href="' + attr_h(url) + '">'
170
+ s << '<li class="' + klass
171
+ s << ' current' if request.request_uri[url]
172
+ s << '"><a href="' + attr_h(url) + '">'
154
173
  s << title
155
174
  s << "</a></li>\n"
156
175
  end
@@ -24,9 +24,9 @@ module Ramaze
24
24
  # 1/60 => '1/60th'
25
25
  def neat_time(rational)
26
26
  if rational.denominator == 1
27
- rational.numerator.ordinal.to_s
27
+ rational.numerator.to_s + ' seconds'
28
28
  else
29
- "#{rational.numerator}/#{rational.denominator.ordinal.to_s}"
29
+ "#{rational.numerator}/#{rational.denominator.ordinal.to_s} of a second"
30
30
  end
31
31
  end
32
32
  end
@@ -0,0 +1,44 @@
1
+ module Ramaze
2
+ module Helper
3
+ # Provides programmatic sidebar boxes
4
+ module Sidebar
5
+ # Renders the sidebar
6
+ def sidebar
7
+ sidebar = ''
8
+ CortexReaver.config.view.sidebar.each do |path, view|
9
+ if path_matches? path
10
+ sidebar << CortexReaver::MainController.render_view('sidebar/' + view)
11
+ end
12
+ end
13
+ sidebar
14
+ end
15
+
16
+ # True if the given glob matches our request path.
17
+ def path_matches?(path)
18
+ case path
19
+ when String
20
+ # Convert string to regex.
21
+ pattern = path.gsub(/\*(\*)?/) do |match|
22
+ if match[1]
23
+ '.*'
24
+ else
25
+ '[^\/]*'
26
+ end
27
+ end
28
+
29
+ if Regexp.new("^#{pattern}$").match request.path_info
30
+ true
31
+ else
32
+ false
33
+ end
34
+ when Regexp
35
+ if path.match request.path_info
36
+ true
37
+ else
38
+ false
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,23 +1,41 @@
1
1
  module Ramaze
2
2
  module Helper
3
3
  module Tags
4
+ Helper::LOOKUP << self
5
+
6
+ # Finds models with a given tag.
7
+ def tagged(tags)
8
+ tags = tags.split(',').map! do |tag|
9
+ CortexReaver::Tag.get(tag.gsub(/[^-_\w]+/, '').strip)
10
+ end
11
+
12
+ @title = "#{model_class.to_s.demodulize.pluralize.titleize}: #{tags.join(', ')}"
13
+ @models = model_class.tagged_with(tags)
14
+ set_plural_model_var @models
15
+
16
+ if user.can_create? model_class.new
17
+ workflow "New #{model_class.to_s.demodulize}", rs(:new)
18
+ end
19
+
20
+ render_view(:list)
21
+ end
22
+
23
+ private
4
24
  # Adds an AJAX-ified tag editor for a model.
5
25
  def live_tags_field(model, opts={:name => 'tags'})
6
26
  name = opts[:name]
7
27
  title = opts[:title] || name.to_s.titleize
8
28
 
9
29
  s = "<p><label for=\"#{name}\">#{title}</label>\n"
10
- s << "<ul id=\"#{name}-holder\" class=\"acfb-holder\">\n"
11
- s << "<input name=\"#{name}\" id=\"#{name}\" type=\"text\" class=\"acfb-input\" value=\"#{attr_h(tags_on(model, false))}\" />"
12
- s << "</ul></p>"
30
+ s << "<input name=\"#{name}\" id=\"#{name}\" type=\"text\" value=\"#{attr_h(tags_on(model, false))}\" />"
31
+ s << "</p>"
13
32
 
14
33
  s << <<EOF
15
34
  <script type="text/javascript">
16
35
  /* <![CDATA[ */
17
36
  $(document).ready(function() {
18
- $("##{name}-holder").autoCompletefb({
19
- urlLookup:'/tags/autocomplete',
20
- acOptions:{extraParams:{id:'title'}}
37
+ $("##{name}").autotags({
38
+ url: "#{CortexReaver::TagController.r(:autocomplete)}"
21
39
  });
22
40
  });
23
41
  /* ]]> */
@@ -25,16 +43,21 @@ module Ramaze
25
43
  EOF
26
44
  end
27
45
 
28
- # Returns an html list of tags on a model that supports #tags.
29
- def tags_on(model, html=true)
46
+ # Returns a list of tags on a model that supports #tags.
47
+ def tags_on(model, format = :html)
30
48
  begin
31
- if html
49
+ case format
50
+ when :html
32
51
  #t = '<img src="/images/tag.gif" alt="Tags" />'
33
52
  t = '<ul class="tags">'
34
53
  model.tags.each do |tag|
35
54
  t << "<li><a href=\"#{tag.url}\">#{tag.title}</a></li>"
36
55
  end
37
56
  t << '</ul>'
57
+ when :json
58
+ model.tags.map { |t|
59
+ {:id => t.name, :name => t.title}
60
+ }.to_json
38
61
  else
39
62
  t = model.tags.map{ |t| t.title }.join(', ')
40
63
  end
@@ -6,21 +6,9 @@ module Ramaze
6
6
  @workflows
7
7
  end
8
8
 
9
- def workflow(name, href)
9
+ def workflow(name, href, *classes)
10
10
  @workflows ||= []
11
- @workflows << [name, href]
12
- end
13
-
14
- def workflowbox
15
- if @workflows
16
- b = '<div class="workflows">'
17
- b << ' <ul>'
18
- @workflows.each do |name, href|
19
- b << " <li><a href=\"#{href}\">#{name}</a></li>"
20
- end
21
- b << ' </ul>'
22
- b << '</div>'
23
- end
11
+ @workflows << [name, href, classes]
24
12
  end
25
13
  end
26
14
  end
@@ -3,45 +3,41 @@
3
3
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
4
  <html xmlns="http://www.w3.org/1999/xhtml">
5
5
  <head>
6
- <title><%=h (@title || CortexReaver.config[:site][:name]) %></title>
7
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
8
- <meta http-equiv="Content-Style-Type" content="text/css" />
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <meta http-equiv="expires" content="0" />
11
- <meta name="description" content="<%=attr_h CortexReaver.config[:site][:description] %>" />
12
- <meta name="generator" content="Cortex Reaver <%= CortexReaver::APP_VERSION %>" />
13
- <meta name="keywords" content="<%= attr_h CortexReaver.config[:site][:keywords] %>" />
14
- <meta name="author" content="<%= attr_h CortexReaver.config[:site][:author] %>" />
15
- <meta name="date" content="<%= Time.now.iso8601 %>" />
16
- <link rel="stylesheet" type="text/css" href="/css/main.css" />
17
- <link rel="stylesheet" type="text/css" href="/css/admin.css" />
18
- <link rel="stylesheet" type="text/css" href="/css/photo.css" />
19
- <link rel="stylesheet" type="text/css" href="/css/text.css" />
20
- <link rel="stylesheet" type="text/css" href="/css/form.css" />
21
- <link rel="stylesheet" type="text/css" href="/css/code.css" />
22
- <link rel="stylesheet" type="text/css" href="/css/custom.css" />
23
6
  <% if defined? feeds %>
24
7
  <% feeds.each do |title, feed| %>
25
8
  <link rel="alternate" type="application/atom+xml" href="<%= attr_h feed %>" title="<%= attr_h title %>" />
26
9
  <% end %>
27
10
  <% end %>
11
+
12
+ <%= CortexReaver::MainController.render_view('head') %>
28
13
  </head>
29
- <body class="blank">
30
- <script type="text/javascript" src="/js/jquery.js"></script>
31
- <script type="text/javascript" defer="defer" src="/js/cookie.js"></script>
32
- <script type="text/javascript" defer="defer" src="/js/admin.js"></script>
33
- <script type="text/javascript" src="/js/photo.js"></script>
34
-
14
+ <body class="blank <%= @body_class %>">
15
+ <%= CortexReaver::MainController.render_view('js') %>
16
+
35
17
  <%= CortexReaver::MainController.render_view('adminbox') %>
36
18
 
37
- <%= flashbox %>
38
-
39
- <div id="content">
40
- <%= @content %>
41
- </div>
19
+ <%= @content %>
20
+
21
+ <%= CortexReaver::MainController.render_view('tracker') %>
22
+
23
+ <script type="text/javascript">
24
+ /* <![CDATA[ */
25
+ $(document).ready(function() {
26
+ $('#main').corners('10px');
42
27
 
43
- <div id="colophon">
44
- Copyright &copy; 2001&mdash;<%= Time.now.strftime('%Y') %> Aphyr
45
- </div>
28
+ $('.pagination').each(function() {
29
+ $(this).find('li:not(.placeholder):first').corners("left");
30
+ $(this).find('li:not(.placeholder):last').corners("right");
31
+ });
32
+ $('.pagination li').not('.elided').add('.actions > li').not('.current').not('.placeholder').each(function(i) {
33
+ $(this).fadeTo(0,0.8);
34
+ $(this).hover(
35
+ function() { $(this).fadeTo(0,1) },
36
+ function() { $(this).fadeTo(200,0.8) }
37
+ );
38
+ });
39
+ });
40
+ /* ]]> */
41
+ </script>
46
42
  </body>
47
43
  </html>
@@ -3,83 +3,70 @@
3
3
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
4
  <html xmlns="http://www.w3.org/1999/xhtml">
5
5
  <head>
6
- <title><%=h (@title || CortexReaver.config[:site][:name]) %></title>
7
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
8
- <meta http-equiv="Content-Style-Type" content="text/css" />
9
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
- <meta http-equiv="expires" content="0" />
11
- <meta name="description" content="<%= attr_h CortexReaver.config[:site][:description] %>" />
12
- <meta name="generator" content="Cortex Reaver <%= CortexReaver::APP_VERSION %>" />
13
- <meta name="keywords" content="<%= attr_h CortexReaver.config[:site][:keywords] %>" />
14
- <meta name="author" content="<%= attr_h CortexReaver.config[:site][:author] %>" />
15
- <meta name="date" content="<%= Time.now.iso8601 %>" />
16
- <link rel="stylesheet" type="text/css" href="/css/main.css" />
17
- <link rel="stylesheet" type="text/css" href="/css/admin.css" />
18
- <link rel="stylesheet" type="text/css" href="/css/photo.css" />
19
- <link rel="stylesheet" type="text/css" href="/css/text.css" />
20
- <link rel="stylesheet" type="text/css" href="/css/form.css" />
21
- <link rel="stylesheet" type="text/css" href="/css/code.css" />
22
- <link rel="stylesheet" type="text/css" href="/css/custom.css" />
23
- <% if @feeds %>
24
- <% @feeds.each do |title, feed| %>
6
+ <% if defined? feeds %>
7
+ <% feeds.each do |title, feed| %>
25
8
  <link rel="alternate" type="application/atom+xml" href="<%= attr_h feed %>" title="<%= attr_h title %>" />
26
9
  <% end %>
27
10
  <% end %>
11
+
12
+ <%= CortexReaver::MainController.render_view('head') %>
28
13
  </head>
29
- <body>
30
- <script type="text/javascript" src="/js/jquery.js"></script>
31
- <script type="text/javascript" defer="defer" src="/js/cookie.js"></script>
32
- <script type="text/javascript" defer="defer" src="/js/admin.js"></script>
33
- <% if user.admin? or user.contributor? or user.editor? or user.moderator? %>
34
- <script type="text/javascript" defer="defer" src="/js/jquery.autocomplete.js"></script>
35
- <script type="text/javascript" defer="defer" src="/js/jquery.bgiframe.min.js"></script>
36
- <script type="text/javascript" defer="defer" src="/js/jquery.dimensions.js"></script>
37
- <script type="text/javascript" defer="defer" src="/js/jquery.autocompletefb.js"></script>
38
- <% end %>
39
-
40
- <div id="top">
41
- <a href="/">
42
- <img id="header" src="/images/header.png" alt="<%= attr_h CortexReaver.config[:site][:name] %>" />
43
- </a>
44
- </div>
14
+ <body class="<%= @body_class %>">
15
+ <%= CortexReaver::MainController.render_view('js') %>
45
16
 
46
- <div id="sections">
47
- <%= section_nav([
48
- ['Journals', '/journals'],
49
- ['Photographs', '/photographs'],
50
- ['Projects', '/projects'],
51
- ['Tags', '/tags'],
52
- ['Comments', '/comments'],
53
- ['About', '/about']
54
- ]) %>
55
- </div>
17
+ <%= CortexReaver::MainController.render_view('adminbox') %>
56
18
 
57
- <div id="middle">
58
- <table id="columns">
59
- <tbody>
60
- <tr>
61
- <td id="main">
62
- <%= CortexReaver::MainController.render_view('adminbox') %>
19
+ <div id="content">
20
+ <div id="top">
21
+ <% if @model %>
22
+ <%= model_nav @model %>
23
+ <% end %>
24
+ <h1><a href="/"><%=h CortexReaver.config.site.name %></a></h1>
25
+ </div>
63
26
 
64
- <%= flashbox %>
27
+ <div id="boxes">
28
+ <%= sidebar %>
29
+ </div>
65
30
 
66
- <div id="content">
67
- <%= @content %>
68
- </div>
69
- </td>
31
+ <div id="main-container">
32
+ <div id="main">
33
+ <%= flashbox %>
70
34
 
71
- <% if @sidebar %>
72
- <td id="sidebar">
73
- <%= @sidebar %>
74
- </td>
75
- <% end %>
76
- </tr>
77
- </tbody>
78
- </table>
79
- </div>
35
+ <%= @content %>
36
+ </div>
80
37
 
81
- <div id="colophon">
82
- Copyright &copy; 2001&mdash;<%= Time.now.strftime('%Y') %> <%=h CortexReaver.config[:site][:author] %>
38
+ <div id="colophon">
39
+ Copyright &copy; <% if @model %>
40
+ <%= @model.updated_on.year %>
41
+ <%= user_link @model %>
42
+ <% else %>
43
+ <%= CortexReaver.content_range.begin.year %>&mdash;<%= CortexReaver.content_range.end.year %>
44
+ <%=h CortexReaver.config.site.author %>
45
+ <% end %>
46
+ </div>
47
+ </div>
83
48
  </div>
49
+
50
+ <%= CortexReaver::MainController.render_view('tracker') %>
51
+
52
+ <script type="text/javascript">
53
+ /* <![CDATA[ */
54
+ $(document).ready(function() {
55
+ $('#main').corners('10px');
56
+
57
+ $('.pagination').each(function() {
58
+ $(this).find('li:not(.placeholder):first').corners("left");
59
+ $(this).find('li:not(.placeholder):last').corners("right");
60
+ });
61
+ $('.pagination li').add('.actions > li').not('.elided').not('.current').not('.placeholder').each(function(i) {
62
+ $(this).fadeTo(0,0.8);
63
+ $(this).hover(
64
+ function() { $(this).fadeTo(0,1) },
65
+ function() { $(this).fadeTo(200,0.8) }
66
+ );
67
+ });
68
+ });
69
+ /* ]]> */
70
+ </script>
84
71
  </body>
85
72
  </html>