journalduhacker/app/views/settings/index.html.erb

314 lines
8.5 KiB
Plaintext

<div class="box wide">
<div class="legend right">
<a href="/u/<%= @user.username %>"><%= t('.viewprofile') %></a>
|
<%= link_to t('.logoutlink'), { :controller => "login", :action => "logout" },
:data => { :confirm => t('.confirmlogoutlink') },
:method => "post" %>
</div>
<div class="legend">
<%= t('.accountsettings') %>
</div>
<%= form_for @edit_user, :url => settings_path, :method => :post,
:html => { :id => "edit_user" } do |f| %>
<%= error_messages_for f.object %>
<div class="boxline">
<%= f.label :username, t('.username'), :class => "required" %>
<%= f.text_field :username, :size => 15 %>
<span class="hint">
<tt><%= User.username_regex_s %></tt>
</span>
</div>
<div class="boxline">
<%= label_tag :current_password, t('.currentpassword'),
:class => "required" %>
<%= password_field_tag :current_password, nil, :size => 40 %>
</div>
<div class="boxline">
<%= f.label :password, t('.password'), :class => "required" %>
<%= f.password_field :password, :size => 40, :autocomplete => "off" %>
</div>
<div class="boxline">
<%= f.label :password_confirmation, t('.confirmpassword'),
:class => "required" %>
<%= f.password_field :password_confirmation, :size => 40,
:autocomplete => "off" %>
</div>
<div class="boxline">
<%= f.label :email, t('.emailaddress'), :class => "required" %>
<%= f.email_field :email, :size => 40 %>
<span class="hint">
<%= raw(t('.gravatarized')) %>
</span>
</div>
<div class="boxline">
<%= f.label :about, t('.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">
<%= t('.markdownformattingavailable') %>
</div>
<div style="clear: both;"></div>
<%= render :partial => "global/markdownhelp" %>
</div>
</div>
<p>
<%= f.submit t('.saveaccountsettings') %>
</p>
<br>
<div class="legend">
<%= t('.securitysettings') %>
</div>
<div class="boxline">
<%= f.label :twofa, t('.twofactorauth'), :class => "required" %>
<span>
<% if @edit_user.totp_secret.present? %>
<span style="color: green; font-weight: bold;">
<%= t('.enabled2fa') %>
</span> (<a href="/settings/2fa"><%= t('.disable2fa') %></a>)
<% else %>
<%= t('.disabled2fa') %> (<a href="/settings/2fa"><%= t('.enroll2fa') %></a>)
<% end %>
</span>
</div>
<br>
<div class="legend">
<%= t('.commentreplynotificationsettings') %>
</div>
<div class="boxline">
<%= f.label :email_replies, t('.receiveemail'), :class => "required" %>
<%= f.check_box :email_replies %>
</div>
<div class="boxline">
<%= f.label :pushover_replies, t('.receivepushover'),
:class => "required" %>
<%= f.check_box :pushover_replies %>
<span class="hint">
<%= t('.requirepushover') %>
</span>
</div>
<br>
<div class="legend">
<%= t('.commentmentionnotificationsettings') %>
</div>
<div class="boxline">
<%= f.label :email_mentions, t('.receiveemail'), :class => "required" %>
<%= f.check_box :email_mentions %>
</div>
<div class="boxline">
<%= f.label :pushover_mentions, t('.receivepushover'),
:class => "required" %>
<%= f.check_box :pushover_mentions %>
<span class="hint">
<%= t('.requirepushover') %>
</span>
</div>
<br>
<div class="legend">
<%= t('.privatemessagenotificationsettings') %>
</div>
<div class="boxline">
<%= f.label :email_messages, t('.receiveemail'), :class => "required" %>
<%= f.check_box :email_messages %>
</div>
<div class="boxline">
<%= f.label :pushover_messages, t('.receivepushover'),
:class => "required" %>
<%= f.check_box :pushover_messages %>
<span class="hint">
<%= t('.requirepushover') %>
</span>
</div>
<br>
<div class="legend">
<%= t('.submittedstorycommentsettings') %>
</div>
<div class="boxline">
<%= f.label :show_submitted_story_threads,
raw(t('.showyourthreads')),
:class => "required" %>
<%= f.check_box :show_submitted_story_threads %>
</div>
<br>
<div class="legend">
<%= t('.mailinglistsettings') %>
</div>
<p>
<%= raw(t('.mailinglisttext')) %>
</p>
<div class="boxline">
<%= f.label :mailing_list_mode, t('.receivelistemails'),
:class => "required" %>
<%= f.select :mailing_list_mode, [ [ t('.listemailoption1'), 0 ],
[ t('.listemailoption2'), 1 ], [ t('.listemailoption3'), 2 ] ] %>
</div>
<div class="boxline">
<label class="required"><%= t('.listaddress') %></label>
<span>
<tt><%= Rails.application.shortname %>-<%=
@edit_user.mailing_list_token %>@<%= Rails.application.domain %></tt>
</span>
</div>
<br>
<div class="legend">
<%= t('.miscsettings') %>
</div>
<div class="boxline">
<%= f.label :show_story_previews, t('.storypreview'),
:class => "required" %>
<%= f.check_box :show_story_previews %>
</div>
<div class="boxline">
<%= f.label :show_avatars, t('.useravatars'), :class => "required" %>
<%= f.check_box :show_avatars %>
</div>
<div class="boxline">
<%= f.label :hide_dragons, t('.hidedragons'), :class => "required" %>
<%= f.check_box :hide_dragons %>
</div>
<div class="boxline">
<%= f.label :theme, t('.theme'), :class => "required" %>
<%= f.select :theme, [
["Light", "light"],
["Dark", "dark"],
["Neo Dark", "neo_dark"],
["Solarized Dark", "solarized_dark"]
]%>
</div
<br>
<%= f.submit t('.saveallsettings') %>
<% end %>
<br>
<br>
<div class="legend">
<%= t('.externalaccounts') %>
</div>
<% if Pushover.enabled? %>
<div class="boxline">
<%= label_tag :pushover_user_key,
raw("<a href=\"https://pushover.net/\">Pushover</a>:"),
:class => "required" %>
<%= 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 above
</span>
</div>
<% end %>
<% if Github.enabled? %>
<div class="boxline">
<%= label_tag :github_username, "GitHub:", :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 %>
</div>
<% end %>
<% if Twitter.enabled? %>
<div class="boxline">
<%= label_tag :twitter_username, "Twitter:", :class => "required" %>
<% 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 %>
</div>
<% end %>
<br>
<br>
<a name="invite"></a>
<div class="legend">
<%= t('.inviteuser') %>
</div>
<% if @user.can_invite? %>
<%= render :partial => "users/invitationform" %>
<% else %>
<%= t('.cannotsendinvitations') %>
<% end %>
<br>
<br>
<%= form_for @edit_user, :url => delete_account_path, :method => :post,
:html => { :id => "delete_user" } do |f| %>
<div class="legend">
<%= t('.deleteaccount') %>
</div>
<p>
<%= t('.deleteaccounttext') %>
</p>
<div class="boxline">
<%= f.label :password, t('.verifypassword'), :class => "required" %>
<%= f.password_field :password, :size => 40, :autocomplete => "off" %>
</div>
<br>
<%= f.submit t('.deleteaccountconfirmation') %>
<% end %>
</div>