-
Notifications
You must be signed in to change notification settings - Fork 351
Added an Issues Tab #1491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added an Issues Tab #1491
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,11 +16,14 @@ | |
| <img | ||
| class="responsive-img" | ||
| src={{ profile.profile_image_url }} | ||
| /> | ||
|
|
||
|
|
||
| > | ||
| </div> | ||
| </div> | ||
|
|
||
|
||
| <!-- Prevent users from following themselves. --> | ||
|
|
||
|
||
| {% if not profile == request.user.profile %} | ||
| {% if profile not in request.user.profile.following.all %} | ||
| <a href="{% url 'profile-follow' profile.user.username %}" class="waves-effect waves-light btn follow-btn" id="sidebar-follow-btn"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,27 +2,40 @@ | |
| {% load i18n %} | ||
|
|
||
| {% block content %} | ||
| {% for civi in civis %} | ||
| <div class="civi-card white" data-id=""> | ||
| <div class="civi-header-account white"> | ||
| <div class="civi-title-outer"> | ||
| <div class="civi-type gray-text">{{ civi.c_type }}</div> | ||
| <div class="civi-title">{{ civi.title }}</div> | ||
| </div> | ||
| </div> | ||
| <div class="civi-body"> | ||
| <div class="civi-body-inner">{{ civi.body }}</div> | ||
| </div> | ||
| {% for civi in civis %} | ||
| <div class="civi-card white" data-id=""> | ||
| <div class="civi-header-account white"> | ||
| <div class="civi-title-outer"> | ||
| <div class="civi-type gray-text">{{ civi.c_type }}</div> | ||
| <div class="civi-title">{{ civi.title }}</div> | ||
| </div> | ||
| {% empty %} | ||
| <div class="section no-state"> | ||
| <div class="container"> | ||
| <div class="section"> | ||
| <div class="center title-lato text">No activity</div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div class="civi-body"> | ||
| <div class="civi-body-inner">{{ civi.body }}</div> | ||
| </div> | ||
| </div> | ||
| {% empty %} | ||
| <div class="section no-state"> | ||
| <div class="container"> | ||
| <div class="section"> | ||
| <div class="center title-lato text">No activity</div> | ||
| </div> | ||
| {% endfor %} | ||
| </div> | ||
| </div> | ||
| {% endfor %} | ||
|
|
||
| {% for follower in followers%} | ||
| <div class="col s12 m6"> | ||
| <div class="user-chip chip white"> | ||
| <div class="user-chip-contents"> | ||
| <a href="/profile/{{ follower.user.username }}/"> | ||
| <img src="{{ follower.profile_image_url }}" alt="{{ followers.user.username }}"> | ||
| @{{ follower.user.username }} | ||
| </a> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| {%endfor%} | ||
|
|
||
|
|
||
| {% endblock content %} | ||
| {% endblock content %} | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,10 +188,9 @@ def get(self, request, username=None): | |
| ) | ||
|
|
||
|
|
||
|
|
||
| class UserFollowers(LoginRequiredMixin, View): | ||
| """A view that shows the followers for authorized users""" | ||
|
|
||
| def get(self, request, username=None): | ||
| profile = get_object_or_404(Profile, user__username=username) | ||
|
|
||
|
|
@@ -215,16 +214,13 @@ def get(self, request, username=None): | |
|
|
||
| return TemplateResponse( | ||
| request, | ||
|
|
||
| "profile_following.html", | ||
|
|
||
| { | ||
| "profile": profile, | ||
| }, | ||
| ) | ||
|
|
||
|
|
||
|
|
||
| class UserCivis(LoginRequiredMixin, View): | ||
| """ | ||
| A view that shows list of civis | ||
|
|
@@ -243,7 +239,6 @@ def get(self, request, username=None): | |
| ) | ||
|
|
||
|
|
||
|
|
||
| @login_required | ||
| def expunge_user(request): | ||
| """ | ||
|
|
@@ -276,3 +271,16 @@ def expunge_user(request): | |
| profile.save() | ||
|
|
||
| return redirect("/") | ||
|
|
||
|
|
||
| class UserIssues(LoginRequiredMixin, View): | ||
| def get(self, request, username=None): | ||
| profile = get_object_or_404(Profile, user__username=username) | ||
| user = profile.user | ||
| civis = user.civis.all() | ||
| followers = profile.followers.all() | ||
| return TemplateResponse( | ||
| request, | ||
| "user_civis.html", | ||
| {"profile": profile, "followers": followers, "user": user, "civis": civis}, | ||
|
||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected trailing spaces found.