kit_cms 2.3.20 → 2.3.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/app/assets/images/kit/toolbar/smile.png +0 -0
  2. data/app/assets/images/kit/toolbar/wink.gif +0 -0
  3. data/app/assets/images/kit/toolbar/wink.png +0 -0
  4. data/app/assets/javascripts/codemirror/editor.js +55 -17
  5. data/app/assets/javascripts/codemirror/jquery.js +0 -1
  6. data/app/assets/javascripts/codemirror/ruby.js +196 -0
  7. data/app/assets/javascripts/jquery.js +3036 -2838
  8. data/app/assets/javascripts/kit/utilities.js +655 -586
  9. data/app/assets/stylesheets/codemirror/style.css +1 -1
  10. data/app/assets/stylesheets/codemirror/theme.css +23 -3
  11. data/app/assets/stylesheets/kit/calendar.css +6 -1
  12. data/app/assets/stylesheets/kit/cms/cms.css +36 -0
  13. data/app/assets/stylesheets/kit/forums.css +5 -1
  14. data/app/assets/stylesheets/kit/kit.css +3 -1
  15. data/app/controllers/account_controller.rb +306 -0
  16. data/app/controllers/ad_controller.rb +2 -0
  17. data/app/controllers/admin/ad_units_controller.rb +1 -1
  18. data/app/controllers/admin/ad_zones_controller.rb +15 -0
  19. data/app/controllers/admin/ads_controller.rb +5 -0
  20. data/app/controllers/admin/block_controller.rb +1 -65
  21. data/app/controllers/admin/blocks_controller.rb +2 -0
  22. data/app/controllers/admin/content_controller.rb +3 -1
  23. data/app/controllers/admin/dashboard_controller.rb +28 -4
  24. data/app/controllers/admin/dj_controller.rb +45 -0
  25. data/app/controllers/admin/help_controller.rb +1 -1
  26. data/app/controllers/admin/html_asset_controller.rb +0 -12
  27. data/app/controllers/admin/q_controller.rb +120 -0
  28. data/app/controllers/admin/user_controller.rb +4 -4
  29. data/app/controllers/api_controller.rb +34 -0
  30. data/app/controllers/calendar_controller.rb +1 -1
  31. data/app/controllers/form_controller.rb +3 -3
  32. data/app/controllers/forum_controller.rb +39 -29
  33. data/app/controllers/kit_controller.rb +42 -15
  34. data/app/controllers/pages_controller.rb +25 -5
  35. data/app/controllers/q_controller.rb +235 -0
  36. data/app/controllers/repo_controller.rb +7 -0
  37. data/app/controllers/user_controller.rb +14 -10
  38. data/app/controllers/utility_controller.rb +1 -1
  39. data/app/helpers/account_helper.rb +47 -0
  40. data/app/helpers/admin/layouts_helper.rb +8 -0
  41. data/app/helpers/admin/page_templates_helper.rb +8 -0
  42. data/app/helpers/ads_helper.rb +11 -12
  43. data/app/helpers/calendar_helper.rb +6 -2
  44. data/app/helpers/form_data_helper.rb +1 -1
  45. data/app/helpers/form_helper.rb +8 -0
  46. data/app/helpers/forum_helper.rb +5 -1
  47. data/app/helpers/kit_helper.rb +65 -35
  48. data/app/helpers/kit_modules_helper.rb +4 -0
  49. data/app/helpers/user_helper.rb +0 -28
  50. data/app/jobs/page_link_job.rb +34 -0
  51. data/app/jobs/queue_job.rb +134 -0
  52. data/app/mailers/notification.rb +10 -0
  53. data/app/mailers/queue_mailer.rb +13 -0
  54. data/app/models/ad.rb +6 -6
  55. data/app/models/ad_unit.rb +1 -1
  56. data/app/models/ad_zone.rb +4 -0
  57. data/app/models/block.rb +1 -1
  58. data/app/models/delayed_job.rb +3 -0
  59. data/app/models/form.rb +16 -4
  60. data/app/models/html_asset.rb +19 -4
  61. data/app/models/html_asset_usage.rb +3 -0
  62. data/app/models/html_assetable.rb +4 -0
  63. data/app/models/layout.rb +36 -6
  64. data/app/models/newsletter.rb +1 -1
  65. data/app/models/page.rb +36 -2
  66. data/app/models/page_link.rb +5 -0
  67. data/app/models/page_template.rb +22 -2
  68. data/app/models/preference.rb +1 -1
  69. data/app/models/q_event.rb +12 -0
  70. data/app/models/q_klass.rb +5 -0
  71. data/app/models/q_message.rb +9 -0
  72. data/app/models/q_publisher.rb +35 -0
  73. data/app/models/q_subscription.rb +7 -0
  74. data/app/models/q_user.rb +29 -0
  75. data/app/models/q_users_method.rb +6 -0
  76. data/app/models/q_users_publisher.rb +6 -0
  77. data/app/models/user.rb +127 -19
  78. data/app/models/user_login.rb +4 -0
  79. data/app/validators/email_validator.rb +14 -0
  80. data/app/views/account/_edit.html.haml +40 -0
  81. data/app/views/account/_edit_intro.html.haml +3 -0
  82. data/app/views/account/_forgotten.html.haml +20 -0
  83. data/app/views/account/_forgotten_intro.html.haml +5 -0
  84. data/app/views/account/_sign_in.html.haml +31 -0
  85. data/app/views/account/_sign_in_intro.html.haml +4 -0
  86. data/app/views/account/_sign_up.html.haml +51 -0
  87. data/app/views/account/_sign_up_intro.html.haml +4 -0
  88. data/app/views/account/edit.html.haml +1 -0
  89. data/app/views/account/forgotten.html.haml +1 -0
  90. data/app/views/account/sign_in.html.haml +2 -0
  91. data/app/views/account/sign_up.html.haml +1 -0
  92. data/app/views/ad/_buy.html.haml +2 -1
  93. data/app/views/admin/ad_zones/_form.html.haml +1 -1
  94. data/app/views/admin/ad_zones/show.html.haml +2 -0
  95. data/app/views/admin/blocks/_form.html.haml +11 -1
  96. data/app/views/admin/dashboard/broken_links.html.haml +9 -0
  97. data/app/views/admin/dashboard/system.html.haml +11 -0
  98. data/app/views/admin/dj/index.html.haml +43 -0
  99. data/app/views/admin/form/_form.html.haml +15 -10
  100. data/app/views/admin/group/index.html.haml +1 -1
  101. data/app/views/admin/help/edit.html.haml +1 -1
  102. data/app/views/admin/html_asset/show.html.haml +9 -2
  103. data/app/views/admin/layouts/show.html.haml +10 -16
  104. data/app/views/admin/page_templates/_form.html.haml +9 -17
  105. data/app/views/admin/page_templates/show.html.haml +5 -4
  106. data/app/views/admin/q/events.html.haml +26 -0
  107. data/app/views/admin/q/index.html.haml +28 -0
  108. data/app/views/admin/q/klasses.html.haml +61 -0
  109. data/app/views/admin/q/messages.html.haml +37 -0
  110. data/app/views/admin/q/show.html.haml +98 -0
  111. data/app/views/admin/q/subscriptions.html.haml +26 -0
  112. data/app/views/admin/q/users.html.haml +27 -0
  113. data/app/views/admin/snippet/edit.html.erb +1 -1
  114. data/app/views/admin/snippet/new.html.erb +1 -1
  115. data/app/views/admin/stylesheet/show.html.haml +1 -1
  116. data/app/views/admin/user/index.html.erb +15 -6
  117. data/app/views/admin/user/view.html.erb +5 -4
  118. data/app/views/admin/views/_form.html.haml +3 -3
  119. data/app/views/calendar/_buy_tickets.html.haml +1 -1
  120. data/app/views/calendar/_calendar_entry.html.haml +1 -1
  121. data/app/views/calendar/_month.html.haml +7 -7
  122. data/app/views/form/_show.html.haml +1 -1
  123. data/app/views/forum/_add_post.html.haml +7 -8
  124. data/app/views/forum/_mod_thread.js.erb +46 -6
  125. data/app/views/forum/_post_moderation.html.haml +2 -1
  126. data/app/views/forum/_post_preview.html.haml +1 -9
  127. data/app/views/forum/_post_scripts.js.erb +29 -5
  128. data/app/views/forum/fetch_raw.html.haml +1 -0
  129. data/app/views/forum/moderate.html.haml +1 -0
  130. data/app/views/forum/topic_index.html.haml +4 -0
  131. data/app/views/notification/{event.txt.erb → event.text.erb} +0 -0
  132. data/app/views/notification/forgotten_password.text.erb +2 -0
  133. data/app/views/pages/content_edit.html.haml +1 -1
  134. data/app/views/pages/info.html.erb +13 -2
  135. data/app/views/pages/links.html.haml +63 -0
  136. data/app/views/user/edit_profile.html.haml +1 -1
  137. data/app/views/utility/_cm_editor.html.erb +13 -10
  138. data/app/views/utility/_cm_toolbar_markdown.html.haml +8 -1
  139. data/app/views/utility/_menu.html.haml +4 -0
  140. data/app/views/utility/mercury_html.html.haml +1 -0
  141. data/config/initializers/elastic_search.rb +6 -3
  142. data/config/initializers/extend_controller.rb +3 -0
  143. data/config/initializers/string.rb +9 -6
  144. data/config/initializers/warden.rb +49 -0
  145. data/config/locales/en.yml +29 -1
  146. data/config/routes.rb +35 -2
  147. data/lib/kit_cms.rb +7 -2
  148. data/lib/tasks/kit.rake +90 -2
  149. metadata +139 -27
  150. data/app/controllers/user/confirmations_controller.rb +0 -11
  151. data/app/controllers/user/passwords_controller.rb +0 -13
  152. data/app/controllers/user/registrations_controller.rb +0 -110
  153. data/app/controllers/user/sessions_controller.rb +0 -33
  154. data/app/controllers/user/unlocks_controller.rb +0 -13
  155. data/app/views/devise/_links.erb +0 -25
  156. data/app/views/devise/confirmations/new.html.erb +0 -12
  157. data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
  158. data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
  159. data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
  160. data/app/views/devise/passwords/edit.html.erb +0 -16
  161. data/app/views/devise/passwords/new.html.erb +0 -12
  162. data/app/views/devise/registrations/edit.html.erb +0 -28
  163. data/app/views/devise/registrations/new.html.erb +0 -18
  164. data/app/views/devise/sessions/new.html.erb +0 -18
  165. data/app/views/devise/shared/_links.erb +0 -25
  166. data/app/views/devise/unlocks/new.html.erb +0 -12
  167. data/app/views/pages/links.html.erb +0 -8
  168. data/app/views/user/shared/_links.erb +0 -25
  169. data/config/initializers/devise.rb +0 -196
  170. data/config/initializers/devise_extender.rb +0 -39
@@ -0,0 +1,7 @@
1
+ class QSubscription < ActiveRecord::Base
2
+
3
+ belongs_to :q_publisher
4
+ belongs_to :q_user
5
+
6
+ before_save { self.topic = self.topic.downcase }
7
+ end
@@ -0,0 +1,29 @@
1
+ require 'bcrypt'
2
+ require 'digest/md5'
3
+
4
+ class QUser < ActiveRecord::Base
5
+ include BCrypt
6
+
7
+ has_many :q_users_publishers
8
+ has_many :q_publishers, :through=>:q_users_publishers
9
+ has_many :q_subscriptions, :dependent => :destroy
10
+ has_many :q_messages, :dependent=>:destroy
11
+ has_many :q_users_methods
12
+
13
+ def methods
14
+ self.q_users_methods.map { |m| m.method }.join ", "
15
+ end
16
+
17
+ def password
18
+ @password ||= Password.new(encrypted_password)
19
+ end
20
+
21
+ def password=(new_password)
22
+ @password = Password.create(new_password)
23
+ self.encrypted_password = @password
24
+ end
25
+
26
+ def generate_session_token
27
+ self.session_token = Digest::MD5.hexdigest(Time.now.to_s + rand(10000000).to_s)
28
+ end
29
+ end
@@ -0,0 +1,6 @@
1
+ class QUsersMethod < ActiveRecord::Base
2
+
3
+ belongs_to :q_user
4
+
5
+ end
6
+
@@ -0,0 +1,6 @@
1
+ class QUsersPublisher < ActiveRecord::Base
2
+
3
+ belongs_to :q_user
4
+ belongs_to :q_publisher
5
+
6
+ end
@@ -1,4 +1,10 @@
1
1
  class User < KitIndexed
2
+ include BCrypt
3
+ include ActionView::Helpers
4
+
5
+ has_many :user_logins
6
+
7
+ after_initialize { self.skip_password = true }
2
8
 
3
9
  User.do_indexing :User, [
4
10
  {:name=>"id", :index=>:not_analyzed, :include_in_all=>false},
@@ -103,29 +109,30 @@ class User < KitIndexed
103
109
  "%d" % r rescue nil
104
110
  end
105
111
 
106
- def active_for_authentication?
107
- super && self.banned_at == nil
108
- end
109
-
110
- devise :database_authenticatable, :registerable,
111
- :recoverable, :rememberable, :trackable, :lockable,
112
- :maximum_attempts=>10, :unlock_strategy=>:time
113
-
114
- if Rails.configuration.respond_to?(:use_rest_auth) && Rails.configuration.use_rest_auth
115
- devise :encryptable, :encryptor => :restful_authentication_sha1
116
- end
117
-
118
112
  after_create :welcome_message
119
113
 
120
- validates :display_name, :uniqueness=>{:scope=>:system_id}, :allow_blank => true
121
- validates :email, :presence=>true, :uniqueness=>{:scope=>:system_id}
122
- validates :password, :presence=>true, :confirmation=>true, :on=>:create
123
- validates_confirmation_of :password, :on=>:create
114
+ validates :display_name, :format=>{:with=>/\A[a-z0-9\-\_\ \.]+\z/i, :message=>"Invalid name (may only contain letters, numbers, spaces, hyphens and underscores"}, :presence=>{:message=>"You must enter a name"}, :uniqueness=>{:case_sensitive => false, :message=>"That name has already been used", :scope=>:system_id}, :if => Proc.new { |u|
115
+ Preference.get_cached(u.system_id, "show_forum_nickname_on_signup")=='true'
116
+ }
117
+
118
+ validates :email, :presence=>true, :uniqueness=>{:scope=>:system_id, :case_sensitive => false}, :email=>true
119
+ attr_accessor :skip_password
124
120
 
121
+ validates :password, :presence=>true, :confirmation=>true, :length=>{:minimum=>4, :maximum=>40}, :unless=>proc {self.skip_password==true}
122
+ validates :password_confirmation, :presence=>true, :unless=>proc {self.skip_password==true}
125
123
  attr_accessible :email, :password, :password_confirmation, :remember_me, :display_name, :subscribe_newsletter, :spam_points, :system_id
126
124
 
127
125
  attr_accessor :fave_pages
128
126
 
127
+ def password=(new_password)
128
+ @password = new_password
129
+ self.encrypted_password = Password.create(new_password)
130
+ end
131
+
132
+ def password
133
+ @password ||= Password.new(self.encrypted_password)
134
+ end
135
+
129
136
  def concatenated_groups
130
137
  self.groups.map {|g| g.name}.join(", ")
131
138
  end
@@ -142,11 +149,22 @@ class User < KitIndexed
142
149
  User.connection.execute("update users set last_heard_from=now() where id = #{self.id}")
143
150
  end
144
151
 
152
+ def unlock_access!
153
+ Activity.add(self.system.id, "UnLocking user <a href='/admin/user/#{self.id}'>#{self.email}</a>", 0, "Users")
154
+ self.locked_at = nil
155
+ self.save
156
+ end
157
+
145
158
  def lock_access!
146
159
  Activity.add(self.system.id, "Locking user <a href='/admin/user/#{self.id}'>#{self.email}</a> after #{self.failed_attempts} failed attempts", 0, "Users")
147
- super
160
+ self.locked_at = Time.now
161
+ self.save
148
162
  end
149
163
 
164
+ def locked?
165
+ self.locked_at != nil
166
+ end
167
+
150
168
  def load_favourite_pages
151
169
  unless self.fave_pages
152
170
  self.fave_pages = Hash.new
@@ -230,7 +248,7 @@ class User < KitIndexed
230
248
  end
231
249
 
232
250
  def active?
233
- super && self.not_banned?
251
+ self.not_banned?
234
252
  end
235
253
 
236
254
  def add_role(role, current_user_id = nil)
@@ -294,5 +312,95 @@ class User < KitIndexed
294
312
  def mailchimp_connection
295
313
  Gibbon.new(Preference.get_cached(self.system_id,'mailchimp_api_key'))
296
314
  end
297
-
315
+
316
+ def self.authenticate(sid, email, password)
317
+ logger.debug "Authenticating #{email}"
318
+ u = User.sys(sid).where(:email=>email).first
319
+
320
+ unlock_hours = Preference.get_cached(sid, "account_unlock_after_hours")
321
+ if unlock_hours.not_blank?
322
+ unlock_hours = unlock_hours.to_i
323
+ if Time.now >= u.locked_at + unlock_hours.hours
324
+ u.unlock_access!
325
+ end
326
+ end
327
+
328
+ return nil unless u
329
+ return nil unless u.password==password
330
+ return nil unless u.not_banned?
331
+ return nil if u.locked?
332
+ return u
333
+ end
334
+
335
+ def self.cookie_authenticate(sid, token)
336
+ return nil unless token
337
+ User.sys(sid).where(:remember_token=>token).where("remember_token is not null and remember_token <> ''").first
338
+ end
339
+
340
+ def self.token_authenticate(sid, token)
341
+ if Preference.get_cached(sid, "account_token_auth")=="true"
342
+ User.sys(sid).where("token is not null and token<>''").where(:token=>token).first rescue nil
343
+ else
344
+ nil
345
+ end
346
+ end
347
+
348
+ def status_display
349
+ status = []
350
+ roles = self.roles.collect {|r| r.name }.join(', ')
351
+ status << "[#{roles}]" if roles.not_blank?
352
+ status << "Banned" if self.banned_at
353
+ status << "Locked" if self.locked_at
354
+ status << "Failures: #{self.failed_attempts}" if self.failed_attempts>0
355
+ status.join(", ")
356
+ end
357
+
358
+
359
+ def dont_remember
360
+ self.remember_created_at = nil
361
+ self.remember_token = nil
362
+ self.save
363
+ end
364
+
365
+ def record_signin(sid, request, method = 'e')
366
+ lh = UserLogin.new
367
+ lh.user_id = self.id
368
+ lh.ip = request.remote_ip
369
+ lh.method = method
370
+ lh.system_id = sid
371
+ lh.save
372
+ self.sign_in_count = (self.sign_in_count + 1) rescue 1
373
+ self.last_sign_in_at = self.current_sign_in_at
374
+ self.current_sign_in_at = Time.now
375
+ self.last_sign_in_ip = self.current_sign_in_ip
376
+ self.current_sign_in_ip = request.remote_ip
377
+ self.failed_attempts = 0
378
+ self.skip_password = true
379
+
380
+ if method=='c' || request.params[:remember_me]
381
+ self.remember_created_at = Time.now
382
+ self.remember_token ||= Digest::MD5.hexdigest(self.email + Time.now.to_s + rand(100000).to_s)
383
+ else
384
+ self.remember_created_at = nil
385
+ self.remember_token = nil
386
+ end
387
+ self.save
388
+ end
389
+
390
+ def self.record_failed_signin(sid, request, method = 'e')
391
+ user = nil
392
+ email = request.params[:email] || request.params[:user][:email]
393
+ if email
394
+ user = User.sys(sid).where(:email=>email).first
395
+ if user
396
+ user.failed_attempts = (self.failed_attempts + 1) rescue 1
397
+ if user.failed_attempts >= (Preference.get_cached(sid, "account_lock_after_failures") || "10").to_i
398
+ user.lock_access!
399
+ end
400
+ user.save
401
+ end
402
+ end
403
+ return user
404
+ end
405
+
298
406
  end
@@ -0,0 +1,4 @@
1
+ class UserLogin < ActiveRecord::Base
2
+
3
+ belongs_to :user
4
+ end
@@ -0,0 +1,14 @@
1
+ require 'mail'
2
+ class EmailValidator < ActiveModel::EachValidator
3
+ def validate_each(record,attribute,value)
4
+ begin
5
+ m = Mail::Address.new(value)
6
+ r = m.domain && m.address == value
7
+ t = m.__send__(:tree)
8
+ r &&= (t.domain.dot_atom_text.elements.size > 1)
9
+ rescue Exception => e
10
+ r = false
11
+ end
12
+ record.errors[attribute] << (options[:message] || "is invalid") unless r
13
+ end
14
+ end
@@ -0,0 +1,40 @@
1
+ #edit.users
2
+ %h2= t "account.edit_user_title"
3
+
4
+ - unless options[:dont_show_intro]
5
+ .intro
6
+ = render :partial=>"edit_intro"
7
+
8
+
9
+ = form_tag "/users/edit" do |f|
10
+
11
+ - if user
12
+ = error_messages_for user
13
+
14
+ - if options[:return_to]
15
+ = hidden_field_tag :return_to, options[:return_to]
16
+
17
+ - unless options[:must_change_password]==true || params[:must_change_password]=="1"
18
+ #email
19
+ %label= t "account.email_label"
20
+ = email_field_tag :email, user.email
21
+
22
+ - if options[:must_change_password]==true || params[:must_change_password]=="1"
23
+ = hidden_field_tag :must_change_password, 1
24
+
25
+ #password
26
+ = t "account.only_if_changing_password" unless options[:dont_show_leave_blank_passwords]==true
27
+ %label= t "account.password_label"
28
+ = password_field_tag :password
29
+
30
+ #password_confirmation
31
+ %label= t "account.password_confirmation_label"
32
+ = password_field_tag :password_confirmation
33
+
34
+ #submit
35
+ = submit_tag t("account.edit_user_label")
36
+
37
+ - unless options[:dont_show_intro]
38
+ .outro
39
+ = render :partial=>"edit_intro"
40
+
@@ -0,0 +1,3 @@
1
+ - if users_have_profiles?
2
+ .profile_link
3
+ = link_to t("account.edit_profile_link"), "/user/profile/edit"
@@ -0,0 +1,20 @@
1
+ #forgotten.users
2
+
3
+ %h2= t "account.forgotten_title"
4
+
5
+ .intro
6
+ = render :partial=>"account/forgotten_intro"
7
+
8
+ = form_tag "/users/forgotten" do |f|
9
+
10
+ #email
11
+ %label= t "account.email_label"
12
+ = text_field_tag :email, params[:email]
13
+
14
+ #submit
15
+ = submit_tag t("account.forgotten_label")
16
+
17
+ .outro
18
+ = render :partial=>"account/forgotten_intro"
19
+
20
+
@@ -0,0 +1,5 @@
1
+ .already
2
+ = t "account.not_forgotten"
3
+ = link_to t("account.sign_in_link"), sign_in_url
4
+
5
+
@@ -0,0 +1,31 @@
1
+ #sign_in.users
2
+ %h2= t "account.sign_in_title"
3
+
4
+ .intro
5
+ = render :partial=>"account/sign_in_intro"
6
+
7
+ = form_tag "/users/sign_in" do |f|
8
+
9
+ - if options[:return_to]
10
+ = hidden_field_tag :return_to, options[:return_to]
11
+
12
+ #email
13
+ %label= t "account.email_label"
14
+ = email_field_tag :email, params[:email]
15
+
16
+ #password
17
+ %label= t "account.password_label"
18
+ = password_field_tag :password
19
+ .forgotten
20
+ = link_to t("account.forgotten_password"), forgotten_url
21
+
22
+ - unless sys_pref('account_no_remember')=='true'
23
+ #remember
24
+ %label= t "account.remember_label"
25
+ = check_box_tag :remember_me, params[:remember_me]
26
+
27
+ #submit
28
+ = submit_tag t("account.sign_in_label")
29
+
30
+ .outro
31
+ = render :partial=>"account/sign_in_intro"
@@ -0,0 +1,4 @@
1
+ .already
2
+ Don't already have an account?
3
+ = link_to "Sign up", sign_up_url
4
+
@@ -0,0 +1,51 @@
1
+ #sign_up.users
2
+
3
+ %h2= t "account.sign_up_title"
4
+
5
+ .intro
6
+ = render :partial=>"account/sign_up_intro"
7
+
8
+ = form_tag "/users/sign_up" do |f|
9
+
10
+ - if @user
11
+ = error_messages_for @user
12
+
13
+ #email
14
+ %label= t "account.email_label"
15
+ = text_field_tag :email, params[:email]
16
+
17
+ #password
18
+ %label= t "account.password_label"
19
+ = password_field_tag :password
20
+
21
+ #password_confirmation
22
+ %label= t "account.password_confirmation_label"
23
+ = password_field_tag :password_confirmation
24
+
25
+ - if params[:groups]
26
+ = hidden_field_tag :groups, params[:groups]
27
+
28
+ - if sys_pref("show_forum_nickname_on_signup")=='true'
29
+ #forum_nickname
30
+ %label= t "account.forum_nickname"
31
+ = text_field_tag :display_name, params[:display_name]
32
+
33
+ - @attributes = UserAttribute.sys(_sid).where(:show_on_signup=>1).all
34
+
35
+ - if @attributes && @attributes.size>0
36
+ .attributes
37
+ - @attributes.each do |attr|
38
+ .attribute(class="#{attr.code_name}")
39
+ %label= attr.name
40
+
41
+ = render :partial=>"form/form_field", :locals=>{:type=>attr.form_field_type, :field=>attr, :value=>params["#{attr.code_name}"], :is_mandatory=>attr.is_mandatory?, :has_error=>@errors && @errors[attr.id], :show_options_editor=>false}
42
+
43
+ - if attr.description.not_blank?
44
+ .description
45
+ = attr.description
46
+ #submit
47
+ = submit_tag t("account.sign_up_label")
48
+
49
+ .outro
50
+ = render :partial=>"account/sign_up_intro"
51
+
@@ -0,0 +1,4 @@
1
+ .already
2
+ = t "account.already_have_account"
3
+ = link_to "Sign in", sign_in_url
4
+
@@ -0,0 +1 @@
1
+ = account_edit_form(@options)
@@ -0,0 +1 @@
1
+ = account_forgotten
@@ -0,0 +1,2 @@
1
+ = account_sign_in_form
2
+
@@ -0,0 +1 @@
1
+ = account_sign_up_form
@@ -5,6 +5,7 @@
5
5
 
6
6
  = hidden_field_tag :options, options.to_json
7
7
 
8
+ = f.error_messages
8
9
  %label(for="name")
9
10
  Name
10
11
  = f.text_field :name, :class=>"required"
@@ -34,7 +35,7 @@
34
35
  Content
35
36
  = f.file_field :creative, :class=>"required"
36
37
  .help
37
- The content of your ad - a GIF, JPG or PNG file, no larger than 100Kb in size. It will automatically be resized to fit but for best results you should resize it to #{@zones.first.width}px (width) by #{@zones.first.height}px (height) before uploading.
38
+ The content of your ad - a GIF, JPG or PNG file, no larger than 100Kb in size. It will automatically be resized to fit but for best results you should resize it to be the same size as the zone you're creating the ad for.
38
39
 
39
40
  %label(for="link")
40
41
  Link