zena 0.15.2 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. data/.gitignore +20 -0
  2. data/CREDITS +27 -0
  3. data/Capfile +3 -0
  4. data/DEVELOPERS +46 -0
  5. data/History.txt +15 -0
  6. data/MIT-LICENSE +19 -0
  7. data/Rakefile +44 -0
  8. data/TODO +24 -0
  9. data/TODO_ZENA_1_0 +23 -0
  10. data/app/controllers/application_controller.rb +3 -0
  11. data/app/controllers/documents_controller.rb +22 -56
  12. data/app/controllers/nodes_controller.rb +42 -27
  13. data/app/controllers/pings_controller.rb +19 -0
  14. data/app/controllers/relations_controller.rb +5 -1
  15. data/app/controllers/sites_controller.rb +1 -46
  16. data/app/controllers/user_sessions_controller.rb +47 -0
  17. data/app/controllers/users_controller.rb +1 -0
  18. data/app/controllers/versions_controller.rb +25 -7
  19. data/app/controllers/virtual_classes_controller.rb +1 -1
  20. data/app/helpers/application_helper.rb +1 -1
  21. data/app/models/comment.rb +2 -1
  22. data/app/models/contact_content.rb +2 -2
  23. data/app/models/data_entry.rb +5 -6
  24. data/app/models/document.rb +14 -10
  25. data/app/models/document_content.rb +4 -6
  26. data/app/models/iformat.rb +2 -2
  27. data/app/models/image_content.rb +6 -9
  28. data/app/models/node.rb +106 -164
  29. data/app/models/page.rb +0 -20
  30. data/app/models/site.rb +42 -12
  31. data/app/models/template.rb +3 -8
  32. data/app/models/template_content.rb +2 -0
  33. data/app/models/text_document.rb +13 -8
  34. data/app/models/user.rb +47 -100
  35. data/app/models/user_session.rb +4 -0
  36. data/app/models/version.rb +1 -1
  37. data/app/views/comments/create.rjs +3 -3
  38. data/app/views/comments/edit.rjs +1 -1
  39. data/app/views/comments/update.rjs +1 -1
  40. data/app/views/nodes/_import_results.rhtml +1 -1
  41. data/app/views/nodes/create.rjs +3 -3
  42. data/app/views/templates/document_create_tabs/_file.rhtml +1 -2
  43. data/app/views/templates/document_create_tabs/_import.rhtml +7 -2
  44. data/app/views/templates/edit_tabs/_document.rhtml +1 -3
  45. data/app/views/templates/edit_tabs/_image.rhtml +1 -3
  46. data/app/views/versions/_tr.rhtml +1 -1
  47. data/app/views/versions/edit.rhtml +2 -26
  48. data/bin/zena +6 -1
  49. data/bricks/delayed_job/README +18 -0
  50. data/bricks/delayed_job/migrate/20091104191643_create_delayed_jobs_table.rb +19 -0
  51. data/bricks/delayed_job/misc/init.rb +8 -0
  52. data/bricks/delayed_job/misc/tasks.rb +2 -0
  53. data/bricks/math/patch/application_helper.rb +1 -1
  54. data/bricks/sphinx/MIT-LICENSE +19 -0
  55. data/bricks/sphinx/README +19 -0
  56. data/bricks/sphinx/lib/use_sphinx.rb +78 -0
  57. data/bricks/sphinx/migrate/20091102171258_add_delta_for_sphinx.rb +9 -0
  58. data/bricks/sphinx/misc/deploy.rb +20 -0
  59. data/bricks/sphinx/misc/sphinx.yml +12 -0
  60. data/bricks/sphinx/misc/tasks.rb +21 -0
  61. data/bricks/sphinx/patch/node.rb +8 -0
  62. data/bricks/tags/lib/has_tags.rb +5 -3
  63. data/bricks/tags/test/zafu/tags.yml +13 -1
  64. data/config/bricks.yml +35 -0
  65. data/config/deploy.rb +8 -1
  66. data/config/environment.rb +1 -1
  67. data/config/environments/production.rb +1 -1
  68. data/config/gems.yml +28 -5
  69. data/config/sphinx.yml +12 -0
  70. data/db/init/base/skins/default/Node-+popupLayout.zafu +1 -16
  71. data/db/migrate/20091026161708_add_persistence_token.rb +13 -0
  72. data/db/migrate/20091101184952_add_session_table.rb +16 -0
  73. data/db/migrate/20091123175137_add_single_access_token.rb +9 -0
  74. data/db/migrate/20091124161608_rebuild_fullpath.rb +11 -0
  75. data/db/schema.rb +21 -8
  76. data/doc/README_FOR_APP +24 -0
  77. data/doc/fixtures.graffle +19568 -0
  78. data/doc/fixtures.pdf +0 -0
  79. data/doc/template/LICENSE +184 -0
  80. data/doc/template/README +37 -0
  81. data/doc/template/allison.css +283 -0
  82. data/doc/template/allison.js +307 -0
  83. data/doc/template/allison.rb +260 -0
  84. data/doc/template/cache/BODY +588 -0
  85. data/doc/template/cache/CLASS_INDEX +4 -0
  86. data/doc/template/cache/CLASS_PAGE +1 -0
  87. data/doc/template/cache/FILE_INDEX +4 -0
  88. data/doc/template/cache/FILE_PAGE +1 -0
  89. data/doc/template/cache/FONTS +1 -0
  90. data/doc/template/cache/FR_INDEX_BODY +1 -0
  91. data/doc/template/cache/IMGPATH +1 -0
  92. data/doc/template/cache/INDEX +1 -0
  93. data/doc/template/cache/JAVASCRIPT +307 -0
  94. data/doc/template/cache/METHOD_INDEX +4 -0
  95. data/doc/template/cache/METHOD_LIST +1 -0
  96. data/doc/template/cache/SRC_PAGE +1 -0
  97. data/doc/template/cache/STYLE +283 -0
  98. data/doc/template/cache/URL +1 -0
  99. data/doc/zafu_changes.yml +29 -0
  100. data/lib/base_additions.rb +1 -1
  101. data/lib/bricks.rb +9 -0
  102. data/lib/bricks/loader.rb +86 -0
  103. data/lib/bricks/requirements_validation.rb +71 -0
  104. data/lib/tasks/zena.rake +42 -4
  105. data/lib/zafu/action.rb +285 -0
  106. data/lib/zafu/ajax.rb +93 -0
  107. data/lib/zafu/attributes.rb +117 -0
  108. data/lib/zafu/calendar.rb +159 -0
  109. data/lib/zafu/context.rb +330 -0
  110. data/lib/zafu/core/html.rb +102 -0
  111. data/lib/zafu/core/move_to_parser.rb +167 -0
  112. data/lib/zafu/dates.rb +58 -0
  113. data/lib/zafu/display.rb +502 -0
  114. data/lib/zafu/eval.rb +66 -0
  115. data/lib/zafu/experimental.rb +66 -0
  116. data/lib/zafu/i18n.rb +64 -0
  117. data/lib/zafu/meta.rb +25 -0
  118. data/lib/zafu/refactor.rb +73 -0
  119. data/lib/zafu/support/context.rb +265 -0
  120. data/lib/zafu/support/dom.rb +145 -0
  121. data/lib/zafu/support/erb.rb +62 -0
  122. data/lib/zafu/support/flow.rb +401 -0
  123. data/lib/zafu/support/forms.rb +461 -0
  124. data/lib/zafu/support/links.rb +306 -0
  125. data/lib/zafu_parser.rb +26 -2
  126. data/lib/zena.rb +34 -15
  127. data/lib/zena/acts/multiversion.rb +2 -2
  128. data/lib/zena/acts/secure.rb +41 -30
  129. data/lib/zena/app.rb +7 -10
  130. data/lib/zena/controller/test_case.rb +12 -7
  131. data/lib/zena/crypto_provider/initial.rb +15 -0
  132. data/lib/zena/db.rb +6 -1
  133. data/lib/zena/deploy.rb +34 -6
  134. data/lib/zena/deploy/logrotate_app.rhtml +9 -0
  135. data/lib/zena/deploy/logrotate_host.rhtml +34 -0
  136. data/lib/zena/deploy/template.rb +1 -9
  137. data/lib/zena/foxy_parser.rb +1 -1
  138. data/lib/zena/info.rb +3 -1
  139. data/lib/zena/migrator.rb +1 -1
  140. data/lib/zena/parser.rb +12 -4
  141. data/lib/zena/parser/zazen_rules.rb +6 -6
  142. data/lib/zena/parser/zena_rules.rb +1 -7
  143. data/lib/zena/routes.rb +5 -5
  144. data/lib/zena/test_controller.rb +7 -2
  145. data/lib/zena/unit/test_case.rb +6 -8
  146. data/lib/zena/use/ajax.rb +10 -10
  147. data/lib/zena/use/authlogic.rb +93 -0
  148. data/lib/zena/use/dyn_attributes.rb +5 -0
  149. data/lib/zena/use/html_tags.rb +16 -34
  150. data/lib/zena/use/i18n.rb +4 -1
  151. data/lib/zena/use/node_query_finders.rb +8 -4
  152. data/lib/zena/use/refactor.rb +8 -20
  153. data/lib/zena/use/relations.rb +1 -0
  154. data/lib/zena/use/rendering.rb +4 -2
  155. data/lib/zena/use/search.rb +52 -0
  156. data/lib/zena/use/test_helper.rb +27 -28
  157. data/lib/zena/use/upload.rb +188 -0
  158. data/lib/zena/use/urls.rb +16 -14
  159. data/lib/zena/use/zafu.rb +16 -63
  160. data/lib/zena/use/zazen.rb +8 -8
  161. data/lib/zena/view/test_case.rb +8 -4
  162. data/locale/en/LC_MESSAGES/zena.mo +0 -0
  163. data/locale/en/zena.po +3 -3
  164. data/public/.htaccess +40 -0
  165. data/public/javascripts/upload-progress.js +17 -8
  166. data/public/javascripts/zena.js +8 -2
  167. data/public/stylesheets/popup.css +1 -0
  168. data/script/about +3 -0
  169. data/script/apache_logging +25 -0
  170. data/script/breakpointer +3 -0
  171. data/script/console +3 -0
  172. data/script/dbconsole +3 -0
  173. data/script/destroy +3 -0
  174. data/script/generate +3 -0
  175. data/script/performance/benchmarker +3 -0
  176. data/script/performance/profiler +3 -0
  177. data/script/plugin +3 -0
  178. data/script/process/inspector +3 -0
  179. data/script/process/reaper +3 -0
  180. data/script/process/spawner +3 -0
  181. data/script/runner +3 -0
  182. data/script/server +3 -0
  183. data/script/set_revision +29 -0
  184. data/spec/controllers/versions_controller_spec.rb +11 -0
  185. data/test/fixtures/files/Node-test.zafu +1 -1
  186. data/test/functional/nodes_controller_test.rb +25 -0
  187. data/test/functional/pings_controller_test.rb +8 -0
  188. data/test/functional/user_sessions_controller_test.rb +59 -0
  189. data/test/functional/users_controller_test.rb +81 -19
  190. data/test/helpers/node_query/filters.yml +5 -0
  191. data/test/helpers/node_query_test.rb +3 -3
  192. data/test/integration/multiple_hosts_test.rb +1 -1
  193. data/test/integration/navigation_test.rb +1 -1
  194. data/test/sites/complex/users.yml +1 -1
  195. data/test/sites/ocean/users.yml +3 -3
  196. data/test/sites/zena/users.yml +5 -4
  197. data/test/test_zena.rb +38 -38
  198. data/test/unit/cached_page_test.rb +2 -2
  199. data/test/unit/comment_test.rb +0 -1
  200. data/test/unit/document_test.rb +23 -11
  201. data/test/unit/helpers/ping_helper_test.rb +4 -0
  202. data/test/unit/multiversion_test.rb +24 -16
  203. data/test/unit/node_test.rb +32 -93
  204. data/test/unit/note_test.rb +9 -0
  205. data/test/unit/page_test.rb +2 -2
  206. data/test/unit/secure_test.rb +2 -12
  207. data/test/unit/site_test.rb +43 -24
  208. data/test/unit/template_test.rb +45 -3
  209. data/test/unit/text_document_test.rb +4 -3
  210. data/test/unit/user_test.rb +13 -33
  211. data/test/unit/zena/db_test.rb +8 -0
  212. data/test/unit/zena/parser/zazen.yml +4 -4
  213. data/test/unit/zena/use/dates_view_methods_test.rb +2 -1
  214. data/test/unit/zena/use/html_tags_test.rb +12 -4
  215. data/test/unit/zena/use/refactor_test.rb +4 -3
  216. data/test/unit/zena/use/rendering_test.rb +1 -0
  217. data/test/unit/zena/use/upload_test.rb +76 -0
  218. data/test/unit/zena/use/urls_test.rb +4 -0
  219. data/test/unit/zena/use/zafu_test.rb +8 -0
  220. data/test/unit/zena/workflow/status_version_test.rb +6 -0
  221. data/test/unit/zena/zena_tags/ajax.yml +4 -4
  222. data/test/unit/zena/zena_tags/basic.yml +21 -10
  223. data/test/unit/zena/zena_tags/relations.yml +0 -6
  224. data/test/unit/zena/zena_tags/rubyless.yml +35 -0
  225. data/test/unit/zena/zena_tags/zazen.yml +4 -4
  226. data/test/unit/zena/zena_tags_test.rb +36 -4
  227. data/vendor/TextMate/Zena.tmbundle/Commands/Run all yaml tests.tmCommand +1 -1
  228. data/vendor/TextMate/Zena.tmbundle/Commands/Run focused yaml test.tmCommand +2 -3
  229. data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/catch_exception.rb +39 -0
  230. data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/run_script.rb +102 -58
  231. data/vendor/TextMate/Zena.tmbundle/Support/RubyMate/stdin_dialog.rb +14 -0
  232. data/vendor/TextMate/Zena.tmbundle/info.plist +2 -0
  233. data/zena.gemspec +2085 -0
  234. metadata +265 -90
  235. data/app/controllers/sessions_controller.rb +0 -41
  236. data/app/views/sites/zena_up.html.erb +0 -11
  237. data/config/database.yml +0 -40
  238. data/db/production.sqlite3 +0 -0
  239. data/lib/bricks/patcher.rb +0 -68
  240. data/lib/zena/parser/zena_tags.rb +0 -3562
  241. data/lib/zena/use/authentification.rb +0 -120
  242. data/public/images/ext/contact_pv.png +0 -0
  243. data/public/images/ext/other_pv.png +0 -0
  244. data/public/images/ext/page_pv.png +0 -0
  245. data/public/images/ext/page_tiny.png +0 -0
  246. data/public/images/ext/pdf_pv.png +0 -0
  247. data/public/images/ext/post_pv.png +0 -0
  248. data/public/images/ext/post_tiny.png +0 -0
  249. data/public/images/ext/project_pv.png +0 -0
  250. data/public/images/ext/project_tiny.png +0 -0
  251. data/public/images/ext/tag_pv.png +0 -0
  252. data/public/images/ext/zip_pv.png +0 -0
  253. data/tasks/ann.rake +0 -80
  254. data/tasks/bones.rake +0 -20
  255. data/tasks/gem.rake +0 -201
  256. data/tasks/git.rake +0 -40
  257. data/tasks/notes.rake +0 -27
  258. data/tasks/post_load.rake +0 -34
  259. data/tasks/rdoc.rake +0 -51
  260. data/tasks/rubyforge.rake +0 -55
  261. data/tasks/setup.rb +0 -292
  262. data/tasks/spec.rake +0 -54
  263. data/tasks/svn.rake +0 -47
  264. data/tasks/test.rake +0 -40
  265. data/tasks/zentest.rake +0 -36
  266. data/test/fixtures/comments.yml +0 -126
  267. data/test/fixtures/contact_contents.yml +0 -132
  268. data/test/fixtures/data_entries.yml +0 -65
  269. data/test/fixtures/discussions.yml +0 -48
  270. data/test/fixtures/document_contents.yml +0 -108
  271. data/test/fixtures/dyn_attributes.yml +0 -66
  272. data/test/fixtures/groups.yml +0 -86
  273. data/test/fixtures/groups_users.yml +0 -81
  274. data/test/fixtures/iformats.yml +0 -29
  275. data/test/fixtures/links.yml +0 -313
  276. data/test/fixtures/nodes.yml +0 -2592
  277. data/test/fixtures/relations.yml +0 -126
  278. data/test/fixtures/sites.yml +0 -58
  279. data/test/fixtures/template_contents.yml +0 -172
  280. data/test/fixtures/users.yml +0 -167
  281. data/test/fixtures/versions.yml +0 -1911
  282. data/test/fixtures/virtual_classes.yml +0 -87
  283. data/test/fixtures/zips.yml +0 -15
  284. data/test/functional/sessions_controller_test.rb +0 -73
@@ -17,20 +17,22 @@ module Zena
17
17
 
18
18
  return '#' unless node
19
19
 
20
-
21
- if sharp = options.delete(:sharp)
22
- if sharp =~ /\[(.+)\]/
23
- sharp_value = node.safe_read($1)
24
- elsif sharp == 'true'
25
- sharp_value = "node#{node[:zip]}"
20
+ if anchor = options.delete(:anchor)
21
+ if anchor =~ /\[(.+)\]/
22
+ anchor_value = node.safe_read($1)
23
+ elsif anchor == 'true'
24
+ anchor_value = "node#{node[:zip]}"
26
25
  else
27
- sharp_value = sharp
26
+ fixed = true
27
+ anchor_value = anchor
28
28
  end
29
- if sharp_in = options.delete(:sharp_in)
30
- sharp_node = sharp_in.kind_of?(Node) ? sharp_in : (node.find(:first, [sharp_in]) || node)
31
- return "#{zen_path(sharp_node, options)}##{sharp_value}"
29
+ if anchor_in = options.delete(:anchor_in)
30
+ anchor_node = anchor_in.kind_of?(Node) ? anchor_in : (node.find(:first, [anchor_in]) || node)
31
+ return "#{zen_path(anchor_node, options)}##{anchor_value}"
32
+ elsif fixed
33
+ return "#{zen_path(node, options)}##{anchor_value}"
32
34
  else
33
- return "##{sharp_value}"
35
+ return "##{anchor_value}"
34
36
  end
35
37
  end
36
38
 
@@ -43,7 +45,7 @@ module Zena
43
45
  abs_url_prefix = host ? "http://#{host}" : ''
44
46
 
45
47
  if node.kind_of?(Document) && format == node.version.content.ext
46
- if node.public? && !current_site.authentication?
48
+ if node.public? && !visitor.site.authentication?
47
49
  # force the use of a cacheable path for the data, even when navigating in '/oo'
48
50
  pre = node.version.lang
49
51
  end
@@ -60,7 +62,7 @@ module Zena
60
62
  opts.delete(:cachestamp) # cachestamp
61
63
  end
62
64
 
63
- path = if !asset && node[:id] == current_site[:root_id] && mode.nil? && format == 'html'
65
+ path = if !asset && node[:id] == visitor.site[:root_id] && mode.nil? && format == 'html'
64
66
  "#{abs_url_prefix}/#{pre}" # index page
65
67
  elsif node[:custom_base]
66
68
  "#{abs_url_prefix}/#{pre}/" +
@@ -109,7 +111,7 @@ module Zena
109
111
  # Url for a node. Options are 'mode' and 'format'
110
112
  # ex 'http://test.host/en/document34_print.html'
111
113
  def zen_url(node, opts={})
112
- zen_path(node,opts.merge(:host => current_site[:host]))
114
+ zen_path(node,opts.merge(:host => visitor.site[:host]))
113
115
  end
114
116
 
115
117
  # Return the path to a document's data
@@ -93,8 +93,15 @@ module Zena
93
93
  ""
94
94
  end
95
95
 
96
- # TODO: test
96
+ # Return the full path from a template's url.
97
+ # The expected url is of the form '/skin/Klass-mode/partial'
97
98
  def fullpath_from_template_url(template_url=params[:t_url])
99
+ "#{SITES_ROOT}#{template_path_from_template_url(template_url)}"
100
+ end
101
+
102
+ # Return the template path without '.erb' extension in case we need to append '_form'
103
+ # from a template's url. The expected url is of the form '/skin/Klass-mode/partial'
104
+ def template_path_from_template_url(template_url=params[:t_url])
98
105
  if template_url =~ /\A\.|[^\w\+\._\-\/]/
99
106
  raise Zena::AccessViolation.new("'template_url' contains illegal characters : #{template_url.inspect}")
100
107
  end
@@ -102,11 +109,12 @@ module Zena
102
109
  template_url = template_url[1..-1].split('/')
103
110
  path = "/#{template_url[0]}/#{template_url[1]}/#{dev_mode? ? "dev_#{lang}" : lang}/#{template_url[2..-1].join('/')}"
104
111
 
105
- "#{SITES_ROOT}/#{current_site.host}/zafu#{path}"
112
+ "/#{current_site.host}/zafu#{path}"
106
113
  end
107
114
 
108
115
  # Make sure some vital templates never get broken
109
116
  def valid_template?(content, opts)
117
+ #puts content
110
118
  mode = opts[:mode]
111
119
  case mode
112
120
  when '+login'
@@ -162,16 +170,14 @@ module Zena
162
170
  skin_names_list << name unless skin_names_list.include?(name)
163
171
  end
164
172
  end
173
+
165
174
  document = skin_name = nil
166
- [false, true].each do |rebuild_path|
167
- # try to find using cached fullpath first.
168
- skin_names_list.each do |skin_name|
169
- next unless skin = @skin[skin_name] ||= secure(Skin) { Skin.find_by_name(skin_name) }
170
- path = (skin.fullpath(rebuild_path).split('/') + url).join('/')
171
- break if document = secure(Document) { Document.find_by_path(path) }
172
- end
173
- break if document
175
+ skin_names_list.each do |skin_name|
176
+ next unless skin = @skin[skin_name] ||= secure(Skin) { Skin.find_by_name(skin_name) }
177
+ path = (skin.fullpath.split('/') + url).join('/')
178
+ break if document = secure(Document) { Document.find_by_path(path) }
174
179
  end
180
+
175
181
  if format == 'data' && document
176
182
  format = document.c_ext
177
183
  end
@@ -502,60 +508,7 @@ module Zena
502
508
  title
503
509
  end
504
510
  end
505
-
506
-
507
511
  end # ViewMethods
508
-
509
- # This will be completely replaced by RubyLess
510
- module ModelMethods
511
- def self.included(base)
512
- zafu_class_methods = <<-END
513
- @@_zafu_context ||= {} # defined for each class (list of methods to change contexts)
514
- @@_zafu_known_contexts ||= {} # full list with inherited attributes
515
-
516
- def self.zafu_context(hash)
517
- @@_zafu_context[self] ||= {}
518
- @@_zafu_context[self].merge!(hash.stringify_keys)
519
- end
520
-
521
- def self.zafu_known_contexts
522
- @@_zafu_known_contexts[self] ||= begin
523
- res = {}
524
- if superclass == ActiveRecord::Base
525
- @@_zafu_context[self] || {}
526
- else
527
- superclass.zafu_known_contexts.merge(@@_zafu_context[self] || {})
528
- end.each do |k,v|
529
- if v.kind_of?(Hash)
530
- res[k] = v.merge(:node_class => parse_class(v[:node_class]))
531
- else
532
- res[k] = {:node_class => parse_class(v)}
533
- end
534
- end
535
- res
536
- end
537
- end
538
-
539
- def self.parse_class(klass)
540
- if klass.kind_of?(Array)
541
- if klass[0].kind_of?(String)
542
- [Module::const_get(klass[0])]
543
- else
544
- klass
545
- end
546
- else
547
- if klass.kind_of?(String)
548
- Module::const_get(klass)
549
- else
550
- klass
551
- end
552
- end
553
- end
554
- END
555
-
556
- base.send(:class_eval, zafu_class_methods)
557
- end
558
- end # ModelMethods
559
512
  end # Zafu
560
513
  end # Use
561
514
  end # Zena
@@ -77,16 +77,16 @@ module Zena
77
77
  def make_link(opts)
78
78
  # for latex refs, see http://www.tug.org/applications/hyperref/manual.html
79
79
  link_opts = {}
80
- if sharp = opts[:sharp]
81
- if sharp =~ /\[(.+?)\/(.*)\]/
82
- sharp_in, sharp = $1, $2
83
- sharp = sharp == '' ? 'true' : "[#{sharp}]"
84
- link_opts[:sharp_in] = sharp_in
80
+ if anchor = opts[:anchor]
81
+ if anchor =~ /\[(.+?)\/(.*)\]/
82
+ anchor_in, anchor = $1, $2
83
+ anchor = anchor == '' ? 'true' : "[#{anchor}]"
84
+ link_opts[:anchor_in] = anchor_in
85
85
  end
86
- if ['[id]', '[zip]'].include?(sharp)
87
- link_opts[:sharp] = 'true'
86
+ if ['[id]', '[zip]'].include?(anchor)
87
+ link_opts[:anchor] = 'true'
88
88
  else
89
- link_opts[:sharp] = sharp
89
+ link_opts[:anchor] = anchor
90
90
  end
91
91
  end
92
92
  if opts[:id] =~ /(\d+)(_\w+|)(\.\w+|)/
@@ -4,13 +4,12 @@ module Zena
4
4
  include Zena::Use::Fixtures
5
5
  include Zena::Use::TestHelper
6
6
  include Zena::Acts::Secure
7
+ include ::Authlogic::TestCase
7
8
 
8
- def self.helper_attr(*args)
9
- # Ignore since we include helpers in the TestCase itself
10
- end
9
+ setup :activate_authlogic
11
10
 
12
11
  def setup
13
- login(:anon, 'zena')
12
+ login :anon
14
13
  end
15
14
 
16
15
  def assert_css(match, target)
@@ -18,6 +17,11 @@ module Zena
18
17
  assert !target.search(match).empty?,
19
18
  "expected tag, but no tag found matching #{match.inspect} in:\n#{target.inspect}"
20
19
  end
20
+
21
+ def self.helper_attr(*args)
22
+ # Ignore since we include helpers in the TestCase itself
23
+ end
24
+
21
25
  end
22
26
  end
23
27
  end
@@ -199,7 +199,7 @@ msgstr "<img src='/images/lock.png' alt='closed'/>"
199
199
 
200
200
  #: app/helpers/application_helper.rb:1073
201
201
  msgid "btn_title_open_discussion"
202
- msgstr "Open the edition window to edit the node's text, title, etc."
202
+ msgstr "Open the edition window to edit the node"
203
203
 
204
204
  #: app/helpers/application_helper.rb:1076
205
205
  #: app/views/comments/_li.rhtml:3
@@ -1661,11 +1661,11 @@ msgstr "<img src='/images/add.png' alt='add'/>"
1661
1661
 
1662
1662
  #: lib/gettext_strings.rb:26
1663
1663
  msgid "btn_title_edit"
1664
- msgstr "Open the edition window to edit the node's text, title, etc."
1664
+ msgstr "Open the edition window to edit the node."
1665
1665
 
1666
1666
  #: lib/gettext_strings.rb:27
1667
1667
  msgid "btn_title_drive"
1668
- msgstr "Open the drive window to change the node's location, links, etc."
1668
+ msgstr "Open the drive window to change the location, links, etc."
1669
1669
 
1670
1670
  #: lib/gettext_strings.rb:33
1671
1671
  msgid "btn_site_add"
@@ -0,0 +1,40 @@
1
+ # General Apache options
2
+ AddHandler fastcgi-script .fcgi
3
+ AddHandler cgi-script .cgi
4
+ Options +FollowSymLinks +ExecCGI
5
+
6
+ # If you don't want Rails to look in certain directories,
7
+ # use the following rewrite rules so that Apache won't rewrite certain requests
8
+ #
9
+ # Example:
10
+ # RewriteCond %{REQUEST_URI} ^/notrails.*
11
+ # RewriteRule .* - [L]
12
+
13
+ # Redirect all requests not available on the filesystem to Rails
14
+ # By default the cgi dispatcher is used which is very slow
15
+ #
16
+ # For better performance replace the dispatcher with the fastcgi one
17
+ #
18
+ # Example:
19
+ # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
20
+ RewriteEngine On
21
+
22
+ # If your Rails application is accessed via an Alias directive,
23
+ # then you MUST also set the RewriteBase in this htaccess file.
24
+ #
25
+ # Example:
26
+ # Alias /myrailsapp /path/to/myrailsapp/public
27
+ # RewriteBase /myrailsapp
28
+
29
+ RewriteRule ^$ index.html [QSA]
30
+ RewriteRule ^([^.]+)$ $1.html [QSA]
31
+ RewriteCond %{REQUEST_FILENAME} !-f
32
+ RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
33
+
34
+ # In case Rails experiences terminal errors
35
+ # Instead of displaying this message you can supply a file here which will be rendered instead
36
+ #
37
+ # Example:
38
+ # ErrorDocument 500 /500.html
39
+
40
+ ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
@@ -3,17 +3,19 @@
3
3
  // and to fix some strange Safari bugs.
4
4
 
5
5
  function submitUploadForm(form, uuid) {
6
+ if (!$('attachment' + uuid)) return;
6
7
  if ($('progress_bar' + uuid)) return;
7
- var need_progress = /\w/.exec($('attachment' + uuid).value);
8
+
8
9
  // create iframe and alter form to submit to an iframe
9
- if (!$('UploadIFrame')) {
10
- $(document.body).insert('<iframe id="UploadIFrame" name="UploadIFrame" src="about:blank"></iframe>');
10
+ if (!$('using_iframe')) {
11
+ if (!$('UploadIFrame')) {
12
+ $(document.body).insert('<iframe id="UploadIFrame" name="UploadIFrame" src="about:blank"></iframe>');
13
+ }
14
+ $(form).insert("<input id='using_iframe' type='hidden' name='iframe' value='true'/>");
15
+ $(form).target = 'UploadIFrame';
11
16
  }
12
- $(form).target = 'UploadIFrame';
13
- if (need_progress) {
14
- // make sure the POST occurs before (Safari Bug)
15
- UploadProgress.monitor(uuid, form);
16
- }
17
+ // make sure the POST occurs before (Safari Bug)
18
+ UploadProgress.monitor(uuid, form);
17
19
  $(form).submit();
18
20
  }
19
21
 
@@ -69,6 +71,8 @@ var UploadProgress = {
69
71
 
70
72
 
71
73
  buildProgressBar: function() {
74
+ $('au' + this.uuid).hide();
75
+ $('af' + this.uuid).show();
72
76
  $('attachment' + this.uuid).insert({after:'<div class ="progress_shell" id="progress_shell' + this.uuid + '"><div class="progress_text" id="progress_text' + this.uuid + '">&nbsp;</div><div class="progress_bar" id="progress_bar' + this.uuid + '" style="width:0%;">&nbsp;</div></div>'});
73
77
  $('attachment' + this.uuid).hide();
74
78
  },
@@ -96,6 +100,11 @@ var UploadProgress = {
96
100
  Effect.Appear('progress_shell' + this.uuid) ;
97
101
  },
98
102
 
103
+ setAsError: function() {
104
+ $('progress_shell' + this.uuid).remove();
105
+ $('attachment' + this.uuid).show();
106
+ },
107
+
99
108
  setAsFinished: function() {
100
109
  this.uploading = false ;
101
110
  this.watcher.stop() ;
@@ -27,7 +27,7 @@ Zena.version_diff = function(id, from, to) {
27
27
  Zena.save = function(url, form, close_on_complete) {
28
28
  if ($(form).select('[name="attachment"]')[0]) {
29
29
  // do not use ajax call
30
- eval(form.onsubmit().getAttribute('onsubmit'));
30
+ eval(form.getAttribute('onsubmit'));
31
31
  return true;
32
32
  } else {
33
33
  if (close_on_complete) {
@@ -504,6 +504,12 @@ Zena.select_tab = function(name) {
504
504
  current_tab.style.display = '';
505
505
  }
506
506
 
507
+ Zena.reloadAndClose = function() {
508
+ opener.window.location.href = opener.window.location.href;
509
+ window.close();
510
+ }
511
+
512
+ // POPUP GALLERY
507
513
  Zena.popup_gallery = null;
508
514
 
509
515
  Zena.popup = function(elem) {
@@ -652,4 +658,4 @@ Zena.popup_close = function() {
652
658
  }
653
659
  });
654
660
  }
655
- }
661
+ }
@@ -66,6 +66,7 @@ ul.link_box { float:left; display:block; margin:2px; padding:2px;}
66
66
 
67
67
  #image_tab .toggle_div, #document_tab .toggle_div { margin-top: 1em; margin-bottom:0.5em;}
68
68
  #file, #file_form { height:2em;}
69
+ .attach .off { color:grey; }
69
70
  #image_tab img {border:1px solid #333; margin-top:4px;}
70
71
  #image_tab, #document_tab { padding-left:3em; padding-top:3em; }
71
72
  #document_tab a { width:80px; display:block; float:left;}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/about'
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), '../lib/log_recorder/lib/log_recorder')
4
+
5
+ # start with :
6
+ # apache_logging 'vhost.com' 'config/database.yml'
7
+ vhost_name = ARGV[0] || 'test.host'
8
+ config_path = ARGV[1] || File.open(File.dirname(__FILE__) + '/../config/database.yml')
9
+
10
+ config = {}
11
+
12
+ YAML::load_documents( config_path ) do |doc|
13
+ doc.each do |elem|
14
+ next unless elem[0] == 'development'
15
+ config = elem[1]
16
+ end
17
+ end
18
+
19
+ rec = LogRecorder.new(vhost_name, config)
20
+
21
+ rec.test
22
+
23
+ #$stdin.each do |l|
24
+ # rec.insert_combined_record()
25
+ #end
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/breakpointer'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/dbconsole'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/plugin'