card 1.16.9 → 1.16.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/db/migrate_core_cards/20120611203506_rails_inflection_updates.rb +3 -1
- data/db/seed/new/card_actions.yml +389 -557
- data/db/seed/new/card_acts.yml +595 -1
- data/db/seed/new/card_changes.yml +22595 -7526
- data/db/seed/new/card_references.yml +379 -407
- data/db/seed/new/cards.yml +1694 -2072
- data/db/seed/test/fixtures/card_actions.yml +966 -1102
- data/db/seed/test/fixtures/card_acts.yml +1017 -399
- data/db/seed/test/fixtures/card_changes.yml +24750 -9681
- data/db/seed/test/fixtures/card_references.yml +603 -631
- data/db/seed/test/fixtures/cards.yml +2293 -2671
- data/lib/card/set.rb +1 -1
- data/mod/01_core/set/all/content.rb +14 -12
- data/mod/03_machines/lib/javascript/wagn_mod.js.coffee +1 -1
- data/mod/05_standard/set/abstract/attachment.rb +9 -9
- data/mod/05_standard/set/all/rich_html/content.rb +115 -103
- data/mod/05_standard/set/type/file.rb +1 -1
- data/tmpsets/set/mod001-01_core/all/active_card.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/collection.rb +3 -3
- data/tmpsets/set/mod001-01_core/all/content.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/erb.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/fetch.rb +169 -93
- data/tmpsets/set/mod001-01_core/all/haml.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/initialize.rb +11 -23
- data/tmpsets/set/mod001-01_core/all/name.rb +130 -80
- data/tmpsets/set/mod001-01_core/all/pattern.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/permissions.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/phases.rb +95 -96
- data/tmpsets/set/mod001-01_core/all/references.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/rules.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/states.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/templating.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/tracked_attributes.rb +85 -60
- data/tmpsets/set/mod001-01_core/all/trash.rb +16 -13
- data/tmpsets/set/mod001-01_core/all/type.rb +5 -25
- data/tmpsets/set/mod001-01_core/all/utils.rb +2 -1
- data/tmpsets/set/mod001-01_core/all/view_cache.rb +2 -1
- data/tmpsets/set/mod002-01_history/all/actions.rb +2 -1
- data/tmpsets/set/mod002-01_history/all/content_history.rb +7 -4
- data/tmpsets/set/mod002-01_history/all/history.rb +119 -83
- data/tmpsets/set/mod003-02_basic_types/all/all_css.rb +2 -1
- data/tmpsets/set/mod003-02_basic_types/all/all_csv.rb +2 -1
- data/tmpsets/set/mod003-02_basic_types/all/all_js.rb +2 -1
- data/tmpsets/set/mod003-02_basic_types/all/base.rb +52 -50
- data/tmpsets/set/mod003-02_basic_types/all/file.rb +2 -1
- data/tmpsets/set/mod003-02_basic_types/all/json.rb +2 -1
- data/tmpsets/set/mod003-02_basic_types/all/rss.rb +2 -1
- data/tmpsets/set/mod003-02_basic_types/all/text.rb +2 -1
- data/tmpsets/set/mod003-02_basic_types/type/html.rb +2 -1
- data/tmpsets/set/mod003-02_basic_types/type/plain_text.rb +2 -1
- data/tmpsets/set/mod003-02_basic_types/type/pointer.rb +10 -1
- data/tmpsets/set/mod004-03_machines/right/machine_input.rb +2 -1
- data/tmpsets/set/mod004-03_machines/right/machine_output.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/script_ace.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/script_card_menu.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/script_html5shiv_printshiv.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/script_jquery.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/script_jquery_helper.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/script_slot.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/script_tinymce.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/style_bootstrap_compatible.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/style_cards.rb +2 -1
- data/tmpsets/set/mod004-03_machines/self/style_jquery_ui_smoothness.rb +2 -1
- data/tmpsets/set/mod004-03_machines/type/coffee_script.rb +2 -1
- data/tmpsets/set/mod004-03_machines/type/css.rb +2 -1
- data/tmpsets/set/mod004-03_machines/type/java_script.rb +2 -1
- data/tmpsets/set/mod004-03_machines/type/scss.rb +2 -1
- data/tmpsets/set/mod004-03_machines/type/skin.rb +2 -1
- data/tmpsets/set/mod005-04_settings/abstract/permission.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/add_help.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/comment.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/create.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/default.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/delete.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/help.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/read.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/script.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/structure.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/style.rb +2 -1
- data/tmpsets/set/mod005-04_settings/right/update.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/accountable.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/add_help.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/autoname.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/captcha.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/create.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/default.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/delete.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/help.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/input.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/layout.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/on_create.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/on_delete.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/on_update.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/options.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/options_label.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/read.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/recent_settings.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/script.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/structure.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/style.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/table_of_contents.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/thanks.rb +2 -1
- data/tmpsets/set/mod005-04_settings/self/update.rb +2 -1
- data/tmpsets/set/mod005-04_settings/type/setting.rb +2 -1
- data/tmpsets/set/mod006-05_email/all/email_html.rb +2 -1
- data/tmpsets/set/mod006-05_email/all/email_text.rb +2 -1
- data/tmpsets/set/mod006-05_email/all/follow.rb +2 -1
- data/tmpsets/set/mod006-05_email/all/notify.rb +2 -1
- data/tmpsets/set/mod006-05_email/all/observer.rb +2 -1
- data/tmpsets/set/mod006-05_email/right/bcc.rb +2 -1
- data/tmpsets/set/mod006-05_email/right/cc.rb +2 -1
- data/tmpsets/set/mod006-05_email/right/follow.rb +2 -1
- data/tmpsets/set/mod006-05_email/right/follow_fields.rb +2 -1
- data/tmpsets/set/mod006-05_email/right/followers.rb +7 -6
- data/tmpsets/set/mod006-05_email/right/following.rb +3 -2
- data/tmpsets/set/mod006-05_email/right/from.rb +2 -1
- data/tmpsets/set/mod006-05_email/right/html_message.rb +2 -1
- data/tmpsets/set/mod006-05_email/right/to.rb +2 -1
- data/tmpsets/set/mod006-05_email/self/always.rb +2 -1
- data/tmpsets/set/mod006-05_email/self/created.rb +2 -1
- data/tmpsets/set/mod006-05_email/self/edited.rb +2 -1
- data/tmpsets/set/mod006-05_email/self/follow.rb +2 -1
- data/tmpsets/set/mod006-05_email/self/follow_defaults.rb +2 -1
- data/tmpsets/set/mod006-05_email/self/never.rb +2 -1
- data/tmpsets/set/mod006-05_email/type/email_template.rb +2 -1
- data/tmpsets/set/mod006-05_email/type_plus_right/user/follow.rb +3 -2
- data/tmpsets/set/mod007-05_standard/abstract/attachment.rb +22 -9
- data/tmpsets/set/mod007-05_standard/all/account.rb +2 -1
- data/tmpsets/set/mod007-05_standard/all/comment.rb +2 -1
- data/tmpsets/set/mod007-05_standard/all/error.rb +2 -1
- data/tmpsets/set/mod007-05_standard/all/event_viz.rb +2 -1
- data/tmpsets/set/mod007-05_standard/all/links.rb +2 -1
- data/tmpsets/set/mod007-05_standard/all/rich_html/content.rb +3 -2
- data/tmpsets/set/mod007-05_standard/all/rich_html/editing.rb +2 -1
- data/tmpsets/set/mod007-05_standard/all/rich_html/form.rb +23 -12
- data/tmpsets/set/mod007-05_standard/all/rich_html/header.rb +2 -1
- data/tmpsets/set/mod007-05_standard/all/rich_html/menu.rb +3 -2
- data/tmpsets/set/mod007-05_standard/all/rich_html/modal.rb +2 -1
- data/tmpsets/set/mod007-05_standard/all/rich_html/toolbar.rb +2 -1
- data/tmpsets/set/mod007-05_standard/all/rich_html/wrapper.rb +2 -1
- data/tmpsets/set/mod007-05_standard/right/account.rb +7 -6
- data/tmpsets/set/mod007-05_standard/right/discussion.rb +2 -1
- data/tmpsets/set/mod007-05_standard/right/email.rb +2 -1
- data/tmpsets/set/mod007-05_standard/right/password.rb +2 -1
- data/tmpsets/set/mod007-05_standard/right/salt.rb +2 -1
- data/tmpsets/set/mod007-05_standard/right/stats.rb +2 -1
- data/tmpsets/set/mod007-05_standard/right/status.rb +2 -1
- data/tmpsets/set/mod007-05_standard/right/token.rb +2 -1
- data/tmpsets/set/mod007-05_standard/right/when_created.rb +2 -1
- data/tmpsets/set/mod007-05_standard/right/when_last_edited.rb +2 -1
- data/tmpsets/set/mod007-05_standard/rstar/rules.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/account_links.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/alerts.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/all.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/foot.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/head.rb +2 -2
- data/tmpsets/set/mod007-05_standard/self/navbox.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/now.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/recent.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/search.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/signin.rb +45 -36
- data/tmpsets/set/mod007-05_standard/self/stats.rb +2 -1
- data/tmpsets/set/mod007-05_standard/self/version.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/basic.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/cardtype.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/date.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/file.rb +11 -3
- data/tmpsets/set/mod007-05_standard/type/image.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/layout_type.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/number.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/phrase.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/search_type.rb +70 -64
- data/tmpsets/set/mod007-05_standard/type/session.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/set.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/signup.rb +96 -64
- data/tmpsets/set/mod007-05_standard/type/toggle.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/uri.rb +2 -1
- data/tmpsets/set/mod007-05_standard/type/user.rb +50 -40
- data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/form.rb +2 -1
- data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/helper.rb +2 -1
- data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/wrapper.rb +2 -1
- data/tmpsets/set/mod008-06_bootstrap/all/rich_bootstrap.rb +2 -1
- data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_cards.rb +2 -1
- data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_js.rb +2 -1
- data/tmpsets/set/mod008-06_bootstrap/self/bootswatch_shared.rb +2 -1
- data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_css.rb +2 -1
- data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_js.rb +2 -1
- metadata +2 -2
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module Type; module Session; extend Card::Set
|
2
|
+
class Card; module Set; module Type; module Session; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/session.rb ~~~~~~~~~~~
|
3
4
|
include Pointer
|
4
5
|
|
5
6
|
def history?
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module Type; module Set; extend Card::Set
|
2
|
+
class Card; module Set; module Type; module Set; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/set.rb ~~~~~~~~~~~
|
3
4
|
|
4
5
|
format :html do
|
5
6
|
|
@@ -1,82 +1,115 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module Type; module Signup; extend Card::Set
|
2
|
+
class Card; module Set; module Type; module Signup; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/signup.rb ~~~~~~~~~~~
|
3
4
|
|
4
5
|
format :html do
|
5
|
-
|
6
6
|
def default_new_args args
|
7
7
|
super args
|
8
8
|
args.merge!(
|
9
|
-
optional_help: :show,
|
10
|
-
buttons: button_tag(
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
optional_help: :show, # , optional_menu: :never
|
10
|
+
buttons: button_tag(' Submit',
|
11
|
+
disable_with: 'Submitting', situation: 'primary'),
|
12
|
+
account: card.fetch(trait: :account, new: {}),
|
13
|
+
title: 'Sign up',
|
14
|
+
hidden: {
|
14
15
|
success: (card.rule(:thanks) || '_self'),
|
15
16
|
'card[type_id]' => card.type_id
|
16
17
|
}
|
17
18
|
)
|
19
|
+
return unless Auth.signed_in? && args[:account].confirm_ok?
|
20
|
+
invite_args args
|
21
|
+
end
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
23
|
+
def invite_args args
|
24
|
+
args.merge!(
|
25
|
+
title: 'Invite',
|
26
|
+
buttons: button_tag('Send Invitation', situation: 'primary'),
|
27
|
+
hidden: { success: '_self' }
|
28
|
+
)
|
24
29
|
end
|
25
30
|
|
26
31
|
view :new do |args|
|
27
|
-
#FIXME
|
32
|
+
# FIXME: make more use of standard new view?
|
28
33
|
|
29
|
-
frame_and_form :create, args, 'main-success'=>
|
34
|
+
frame_and_form :create, args, 'main-success' => 'REDIRECT' do
|
30
35
|
[
|
31
|
-
_render_name_formgroup(
|
32
|
-
_optional_render(
|
33
|
-
(
|
34
|
-
_optional_render(
|
36
|
+
_render_name_formgroup(help: 'usually first and last name'),
|
37
|
+
_optional_render(:account_formgroups, args),
|
38
|
+
(card.structure ? edit_slot : ''),
|
39
|
+
_optional_render(:button_formgroup, args)
|
35
40
|
]
|
36
41
|
end
|
37
42
|
end
|
38
43
|
|
39
|
-
|
40
44
|
view :account_formgroups do |args|
|
41
45
|
sub_args = { structure: true }
|
42
46
|
sub_args[:no_password] = true if Auth.signed_in?
|
43
|
-
Auth.as_bot
|
47
|
+
Auth.as_bot do
|
48
|
+
subformat(args[:account])._render :content_formgroup, sub_args
|
49
|
+
end # YUCK!!!!
|
44
50
|
end
|
45
51
|
|
46
|
-
|
47
|
-
|
48
|
-
headings
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
if account.confirm_ok?
|
59
|
-
links << link_to( "#{token_action} verification email", card_path("update/~#{card.id}?approve_with_token=true" ) )
|
60
|
-
links << link_to( "Approve without verification", card_path("update/~#{card.id}?approve_without_token=true") )
|
61
|
-
end
|
62
|
-
if card.ok? :delete
|
63
|
-
links << link_to( "Deny and delete", card_path("delete/~#{card.id}") )
|
64
|
-
end
|
65
|
-
headings << links * '' if links.any?
|
66
|
-
else
|
67
|
-
headings << "ERROR: signup card missing account"
|
68
|
-
end
|
52
|
+
view :core do |_args|
|
53
|
+
return if card.new_card? # necessary?
|
54
|
+
headings = []
|
55
|
+
by_anon = card.creator_id == AnonymousID
|
56
|
+
headings << %(
|
57
|
+
<strong>#{ card.name }</strong> #{ 'was' if !by_anon } signed up on
|
58
|
+
#{ format_date card.created_at }
|
59
|
+
)
|
60
|
+
if (account = card.account)
|
61
|
+
headings += verification_info account
|
62
|
+
else
|
63
|
+
headings << 'ERROR: signup card missing account'
|
69
64
|
end
|
70
|
-
|
71
|
-
|
65
|
+
<<-HTML
|
66
|
+
<div class="invite-links">
|
67
|
+
#{ headings.map { |h| "<div>#{h}</div>" }.join "\n" }
|
72
68
|
</div>
|
73
69
|
#{ process_content render_raw }
|
74
|
-
|
70
|
+
HTML
|
71
|
+
end
|
72
|
+
|
73
|
+
def verification_info account
|
74
|
+
headings = []
|
75
|
+
token_action = 'Send'
|
76
|
+
if account.token.present?
|
77
|
+
headings << 'A verification email has been sent ' \
|
78
|
+
"#{ "to #{account.email}" if account.email_card.ok? :read }"
|
79
|
+
token_action = 'Resend'
|
80
|
+
end
|
81
|
+
links = verification_links account, token_action
|
82
|
+
headings << links * '' if links.any?
|
83
|
+
headings
|
84
|
+
end
|
85
|
+
|
86
|
+
def verification_links account, token_action
|
87
|
+
links = []
|
88
|
+
if account.confirm_ok?
|
89
|
+
links << link_to(
|
90
|
+
"#{token_action} verification email",
|
91
|
+
card_path("update/~#{card.id}?approve_with_token=true")
|
92
|
+
)
|
93
|
+
links << link_to(
|
94
|
+
'Approve without verification',
|
95
|
+
card_path("update/~#{card.id}?approve_without_token=true")
|
96
|
+
)
|
97
|
+
end
|
98
|
+
if card.ok? :delete
|
99
|
+
links << link_to('Deny and delete', card_path("delete/~#{card.id}"))
|
100
|
+
end
|
101
|
+
links
|
75
102
|
end
|
76
103
|
end
|
77
104
|
|
78
|
-
event :activate_by_token, before: :approve, on: :update,
|
79
|
-
|
105
|
+
event :activate_by_token, before: :approve, on: :update,
|
106
|
+
when: proc { |c| c.has_token? } do
|
107
|
+
result = if account
|
108
|
+
account.authenticate_by_token(@env_token)
|
109
|
+
else
|
110
|
+
"no account associated with #{name}"
|
111
|
+
end
|
112
|
+
|
80
113
|
case result
|
81
114
|
when Integer
|
82
115
|
abort :failure, 'no field manipulation mid-activation' if subcards.present?
|
@@ -98,18 +131,23 @@ def has_token?
|
|
98
131
|
end
|
99
132
|
|
100
133
|
event :activate_account do
|
101
|
-
|
134
|
+
add_subfield :account
|
135
|
+
subfield(:account).add_subfield :status, content: 'active'
|
102
136
|
self.type_id = Card.default_accounted_type_id
|
103
137
|
account.send_welcome_email
|
104
138
|
end
|
105
139
|
|
106
|
-
event :approve_with_token,
|
140
|
+
event :approve_with_token,
|
141
|
+
on: :update, before: :approve,
|
142
|
+
when: proc { Env.params[:approve_with_token] } do
|
107
143
|
abort :failure, 'illegal approval' unless account.confirm_ok?
|
108
144
|
account.reset_token
|
109
145
|
account.send_account_verification_email
|
110
146
|
end
|
111
147
|
|
112
|
-
event :approve_without_token,
|
148
|
+
event :approve_without_token,
|
149
|
+
on: :update, before: :approve,
|
150
|
+
when: proc { Env.params[:approve_without_token] } do
|
113
151
|
abort :failure, 'illegal approval' unless account.confirm_ok?
|
114
152
|
activate_account
|
115
153
|
end
|
@@ -120,31 +158,25 @@ event :resend_activation_token do
|
|
120
158
|
Env.params[:success] = {
|
121
159
|
id: '_self',
|
122
160
|
view: 'message',
|
123
|
-
message:
|
161
|
+
message: 'Sorry, this token has expired. ' \
|
162
|
+
' Please check your email for a new password reset link.'
|
124
163
|
}
|
125
164
|
end
|
126
165
|
|
127
166
|
def signed_in_as_me_without_password?
|
128
|
-
Auth.signed_in? && Auth.current_id==id && account.password.blank?
|
167
|
+
Auth.signed_in? && Auth.current_id == id && account.password.blank?
|
129
168
|
end
|
130
169
|
|
131
|
-
event :redirect_to_edit_password,
|
170
|
+
event :redirect_to_edit_password,
|
171
|
+
on: :update, after: :store,
|
172
|
+
when: proc { |c| c.signed_in_as_me_without_password? } do
|
132
173
|
Env.params[:success] = account.edit_password_success_args
|
133
174
|
end
|
134
175
|
|
135
|
-
event :preprocess_account_subcards, before: :process_subcards, on: :create do
|
136
|
-
#FIXME: use codenames!
|
137
|
-
email, password = subcards.delete('+*account+*email'), subcards.delete('+*account+*password')
|
138
|
-
subcards['+*account'] ||={}
|
139
|
-
subcards['+*account']['+*email'] = email if email
|
140
|
-
subcards['+*account']['+*password' ]=password if password
|
141
|
-
end
|
142
|
-
|
143
176
|
event :act_as_current_for_extend_phase, before: :extend, on: :create do
|
144
|
-
Auth.current_id =
|
177
|
+
Auth.current_id = id
|
145
178
|
end
|
146
179
|
|
147
180
|
|
148
|
-
|
149
181
|
# ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/signup.rb ~~~~~~~~~~~
|
150
182
|
end;end;end;end;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module Type; module Toggle; extend Card::Set
|
2
|
+
class Card; module Set; module Type; module Toggle; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/toggle.rb ~~~~~~~~~~~
|
3
4
|
|
4
5
|
view :core do |args|
|
5
6
|
case card.raw_content.to_i
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module Type; module Uri; extend Card::Set
|
2
|
+
class Card; module Set; module Type; module Uri; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/uri.rb ~~~~~~~~~~~
|
3
4
|
format do
|
4
5
|
include Phrase::Format
|
5
6
|
|
@@ -1,46 +1,59 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module Type; module User; extend Card::Set
|
2
|
+
class Card; module Set; module Type; module User; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/user.rb ~~~~~~~~~~~
|
3
4
|
|
4
5
|
include Basic
|
5
6
|
|
6
7
|
attr_accessor :email
|
7
8
|
|
8
9
|
format :html do
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
view :setup, tags: :unknown_ok,
|
11
|
+
perms: lambda { |_r| Auth.needs_setup? } do |args|
|
12
|
+
account = card.fetch trait: :account, new: {}
|
13
|
+
Auth.as_bot do
|
14
|
+
frame_and_form :create, args do
|
15
|
+
[
|
16
|
+
_render_name_formgroup(help: 'usually first and last name'),
|
17
|
+
subformat(account)._render(:content_formgroup, structure: true),
|
18
|
+
_render_button_formgroup(args)
|
19
|
+
]
|
20
|
+
end
|
14
21
|
end
|
15
|
-
|
22
|
+
end
|
23
|
+
|
24
|
+
def default_setup_args args
|
25
|
+
args.merge!(
|
16
26
|
title: 'Welcome, Wagneer!',
|
17
27
|
optional_help: :show,
|
18
28
|
optional_menu: :never,
|
19
29
|
help_text: help_text,
|
20
|
-
buttons:
|
30
|
+
buttons: setup_button,
|
21
31
|
hidden: {
|
22
32
|
success: "REDIRECT: #{ Card.path_setting '/' }",
|
23
33
|
'card[type_id]' => Card.default_accounted_type_id,
|
24
|
-
'setup'=>true
|
34
|
+
'setup' => true
|
25
35
|
}
|
26
|
-
|
27
|
-
|
28
|
-
account = card.fetch trait: :account, new: {}
|
36
|
+
)
|
37
|
+
end
|
29
38
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
39
|
+
def help_text
|
40
|
+
text = '<h3>To get started, set up an account.</h3>'
|
41
|
+
if Card.config.action_mailer.perform_deliveries == false
|
42
|
+
text += <<-HTML
|
43
|
+
<br>WARNING: Email delivery is turned off.
|
44
|
+
Change settings in config/application.rb to send sign up notifications.'
|
45
|
+
HTML
|
38
46
|
end
|
47
|
+
text
|
39
48
|
end
|
40
|
-
end
|
41
49
|
|
50
|
+
def setup_button
|
51
|
+
button_tag 'Set up', disable_with: 'Setting up', situation: 'primary'
|
52
|
+
end
|
53
|
+
end
|
42
54
|
|
43
|
-
event :setup_as_bot, before: :check_permissions, on: :create,
|
55
|
+
event :setup_as_bot, before: :check_permissions, on: :create,
|
56
|
+
when: proc { Card::Env.params[:setup] } do
|
44
57
|
abort :failure unless Auth.needs_setup?
|
45
58
|
Auth.as_bot
|
46
59
|
# we need bot authority to set the initial administrator roles
|
@@ -48,31 +61,28 @@ event :setup_as_bot, before: :check_permissions, on: :create, when: proc{ |c| Ca
|
|
48
61
|
# flexibility and security when configuring initial setups
|
49
62
|
end
|
50
63
|
|
51
|
-
event :setup_first_user, before: :process_subcards, on: :create,
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
email, password = subcards.delete('+*account+*email'), subcards.delete('+*account+*password')
|
56
|
-
subcards['+*account'] = { '+*email'=>email, '+*password'=>password }
|
64
|
+
event :setup_first_user, before: :process_subcards, on: :create,
|
65
|
+
when: proc { Card::Env.params[:setup] } do
|
66
|
+
add_subcard 'signup alert email+*to', content: name
|
67
|
+
add_subfield :roles, content: Card[:administrator].name
|
57
68
|
end
|
58
69
|
|
59
|
-
event :signin_after_setup, before: :extend, on: :create,
|
60
|
-
|
70
|
+
event :signin_after_setup, before: :extend, on: :create,
|
71
|
+
when: proc { Card::Env.params[:setup] } do
|
61
72
|
Auth.signin id
|
62
73
|
end
|
63
74
|
|
64
|
-
def follow follow_name, option
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
75
|
+
def follow follow_name, option='*always'
|
76
|
+
return unless
|
77
|
+
(card = Card.fetch follow_name) &&
|
78
|
+
(set_card = card.default_follow_set_card) &&
|
79
|
+
(follow_rule_name = set_card.follow_rule_name(name)) &&
|
80
|
+
(follow_rule = Card.fetch follow_rule_name, new: {})
|
81
|
+
follow_rule.drop_item '*never'
|
82
|
+
follow_rule.add_item option
|
83
|
+
follow_rule.save!
|
72
84
|
end
|
73
85
|
|
74
86
|
|
75
|
-
|
76
|
-
|
77
87
|
# ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/type/user.rb ~~~~~~~~~~~
|
78
88
|
end;end;end;end;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module All; module Bootstrap; module Form; extend Card::Set
|
2
|
+
class Card; module Set; module All; module Bootstrap; module Form; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/06_bootstrap/set/all/bootstrap/form.rb ~~~~~~~~~~~
|
3
4
|
format :html do
|
4
5
|
def button_tag content_or_options = nil, options = {}, &block
|
5
6
|
bootstrapify_button( block_given? ? content_or_options : options )
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module All; module Bootstrap; module Helper; extend Card::Set
|
2
|
+
class Card; module Set; module All; module Bootstrap; module Helper; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/06_bootstrap/set/all/bootstrap/helper.rb ~~~~~~~~~~~
|
3
4
|
format :html do
|
4
5
|
def glyphicon icon_type, extra_class=''
|
5
6
|
content_tag(:span, '', class: "glyphicon glyphicon-#{icon_type} #{extra_class}", 'aria-hidden'=>true)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module All; module Bootstrap; module Wrapper; extend Card::Set
|
2
|
+
class Card; module Set; module All; module Bootstrap; module Wrapper; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/06_bootstrap/set/all/bootstrap/wrapper.rb ~~~~~~~~~~~
|
3
4
|
format :html do
|
4
5
|
|
5
6
|
def frame args={}, &block
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module All; module RichBootstrap; extend Card::Set
|
2
|
+
class Card; module Set; module All; module RichBootstrap; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/06_bootstrap/set/all/rich_bootstrap.rb ~~~~~~~~~~~
|
3
4
|
format :html do
|
4
5
|
|
5
6
|
view :closed do |args|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module Self; module BootstrapCards; extend Card::Set
|
2
|
+
class Card; module Set; module Self; module BootstrapCards; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/06_bootstrap/set/self/bootstrap_cards.rb ~~~~~~~~~~~
|
3
4
|
view :raw do |args|
|
4
5
|
File.read "#{Cardio.gem_root}/mod/06_bootstrap/lib/stylesheets/#{card.codename}.scss"
|
5
6
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module Self; module BootstrapJs; extend Card::Set
|
2
|
+
class Card; module Set; module Self; module BootstrapJs; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/06_bootstrap/set/self/bootstrap_js.rb ~~~~~~~~~~~
|
3
4
|
view :raw do |args|
|
4
5
|
[ "bootstrap.js", "bootstrap_modal_wagn.js" ].map do |name|
|
5
6
|
File.read "#{Cardio.gem_root}/mod/06_bootstrap/lib/javascript/#{name}"
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
class Card; module Set; module Self; module BootswatchShared; extend Card::Set
|
2
|
+
class Card; module Set; module Self; module BootswatchShared; extend Card::Set
|
3
|
+
# ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/06_bootstrap/set/self/bootswatch_shared.rb ~~~~~~~~~~~
|
3
4
|
view :raw do |args|
|
4
5
|
bootstrap_path = "#{Cardio.gem_root}/mod/06_bootstrap/lib/stylesheets/bootstrap"
|
5
6
|
|