wagn 1.13.0.pre1 → 1.13.0.pre2
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/controllers/card_controller.rb +3 -3
- data/db/migrate_cards/20140307231621_user_data_to_cards.rb +5 -1
- data/lib/card.rb +5 -7
- data/lib/card/chunk.rb +1 -0
- data/lib/card/codename.rb +48 -31
- data/lib/card/env.rb +0 -1
- data/lib/card/exceptions.rb +3 -3
- data/lib/card/format.rb +89 -166
- data/lib/card/generators/set/USAGE +1 -1
- data/lib/card/loader.rb +1 -1
- data/lib/card/set.rb +196 -112
- data/lib/card/set_pattern.rb +37 -71
- data/lib/wagn/cache.rb +8 -7
- data/lib/wagn/commands.rb +1 -1
- data/lib/wagn/config/environments/development.rb +1 -1
- data/lib/wagn/config/initializers/paperclip.rb +1 -0
- data/lib/wagn/generators/wagn/templates/Gemfile +59 -55
- data/lib/wagn/location.rb +2 -2
- data/mods/core/formats/html_format.rb +2 -6
- data/mods/core/formats/text_format.rb +1 -1
- data/mods/core/set_patterns/01_all.rb +0 -5
- data/mods/core/set_patterns/02_all_plus.rb +1 -3
- data/mods/core/set_patterns/07_type_plus_right.rb +0 -1
- data/mods/core/sets/all/active_card.rb +1 -1
- data/mods/core/sets/all/name.rb +3 -2
- data/mods/core/sets/all/pattern.rb +9 -23
- data/mods/core/sets/all/phases.rb +27 -13
- data/mods/core/sets/all/rules.rb +3 -3
- data/mods/core/sets/all/templating.rb +5 -2
- data/mods/core/sets/all/tracked_attributes.rb +2 -1
- data/mods/core/sets/right/structure.rb +13 -0
- data/mods/{standard → core}/sets/type/plain_text.rb +0 -0
- data/mods/standard/formats/email_html_format.rb +1 -1
- data/mods/standard/lib/card/machine.rb +16 -12
- data/mods/standard/lib/card/machine_input.rb +1 -1
- data/mods/standard/sets/all/attach.rb +1 -1
- data/mods/standard/sets/all/base.rb +92 -94
- data/mods/standard/sets/all/follow.rb +1 -1
- data/mods/standard/sets/all/rich_html.rb +5 -3
- data/mods/standard/sets/all/rss.rb +12 -5
- data/mods/standard/sets/right/account.rb +1 -1
- data/mods/standard/sets/right/add_help.rb +3 -1
- data/mods/standard/sets/right/comment.rb +92 -3
- data/mods/standard/sets/right/create.rb +2 -87
- data/mods/standard/sets/right/default.rb +3 -2
- data/mods/standard/sets/right/delete.rb +2 -5
- data/mods/standard/sets/right/help.rb +3 -1
- data/mods/standard/sets/right/machine_output.rb +9 -7
- data/mods/standard/sets/right/read.rb +2 -5
- data/mods/standard/sets/right/style.rb +3 -2
- data/mods/standard/sets/right/update.rb +2 -5
- data/mods/standard/sets/rstar/rules.rb +0 -2
- data/mods/standard/sets/self/head.rb +2 -3
- data/mods/standard/sets/self/navbox.rb +0 -7
- data/mods/standard/sets/self/recent.rb +2 -2
- data/mods/standard/sets/self/search.rb +10 -3
- data/mods/standard/sets/self/signin.rb +3 -3
- data/mods/standard/sets/type/cardtype.rb +2 -2
- data/mods/standard/sets/type/coffee_script.rb +4 -4
- data/mods/standard/sets/type/css.rb +12 -4
- data/mods/standard/sets/type/image.rb +19 -19
- data/mods/standard/sets/type/java_script.rb +1 -1
- data/mods/standard/sets/type/layout_type.rb +3 -2
- data/mods/standard/sets/type/pointer.rb +3 -2
- data/mods/standard/sets/type/scss.rb +6 -34
- data/mods/standard/sets/type/search_type.rb +22 -16
- data/mods/standard/sets/type/set.rb +2 -2
- data/mods/standard/sets/type/setting.rb +2 -2
- data/mods/standard/sets/type/skin.rb +4 -18
- data/spec/controllers/card_controller_spec.rb +2 -2
- data/spec/lib/card/flexmail_spec.rb +1 -0
- data/spec/lib/card/format_spec.rb +9 -9
- data/spec/lib/card/loader_spec.rb +1 -2
- data/spec/lib/card/name_spec.rb +7 -1
- data/spec/lib/card/set_pattern_spec.rb +5 -5
- data/spec/mods/core/sets/all/pattern_spec.rb +0 -9
- data/spec/mods/core/sets/all/phases_spec.rb +2 -1
- data/spec/mods/standard/lib/machine_input_spec.rb +20 -4
- data/spec/mods/standard/lib/machine_spec.rb +64 -14
- data/spec/mods/standard/sets/right/machine_output_spec.rb +2 -17
- data/spec/mods/standard/sets/right/script_spec.rb +9 -5
- data/spec/mods/standard/sets/right/style_spec.rb +11 -5
- data/spec/mods/standard/sets/type/coffeescript_spec.rb +5 -7
- data/spec/mods/standard/sets/type/css_spec.rb +3 -4
- data/spec/mods/standard/sets/type/javascript_spec.rb +3 -5
- data/spec/mods/standard/sets/type/scss_spec.rb +4 -7
- data/spec/mods/standard/sets/type/skin_spec.rb +29 -8
- metadata +5 -4
- data/mods/standard/sets/right/structure.rb +0 -12
@@ -1,3 +1,92 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
view :
|
1
|
+
|
2
|
+
format :html do
|
3
|
+
view :editor do |args|
|
4
|
+
set_name = card.cardname.trunk_name
|
5
|
+
set_card = Card.fetch(set_name)
|
6
|
+
not_set = set_card && set_card.type_id != SetID
|
7
|
+
|
8
|
+
group_options = Auth.as_bot { Card.search(:type_id=>RoleID, :sort=>'name') }
|
9
|
+
|
10
|
+
inheritable = not_set ? false : set_card.inheritable?
|
11
|
+
inheriting = inheritable && card.content=='_left'
|
12
|
+
|
13
|
+
item_names = inheriting ? [] : card.item_names
|
14
|
+
|
15
|
+
%{
|
16
|
+
#{ form.hidden_field :content, :class=>'card-content' }
|
17
|
+
<div class="perm-editor">
|
18
|
+
|
19
|
+
#{ if inheritable; %{
|
20
|
+
<div class="perm-inheritance perm-section">
|
21
|
+
#{ check_box_tag 'inherit', 'inherit', inheriting }
|
22
|
+
<label>
|
23
|
+
#{ core_inherit_content args.merge(:target=>'wagn_role') }
|
24
|
+
#{ content_tag( :a, :title=>"use left's #{card.cardname.tag} rule") { '?' } }
|
25
|
+
</label>
|
26
|
+
</div>
|
27
|
+
} end }
|
28
|
+
|
29
|
+
<div class="perm-group perm-vals perm-section">
|
30
|
+
<h5>Groups</h5>
|
31
|
+
#{
|
32
|
+
group_options.map do |option|
|
33
|
+
checked = !!item_names.delete(option.name)
|
34
|
+
%{
|
35
|
+
<div class="group-option">
|
36
|
+
#{ check_box_tag( "#{option.key}-perm-checkbox", option.name, checked, :class=>'perm-checkbox-button' ) }
|
37
|
+
<label>#{ link_to_page option.name, nil, :target=>'wagn_role' }</label>
|
38
|
+
</div>
|
39
|
+
}
|
40
|
+
end * "\n"
|
41
|
+
}
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div class="perm-indiv perm-vals perm-section">
|
45
|
+
<h5>Individuals</h5>
|
46
|
+
#{ _render_list :item_list=>item_names, :extra_css_class=>'perm-indiv-ul' }
|
47
|
+
</div>
|
48
|
+
|
49
|
+
</div>
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
view :pointer_core, :view=>:core, :mod=>Type::Pointer::HtmlFormat
|
55
|
+
|
56
|
+
view :core do |args|
|
57
|
+
args[:item] ||= :link
|
58
|
+
card.content=='_left' ? core_inherit_content(args) : render( :pointer_core, args )
|
59
|
+
end
|
60
|
+
|
61
|
+
view :closed_content do |args|
|
62
|
+
card.content=='_left' ? core_inherit_content(args) : render( :pointer_core, args )
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
def core_inherit_content args={}
|
69
|
+
sc = args[:set_context]
|
70
|
+
text = if sc && sc.tag_name.key == Card[:self].key
|
71
|
+
begin
|
72
|
+
task = card.tag.codename
|
73
|
+
ancestor = Card[sc.trunk_name.trunk_name]
|
74
|
+
links = ancestor.who_can( task.to_sym ).map do |card_id|
|
75
|
+
link_to_page Card[card_id].name, nil, :target=>args[:target]
|
76
|
+
end*", "
|
77
|
+
"Inherit ( #{links} )"
|
78
|
+
rescue
|
79
|
+
'Inherit'
|
80
|
+
end
|
81
|
+
else
|
82
|
+
'Inherit from left card'
|
83
|
+
end
|
84
|
+
%{<span class="inherit-perm">#{text}</span>}
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
|
89
|
+
def standardize_items
|
90
|
+
# noop to override default behavior, which wouldn't let '_left' through and would therefore break
|
91
|
+
end
|
92
|
+
|
@@ -1,88 +1,3 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
set_name = card.cardname.trunk_name
|
5
|
-
set_card = Card.fetch(set_name)
|
6
|
-
not_set = set_card && set_card.type_id != SetID
|
7
|
-
|
8
|
-
group_options = Auth.as_bot { Card.search(:type_id=>RoleID, :sort=>'name') }
|
9
|
-
|
10
|
-
inheritable = not_set ? false : set_card.inheritable?
|
11
|
-
inheriting = inheritable && card.content=='_left'
|
12
|
-
|
13
|
-
item_names = inheriting ? [] : card.item_names
|
14
|
-
|
15
|
-
%{
|
16
|
-
#{ form.hidden_field :content, :class=>'card-content' }
|
17
|
-
<div class="perm-editor">
|
18
|
-
|
19
|
-
#{ if inheritable; %{
|
20
|
-
<div class="perm-inheritance perm-section">
|
21
|
-
#{ check_box_tag 'inherit', 'inherit', inheriting }
|
22
|
-
<label>
|
23
|
-
#{ core_inherit_content args.merge(:target=>'wagn_role') }
|
24
|
-
#{ content_tag( :a, :title=>"use left's #{card.cardname.tag} rule") { '?' } }
|
25
|
-
</label>
|
26
|
-
</div>
|
27
|
-
} end }
|
28
|
-
|
29
|
-
<div class="perm-group perm-vals perm-section">
|
30
|
-
<h5>Groups</h5>
|
31
|
-
#{
|
32
|
-
group_options.map do |option|
|
33
|
-
checked = !!item_names.delete(option.name)
|
34
|
-
%{
|
35
|
-
<div class="group-option">
|
36
|
-
#{ check_box_tag( "#{option.key}-perm-checkbox", option.name, checked, :class=>'perm-checkbox-button' ) }
|
37
|
-
<label>#{ link_to_page option.name, nil, :target=>'wagn_role' }</label>
|
38
|
-
</div>
|
39
|
-
}
|
40
|
-
end * "\n"
|
41
|
-
}
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<div class="perm-indiv perm-vals perm-section">
|
45
|
-
<h5>Individuals</h5>
|
46
|
-
#{ _render_list :item_list=>item_names, :extra_css_class=>'perm-indiv-ul' }
|
47
|
-
</div>
|
48
|
-
|
49
|
-
</div>
|
50
|
-
}
|
51
|
-
end
|
52
|
-
|
53
|
-
view :core do |args|
|
54
|
-
args[:item] ||= :link
|
55
|
-
card.content=='_left' ? core_inherit_content(args) : _final_pointer_type_core(args)
|
56
|
-
end
|
57
|
-
|
58
|
-
view :closed_content do |args|
|
59
|
-
card.content=='_left' ? core_inherit_content(args) : _final_pointer_type_closed_content(args)
|
60
|
-
end
|
61
|
-
|
62
|
-
|
63
|
-
private
|
64
|
-
|
65
|
-
def core_inherit_content args={}
|
66
|
-
sc = args[:set_context]
|
67
|
-
text = if sc && sc.tag_name.key == Card[:self].key
|
68
|
-
begin
|
69
|
-
task = card.tag.codename
|
70
|
-
ancestor = Card[sc.trunk_name.trunk_name]
|
71
|
-
links = ancestor.who_can( task.to_sym ).map do |card_id|
|
72
|
-
link_to_page Card[card_id].name, nil, :target=>args[:target]
|
73
|
-
end*", "
|
74
|
-
"Inherit ( #{links} )"
|
75
|
-
rescue
|
76
|
-
'Inherit'
|
77
|
-
end
|
78
|
-
else
|
79
|
-
'Inherit from left card'
|
80
|
-
end
|
81
|
-
%{<span class="inherit-perm">#{text}</span>}
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
|
86
|
-
def standardize_items
|
87
|
-
# noop to override default behavior, which wouldn't let '_left' through and would therefore break
|
88
|
-
end
|
2
|
+
include Comment
|
3
|
+
format :html do include Comment::HtmlFormat end
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
format :html do
|
2
|
+
include Structure::HtmlFormat
|
3
|
+
end
|
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
1
|
format do
|
3
2
|
view :not_found do |args|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
srid = card.selected_revision_id
|
4
|
+
if card.left.kind_of? Machine and (card.new_card? or !srid or srid == card.current_revision_id)
|
5
|
+
# only regenerate output if it's really warranted
|
6
|
+
# (not when someone requests a specific old version that has been removed)
|
7
|
+
card.left.update_machine_output
|
8
|
+
root.error_status = 302
|
9
|
+
wagn_path card.left.machine_output_url
|
8
10
|
else
|
9
|
-
|
11
|
+
super args
|
10
12
|
end
|
11
13
|
end
|
12
|
-
end
|
14
|
+
end
|
@@ -7,7 +7,8 @@ def chunk_list #turn off autodetection of uri's
|
|
7
7
|
#TODO with the new format pattern this should be handled in the js format
|
8
8
|
:inclusion_only
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
|
+
=begin
|
11
12
|
format :file do
|
12
13
|
view :core do |args|
|
13
14
|
if params[:explicit_file] and r = controller.response
|
@@ -18,4 +19,4 @@ format :file do
|
|
18
19
|
:x_sendfile=>true, :type=>'text/css', :disposition=>'inline' } ]
|
19
20
|
end
|
20
21
|
end
|
21
|
-
|
22
|
+
=end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
format :html do
|
3
2
|
|
4
3
|
view :raw do |args|
|
@@ -45,7 +44,7 @@ format :html do
|
|
45
44
|
# RSS # move to mods!
|
46
45
|
if root.card.type_id == SearchTypeID
|
47
46
|
opts = { :format => :rss }
|
48
|
-
search_params[:vars].each { |key, val| opts["_#{key}"] = val }
|
47
|
+
root.search_params[:vars].each { |key, val| opts["_#{key}"] = val }
|
49
48
|
bits << %{<link rel="alternate" type="application/rss+xml" title="RSS" href=#{page_path root.card.name, opts} />}
|
50
49
|
end
|
51
50
|
end
|
@@ -77,7 +76,7 @@ format :html do
|
|
77
76
|
c=Card[:double_click] and !Card.toggle c.content and varvals << 'wagn.noDoubleClick=true'
|
78
77
|
@css_path and varvals << "wagn.cssPath='#{@css_path}'"
|
79
78
|
|
80
|
-
script_card = card.rule_card :script
|
79
|
+
script_card = root.card.rule_card :script
|
81
80
|
ie9_card = Card[:script_html5shiv_printshiv]
|
82
81
|
%(#{ javascript_tag do varvals * ';' end }
|
83
82
|
#{ javascript_include_tag script_card.machine_output_url if script_card }
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
view :title do |args|
|
3
|
-
|
3
|
+
super args.merge( :title=>'Recent Changes' )
|
4
4
|
end
|
5
5
|
|
6
6
|
format :html do
|
@@ -13,7 +13,7 @@ format :html do
|
|
13
13
|
begin
|
14
14
|
stamp = card.updated_at
|
15
15
|
day = Date.new(stamp.year, stamp.month, stamp.day)
|
16
|
-
rescue
|
16
|
+
rescue =>e
|
17
17
|
day = Date.today
|
18
18
|
card.content = "(error getting date)"
|
19
19
|
end
|
@@ -2,10 +2,11 @@
|
|
2
2
|
format :html do
|
3
3
|
|
4
4
|
view :title do |args|
|
5
|
-
|
6
|
-
|
5
|
+
vars = root.search_params[:vars]
|
6
|
+
if vars && vars[:keyword]
|
7
|
+
args.merge! :title=> %{Search results for: <span class="search-keyword">#{ vars[:keyword] }</span>}
|
7
8
|
end
|
8
|
-
|
9
|
+
super args
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
@@ -33,4 +34,10 @@ format :json do
|
|
33
34
|
}
|
34
35
|
|
35
36
|
end
|
37
|
+
|
38
|
+
#hacky. here for override
|
39
|
+
def goto_wql(term)
|
40
|
+
{ :complete=>term, :limit=>8, :sort=>'name', :return=>'name' }
|
41
|
+
end
|
42
|
+
|
36
43
|
end
|
@@ -3,7 +3,7 @@ format :html do
|
|
3
3
|
|
4
4
|
view :open do |args|
|
5
5
|
args.merge! :title=>'Sign In', :optional_help=>:show
|
6
|
-
|
6
|
+
super args
|
7
7
|
end
|
8
8
|
|
9
9
|
view :open_content do |args|
|
@@ -22,7 +22,7 @@ format :html do
|
|
22
22
|
account = card.fetch :trait=>:account, :new=>{}
|
23
23
|
|
24
24
|
form_args = {
|
25
|
-
:hidden => { :success=>'REDIRECT:
|
25
|
+
:hidden => { :success=>'REDIRECT: *previous' },
|
26
26
|
:recaptcha => :off
|
27
27
|
}
|
28
28
|
|
@@ -51,7 +51,7 @@ format :html do
|
|
51
51
|
}
|
52
52
|
} )
|
53
53
|
|
54
|
-
Auth.as_bot {
|
54
|
+
Auth.as_bot { super args }
|
55
55
|
end
|
56
56
|
|
57
57
|
view :raw do |args|
|
@@ -3,14 +3,14 @@ format :html do
|
|
3
3
|
|
4
4
|
view :type do |args|
|
5
5
|
args.merge!(:type_class=>'no-edit') if card.cards_of_type_exist?
|
6
|
-
|
6
|
+
super args
|
7
7
|
end
|
8
8
|
|
9
9
|
view :type_fieldset do |args|
|
10
10
|
if card.cards_of_type_exist?
|
11
11
|
%{<div>Sorry, this card must remain a Cardtype so long as there are <strong>#{ card.name }</strong> cards.</div>}
|
12
12
|
else
|
13
|
-
|
13
|
+
super args
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
@@ -6,13 +6,13 @@ include Machine
|
|
6
6
|
include MachineInput
|
7
7
|
|
8
8
|
def compile_coffee script
|
9
|
-
|
10
|
-
rescue
|
9
|
+
::CoffeeScript.compile script
|
10
|
+
rescue =>e
|
11
11
|
e
|
12
12
|
end
|
13
13
|
|
14
14
|
machine_input do
|
15
|
-
compile_coffee format(:format=>:js)._render_raw
|
15
|
+
Uglifier.compile( compile_coffee format(:format=>:js)._render_raw )
|
16
16
|
end
|
17
17
|
|
18
18
|
store_machine_output :filetype => "js"
|
@@ -28,7 +28,7 @@ end
|
|
28
28
|
|
29
29
|
|
30
30
|
format :html do
|
31
|
-
view :editor, :
|
31
|
+
view :editor, :mod=>PlainText::HtmlFormat
|
32
32
|
|
33
33
|
view :core do |args|
|
34
34
|
js = card.compile_coffee _render_raw
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require 'sass'
|
1
3
|
include Machine
|
2
4
|
include MachineInput
|
3
5
|
|
@@ -10,19 +12,25 @@ end
|
|
10
12
|
def compress_css input
|
11
13
|
begin
|
12
14
|
Sass.compile input, :style=>:compressed
|
13
|
-
rescue
|
15
|
+
rescue => e
|
14
16
|
raise Card::Oops, "Stylesheet Error:\n#{ e.message }"
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
|
-
|
20
|
+
def clean_html?
|
21
|
+
false
|
22
|
+
end
|
23
|
+
|
24
|
+
def chunk_list #turn off autodetection of uri's
|
25
|
+
:inclusion_and_link
|
26
|
+
end
|
19
27
|
|
20
|
-
|
28
|
+
format :html do
|
29
|
+
view :editor, :mod=>PlainText::HtmlFormat
|
21
30
|
|
22
31
|
view :core do |args|
|
23
32
|
# FIXME: scan must happen before process for inclusion interactions to work, but this will likely cause
|
24
33
|
# problems with including other css?
|
25
34
|
process_content ::CodeRay.scan( _render_raw, :css ).div, :size=>:icon
|
26
35
|
end
|
27
|
-
|
28
36
|
end
|