layout 'site'
before_filter :authorize, :only => :preferences
- before_filter :authorize_web, :only => [:rename, :account]
- before_filter :require_user, :only => [:account, :display_name_edit]
+ before_filter :authorize_web, :only => [:rename, :account, :go_public]
+ before_filter :require_user, :only => [:rename, :account, :go_public]
def save
@user = User.new(params[:user])
end
end
+ def go_public
+ @user.data_public = true
+ @user.save
+ flash[:notice] = 'All your edits are now public'
+ redirect_to :controller => 'user', :action => 'account'
+ end
+
def lost_password
if params['user']['email']
user = User.find_by_email(params['user']['email'])
</table>
<h2>Privacy</h2>
-
-<%= start_form_tag :controller => 'user', :action => 'public'%>
-<%= submit_tag 'Make all my edits public, forever' %>
-<%= end_form_tag %>
-
+<% if @user.data_public? %>
+ All your edits are public.
+<% else %>
+ Currently your edits are ananymous and people can't find out where you are located. To show what you edited and allow people to contact you through the website, click the button below. This action cannot be reversed.
+ <br /><br />
+ <%= start_form_tag :controller => 'user', :action => 'go_public'%>
+ <%= submit_tag 'Make all my edits public, forever' %>
+ <%= end_form_tag %>
+<% end %>
alter table users add preferences text;
create index users_display_name_idx on users(display_name);
-alter table users add public boolean default false;
+alter table users add data_public boolean default false;