wagn 1.14.0.pre3 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/VERSION +1 -1
- data/app/controllers/card_controller.rb +3 -0
- data/config/version_cards.txt +1 -1
- data/db/bootstrap/card_actions.yml +1072 -1016
- data/db/bootstrap/card_acts.yml +2 -2
- data/db/bootstrap/card_changes.yml +1740 -1643
- data/db/bootstrap/card_references.yml +498 -477
- data/db/bootstrap/cards.yml +1179 -1047
- data/db/{migrate_cards → migrate_core_cards}/20130411191151_renaming_for_menu.rb +1 -1
- data/db/{migrate_cards → migrate_core_cards}/20130411211600_delete_old_related_tab_cards.rb +1 -1
- data/db/{migrate_cards → migrate_core_cards}/20130419215612_import_help_text.rb +3 -3
- data/db/{migrate_cards → migrate_core_cards}/20130823192433_add_style_cards.rb +1 -1
- data/db/{migrate_cards → migrate_core_cards}/20130910183318_move_styles_to_content.rb +2 -2
- data/db/{migrate_cards → migrate_core_cards}/20130920214038_jsonize_tinymce.rb +1 -1
- data/db/{migrate_cards → migrate_core_cards}/20130920291703_update_stylesheets.rb +2 -2
- data/db/{migrate_cards → migrate_core_cards}/20130927191728_account_events.rb +1 -1
- data/db/{migrate_cards → migrate_core_cards}/20131016172445_common_css_patch.rb +2 -2
- data/db/{migrate_cards → migrate_core_cards}/20140110193325_reset_account_request_type.rb +1 -1
- data/db/{migrate_cards → migrate_core_cards}/20140307231621_user_data_to_cards.rb +1 -1
- data/db/{migrate_cards → migrate_core_cards}/20140317035504_account_requests_to_signups.rb +1 -1
- data/db/{migrate_cards → migrate_core_cards}/20140512155840_add_script_cards.rb +1 -1
- data/db/{migrate_cards → migrate_core_cards}/20140629222005_add_email_cards.rb +5 -5
- data/db/migrate_core_cards/20140725180118_config_card_updates.rb +9 -0
- data/db/migrate_core_cards/20141111083921_delete_machine_output.rb +9 -0
- data/db/migrate_core_cards/20141115034214_config_descriptions_etc.rb +14 -0
- data/db/{migrate_cards → migrate_core_cards}/data/1.11_help_text.json +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/1.12_stylesheets/classic_cards.scss +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/1.12_stylesheets/common.scss +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/1.12_stylesheets/right_sidebar.scss +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/1.12_stylesheets/traditional.scss +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/1.13_config_text.json +1 -1
- data/db/migrate_core_cards/data/1.14_config_descriptions_etc.json +77 -0
- data/db/{migrate_cards → migrate_core_cards}/data/mailer/follower_notification_email.html +1 -1
- data/db/{migrate_cards → migrate_core_cards}/data/mailer/follower_notification_email.txt +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/mailer/mail_config.json +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/mailer/password_reset_email.html +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/mailer/password_reset_email.txt +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/mailer/signup_alert_email.html +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/mailer/signup_alert_email.txt +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/mailer/verification_email.html +0 -0
- data/db/{migrate_cards → migrate_core_cards}/data/mailer/verification_email.txt +0 -0
- data/db/schema.rb +6 -0
- data/features/conflict.feature +3 -3
- data/features/watch.feature +1 -1
- data/lib/card/act.rb +1 -1
- data/lib/card/generators/card_migration/card_migration_generator.rb +1 -0
- data/lib/card/generators/card_migration/templates/card_migration.erb +5 -4
- data/lib/wagn/application.rb +1 -1
- data/lib/wagn/commands.rb +1 -1
- data/lib/wagn/core_migration.rb +19 -0
- data/lib/wagn/migration.rb +33 -11
- data/lib/wagn/tasks/wagn.rake +24 -16
- data/lib/wagn/version.rb +4 -3
- data/mod/01_core/set/all/content.rb +17 -0
- data/mod/02_basic_types/set/type/pointer.rb +8 -6
- data/mod/05_standard/set/all/base.rb +3 -1
- data/mod/05_standard/set/all/rich_html.rb +28 -12
- data/mod/05_standard/set/type/signup.rb +1 -1
- data/mod/05_standard/spec/set/type/email_template_spec.rb +3 -1
- data/mod/06_email/set/right/bcc.rb +9 -1
- data/mod/06_email/set/right/cc.rb +2 -1
- data/mod/06_email/set/right/from.rb +2 -1
- data/mod/06_email/set/right/to.rb +1 -0
- data/test/1.10.0-data-dump.sql +32 -0
- data/test/fixtures/card_actions.yml +1565 -1509
- data/test/fixtures/card_acts.yml +283 -283
- data/test/fixtures/card_changes.yml +3808 -3718
- data/test/fixtures/card_references.yml +763 -735
- data/test/fixtures/cards.yml +1931 -1806
- data/wagn.gemspec +1 -1
- metadata +40 -36
- data/db/migrate_cards/20140725180118_config_card_updates.rb +0 -9
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
class ImportHelpText < Wagn::
|
3
|
+
class ImportHelpText < Wagn::CoreMigration
|
4
4
|
def up
|
5
|
-
|
6
|
-
data = JSON.parse
|
5
|
+
dir = data_path '1.11_help_text.json'
|
6
|
+
data = JSON.parse( File.read dir )
|
7
7
|
data.each do |atom|
|
8
8
|
c = atom['card']
|
9
9
|
Card.merge c['name'], { :type=>c['type'], :content=>atom['views'][0]['parts'] }, :pristine=>true
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
class MoveStylesToContent < Wagn::
|
3
|
+
class MoveStylesToContent < Wagn::CoreMigration
|
4
4
|
def up
|
5
|
-
dir = "
|
5
|
+
dir = File.join data_path, "1.12_stylesheets"
|
6
6
|
%w{ right_sidebar common classic_cards traditional }.each do |sheetname|
|
7
7
|
Card["style: #{sheetname}"].update_attributes! :codename=>nil, :content=>File.read("#{dir}/#{sheetname}.scss")
|
8
8
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
class UpdateStylesheets < Wagn::
|
3
|
+
class UpdateStylesheets < Wagn::CoreMigration
|
4
4
|
def up
|
5
|
-
dir =
|
5
|
+
dir = File.join data_path, '1.12_stylesheets'
|
6
6
|
%w{ common traditional }.each do |sheetname|
|
7
7
|
card = Card["style: #{sheetname}"]
|
8
8
|
if card && card.pristine?
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
class CommonCssPatch < Wagn::
|
3
|
+
class CommonCssPatch < Wagn::CoreMigration
|
4
4
|
def up
|
5
|
-
dir = "
|
5
|
+
dir = File.join data_path, "1.12_stylesheets"
|
6
6
|
card = Card["style: common"]
|
7
7
|
if card && card.pristine?
|
8
8
|
card.update_attributes! :content=>File.read("#{dir}/common.scss")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
class AddEmailCards < Wagn::
|
3
|
+
class AddEmailCards < Wagn::CoreMigration
|
4
4
|
def up
|
5
5
|
|
6
6
|
# change notification rules
|
@@ -38,7 +38,7 @@ class AddEmailCards < Wagn::Migration
|
|
38
38
|
{{+*subject | titled}}
|
39
39
|
{{+*html message | titled}}
|
40
40
|
{{+*text message | titled}}
|
41
|
-
{+*attach | titled}}
|
41
|
+
{{+*attach | titled}}
|
42
42
|
)
|
43
43
|
|
44
44
|
c = Card.fetch '*message', :new=>{ }
|
@@ -54,8 +54,8 @@ class AddEmailCards < Wagn::Migration
|
|
54
54
|
|
55
55
|
|
56
56
|
# create system email cards
|
57
|
-
dir =
|
58
|
-
json = File.read( File.join( dir, 'mail_config.json' ))
|
57
|
+
dir = File.join data_path, 'mailer'
|
58
|
+
json = File.read( File.join( dir, 'mail_config.json' ) )
|
59
59
|
data = JSON.parse(json)
|
60
60
|
data.each do |mail|
|
61
61
|
mail = mail.symbolize_keys!
|
@@ -124,7 +124,7 @@ class AddEmailCards < Wagn::Migration
|
|
124
124
|
# move old send rule to on_create
|
125
125
|
#fields = %w( to from cc bcc subject message attach )
|
126
126
|
Card.search(:right=>"*send").each do |send_rule|
|
127
|
-
Card.create! :name=>"#{send_rule.
|
127
|
+
Card.create! :name=>"#{send_rule.left_name}+*on create", :content=>send_rule.content, :type_code=>:pointer
|
128
128
|
send_rule.delete #@ethn: keep old rule for safety reasons?
|
129
129
|
end
|
130
130
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
class ConfigCardUpdates < Wagn::CoreMigration
|
4
|
+
def up
|
5
|
+
raw_json = File.read( data_path '1.13_config_text.json' )
|
6
|
+
json = JSON.parse raw_json
|
7
|
+
Card.merge_list json["card"]["value"], :output_file=>"tmp/unmerged_config_text.json"
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
class ConfigDescriptionsEtc < Wagn::CoreMigration
|
4
|
+
def up
|
5
|
+
raw_json = File.read( data_path '1.14_config_descriptions_etc.json' )
|
6
|
+
json = JSON.parse raw_json
|
7
|
+
Card.merge_list json["card"]["value"], :output_file=>"tmp/unmerged_config_text.json"
|
8
|
+
|
9
|
+
# fix missing +*from card
|
10
|
+
c = Card.fetch "follower notification email+#{Card[:from].name}", :new=>{}
|
11
|
+
c.content = Card[:wagn_bot].name
|
12
|
+
c.save!
|
13
|
+
end
|
14
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -14,7 +14,7 @@
|
|
14
14
|
{
|
15
15
|
"name": "Sign up+description",
|
16
16
|
"type": "Basic",
|
17
|
-
"content": "<p>[[Sign up]] cards represent not-yet-approved accounts.
|
17
|
+
"content": "<p>[[Sign up]] cards represent not-yet-approved accounts. When approved, they become [[User]] cards. [[http://wagn.org/account|more]]</p>"
|
18
18
|
},
|
19
19
|
{
|
20
20
|
"name": "Config",
|
@@ -0,0 +1,77 @@
|
|
1
|
+
{
|
2
|
+
"url": "http://en.dwagn.org/export.json",
|
3
|
+
"timestamp": "2014-11-15 03:44:05 +0000",
|
4
|
+
"card": {
|
5
|
+
"name": "export",
|
6
|
+
"type": "Pointer",
|
7
|
+
"content": "[[Config]]\n[[*account]]\n[[Skin+description]]\n[[Sign up+description]]\n[[Toggle+description]]\n[[User+description]]\n[[Email_template+*type+*structure]]\n[[JavaScript+description]]\n[[CSS+description]]\n[[CoffeeScript+description]]\n[[Layout+description]]\n[[Email template+description]]\n[[SCSS+description]]",
|
8
|
+
"value": [
|
9
|
+
{
|
10
|
+
"name": "Config",
|
11
|
+
"type": "Basic",
|
12
|
+
"content": "<h1>Basics</h1>\r\n<div>Set your site title, home card, and logo image:</div>\r\n<blockquote>\r\n<div>{{*title|closed;type:Phrase}}</div>\r\n<div>{{*home|closed;type:Phrase}}</div>\r\n<div>{{*logo|closed;type:Image}}</div>\r\n</blockquote>\r\n<div> </div>\r\n<h1>Rules</h1>\r\n<div>Cards are configured by creating <em>rules</em>. All rules impacting a given card can be accessed from its card menu via \"advanced\".</div>\r\n<div> </div>\r\n<div>Here are the site-wide defaults:</div>\r\n<div>\r\n<blockquote>{{*all|closed}}</blockquote>\r\n</div>\r\n<div><em>[[http://wagn.org/rules | More about rules.]]</em></div>\r\n<div> </div>\r\n<h1>Accounts</h1>\r\n<div>{{*accounts}}</div>\r\n<div> </div>\r\n<h1>Emails </h1>\r\n<div>Here are the current [[Email Templates]] for your site.</div>\r\n<blockquote>\r\n<div>{{Email Templates+*type+by update}} </div>\r\n</blockquote>"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"name": "*account",
|
16
|
+
"type": "Basic",
|
17
|
+
"content": "<div>When someone signs up, they create a [[Sign up]] card...</div>\r\n<blockquote>\r\n<div>{{Sign up|closed;title: Sign ups}}</div>\r\n</blockquote>\r\n<div>...that can be changed into a [[User]] card:</div>\r\n<blockquote>\r\n<div>{{User|closed}}</div>\r\n</blockquote>\r\n<div>Some important [[http://wagn.org/permissions|permissions]]:</div>\r\n<div>\r\n<ul>\r\n<li>When [[Anyone]] can [[*create|create]] a [[Sign up]] card, links to sign up will appear.</li>\r\n<li>When [[Anyone]] can [[*create|create]] a [[User]] card, each [[Sign up]] can be auto-approved with a verification email.</li>\r\n<li>If permission to [[*create|create]] a [[User]] is restricted, someone with that permission must approve each [[Sign up]] by hand.</li>\r\n</ul>\r\n</div>\r\n<div><em>[[http://wagn.org/account | More about accounts.]]</em></div>",
|
18
|
+
"codename": "account"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "Skin+description",
|
22
|
+
"type": "Basic",
|
23
|
+
"content": "<p>A [[skin]] determines a page's look and feel. [[http://wagn.org/Skins|more]]</p>"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"name": "Sign up+description",
|
27
|
+
"type": "Basic",
|
28
|
+
"content": "<p>[[Sign up]] cards represent not-yet-approved accounts. When approved, they become [[User]] cards. [[http://wagn.org/account|more]]</p>"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"name": "Toggle+description",
|
32
|
+
"type": "Basic",
|
33
|
+
"content": "<p>Toggles simply indicate yes or no. [[http://wagn.org/wagn/Toggle|more]].</p>"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"name": "User+description",
|
37
|
+
"type": "Basic",
|
38
|
+
"content": "<p>{{_l|name}} cards can support accounts, profile pages, and more. [[http://wagn.org/Users|more]]</p>"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"name": "Email template+*type+*structure",
|
42
|
+
"type": "Basic",
|
43
|
+
"content": "<p>{{+*from | labeled | link}} {{+*to | labeled | link}} {{+*cc | labeled | link}} {{+*bcc | labeled | link}} {{+*subject | titled}} {{+*html message | titled}} {{+*text message | titled}} {{+*attach | titled}}</p>"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"name": "JavaScript+description",
|
47
|
+
"type": "Basic",
|
48
|
+
"content": "<p>Create custom JavaScript for [[*script]] rules. [[http://wagn.org/JavaScript|more]]</p>"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"name": "CSS+description",
|
52
|
+
"type": "Basic",
|
53
|
+
"content": "<p>Customize styles for [[Skins]]. [[http://wagn.org/CSS|more]]</p>"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"name": "CoffeeScript+description",
|
57
|
+
"type": "Basic",
|
58
|
+
"content": "<p>Generate JavaScript for [[*script]] rules. [[http://wagn.org/CoffeeScript|more]]</p>"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"name": "Layout+description",
|
62
|
+
"type": "Basic",
|
63
|
+
"content": "<p>Organize webpages. [[http://wagn.org/Layout|more]]</p>"
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"name": "Email template+description",
|
67
|
+
"type": "Basic",
|
68
|
+
"content": "<p>Design custom emails to be triggered by card actions. [[http://wagn.org/actions|more]]</p>"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"name": "SCSS+description",
|
72
|
+
"type": "Basic",
|
73
|
+
"content": "<p>Customize styles for [[Skins]]. [[http://wagn.org/SCSS|more]]</p>"
|
74
|
+
}
|
75
|
+
]
|
76
|
+
}
|
77
|
+
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/db/schema.rb
CHANGED
@@ -96,6 +96,12 @@ ActiveRecord::Schema.define(:version => 20141001105348) do
|
|
96
96
|
|
97
97
|
add_index "schema_migrations_cards", ["version"], :name => "unique_schema_migrations_cards", :unique => true
|
98
98
|
|
99
|
+
create_table "schema_migrations_deck_cards", :id => false, :force => true do |t|
|
100
|
+
t.string "version", :null => false
|
101
|
+
end
|
102
|
+
|
103
|
+
add_index "schema_migrations_deck_cards", ["version"], :name => "unique_schema_migrations_deck_cards", :unique => true
|
104
|
+
|
99
105
|
create_table "sessions", :force => true do |t|
|
100
106
|
t.string "session_id"
|
101
107
|
t.text "data"
|
data/features/conflict.feature
CHANGED
@@ -28,11 +28,11 @@ Feature: Conflict
|
|
28
28
|
And I open a new window for Joe User
|
29
29
|
And I edit "Duck Soup" setting content to "Stan Laurel"
|
30
30
|
And I am signed out
|
31
|
-
And I
|
32
|
-
And I am signed in as Joe Admin
|
31
|
+
And I am signed in as Joe Admin
|
33
32
|
And I close window
|
34
33
|
And I submit
|
35
|
-
Then I
|
34
|
+
Then I should see "Conflict!"
|
35
|
+
And I should see "No difference between your changes and Joe User's version."
|
36
36
|
|
37
37
|
|
38
38
|
|
data/features/watch.feature
CHANGED
@@ -41,7 +41,7 @@ Feature: Watch interface
|
|
41
41
|
Given Joe User is watching "User"
|
42
42
|
And I go to card Joe User
|
43
43
|
And I hover over the main menu
|
44
|
-
Then In the main card menu I should see "(following)"
|
44
|
+
Then In the main card menu I should see "(following)|unfollow"
|
45
45
|
|
46
46
|
#too long for menu
|
47
47
|
#
|
data/lib/card/act.rb
CHANGED
@@ -21,6 +21,7 @@ class CardMigrationGenerator < ActiveRecord::Generators::Base
|
|
21
21
|
|
22
22
|
def set_local_assigns!
|
23
23
|
@migration_template = "card_migration.erb"
|
24
|
+
@migration_parent_class = options['core'] ? 'Wagn::CoreMigration' : 'Wagn::Migration'
|
24
25
|
case file_name
|
25
26
|
when /^(import)_(.*)(?:\.json)?/
|
26
27
|
@migration_action = $1
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
class <%= migration_class_name %> <
|
3
|
+
class <%= migration_class_name %> < <%= @migration_parent_class %>
|
4
4
|
def up
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
<% if @migration_action == 'import' -%>
|
6
|
+
import_json "<%= @json_filename %>"
|
7
|
+
<% end -%>
|
8
|
+
|
8
9
|
end
|
9
10
|
end
|
data/lib/wagn/application.rb
CHANGED
@@ -92,7 +92,7 @@ module Wagn
|
|
92
92
|
add_gem_path paths, "config/routes", :with => "config/routes.rb"
|
93
93
|
add_gem_path paths, "db"
|
94
94
|
add_gem_path paths, "db/migrate"
|
95
|
-
add_gem_path paths, "db/
|
95
|
+
add_gem_path paths, "db/migrate_core_cards"
|
96
96
|
add_gem_path paths, "db/seeds", :with => "db/seeds.rb"
|
97
97
|
add_gem_path paths, 'gem-mod', :with => 'mod'
|
98
98
|
add_gem_path paths, 'gem-assets', :with => 'public/assets'
|
data/lib/wagn/commands.rb
CHANGED
@@ -52,7 +52,7 @@ else
|
|
52
52
|
parser = OptionParser.new do |parser|
|
53
53
|
parser.banner = "Usage: wagn seed [options]\n\nCreate and seed the production database specified in config/database.yml\n\n"
|
54
54
|
parser.on('--production','-p', 'seed production database (default)') do
|
55
|
-
envs = ['
|
55
|
+
envs = ['production']
|
56
56
|
end
|
57
57
|
parser.on('--test','-t', 'seed test database') do
|
58
58
|
envs = ['test']
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
class Wagn::CoreMigration < Wagn::Migration
|
4
|
+
def migration_paths
|
5
|
+
Wagn::Migration.core_card_migration_paths
|
6
|
+
end
|
7
|
+
|
8
|
+
def schema_mode
|
9
|
+
Wagn::Migration.schema_mode :card
|
10
|
+
end
|
11
|
+
|
12
|
+
def import_json filename
|
13
|
+
Wagn.config.action_mailer.perform_deliveries = false
|
14
|
+
raw_json = File.read( data_path filename )
|
15
|
+
json = JSON.parse raw_json
|
16
|
+
Card.merge_list json["card"]["value"], :output_file=>File.join(data_path,"unmerged_#{ filename }")
|
17
|
+
#fixme - output file should not be in gem!
|
18
|
+
end
|
19
|
+
end
|