Commit b5351cc5 by Arjun Singh

Support legacy anonymity

parent 033ce7ef
...@@ -342,4 +342,8 @@ def safe_content(content): ...@@ -342,4 +342,8 @@ def safe_content(content):
if (content.get('anonymous') is False) and (content.get('anonymous_to_peers') is False): if (content.get('anonymous') is False) and (content.get('anonymous_to_peers') is False):
fields += ['username', 'user_id'] fields += ['username', 'user_id']
if 'children' in content:
safe_children = [safe_content(child) for child in content['children']]
content['children'] = safe_children
return strip_none(extract(content, fields)) return strip_none(extract(content, fields))
...@@ -19,7 +19,8 @@ if Backbone? ...@@ -19,7 +19,8 @@ if Backbone?
addReplyLink: () -> addReplyLink: () ->
if @model.hasOwnProperty('parent') if @model.hasOwnProperty('parent')
html = "<a href='#comment_#{@model.parent.id}'>@#{@model.parent.get('username')}</a>: " name = @model.parent.get('username') ? "anonymous"
html = "<a href='#comment_#{@model.parent.id}'>@#{name}</a>: "
p = @$('.response-body p:first') p = @$('.response-body p:first')
p.prepend(html) p.prepend(html)
......
...@@ -1702,6 +1702,12 @@ body.discussion { ...@@ -1702,6 +1702,12 @@ body.discussion {
background: #f6f6f6 !important; background: #f6f6f6 !important;
border-radius: 3px; border-radius: 3px;
header {
.anonymous{
font-size: 15px;
}
}
.responses { .responses {
margin-top: 40px; margin-top: 40px;
......
...@@ -93,7 +93,9 @@ ...@@ -93,7 +93,9 @@
<header class="response-local"> <header class="response-local">
<a href="javascript:void(0)" class="vote-btn" data-tooltip="vote"><span class="plus-icon"></span><span class="votes-count-number">${"<%- votes['up_count'] %>"}</span></a> <a href="javascript:void(0)" class="vote-btn" data-tooltip="vote"><span class="plus-icon"></span><span class="votes-count-number">${"<%- votes['up_count'] %>"}</span></a>
<a href="javascript:void(0)" class="endorse-btn${'<% if (endorsed) { %> is-endorsed<% } %>'} action-endorse" style="cursor: default; display: none;" data-tooltip="endorse"><span class="check-icon" style="pointer-events: none; "></span></a> <a href="javascript:void(0)" class="endorse-btn${'<% if (endorsed) { %> is-endorsed<% } %>'} action-endorse" style="cursor: default; display: none;" data-tooltip="endorse"><span class="check-icon" style="pointer-events: none; "></span></a>
<a href="${'<%- user_url %>'}" class="posted-by">${"<%- username %>"}</a> ${"<% if (obj.username) { %>"}
<a href="${'<%- user_url %>'}" class="posted-by">${'<%- username %>'}</a>
${"<% } else {print('<span class=\"anonymous\"><em>anonymous</em></span>');} %>"}
<p class="posted-details" title="${'<%- created_at %>'}">${'<%- created_at %>'}</p> <p class="posted-details" title="${'<%- created_at %>'}">${'<%- created_at %>'}</p>
</header> </header>
<div class="response-local"><div class="response-body">${"<%- body %>"}</div></div> <div class="response-local"><div class="response-body">${"<%- body %>"}</div></div>
...@@ -121,7 +123,11 @@ ...@@ -121,7 +123,11 @@
<div class="response-body"> <div class="response-body">
${'<%- body %>'} ${'<%- body %>'}
</div> </div>
<p class="posted-details">&ndash;posted <span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</span> by <a href="${'<%- user_url %>'}" class="profile-link">${'<%- username %>'}</a></p> <p class="posted-details">&ndash;posted <span class="timeago" title="${'<%- created_at %>'}">${'<%- created_at %>'}</span> by
${"<% if (obj.username) { %>"}
<a href="${'<%- user_url %>'}" class="profile-link">${'<%- username %>'}</a>
${"<% } else {print('anonymous');} %>"}
</p>
</div> </div>
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment