tilde.news/app/views/settings/index.html.erb

341 lines
9.9 KiB
Plaintext

<div class="box wide">
<div class="legend right">
<a href="/filters">Filtered Tags</a>
|
<%= link_to "Logout", { :controller => "login", :action => "logout" },
:data => { :confirm => "Are you sure you want to logout?" },
:method => "post" %>
</div>
<div class="legend">
Account Settings (<a href="/u/<%= @user.username %>">View Profile</a>)
</div>
<%= form_with :model => @edit_user, :url => settings_path, :method => :post,
:id => "edit_user" do |f| %>
<%= error_messages_for f.object %>
<div class="boxline">
<%= f.label :username, "Username:", :class => "required" %>
<%= f.text_field :username, :size => 15 %>
<span class="hint">
<tt><%= User.username_regex_s %></tt>
</span>
</div>
<div class="boxline">
<%= f.label :current_password, "Current Password:",
:class => "required" %>
<%= f.password_field :current_password, :name => "current_password", :size => 30 %>
</div>
<div class="boxline">
<%= f.label :password, "New Password:", :class => "required" %>
<%= f.password_field :password, :size => 40, :autocomplete => "off" %>
</div>
<div class="boxline">
<%= f.label :password_confirmation, "Confirm Password:",
:class => "required" %>
<%= f.password_field :password_confirmation, :size => 40,
:autocomplete => "off" %>
</div>
<div class="boxline">
<%= f.label :email, "E-mail Address:", :class => "required" %>
<%= f.email_field :email, :size => 40 %>
</div>
<div class="boxline">
<%= f.label :about, "About:", :class => "required" %>
<%= f.text_area :about, :size => "100x5", :style => "width: 600px;" %>
</div>
<div class="box">
<div class="boxline markdown_help_toggler" style="margin-left: 9em;
width: 600px;">
<div class="markdown_help_label">
Markdown formatting available
</div>
<div style="clear: both;"></div>
<%= render :partial => "global/markdownhelp" %>
</div>
</div>
<p>
<%= f.submit "Save Account Settings" %>
</p>
<br>
<div class="legend">
External Accounts
</div>
<div class="boxline">
<%= f.label :gravatar,
raw("<a href=\"https://gravatar.com/\">Gravatar</a>:"),
:class => "required" %>
<span>
Your avatar will be cached from the Gravatar icon for your e-mail
address above.
(<%= link_to "Expire cache", "/avatars/expire", :method => :post %>)
</span>
</div>
<% if Pushover.enabled? %>
<div class="boxline">
<%= f.label :pushover_user_key,
raw("<a href=\"https://pushover.net/\">Pushover</a>:"),
:class => "required" %>
<span>
<%= link_to((@edit_user.pushover_user_key.present??
"Manage Pushover Subscription" : "Subscribe With Pushover"),
"/settings/pushover_auth", :class => "pushover_button",
:method => :post) %>
<span class="hint">
For optional comment and message notifications below
</span>
</span>
</div>
<% end %>
<% if Github.enabled? %>
<div class="boxline">
<span>
<%= f.label :github_username,
raw("<a href=\"https://github.com/\">GitHub</a>:"),
:class => "required" %>
<% if @edit_user.github_username.present? %>
Linked to
<strong><a href="https://github.com/<%= h(@edit_user.github_username)
%>"><%= h(@edit_user.github_username) %></a></strong>
(<%= link_to "Disconnect", "/settings/github_disconnect",
:method => :post %>)
<% else %>
<a href="/settings/github_auth">Connect</a>
<% end %>
</span>
</div>
<% end %>
<% if Twitter.enabled? %>
<div class="boxline">
<%= f.label :twitter_username,
raw("<a href=\"https://twitter.com/\">Twitter</a>:"),
:class => "required" %>
<span>
<% if @edit_user.twitter_username.present? %>
Linked to
<strong><a href="https://twitter.com/<%= h(@edit_user.twitter_username)
%>">@<%= h(@edit_user.twitter_username) %></a></strong>
(<%= link_to "Disconnect", "/settings/twitter_disconnect",
:method => :post %>)
<% else %>
<a href="/settings/twitter_auth">Connect</a>
<% end %>
</span>
</div>
<% end %>
<br>
<div class="legend">
Security Settings
</div>
<div class="boxline">
<%= f.label :twofa, "Two-Factor Auth:", :class => "required" %>
<span>
<% if @edit_user.totp_secret.present? %>
<span style="color: green; font-weight: bold;">
Enabled
</span> (<a href="/settings/2fa">Disable</a>)
<% else %>
Disabled (<a href="/settings/2fa">Enroll</a>)
<% end %>
</span>
</div>
<br>
<div class="legend">
Comment Reply Notification Settings
</div>
<div class="boxline">
<%= f.label :email_replies, "Receive E-mail:", :class => "required" %>
<%= f.check_box :email_replies %>
</div>
<div class="boxline">
<%= f.label :pushover_replies, "Receive Pushover Alert:",
:class => "required" %>
<%= f.check_box :pushover_replies %>
<span class="hint">
Requires Pushover subscription above
</span>
</div>
<br>
<div class="legend">
Comment Mention Notification Settings
</div>
<div class="boxline">
<%= f.label :email_mentions, "Receive E-mail:", :class => "required" %>
<%= f.check_box :email_mentions %>
</div>
<div class="boxline">
<%= f.label :pushover_mentions, "Receive Pushover Alert:",
:class => "required" %>
<%= f.check_box :pushover_mentions %>
<span class="hint">
Requires Pushover subscription above
</span>
</div>
<br>
<div class="legend">
Private Message Notification Settings
</div>
<div class="boxline">
<%= f.label :email_messages, "Receive E-mail:", :class => "required" %>
<%= f.check_box :email_messages %>
</div>
<div class="boxline">
<%= f.label :pushover_messages, "Receive Pushover Alert:",
:class => "required" %>
<%= f.check_box :pushover_messages %>
<span class="hint">
Requires Pushover subscription above
</span>
</div>
<br>
<div class="legend">
Submitted Story Comment Settings
</div>
<div class="boxline">
<%= f.label :show_submitted_story_threads,
raw("Show in <a href=\"/threads\">Your Threads</a>:"),
:class => "required" %>
<%= f.check_box :show_submitted_story_threads %>
</div>
<br>
<div class="legend">
Mailing List Settings
</div>
<p>
When enabled, you will receive all newly submitted stories and comments to
your e-mail address entered above, except the stories and comments filtered
by your <a href="/filters">tag filters</a>.
All e-mail messages will appear to be sent to your private list address
shown below which you can filter on, and e-mails you send to that address
will be posted under your account on this website. You should keep your
unique list address private to prevent others from posting comments as you.
</p>
<div class="boxline">
<%= f.label :mailing_list_mode, "Receive List E-mails:",
:class => "required" %>
<%= f.select :mailing_list_mode, [ [ "No e-mails", 0 ],
[ "All stories and comments", 1 ], [ "Only stories", 2 ] ] %>
</div>
<div class="boxline">
<label class="required">List Address:</label>
<span>
<tt><%= Rails.application.shortname %>-<%=
@edit_user.mailing_list_token %>@<%= Rails.application.domain %></tt>
</span>
</div>
<br>
<div class="legend">
Miscellaneous Settings
</div>
<div class="boxline">
<%= f.label :show_story_previews, "Show Story Previews:",
:class => "required" %>
<%= f.check_box :show_story_previews %>
</div>
<div class="boxline">
<%= f.label :show_avatars, "Show User Avatars:", :class => "required" %>
<%= f.check_box :show_avatars %>
</div>
<br>
<%= f.submit "Save All Settings" %>
<% end %>
<br>
<br>
<a name="invite"></a>
<div class="legend">
Invite a New User
</div>
<% if @user.can_invite? %>
<%= render :partial => "users/invitationform" %>
<% else %>
You cannot send invitations: <%= @user.disabled_invite_reason %>
<% end %>
<br>
<br>
<div class="deletion">
<%= form_with :model => @edit_user, :url => delete_account_path, :method => :post,
:id => "delete_user" do |f| %>
<div class="legend">
Delete Account
</div>
<p>
To permanently delete your account, verify your current password below.
</p>
<ul>
<li>Your account will be put into a deleted state.</li>
<li>Your username will remain reserved and will not be available for any other account.</li>
<li>Your private messages will be deleted.</li>
<li>Your submitted stories will not be deleted.</li>
<li>
Your comments with negative scores will be deleted, and you can check
"disown comments" below if you want all of your comments to change to
list <a href="/u/inactive-user">inactive-user</a> as the author
instead of your username.
</li>
</ul>
<div class="boxline">
<%= f.label :password, "Verify Password:", :class => "required" %>
<%= f.password_field :password, :size => 40, :autocomplete => "off" %>
</div>
<div class="boxline">
<%= f.label :i_am_sure, "I am sure:", :class => "required" %>
<%= f.check_box :i_am_sure %>
<br />
<%= f.label :disown, "Disown Comments:" %>
<%= f.check_box :disown %> (optional)
</div>
<%= f.submit "Yes, Delete My Account", :class => "deletion" %>
<% end %>
</div>
</div>