aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blog/views.py2
-rw-r--r--static/css/main.css4
-rw-r--r--templates/blog/activity.html10
3 files changed, 12 insertions, 4 deletions
diff --git a/blog/views.py b/blog/views.py
index 0aa79b65..690eea66 100644
--- a/blog/views.py
+++ b/blog/views.py
@@ -250,7 +250,7 @@ def articles(request):
def user_activity(request, username):
user = User.objects.get(username=username)
user_profile = UserProfile.objects.get(user=user)
- if user_profile.is_public:
+ if user_profile.is_public or user == request.user:
recent_comments = Comment.objects.filter(user=user).order_by('-created_at')[:5]
else:
recent_comments = []
diff --git a/static/css/main.css b/static/css/main.css
index 9fc865a8..cd543f37 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -168,6 +168,10 @@ kbd {
color: #00ff00;
}
+.info {
+ color: #65c6c6;
+}
+
.ac {
margin-right: 5px;
height: 12px;
diff --git a/templates/blog/activity.html b/templates/blog/activity.html
index 595dd920..6d70af3b 100644
--- a/templates/blog/activity.html
+++ b/templates/blog/activity.html
@@ -28,10 +28,14 @@
</div>
<div style="clear: both;" id="activity">
- {% if activity_user_profile.is_public %}
+ {% if activity_user_profile.is_public or request.user.username == activity_user.username %}
- {% if activity_recent_comments %}
- <h2>Recent Comments</h2>
+
+ {% if activity_recent_comments %}
+ <h2>Recent Comments</h2>
+ {% if not activity_user_profile.is_public and request.user.username == activity_user.username %}
+ <p class="info">Your profile is not public. Only you can see this information. If you want to change this, go to your <a href="{% url 'blog:account' %}?tab=details">account settings</a>.</p>
+ {% endif %}
<ul>
{% for comment in activity_recent_comments %}
<li style="background: #1c1c1c;padding: 20px 10px 10px 10px;margin-bottom: 10px;border-radius: 8px;"