use 'me' instead of 'user' consistently
This commit is contained in:
@ -4,8 +4,8 @@
|
||||
<a href="<%= url_for("all_topics") %>">All topics</a>
|
||||
</span>
|
||||
<span>
|
||||
<% if user:is_logged_in() then -%>
|
||||
Welcome, <a href="<%= url_for("user", {username = user.username}) %>"><%= user.username %></a>
|
||||
<% if me:is_logged_in() then -%>
|
||||
Welcome, <a href="<%= url_for("user", {username = me.username}) %>"><%= me.username %></a>
|
||||
<% else -%>
|
||||
Welcome, guest. Please <a href="<%= url_for("user_login") %>">log in</a>
|
||||
<% end -%>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<% render("views.common.topnav", {user = user}) -%>
|
||||
<% render("views.common.topnav") -%>
|
||||
<main>
|
||||
<nav id="threadnav">
|
||||
<h1 class="thread-title"><%= thread.title %></h1>
|
||||
@ -13,7 +13,7 @@
|
||||
<% render("views.common.pagination", {page_count = pages, current_page = page}) %>
|
||||
</nav>
|
||||
|
||||
<% if not user:is_guest() then %>
|
||||
<% if not me:is_guest() then %>
|
||||
<h1>Respond to "<%= thread.title %>"</h1>
|
||||
<form method="post">
|
||||
<textarea id="post_content" name="post_content" placeholder="Response body" required></textarea><br>
|
||||
|
@ -22,7 +22,7 @@
|
||||
<p>This topic is locked.</p>
|
||||
<% end %>
|
||||
|
||||
<% if user:is_mod() then %>
|
||||
<% if me:is_mod() then %>
|
||||
<br>
|
||||
<a href="<%= url_for("topic_edit", {slug = topic.slug}) %>">Edit topic</a>
|
||||
<form method="post" action="<%= url_for("topic_edit", {slug = topic.slug}) %>">
|
||||
|
@ -11,6 +11,6 @@
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% if user:is_mod() then %>
|
||||
<% if me:is_mod() then %>
|
||||
<a href="<%= url_for("topic_create") %>">Create new topic</a>
|
||||
<% end %>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<h1>Are you sure you want to delete your account, <%= user.username %>?</h1>
|
||||
<h1>Are you sure you want to delete your account, <%= me.username %>?</h1>
|
||||
<p>This cannot be undone. This will not delete your posts, only anonymize them.</p>
|
||||
<p>If you are sure, please type your password below.</p>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<h2><%= err %></h2>
|
||||
<% end %>
|
||||
|
||||
<form method="post" action="<%= url_for("user_delete", {username = user.username}) %>">
|
||||
<form method="post" action="<%= url_for("user_delete", {username = me.username}) %>">
|
||||
<input type="password" name="password" id="password" autocomplete="current-password" placeholder="Password" required><br>
|
||||
<input class="critical" type="submit" value="Delete my account (NO UNDO)">
|
||||
</form>
|
||||
|
@ -2,19 +2,19 @@
|
||||
<% if flash_msg then %>
|
||||
<h2><%= flash_msg %></h2>
|
||||
<% end %>
|
||||
<form method="post" action="<%= url_for("user_set_avatar", {username = user.username}) %>" enctype="multipart/form-data">
|
||||
<img src="<%= avatar_url(user) %>"><br>
|
||||
<form method="post" action="<%= url_for("user_set_avatar", {username = me.username}) %>" enctype="multipart/form-data">
|
||||
<img src="<%= avatar_url(me) %>"><br>
|
||||
<input id="file" type="file" name="avatar" accept="image/*">
|
||||
<input type="submit" value="Update avatar">
|
||||
<% if not user:is_default_avatar() then %>
|
||||
<input type="submit" value="Clear avatar" formaction="<%= url_for("user_clear_avatar", {username = user.username}) %>">
|
||||
<% if not me:is_default_avatar() then %>
|
||||
<input type="submit" value="Clear avatar" formaction="<%= url_for("user_clear_avatar", {username = me.username}) %>">
|
||||
<% end %>
|
||||
<br>
|
||||
</form>
|
||||
<form method="post" action="">
|
||||
<label for="status">Status</label>
|
||||
<input type="text" id="status" name="status" value="<%= user.status %>" maxlength="30"><br>
|
||||
<input type="text" id="status" name="status" value="<%= me.status %>" maxlength="30"><br>
|
||||
<input type="submit" value="Save status">
|
||||
</form>
|
||||
<br>
|
||||
<a class="linkbutton critical" href="<%= url_for("user_delete_confirm", {username = user.username}) %>">Delete account</a>
|
||||
<a class="linkbutton critical" href="<%= url_for("user_delete_confirm", {username = me.username}) %>">Delete account</a>
|
||||
|
Reference in New Issue
Block a user