diff --git a/events/migrations/0009_auto_20180224_0556.py b/events/migrations/0009_auto_20180224_0556.py
new file mode 100644
index 0000000..9990892
--- /dev/null
+++ b/events/migrations/0009_auto_20180224_0556.py
@@ -0,0 +1,23 @@
+# Generated by Django 2.0 on 2018-02-24 05:56
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('events', '0008_add-team-description'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='searchable',
+ name='venue_name',
+ field=models.CharField(blank=True, max_length=256),
+ ),
+ migrations.AlterField(
+ model_name='userprofile',
+ name='avatar',
+ field=models.URLField(blank=True, max_length=150, null=True, verbose_name='Photo Image'),
+ ),
+ ]
diff --git a/events/templates/events/team_list.html b/events/templates/events/team_list.html
index d70b9a6..8a1a995 100644
--- a/events/templates/events/team_list.html
+++ b/events/templates/events/team_list.html
@@ -7,7 +7,7 @@
{{ team.country.name|default:'' }} |
{{ team.spr.name|default:'' }} |
{{ team.city.name|default:'' }} |
- {{ team.owner_profile }} |
+ {{ team.owner_profile }} |
{{ team.created_time }} |
{% endfor %}
diff --git a/get_together/templates/get_together/events/show_event.html b/get_together/templates/get_together/events/show_event.html
index dbf0599..68fdcb7 100644
--- a/get_together/templates/get_together/events/show_event.html
+++ b/get_together/templates/get_together/events/show_event.html
@@ -75,7 +75,9 @@
{% for badge in attendee.user.user.account.badges.all %}{% endfor %}
-
{{attendee.user}} {{ attendee.status_name }}
+
{% if attendee.role > 0 %}
{{ attendee.role_name }}{% endif %}
diff --git a/get_together/templates/get_together/teams/show_team.html b/get_together/templates/get_together/teams/show_team.html
index 456881d..9897f02 100644
--- a/get_together/templates/get_together/teams/show_team.html
+++ b/get_together/templates/get_together/teams/show_team.html
@@ -61,7 +61,7 @@
{% for badge in member.user.user.account.badges.all %}{% endfor %}
-
{{member.user}}
+
{% if member.role > 0 %}
{{ member.role_name }}{% endif %}
diff --git a/get_together/templates/get_together/users/show_profile.html b/get_together/templates/get_together/users/show_profile.html
new file mode 100644
index 0000000..20d79e6
--- /dev/null
+++ b/get_together/templates/get_together/users/show_profile.html
@@ -0,0 +1,32 @@
+{% extends "get_together/base.html" %}
+
+{% block content %}
+
+{% if user %}
+
+Profile: {{user.user}}
+
+Realname: {{user.realname}}
+
+{% if user.weburl %}
+Homepage: {{user.weburl}}
+{% endif %}
+
+{% if teams %}
+ Teams
+
+ {% for t in teams %}
+ -
+ {{t.name}}
+
+ {% endfor %}
+
+{% endif %}
+
+{% else %}
+
+User not found.
+
+{% endif %}
+
+{% endblock %}
diff --git a/get_together/urls.py b/get_together/urls.py
index 198f633..92dc359 100644
--- a/get_together/urls.py
+++ b/get_together/urls.py
@@ -36,6 +36,7 @@ urlpatterns = [
path('api/find_city/', event_views.find_city),
path('profile/+edit', views.edit_profile, name='edit-profile'),
+ path('profile//', views.show_profile, name='show-profile'),
path('events/', views.events_list, name='events'),
path('+create-team/', views.create_team, name='create-team'),
diff --git a/get_together/views/user.py b/get_together/views/user.py
index 088b035..1f0a47e 100644
--- a/get_together/views/user.py
+++ b/get_together/views/user.py
@@ -4,6 +4,7 @@ from django.contrib import messages
from django.contrib.auth import logout as logout_user
from django.shortcuts import render, redirect
from django.http import HttpResponse, JsonResponse
+from django.core.exceptions import ObjectDoesNotExist
from events.models.profiles import Team, UserProfile, Member
from events.forms import UserForm, UserProfileForm
@@ -27,6 +28,26 @@ def login(request):
return redirect('home')
return render(request, 'get_together/users/login.html')
+
+def show_profile(request, user_id):
+
+ template = 'get_together/users/show_profile.html'
+
+ try:
+ user = UserProfile.objects.get(id=user_id)
+ except ObjectDoesNotExist:
+ return render(request, template, {'user': None}, status=404)
+
+ teams = user.memberships.all()
+
+ context = {
+ 'user': user,
+ 'teams': teams,
+ }
+
+ return render(request, template, context)
+
+
def edit_profile(request):
if not request.user.is_authenticated:
messages.add_message(request, messages.WARNING, message=_('You must be logged in to edit your profile.'))