summaryrefslogtreecommitdiff
path: root/app/views/users/edit_website_settings.html.erb
blob: 7d6a6544508c2243395bf735be9e275de89fd771 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<% title "Edit Website Settings: #{@user.name}" %>

<%
  def can_edit?
    (@user.is?(current_user) && confirmed?) || (mod? && current_user.role >= @user.role && current_user.confirmed?)
  end
%>

<%= link_to @user.name, @user %> → Edit Website Settings
<h1>Edit Website Settings</h1>


<%= form_for @user do |f| %>
  <table>
    <tbody>
      <tr>
        <td>Header moves with scrolling (Experimental - do not report bugs)</td>
        <td>
          <%= f.check_box :header_scroll, disabled: !can_edit? %>
        </td>
      </tr>
      <tr>
        <td>Show exact UTC times</td>
        <td>
          <%= f.check_box :utc_time, disabled: !can_edit? %>
        </td>
      </tr>
      <tr>
        <td>Dark theme*</td>
        <td>
          <%= f.check_box :dark, disabled: !can_edit? %>
        </td>
      </tr>
    </tbody>
  </table>
  <p><%= f.submit "Save changes", class: "btn blue left", disabled: !can_edit? %></p>
  <div class="clear"></div>

  <% if !@user.is?(current_user) && !current_user.confirmed? %>
    <span class='red-alert'>You must confirm your own email before you can edit other user's website settings.</span>
  <% elsif !@user.confirmed? && @user.is?(current_user) %>
    <span class='red-alert'>You need to confirm your email before you can edit your website settings.</span>
  <% end %>
<% end %>
<br><br><br>
*Warning: If as a result to enabling this style your eyes get infected with a severe case of eye cancer, we are not reliable for any damage. Please contact your doctor in advance to ensure that in case of infection you will be treated accordingly. Quality theme  brought to you by Redempt™.