wagn 1.14.4 → 1.14.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/app/controllers/card_controller.rb +4 -3
  4. data/db/bootstrap/card_actions.yml +597 -583
  5. data/db/bootstrap/card_acts.yml +2 -2
  6. data/db/bootstrap/card_changes.yml +297 -248
  7. data/db/bootstrap/card_references.yml +3111 -1284
  8. data/db/bootstrap/cards.yml +1067 -1022
  9. data/db/migrate_core_cards/20141208132416_partial_reference_type.rb +7 -0
  10. data/db/migrate_core_cards/20141208162106_add_ace_script.rb +12 -0
  11. data/db/migrate_core_cards/20141230204340_uri_codename.rb +13 -0
  12. data/db/version_core_cards.txt +1 -1
  13. data/features/history.feature +2 -1
  14. data/features/layouts.feature +4 -0
  15. data/features/navbox.feature +1 -0
  16. data/features/step_definitions/wagn_steps.rb +6 -1
  17. data/features/support/env.rb +1 -1
  18. data/lib/card/env.rb +1 -1
  19. data/lib/card/format.rb +35 -48
  20. data/lib/card/loader.rb +9 -9
  21. data/lib/card/mailer.rb +0 -2
  22. data/lib/card/query.rb +8 -8
  23. data/lib/card/query/{card_spec.rb → card_clause.rb} +42 -42
  24. data/lib/card/query/{spec.rb → clause.rb} +3 -3
  25. data/lib/card/query/ref_clause.rb +47 -0
  26. data/lib/card/query/value_clause.rb +65 -0
  27. data/lib/card/reference.rb +11 -20
  28. data/lib/card/set.rb +6 -6
  29. data/lib/card/set_pattern.rb +5 -1
  30. data/lib/wagn/commands.rb +28 -14
  31. data/lib/wagn/config/environments/test.rb +3 -0
  32. data/lib/wagn/generators/wagn/templates/Gemfile +6 -0
  33. data/lib/wagn/generators/wagn/templates/Rakefile +1 -0
  34. data/lib/wagn/generators/wagn/templates/config/application.rb +1 -0
  35. data/lib/wagn/generators/wagn/templates/spec/javascripts/support/deck_jasmine.yml +56 -0
  36. data/lib/wagn/generators/wagn/templates/spec/javascripts/support/wagn_jasmine.yml +69 -0
  37. data/lib/wagn/generators/wagn/wagn_generator.rb +19 -2
  38. data/lib/wagn/migration.rb +10 -0
  39. data/lib/wagn/spec_helper.rb +2 -0
  40. data/lib/wagn/tasks/wagn.rake +9 -16
  41. data/mod/01_core/chunk/link.rb +2 -2
  42. data/mod/01_core/chunk/uri.rb +4 -4
  43. data/mod/01_core/format/html_format.rb +43 -280
  44. data/mod/01_core/set/all/active_card.rb +2 -0
  45. data/mod/01_core/set/all/collection.rb +19 -1
  46. data/mod/01_core/set/all/fetch.rb +5 -0
  47. data/mod/01_core/set/all/initialize.rb +1 -1
  48. data/mod/01_core/set/all/references.rb +25 -8
  49. data/mod/01_core/set/all/templating.rb +1 -1
  50. data/mod/01_core/set/all/tracked_attributes.rb +1 -1
  51. data/mod/01_core/set/all/type.rb +1 -1
  52. data/mod/01_core/set/all/utils.rb +1 -0
  53. data/mod/01_core/set_pattern/07_type_plus_right.rb +2 -1
  54. data/mod/01_core/spec/format/html_format_spec.rb +0 -2
  55. data/mod/01_core/spec/set/all/initialize_spec.rb +4 -4
  56. data/mod/01_core/spec/set/all/notify_spec.rb +9 -9
  57. data/mod/02_basic_types/set/type/pointer.rb +19 -8
  58. data/mod/03_machines/lib/javascript/ace.js +18204 -0
  59. data/mod/03_machines/lib/javascript/jquery-ui.js +13109 -11440
  60. data/mod/03_machines/lib/javascript/jquery.autosize.js +52 -33
  61. data/mod/03_machines/lib/javascript/jquery.fileupload.js +10 -8
  62. data/mod/03_machines/lib/javascript/jquery.iframe-transport.js +44 -16
  63. data/mod/03_machines/lib/javascript/jquery.js +4 -9473
  64. data/mod/03_machines/lib/javascript/jquery_ujs.js +156 -116
  65. data/mod/03_machines/lib/javascript/jquerymobile.js +14890 -8236
  66. data/mod/03_machines/lib/javascript/theme-textmate.js +130 -0
  67. data/mod/03_machines/lib/javascript/wagn_mod.js.coffee +50 -10
  68. data/mod/03_machines/set/self/script_ace.rb +8 -0
  69. data/mod/03_machines/set/type/coffee_script.rb +1 -1
  70. data/mod/03_machines/set/type/css.rb +0 -2
  71. data/mod/03_machines/set/type/java_script.rb +1 -1
  72. data/mod/03_machines/spec/lib/{machine_spec.rb → shared_machine_examples.rb} +0 -0
  73. data/mod/03_machines/spec/lib/{machine_input_spec.rb → shared_machine_input_examples.rb} +0 -0
  74. data/mod/03_machines/spec/set/type/scss_spec.rb +2 -2
  75. data/mod/04_settings/set/right/comment.rb +2 -2
  76. data/mod/04_settings/set/type/setting.rb +2 -2
  77. data/mod/04_settings/spec/set/right/structure_spec.rb +2 -2
  78. data/mod/04_settings/spec/set/right/style_spec.rb +1 -1
  79. data/mod/05_email/set/type/email_template.rb +3 -2
  80. data/mod/05_standard/set/all/all_css.rb +1 -1
  81. data/mod/05_standard/set/all/all_js.rb +1 -1
  82. data/mod/05_standard/set/all/attach.rb +8 -7
  83. data/mod/05_standard/set/all/base.rb +6 -34
  84. data/mod/05_standard/set/all/editing.rb +145 -0
  85. data/mod/05_standard/set/all/error.rb +203 -0
  86. data/mod/05_standard/set/all/follow.rb +2 -2
  87. data/mod/05_standard/set/all/form.rb +211 -0
  88. data/mod/05_standard/set/all/header.rb +60 -0
  89. data/mod/05_standard/set/all/history.rb +3 -3
  90. data/mod/05_standard/set/all/links.rb +101 -0
  91. data/mod/05_standard/set/all/rich_html.rb +14 -392
  92. data/mod/05_standard/set/all/wrapper.rb +74 -0
  93. data/mod/05_standard/set/right/account.rb +1 -2
  94. data/mod/05_standard/set/rstar/rules.rb +5 -5
  95. data/mod/05_standard/set/self/account_links.rb +8 -4
  96. data/mod/05_standard/set/self/head.rb +3 -3
  97. data/mod/05_standard/set/self/signin.rb +5 -3
  98. data/mod/05_standard/set/type/search_type.rb +25 -25
  99. data/mod/05_standard/set/type/set.rb +2 -2
  100. data/mod/05_standard/set/type/signup.rb +0 -2
  101. data/mod/05_standard/set/type/uri.rb +11 -0
  102. data/mod/05_standard/spec/set/all/rich_html_spec.rb +6 -6
  103. data/mod/05_standard/spec/set/all/rss_spec.rb +1 -1
  104. data/mod/05_standard/spec/set/type/signup_spec.rb +0 -1
  105. data/mod/05_standard/spec/set/type/uri_spec.rb +41 -0
  106. data/public/assets/ace/mode-coffee.js +1 -0
  107. data/public/assets/ace/mode-css.js +1 -0
  108. data/public/assets/ace/mode-html.js +1 -0
  109. data/public/assets/ace/mode-javascript.js +1 -0
  110. data/public/assets/ace/mode-json.js +1 -0
  111. data/public/assets/ace/mode-scss.js +922 -0
  112. data/public/assets/ace/theme-github.js +98 -0
  113. data/public/assets/ace/theme-textmate.js +1 -0
  114. data/public/assets/ace/worker-coffee.js +1 -0
  115. data/public/assets/ace/worker-css.js +1 -0
  116. data/public/assets/ace/worker-html.js +1 -0
  117. data/public/assets/ace/worker-javascript.js +1 -0
  118. data/public/assets/ace/worker-json.js +1 -0
  119. data/spec/controllers/card_controller_spec.rb +0 -1
  120. data/spec/controllers/location_spec.rb +0 -2
  121. data/spec/javascripts/helpers/jasmine-jquery.js +812 -0
  122. data/spec/javascripts/support/jasmine.yml +8 -6
  123. data/spec/javascripts/support/jasmine_config.rb +1 -1
  124. data/spec/javascripts/support/jasmine_runner.rb +1 -1
  125. data/spec/javascripts/wagn_spec.coffee +2 -0
  126. data/spec/lib/card/content_spec.rb +28 -6
  127. data/spec/lib/card/format_spec.rb +62 -15
  128. data/spec/lib/card/reference_spec.rb +3 -3
  129. data/spec/spec_helper.rb +2 -2
  130. data/test/fixtures/card_actions.yml +1260 -1239
  131. data/test/fixtures/card_acts.yml +347 -341
  132. data/test/fixtures/card_changes.yml +2345 -2276
  133. data/test/fixtures/card_references.yml +4098 -1606
  134. data/test/fixtures/cards.yml +1950 -1887
  135. metadata +39 -13
  136. data/lib/card/query/ref_spec.rb +0 -37
  137. data/lib/card/query/value_spec.rb +0 -65
  138. data/lib/wagn/location.rb +0 -93
  139. data/spec/javascripts/helpers/jasmine-config.js +0 -2
  140. data/spec/javascripts/helpers/jasmine-jquery-1.3.1.js +0 -295
@@ -0,0 +1,130 @@
1
+ define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ exports.isDark = false;
5
+ exports.cssClass = "ace-tm";
6
+ exports.cssText = ".ace-tm .ace_gutter {\
7
+ background: #f0f0f0;\
8
+ color: #333;\
9
+ }\
10
+ .ace-tm .ace_print-margin {\
11
+ width: 1px;\
12
+ background: #e8e8e8;\
13
+ }\
14
+ .ace-tm .ace_fold {\
15
+ background-color: #6B72E6;\
16
+ }\
17
+ .ace-tm {\
18
+ background-color: #FFFFFF;\
19
+ color: black;\
20
+ }\
21
+ .ace-tm .ace_cursor {\
22
+ color: black;\
23
+ }\
24
+ .ace-tm .ace_invisible {\
25
+ color: rgb(191, 191, 191);\
26
+ }\
27
+ .ace-tm .ace_storage,\
28
+ .ace-tm .ace_keyword {\
29
+ color: blue;\
30
+ }\
31
+ .ace-tm .ace_constant {\
32
+ color: rgb(197, 6, 11);\
33
+ }\
34
+ .ace-tm .ace_constant.ace_buildin {\
35
+ color: rgb(88, 72, 246);\
36
+ }\
37
+ .ace-tm .ace_constant.ace_language {\
38
+ color: rgb(88, 92, 246);\
39
+ }\
40
+ .ace-tm .ace_constant.ace_library {\
41
+ color: rgb(6, 150, 14);\
42
+ }\
43
+ .ace-tm .ace_invalid {\
44
+ background-color: rgba(255, 0, 0, 0.1);\
45
+ color: red;\
46
+ }\
47
+ .ace-tm .ace_support.ace_function {\
48
+ color: rgb(60, 76, 114);\
49
+ }\
50
+ .ace-tm .ace_support.ace_constant {\
51
+ color: rgb(6, 150, 14);\
52
+ }\
53
+ .ace-tm .ace_support.ace_type,\
54
+ .ace-tm .ace_support.ace_class {\
55
+ color: rgb(109, 121, 222);\
56
+ }\
57
+ .ace-tm .ace_keyword.ace_operator {\
58
+ color: rgb(104, 118, 135);\
59
+ }\
60
+ .ace-tm .ace_string {\
61
+ color: rgb(3, 106, 7);\
62
+ }\
63
+ .ace-tm .ace_comment {\
64
+ color: rgb(76, 136, 107);\
65
+ }\
66
+ .ace-tm .ace_comment.ace_doc {\
67
+ color: rgb(0, 102, 255);\
68
+ }\
69
+ .ace-tm .ace_comment.ace_doc.ace_tag {\
70
+ color: rgb(128, 159, 191);\
71
+ }\
72
+ .ace-tm .ace_constant.ace_numeric {\
73
+ color: rgb(0, 0, 205);\
74
+ }\
75
+ .ace-tm .ace_variable {\
76
+ color: rgb(49, 132, 149);\
77
+ }\
78
+ .ace-tm .ace_xml-pe {\
79
+ color: rgb(104, 104, 91);\
80
+ }\
81
+ .ace-tm .ace_entity.ace_name.ace_function {\
82
+ color: #0000A2;\
83
+ }\
84
+ .ace-tm .ace_heading {\
85
+ color: rgb(12, 7, 255);\
86
+ }\
87
+ .ace-tm .ace_list {\
88
+ color:rgb(185, 6, 144);\
89
+ }\
90
+ .ace-tm .ace_meta.ace_tag {\
91
+ color:rgb(0, 22, 142);\
92
+ }\
93
+ .ace-tm .ace_string.ace_regex {\
94
+ color: rgb(255, 0, 0)\
95
+ }\
96
+ .ace-tm .ace_marker-layer .ace_selection {\
97
+ background: rgb(181, 213, 255);\
98
+ }\
99
+ .ace-tm.ace_multiselect .ace_selection.ace_start {\
100
+ box-shadow: 0 0 3px 0px white;\
101
+ border-radius: 2px;\
102
+ }\
103
+ .ace-tm .ace_marker-layer .ace_step {\
104
+ background: rgb(252, 255, 0);\
105
+ }\
106
+ .ace-tm .ace_marker-layer .ace_stack {\
107
+ background: rgb(164, 229, 101);\
108
+ }\
109
+ .ace-tm .ace_marker-layer .ace_bracket {\
110
+ margin: -1px 0 0 -1px;\
111
+ border: 1px solid rgb(192, 192, 192);\
112
+ }\
113
+ .ace-tm .ace_marker-layer .ace_active-line {\
114
+ background: rgba(0, 0, 0, 0.07);\
115
+ }\
116
+ .ace-tm .ace_gutter-active-line {\
117
+ background-color : #dcdcdc;\
118
+ }\
119
+ .ace-tm .ace_marker-layer .ace_selected-word {\
120
+ background: rgb(250, 250, 255);\
121
+ border: 1px solid rgb(200, 200, 250);\
122
+ }\
123
+ .ace-tm .ace_indent-guide {\
124
+ background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;\
125
+ }\
126
+ ";
127
+
128
+ var dom = require("../lib/dom");
129
+ dom.importCssString(exports.cssText, exports.cssClass);
130
+ });
@@ -1,3 +1,4 @@
1
+
1
2
  window.wagn ||= {} #needed to run w/o *head. eg. jasmine
2
3
 
3
4
 
@@ -14,7 +15,7 @@ $.extend wagn,
14
15
 
15
16
  editorInitFunctionMap: {
16
17
  '.date-editor' : -> @datepicker { dateFormat: 'yy-mm-dd' }
17
- 'textarea' : -> $(this).autosize()
18
+ 'textarea' : -> wagn.initAce $(this)#$(this).autosize()
18
19
  '.tinymce-textarea' : -> wagn.initTinyMCE @[0].id
19
20
  '.pointer-list-editor' : -> @sortable(); wagn.initPointerList @find('input')
20
21
  '.file-upload' : -> @fileupload( add: wagn.chooseFile )#, forceIframeTransport: true )
@@ -32,7 +33,46 @@ $.extend wagn,
32
33
  catch
33
34
  {}
34
35
  wagn.tinyMCEConfig = setter()
36
+
37
+ initAce: (textarea) ->
38
+ type_code = textarea.slot().attr "data-card-type-code"
39
+ hash = {}
40
+ hash["java_script"] = "javascript"
41
+ hash["coffee_script"] = "coffee"
42
+ hash["css"] = "css"
43
+ hash["scss"] = "scss"
44
+ hash["html"] = "html"
45
+ hash["search_type"] = "json"
46
+ mode = hash[type_code]
47
+ unless mode
48
+ textarea.autosize()
49
+ return
50
+ editDiv = $("<div>",
51
+ position: "absolute"
52
+ width: textarea.width()
53
+ height: textarea.height()
54
+ class: textarea.attr("class")
55
+ ).insertBefore(textarea)
56
+ textarea.css "visibility", "hidden"
57
+ textarea.css "height", "0px"
58
+ ace.config.set('basePath','/assets/ace')
59
+ editor = ace.edit(editDiv[0])
60
+ editor.renderer.setShowGutter true
61
+ editor.getSession().setValue textarea.val()
62
+ editor.setTheme "ace/theme/github"
63
+ editor.getSession().setMode "ace/mode/" + mode
64
+ editor.setOption "showPrintMargin", false
65
+ editor.getSession().setTabSize 2
66
+ editor.getSession().setUseSoftTabs true
67
+ editor.setOptions maxLines: 30
35
68
 
69
+ textarea.closest("form").submit ->
70
+ textarea.val editor.getSession().getValue()
71
+ return
72
+
73
+ return
74
+
75
+
36
76
  initTinyMCE: (el_id) ->
37
77
  # verify_html: false -- note: this option needed for empty paragraphs to add space.
38
78
  conf = {
@@ -315,15 +355,15 @@ navbox_results = (request, response) ->
315
355
  formData = f.serialize() + '&view=complete'
316
356
 
317
357
  this.xhr = $.ajax {
318
- url: wagn.prepUrl wagn.rootPath + '/:search.json'
319
- data: formData
320
- dataType: "json"
321
- wagReq: ++reqIndex
322
- success: ( data, status ) ->
323
- response navboxize(request.term, data) if this.wagReq == reqIndex
324
- error: () ->
325
- response [] if this.wagReq == reqIndex
326
- }
358
+ url: wagn.prepUrl wagn.rootPath + '/:search.json'
359
+ data: formData
360
+ dataType: "json"
361
+ wagReq: ++reqIndex
362
+ success: ( data, status ) ->
363
+ response navboxize(request.term, data) if this.wagReq == reqIndex
364
+ error: () ->
365
+ response [] if this.wagReq == reqIndex
366
+ }
327
367
 
328
368
  navboxize = (term, results)->
329
369
  items = []
@@ -0,0 +1,8 @@
1
+
2
+ view :raw do |args|
3
+ File.read "#{Wagn.gem_root}/mod/03_machines/lib/javascript/ace.js"
4
+ end
5
+
6
+ view :editor do |args|
7
+ "Content is stored in file and can't be edited."
8
+ end
@@ -12,7 +12,7 @@ rescue =>e
12
12
  end
13
13
 
14
14
  machine_input do
15
- Uglifier.compile( compile_coffee format(:format=>:js)._render_raw )
15
+ Uglifier.compile( compile_coffee format(:js)._render_raw )
16
16
  end
17
17
 
18
18
  store_machine_output :filetype => "js"
@@ -36,8 +36,6 @@ format :html do
36
36
  end
37
37
 
38
38
  view :content_changes, :mod=>CoffeeScript::HtmlFormat
39
-
40
-
41
39
  end
42
40
 
43
41
  def diff_args
@@ -7,7 +7,7 @@ include MachineInput
7
7
  store_machine_output :filetype => "js"
8
8
 
9
9
  machine_input do
10
- Uglifier.compile(format(:format=>:js)._render_core)
10
+ Uglifier.compile(format(:js)._render_core)
11
11
  end
12
12
 
13
13
 
@@ -21,11 +21,11 @@ describe Card::Set::Type::Scss do
21
21
 
22
22
 
23
23
  it 'should highlight code in html' do
24
- assert_view_select @scss_card.format(:format=>:html).render_core, 'div[class=CodeRay]'
24
+ assert_view_select @scss_card.format(:html).render_core, 'div[class=CodeRay]'
25
25
  end
26
26
 
27
27
  it 'should not highlight code in css' do
28
- expect(@scss_card.format(:format=>:css).render_core).not_to match(/CodeRay/)
28
+ expect(@scss_card.format(:css).render_core).not_to match(/CodeRay/)
29
29
  end
30
30
 
31
31
  it_should_behave_like "machine input" do
@@ -33,7 +33,7 @@ format :html do
33
33
  %{
34
34
  <div class="group-option">
35
35
  #{ check_box_tag( "#{option.key}-perm-checkbox", option.name, checked, :class=>'perm-checkbox-button' ) }
36
- <label>#{ link_to_page option.name, nil, :target=>'wagn_role' }</label>
36
+ <label>#{ card_link option.name, :target=>'wagn_role' }</label>
37
37
  </div>
38
38
  }
39
39
  end * "\n"
@@ -71,7 +71,7 @@ format :html do
71
71
  task = card.tag.codename
72
72
  ancestor = Card[sc.trunk_name.trunk_name]
73
73
  links = ancestor.who_can( task.to_sym ).map do |card_id|
74
- link_to_page Card[card_id].name, nil, :target=>args[:target]
74
+ card_link Card[card_id].name, :target=>args[:target]
75
75
  end*", "
76
76
  "Inherit ( #{links} )"
77
77
  rescue
@@ -26,7 +26,7 @@ view :core do |args|
26
26
  klasses.map do |klass, rules|
27
27
  %{
28
28
  <tr class="klass-row anchorless-#{ klass.anchorless? }">
29
- <td class="setting-klass">#{ klass.anchorless? ? link_to_page( klass.pattern ) : klass.pattern }</td>
29
+ <td class="setting-klass">#{ klass.anchorless? ? card_link( klass.pattern ) : klass.pattern }</td>
30
30
  <td class="rule-content-container">
31
31
  <span class="closed-content content">#{ subformat(rules[0])._render_closed_content if klass.anchorless? }</span>
32
32
  </td>
@@ -41,7 +41,7 @@ view :core do |args|
41
41
  previous_content = current_content
42
42
  %{
43
43
  <tr class="#{ 'rule-changeover' if changeover }">
44
- <td class="rule-anchor">#{ link_to_page rule.cardname.trunk_name.trunk_name, rule.cardname.trunk_name }</td>
44
+ <td class="rule-anchor">#{ card_link rule.cardname.trunk_name, :text=> rule.cardname.trunk_name.trunk_name }</td>
45
45
 
46
46
  #{
47
47
  if duplicate
@@ -4,14 +4,14 @@ describe Card::Set::Right::Structure do
4
4
  it "closed_content is rendered as type + raw" do
5
5
  template = Card.new(:name=>'A+*right+*structure', :content=>'[[link]] {{inclusion}}')
6
6
  expect(template.format._render(:closed_content)).to eq(
7
- '<a href="/Basic" class="cardtype">Basic</a> : [[link]] {{inclusion}}'
7
+ '<a class="cardtype known-card" href="/Basic">Basic</a> : [[link]] {{inclusion}}'
8
8
  )
9
9
  end
10
10
 
11
11
  it "closed_content is rendered as type + raw" do
12
12
  template = Card.new(:name=>'A+*right+*structure', :type=>'Html', :content=>'[[link]] {{inclusion}}')
13
13
  expect(template.format._render(:closed_content)).to eq(
14
- '<a href="/HTML" class="cardtype">HTML</a> : [[link]] {{inclusion}}'
14
+ '<a class="cardtype known-card" href="/HTML">HTML</a> : [[link]] {{inclusion}}'
15
15
  )
16
16
  end
17
17
  end
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
- require File.expand_path('../../../../../03_machines/spec/lib/machine_spec.rb', __FILE__)
3
+ require File.expand_path('../../../../../03_machines/spec/lib/shared_machine_examples.rb', __FILE__)
4
4
 
5
5
  describe Card::Set::Right::Style do
6
6
  # describe "#delet"
@@ -1,3 +1,4 @@
1
+
1
2
  def clean_html?
2
3
  false
3
4
  end
@@ -5,7 +6,7 @@ end
5
6
  def deliver args={}
6
7
  begin
7
8
  mail = format.render_mail(args)
8
- mail.deliver
9
+ mail.deliver
9
10
  rescue Net::SMTPError => exception
10
11
  Rails.logger.info "sending email: #{args}\nprocessed args: #{email_config(args)}"
11
12
  errors.add :exception, exception.message
@@ -66,7 +67,7 @@ end
66
67
 
67
68
 
68
69
  format do
69
- view :mail do |args|
70
+ view :mail, :perms=>:none do |args|
70
71
  args = card.email_config(args)
71
72
  text_message = args.delete(:text_message)
72
73
  html_message = args.delete(:html_message)
@@ -28,7 +28,7 @@ format :css do
28
28
  end
29
29
 
30
30
  view :url, :perms=>:none do |args|
31
- page_path card.name, :format=>:css, :item=>args[:item]
31
+ page_path card.cardname, :format=>:css, :item=>args[:item]
32
32
  # wagn_url _render_linkname
33
33
  end
34
34
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  format :js do
3
3
  view :include_tag do |args|
4
- %{\n#{javascript_include_tag page_path(card.name) }\n }
4
+ %{\n#{javascript_include_tag page_path(card.cardname) }\n }
5
5
  end
6
6
 
7
7
  end
@@ -54,15 +54,16 @@ end
54
54
  # FIXME: test extension matches content type
55
55
 
56
56
 
57
- def attachment_symlink_to(previous_action_id) # create filesystem links to files from previous action
58
- if styles = case type_code
59
- when :file; ['']
60
- when :image; STYLES
61
- end
57
+ def attachment_symlink_to(prior_action_id) # create filesystem links to files from prior action
58
+ styles = case type_code
59
+ when :file; ['']
60
+ when :image; STYLES
61
+ end
62
+ if styles and prior_action_id != last_action_id
62
63
  save_action_id = selected_action_id
63
64
  links = {}
64
65
 
65
- self.selected_action_id = previous_action_id
66
+ self.selected_action_id = prior_action_id
66
67
  styles.each { |style| links[style] = ::File.basename(attach.path(style)) }
67
68
 
68
69
  self.selected_action_id = last_action_id
@@ -108,7 +109,7 @@ end
108
109
 
109
110
  module Paperclip::Interpolations
110
111
 
111
- extend Wagn::Location
112
+ extend Card::Format::Location
112
113
 
113
114
  def local at, style_name
114
115
  if mod = at.instance.attach_mod
@@ -14,9 +14,11 @@ format do
14
14
  view :type, :perms=>:none do |args| card.type_name end
15
15
  view :linkname, :perms=>:none do |args| card.cardname.url_key end
16
16
  view :url, :perms=>:none do |args| wagn_url _render_linkname end
17
+ view :title, :perms=>:none do |args| args[:title] || card.name end
18
+ view :url_link, :perms=>:none do |args| web_link wagn_url(_render_linkname) end
17
19
 
18
20
  view :link, :perms=>:none do |args|
19
- card_link card.name, showname( args[:title] ), card.known?, args[:type]
21
+ card_link card.name, :text=>showname( args[:title] ), :known=>card.known?, :path_opts=>{:type=>args[:type]}
20
22
  end
21
23
 
22
24
 
@@ -79,39 +81,9 @@ format do
79
81
  end
80
82
 
81
83
 
82
-
83
- # ERROR VIEWS
84
-
85
-
86
- view :blank, :perms=>:none do |args| '' end
87
- view :closed_missing, :perms=>:none do |args| '' end
88
- view :missing, :perms=>:none do |args| '' end
89
-
90
- view :not_found, :perms=>:none, :error_code=>404 do |args|
91
- %{ Could not find #{card.name.present? ? %{"#{card.name}"} : 'the card requested'}. }
92
- end
93
-
94
- view :server_error, :perms=>:none, :error_code=>500 do |args|
95
- %{ Wagn Hitch! Server Error. Yuck, sorry about that.\n}+
96
- %{ To tell us more and follow the fix, add a support ticket at http://wagn.org/new/Support_Ticket }
97
- end
98
-
99
- view :denial, :perms=>:none, :error_code=>403 do |args|
100
- focal? ? 'Permission Denied' : ''
101
- end
102
-
103
- view :bad_address, :perms=>:none, :error_code=>404 do |args|
104
- %{ 404: Bad Address }
105
- end
106
-
107
- view :too_deep, :perms=>:none do |args|
108
- %{ Man, you're too deep. (Too many levels of inclusions at a time) }
109
- end
110
-
111
- view :too_slow, :perms=>:none do |args|
112
- %{ Timed out! #{ showname } took too long to load. }
113
- end
114
-
84
+ view :blank, :perms=>:none do |args| '' end
85
+
86
+
115
87
 
116
88
  #none of the below belongs here!!
117
89