wagn 1.12.9 → 1.12.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +10 -22
  3. data/VERSION +1 -1
  4. data/app/assets/javascripts/wagn.js.coffee +3 -3
  5. data/app/controllers/account_controller.rb +23 -29
  6. data/app/controllers/admin_controller.rb +14 -20
  7. data/app/controllers/card_controller.rb +1 -39
  8. data/app/controllers/wagn_controller.rb +46 -3
  9. data/app/mailers/mailer.rb +11 -10
  10. data/config/environments/development.rb +3 -0
  11. data/{app/models → lib}/card.rb +0 -0
  12. data/lib/card/content.rb +2 -2
  13. data/lib/card/format.rb +26 -5
  14. data/{app/models → lib}/card/reference.rb +0 -0
  15. data/{app/models → lib}/card/revision.rb +0 -0
  16. data/lib/generators/wagn/templates/Gemfile +2 -0
  17. data/lib/tasks/wagn.rake +6 -7
  18. data/lib/wagn/all.rb +11 -2
  19. data/lib/wagn/application.rb +1 -0
  20. data/mods/core/formats/html_format.rb +74 -29
  21. data/mods/core/sets/all/content.rb +5 -1
  22. data/mods/core/sets/all/permissions.rb +11 -4
  23. data/mods/core/sets/all/trash.rb +6 -1
  24. data/mods/standard/chunks/include.rb +3 -5
  25. data/mods/standard/lib/stylesheets/functional.scss +2 -0
  26. data/mods/standard/lib/stylesheets/standard.scss +1 -1
  27. data/mods/standard/sets/all/account.rb +66 -53
  28. data/mods/standard/sets/all/admin.rb +16 -16
  29. data/mods/standard/sets/all/all_css.rb +2 -2
  30. data/mods/standard/sets/all/base.rb +8 -3
  31. data/mods/standard/sets/all/follow.rb +2 -2
  32. data/mods/standard/sets/all/history.rb +1 -1
  33. data/mods/standard/sets/all/json.rb +3 -2
  34. data/mods/standard/sets/all/kml.rb +3 -2
  35. data/mods/standard/sets/all/rich_html.rb +220 -169
  36. data/mods/standard/sets/all/rss.rb +2 -2
  37. data/mods/standard/sets/right/structure.rb +5 -4
  38. data/mods/standard/sets/self/head.rb +2 -2
  39. data/mods/standard/sets/type/account_request.rb +20 -27
  40. data/mods/standard/sets/type/cardtype.rb +15 -2
  41. data/mods/standard/sets/type/layout_type.rb +6 -4
  42. data/mods/standard/sets/type/search_type.rb +1 -1
  43. data/mods/standard/sets/type/set.rb +6 -3
  44. data/mods/standard/sets/type/user.rb +13 -10
  45. data/public/assets/{application-7f1664ac8e65db8af0bfa6539e23c7df.js → application-af2bc486eb3db1c02c4dcd0e23ca25fc.js} +1 -1
  46. data/public/assets/{application-7f1664ac8e65db8af0bfa6539e23c7df.js.gz → application-af2bc486eb3db1c02c4dcd0e23ca25fc.js.gz} +0 -0
  47. data/public/assets/application.js +1 -1
  48. data/public/assets/application.js.gz +0 -0
  49. data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js.gz +0 -0
  50. data/public/assets/html5shiv-printshiv.js.gz +0 -0
  51. data/public/assets/manifest.yml +2 -2
  52. data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js.gz +0 -0
  53. data/public/assets/tinymce.js.gz +0 -0
  54. data/spec/lib/card/codename_spec.rb +1 -0
  55. data/spec/mods/core/sets/all/permissions_spec.rb +25 -0
  56. data/spec/mods/core/sets/all/trash_spec.rb +16 -0
  57. data/spec/mods/standard/chunks/include_spec.rb +5 -0
  58. data/spec/mods/standard/sets/all/json_spec.rb +6 -6
  59. data/spec/mods/standard/sets/all/rich_html_spec.rb +36 -0
  60. data/spec/mods/standard/sets/right/structure_spec.rb +8 -2
  61. data/wagn.gemspec +2 -2
  62. metadata +14 -38
File without changes
File without changes
@@ -3,3 +3,5 @@ source 'http://rubygems.org'
3
3
  gem 'wagn'
4
4
 
5
5
  <%= database_gemfile_entry -%>
6
+
7
+ #gem 'wagn-dev', :group=>'development'
@@ -33,11 +33,10 @@ namespace :wagn do
33
33
  end
34
34
  end
35
35
 
36
-
37
-
38
- desc "install wagn configuration files"
39
- task :install do
40
- puts "wagn:install is deprecated in favor of 'wagn new'"
36
+ desc "update wagn gems and database"
37
+ task :update do
38
+ system 'bundle update'
39
+ Rake::Task['wagn:migrate'].invoke
41
40
  end
42
41
 
43
42
  desc "reset cache"
@@ -74,7 +73,7 @@ namespace :wagn do
74
73
  task :cards => :environment do
75
74
  Wagn::Cache.reset_global
76
75
  ENV['SCHEMA'] = "#{Wagn.gem_root}/db/schema.rb"
77
- ENV['WAGN_MIGRATION'] = 'true'
76
+ Wagn.config.send_emails = false
78
77
  Card # this is needed in production mode to insure core db structures are loaded before schema_mode is set
79
78
 
80
79
  paths = ActiveRecord::Migrator.migrations_paths = Wagn::MigrationHelper.card_migration_paths
@@ -87,8 +86,8 @@ namespace :wagn do
87
86
 
88
87
  desc 'write the version to a file (not usually called directly)' #maybe we should move this to a method?
89
88
  task :stamp, :suffix do |t, args|
90
- ENV['WAGN_MIGRATION'] = 'true'
91
89
  ENV['SCHEMA'] = "#{Wagn.gem_root}/db/schema.rb"
90
+ Wagn.config.send_emails = false
92
91
 
93
92
  stamp_file = Wagn::Version.schema_stamp_path args[:suffix]
94
93
  Wagn::MigrationHelper.schema_mode args[:suffix ] do
@@ -1,5 +1,12 @@
1
1
  require 'rails/all'
2
- require 'wagn/application'
2
+
3
+ if Rails.env.development?
4
+ begin
5
+ require 'wagn/dev'
6
+ rescue
7
+ Rails.logger.info "WARNING: the gem wagn-dev is strongly recommended when running wagn in development mode!"
8
+ end
9
+ end
3
10
 
4
11
  require 'recaptcha'
5
12
  require 'airbrake'
@@ -13,4 +20,6 @@ require 'paperclip'
13
20
  # require 'xmlscan'
14
21
  # require 'rubyzip'
15
22
  require 'coderay'
16
- require 'sass'
23
+ require 'sass'
24
+
25
+ require 'wagn/application'
@@ -45,6 +45,7 @@ module Wagn
45
45
  config.recaptcha_private_key = nil
46
46
  config.recaptcha_proxy = nil
47
47
 
48
+ config.send_emails = !ENV['WAGN_MIGRATION']
48
49
  config.email_defaults = nil
49
50
  config.override_host = nil
50
51
  config.override_protocol = nil
@@ -15,7 +15,6 @@ class Card::HtmlFormat < Card::Format
15
15
  :normal => { :view => :content }
16
16
  }
17
17
 
18
-
19
18
  def get_inclusion_defaults
20
19
  INCLUSION_DEFAULTS[@mode] || {}
21
20
  end
@@ -33,8 +32,8 @@ class Card::HtmlFormat < Card::Format
33
32
  end
34
33
 
35
34
  def commentable? view, args
36
- self.class.tagged view, :comment and
37
- args[:show] =~ /comment_box/ and
35
+ self.class.tagged view, :comment and
36
+ show_view? :comment_box, args, :hide and #developer or wagneer has overridden default
38
37
  ok? :comment
39
38
  end
40
39
 
@@ -85,19 +84,19 @@ class Card::HtmlFormat < Card::Format
85
84
  JSON( options_hash )
86
85
  end
87
86
 
88
- def wrap view, args = {}
87
+ def wrap args = {}
89
88
  classes = [
90
89
  ( 'card-slot' unless args[:no_slot] ),
91
- "#{view}-view",
90
+ "#{ @current_view }-view",
92
91
  ( args[:slot_class] if args[:slot_class] ),
93
92
  ( "STRUCTURE-#{args[:structure].to_name.key}" if args[:structure]),
94
93
  card.safe_set_keys
95
94
  ].compact
96
95
 
97
96
  div = %{<div id="#{card.cardname.url_key}" data-card-id="#{card.id}" data-card-name="#{h card.name}" style="#{h args[:style]}" class="#{classes*' '}" } +
98
- %{data-slot='#{html_escape_except_quotes slot_options( args )}'>#{yield}</div>}
97
+ %{data-slot='#{html_escape_except_quotes slot_options( args )}'>#{ output yield }</div>}
99
98
 
100
- if params[:debug] == 'slot' && !tagged(view, :no_wrap_comments )
99
+ if params[:debug] == 'slot' && !tagged( @current_view, :no_wrap_comments )
101
100
  name = h card.name
102
101
  space = ' ' * @depth
103
102
  %{<!--\n\n#{ space }BEGIN SLOT: #{ name }\n\n-->#{ div }<!--\n\n#{space}END SLOT: #{ name }\n\n-->}
@@ -115,16 +114,33 @@ class Card::HtmlFormat < Card::Format
115
114
  end
116
115
  end
117
116
 
118
- def wrap_frame view, args={}
119
- wrap view, args.merge(:slot_class=>'card-frame') do
117
+ def frame args={}
118
+ wrap args.merge(:slot_class=>'card-frame') do
120
119
  %{
121
120
  #{ _render_header args }
122
121
  #{ %{ <div class="card-subheader">#{ args[:subheader] }</div> } if args[:subheader] }
123
- #{ _render_help args if args[:show_help] }
124
- #{ wrap_body args do yield args end }
122
+ #{ _optional_render :help, args, :hide }
123
+ #{ wrap_body args do output( yield args ) end }
125
124
  }
126
125
  end
127
126
  end
127
+
128
+ def frame_and_form action, args={}, form_opts={}
129
+ form_opts[:hidden] = args.delete(:hidden)
130
+ frame args do
131
+ card_form action, form_opts do
132
+ output( yield args )
133
+ end
134
+ end
135
+ end
136
+
137
+ def output content
138
+ case content
139
+ when String; content
140
+ when Array ; content.compact.join "\n"
141
+ end
142
+ end
143
+
128
144
 
129
145
  def wrap_main(content)
130
146
  return content if params[:layout]=='none'
@@ -144,18 +160,25 @@ class Card::HtmlFormat < Card::Format
144
160
 
145
161
  def edit_slot args={}
146
162
  if args[:structure] || card.structure
147
- _render_raw(args).scan( /\{\{\s*\+[^\}]*\}\}/ ).map do |inc|
163
+ # multi-card edit mode
164
+ _render_raw(args).scan( /\{\{\s*\+[^\}]*\}\}/ ).map do |inc| #fixme - wrong place for regexp!
148
165
  process_content( inc ).strip
149
166
  end.join
150
167
  # raw _render_core(args)
151
- elsif label = args[:label]
152
- label = '' if label == true
153
- fieldset label, content_field( form, args ), :editor=>:content
154
168
  else
155
- editor_wrap( :content ) { content_field form, args }
169
+ # single-card edit mode
170
+ field = content_field form, args
171
+
172
+ if [ args[:optional_type_fieldset], args[:optional_name_fieldset] ].member? :show
173
+ # display content field in fieldset for consistency with other fields
174
+ fieldset '', field, :editor=>:content
175
+ else
176
+ editor_wrap( :content ) { field }
177
+ end
156
178
  end
157
179
  end
158
180
 
181
+
159
182
 
160
183
  #### -------------------- additional helpers ---------------- ###
161
184
 
@@ -217,12 +240,15 @@ class Card::HtmlFormat < Card::Format
217
240
 
218
241
  def type_field args={}
219
242
  typelist = Account.createable_types
220
- typelist << card.type_name if !card.new_card?
221
- # current type should be an option on existing cards, regardless of create perms
243
+ current_type = unless args.delete :no_current_type
244
+ unless card.new_card? || typelist.include?( card.type_name )
245
+ # current type should be an option on existing cards, regardless of create perms
246
+ typelist = (typelist << card.type_name).sort
247
+ end
248
+ Card[ card ? card.type_id : Card.default_type_id ].name
249
+ end
222
250
 
223
- options = options_from_collection_for_select(
224
- typelist.uniq.sort.map { |name| [ name, name ] },
225
- :first, :last, Card[ card ? card.type_id : Card.default_type_id ].name )
251
+ options = options_from_collection_for_select typelist, :to_s, :to_s, current_type
226
252
  template.select_tag 'card[type]', options, args
227
253
  end
228
254
 
@@ -250,16 +276,34 @@ class Card::HtmlFormat < Card::Format
250
276
  @form ||= form_for_multi
251
277
  end
252
278
 
253
- def card_form *opts
254
- form_for( card, form_opts(*opts) ) { |form| yield form }
279
+ def card_form action, opts={}
280
+ hidden_args = opts.delete :hidden
281
+ form_for card, card_form_opts(action, opts) do |form|
282
+ @form = form
283
+ %{
284
+ #{ hidden_tags hidden_args if hidden_args }
285
+ #{ yield form }
286
+ }
287
+ end
255
288
  end
256
289
 
257
- def form_opts url, classes='', other_html={}
258
- url = path(:action=>url) if Symbol===url
259
- opts = { :url=>url, :remote=>true, :html=>other_html }
260
- opts[:html][:class] = classes + ' slotter'
261
- opts[:html][:recaptcha] = 'on' if Wagn::Env[:recaptcha_on] && Card.toggle( card.rule(:captcha) )
262
- opts
290
+ def card_form_opts action, html={}
291
+ url, action = case action
292
+ when Symbol ; [ path(:action=>action) , action ]
293
+ when Hash ; [ path(action) , action[:action] ]
294
+ when String ; [ wagn_path(action) , nil ] #deprecated
295
+ else ; raise Wagn::Error, "unsupported card_form action class: #{action.class}"
296
+ end
297
+
298
+ klasses = Array.wrap( html[:class] )
299
+ klasses << 'card-form slotter'
300
+ klasses << 'autosave' if action == :update
301
+ html[:class] = klasses.join ' '
302
+
303
+ html[:recaptcha] ||= 'on' if Wagn::Env[:recaptcha_on] && Card.toggle( card.rule(:captcha) )
304
+ html.delete :recaptcha if html[:recaptcha] == :off
305
+
306
+ { :url=>url, :remote=>true, :html=>html }
263
307
  end
264
308
 
265
309
  def editor_wrap type=nil
@@ -291,6 +335,7 @@ class Card::HtmlFormat < Card::Format
291
335
  def hidden_tags hash, base=nil
292
336
  # convert hash into a collection of hidden tags
293
337
  result = ''
338
+ hash ||= {}
294
339
  hash.each do |key, val|
295
340
  result += if Hash === val
296
341
  hidden_tags val, key
@@ -52,7 +52,7 @@ def creator
52
52
  end
53
53
 
54
54
  def updater
55
- Card[ updater_id || Card::AnonID ]
55
+ Card[ updater_id ]
56
56
  end
57
57
 
58
58
  def drafts
@@ -68,6 +68,10 @@ def clear_drafts # yuck!
68
68
  connection.execute %{delete from card_revisions where card_id=#{id} and id > #{current_revision_id} }
69
69
  end
70
70
 
71
+ def clean_html?
72
+ true
73
+ end
74
+
71
75
 
72
76
  event :set_default_content, :on=>:create, :before=>:approve do
73
77
  if !updates.for?(:content)
@@ -30,7 +30,7 @@ def ok! action, opts={}
30
30
  end
31
31
 
32
32
  def update_account_ok? #FIXME - temporary API, I think this is fixed, can we cache any of this for speed, this is accessed for each header
33
- id == Account.current_id || ok?( :update, :trait=>:account )
33
+ id == Account.current_id or ok?( :update, :trait=>:account )
34
34
  end
35
35
 
36
36
  def who_can action
@@ -106,6 +106,16 @@ end
106
106
 
107
107
  def ok_to_create
108
108
  permit :create
109
+ if junction?
110
+ [:left, :right].each do |side|
111
+ part_card = send side, :new=>{}
112
+ if part_card && part_card.new_card? #if no card, there must be other errors
113
+ unless part_card.ok? :create
114
+ deny_because you_cant("create #{part_card.name}")
115
+ end
116
+ end
117
+ end
118
+ end
109
119
  end
110
120
 
111
121
  def ok_to_read
@@ -138,8 +148,6 @@ def ok_to_comment
138
148
  end
139
149
 
140
150
 
141
-
142
-
143
151
  event :set_read_rule, :before=>:store do
144
152
  if trash == true
145
153
  self.read_rule_id = self.read_rule_class = nil
@@ -215,4 +223,3 @@ event :recaptcha, :before=>:approve do
215
223
  end
216
224
 
217
225
 
218
-
@@ -20,12 +20,17 @@ event :pull_from_trash, :before=>:store, :on=>:create do
20
20
  self.trash = false
21
21
  true
22
22
  end
23
- #reset_patterns_if_rule saving=true
24
23
 
25
24
  event :validate_delete, :before=>:approve, :on=>:delete do
26
25
  if !codename.blank?
27
26
  errors.add :delete, "#{name} is is a system card. (#{codename})"
28
27
  end
28
+
29
+ undeletable_all_rules_tags = %w{ default style layout create read update delete }
30
+ if junction? and left.codename == 'all' and undeletable_all_rules_tags.member? right.codename
31
+ errors.add :delete, "#{name} is an indestructible rule"
32
+ end
33
+
29
34
  if account && Card::Revision.find_by_creator_id( self.id )
30
35
  errors.add :delete, "Edits have been made with #{name}'s user account.\n Deleting this card would mess up our revision records."
31
36
  end
@@ -22,11 +22,9 @@ module Card::Chunk
22
22
  when /^\#/ ; "<!-- #{CGI.escapeHTML in_brackets} -->"
23
23
  # when /^\s*$/ ; '' # no name
24
24
  else
25
- @options = if @opt_lists
26
- @opt_lists.split('|').reverse.inject(nil) do |prev_level, level_options|
27
- process_options level_options, prev_level
28
- end
29
- else {} end
25
+ @options = @opt_lists.to_s.split('|').reverse.inject(nil) do |prev_level, level_options|
26
+ process_options level_options, prev_level
27
+ end || {}
30
28
  @options.merge! :inc_name => name, :inc_syntax => in_brackets
31
29
  @name = name
32
30
  end
@@ -45,6 +45,8 @@ in your skin. Choosing (b) will mean your CSS will not be affected by automated
45
45
  .new-current-revision-id,
46
46
  .editor .revision-navigation,
47
47
  .editor .autosave-alert,
48
+ .confirm_rename-view,
49
+ .renamer-updater,
48
50
  .labeled-view .card-menu-link {
49
51
  display: none
50
52
  }
@@ -608,7 +608,7 @@ html>body .open-view {
608
608
  .faint {
609
609
  color: #bbc;
610
610
  }
611
- .cardtype {
611
+ .VIEW-type {
612
612
  font-style: italic;
613
613
  font-size: .85em;
614
614
  }
@@ -10,7 +10,7 @@ end
10
10
 
11
11
  def accountable?
12
12
  Card.toggle( rule(:accountable) ) and
13
- fetch( :trait=>:account, :new=>{} ).ok?( :create)
13
+ fetch( :trait=>:account, :new=>{} ).permitted?( :create) #don't use #ok? here because we don't want to check part permissions
14
14
  end
15
15
 
16
16
  def parties
@@ -58,36 +58,34 @@ format :html do
58
58
  message = email_params[:message] || Card.setting('*invite+*message') || ''
59
59
 
60
60
  success = Card.setting "#{ Card[:invite].name }+#{ Card[:thanks].name }"
61
+ args[:buttons] = %{
62
+ #{ submit_tag 'Invite' }
63
+ #{ link_to 'Cancel', previous_location }
64
+ }
61
65
 
62
66
  %{
63
67
  #{ hidden_field_tag :success, "REDIRECT: #{success}" if success }
64
68
  #{ fieldset :subject, text_field( :email, :subject, :value=>subject, :size=>60 ) }
65
69
  #{ fieldset :message, text_area( :email, :message, :value=>message, :rows=>10, :cols => 60 ),
66
70
  :help => "We'll create a password and attach it to the email." }
67
- <fieldset>
68
- <div class="button-area">
69
- #{ submit_tag 'Invite' }
70
- #{ link_to 'Cancel', previous_location }
71
- </div>
72
- </fieldset>
71
+ #{ _optional_render :button_fieldset, args }
73
72
  }
74
73
  end
75
74
 
76
75
 
77
76
  view :account, :perms=> lambda { |r| r.card.update_account_ok? } do |args|
78
-
79
- locals = {:slot=>self, :card=>card, :account=>card.account }
80
- wrap_frame :account, args do
81
- card_form :update, '', 'notify-success'=>'account details updated' do |form|
82
- %{
83
- #{ hidden_field_tag 'success[id]', '_self' }
84
- #{ hidden_field_tag 'success[view]', 'account' }
85
- #{ render_account_detail }
86
- <fieldset><div class="button-area">#{ submit_tag 'Save Changes' }</div></fieldset>
87
- }
88
- end
77
+ frame_and_form :update, args, 'notify-success'=>'account details updated' do
78
+ %{
79
+ #{ render_account_detail }
80
+ #{ _optional_render :button_fieldset, args }
81
+ }
89
82
  end
90
83
  end
84
+
85
+ def default_account_args args
86
+ default_new_account_args args
87
+ args[:buttons] = submit_tag 'Save Changes'
88
+ end
91
89
 
92
90
 
93
91
  view :account_detail, :perms=>lambda { |r| r.card.update_account_ok? } do |args|
@@ -118,52 +116,67 @@ format :html do
118
116
 
119
117
 
120
118
  view :new_account, :perms=> lambda { |r| r.card.accountable? && !r.card.account } do |args|
121
- wrap_frame :new_account, args do
122
- card_form :update do |form|
123
- %{
124
- #{ hidden_field_tag 'success[id]', '_self' }
125
- #{ hidden_field_tag 'success[view]', 'account' }
126
- #{ fieldset :email, text_field( 'card[account_args]', :email ) }
127
- #{ _render_invitation_field }
128
- }
129
- end
119
+ frame_and_form :update, args do
120
+ %{
121
+ #{ _render_email_fieldset }
122
+ #{ _render_invitation_field }
123
+ }
130
124
  end
131
125
  end
132
126
 
127
+ def default_new_account_args args
128
+ args[:hidden] = { :success => { :id=>'_self', :view=>'account' } }
129
+ end
133
130
 
134
131
 
135
- view :signin, :tags=>:unknown_ok, :perms=>:none do |args|
136
- frame_args = args.merge :title=>'Sign In', :show_help=>true, :optional_menu=>:never
137
- signin_core = wrap_frame :signin, frame_args do
138
- form_tag wagn_path('account/signin') do
139
- %{
140
- #{ fieldset :email, text_field_tag( 'login', params[:login], :id=>'login_field' ) }
141
- #{ fieldset :password, password_field_tag( 'password' ) }
142
- <fieldset>
143
- <div class="button-area">
144
- #{ submit_tag 'Sign in' }
145
- #{ link_to '...or sign up!', wagn_path('account/signup') if Card.new(:type_id=>Card::AccountRequestID).ok? :create }
146
- </div>
147
- </fieldset>
148
- }
149
- end
150
- end
132
+ view :email_fieldset do |args|
133
+ fieldset :email, text_field( 'card[account_args]', :email ), :editor=>'content'
134
+ end
135
+
136
+
137
+ view :signin_and_forgot_password, :perms=>:none do |args|
151
138
  %{
152
- <div id="sign-in">#{signin_core}</div>
153
- <div id="forgot-password">#{_render_forgot_password}</div>
139
+ <div id="sign-in">#{ _render_signin args }</div>
140
+ <div id="forgot-password">#{ _render_forgot_password args }</div>
154
141
  }
155
142
  end
156
143
 
144
+ view :signin, :perms=>:none do |args|
145
+ args.merge!( {
146
+ :title=>'Sign In',
147
+ :optional_help=>:show,
148
+ :optional_menu=>:never,
149
+ :hidden=>{ :success=>'REDIRECT:*previous' },
150
+ :buttons=> submit_tag( 'Sign in' )
151
+ })
152
+ if Card.new(:type_id=>Card::AccountRequestID).ok? :create
153
+ args[:buttons] += link_to( '...or sign up!', wagn_path("new/:account_request"))
154
+ end
155
+
156
+ frame_and_form 'account/signin', args, :recaptcha=>:off do
157
+ [
158
+ fieldset( :email, text_field_tag( 'login', params[:login], :id=>'login_field' ) ),
159
+ fieldset( :password, password_field_tag( 'password' ) ),
160
+ _optional_render( :button_fieldset, args )
161
+ ]
162
+ end
163
+ end
157
164
 
158
165
  view :forgot_password, :perms=>:none do |args|
159
- frame_args = args.merge :title=>'Forgot Password', :show_help=>true, :optional_menu=>:never
160
- wrap_frame :forgot_password, frame_args do
161
- form_tag wagn_path('account/forgot_password') do
162
- %{
163
- #{ fieldset :email, text_field_tag( 'email', params[:email] ) }
164
- <fieldset><div class="button-area">#{ submit_tag 'Reset my password' }</div></fieldset>
165
- }
166
- end
166
+ args.merge!( {
167
+ :title=>'Forgot Password',
168
+ :optional_help=>:show,
169
+ :optional_menu=>:never,
170
+ :hidden => { :success => { :view=>:forgot_password }},
171
+ :buttons => submit_tag( 'Reset my password' )
172
+ } )
173
+
174
+ frame_and_form 'account/forgot_password', args, :recaptcha=>:off,
175
+ 'notify-success'=>"Check your email for your new temporary password" do
176
+ [
177
+ fieldset( :email, text_field_tag( 'email', params[:email] ) ),
178
+ _optional_render( :button_fieldset, args )
179
+ ]
167
180
  end
168
181
  end
169
182
  end