diff --git a/get_together/static/css/get_together.css b/get_together/static/css/get_together.css index 43f64bb..b7e3a5e 100644 --- a/get_together/static/css/get_together.css +++ b/get_together/static/css/get_together.css @@ -110,4 +110,35 @@ ul.errorlist li { font-size: 2em; font-weight: bold; text-shadow: 2px 2px #444; -} \ No newline at end of file +} + +.btn-default { + color: #fff; + background-color: #848484; + border-color: #757575; +} + +.btn-default:hover { + color: #292b2c; + background-color: #e6e6e6; + border-color: #adadad; +} + +.btn-default:focus, .btn-default.focus { + -webkit-box-shadow: 0 0 0 2px rgba(204, 204, 204, 0.5); + box-shadow: 0 0 0 2px rgba(204, 204, 204, 0.5); +} + +.btn-default.disabled, .btn-default:disabled { + color: #e6e6e6; + background-color: #b3b3b3; + border-color: #adadad; +} + +.btn-secondary:active, .btn-secondary.active, +.show > .btn-secondary.dropdown-toggle { + color: #292b2c; + background-color: #e6e6e6; + background-image: none; + border-color: #adadad; +} diff --git a/get_together/templates/get_together/teams/about_team.html b/get_together/templates/get_together/teams/about_team.html index 79645a9..666962b 100644 --- a/get_together/templates/get_together/teams/about_team.html +++ b/get_together/templates/get_together/teams/about_team.html @@ -1,91 +1,12 @@ -{% extends "get_together/base.html" %} +{% extends "get_together/teams/team_page_base.html" %} {% load static markup tz %} -{% block add_to_title %} | {{team.name}}{% endblock %} +{% block about-button %}btn-default{% endblock %} -{% block styles %} - -{% endblock %} - -{% block content %} -
-
-
- {% if team.banner_img %} -
- {{team.name}}'s cover image -

Welcome to {{ team.name }}

-
- {% else %} -

About {{ team.name }}

- {% endif %} - - {% if can_edit_team %} - Edit Team - Manage Members - {% endif %} - {% if is_member %} - {% if not team.owner_profile == request.user.profile %}Leave Team{% endif %} - {% else %} - Join Team - {% endif %} -
- - - {% if team.description %} - - - - {% endif %} - {% if team.organization %} - - - - {% endif %} - {% if team.web_url %} - - - - {% endif %} - - - -

{{ team.description|markdown }}

Organization:{{ team.organization.name }}
Website:{{ team.web_url }}
Events:Return to Events
-
+{% block page_content %}
{{ team.about_page|markdown }}

-
- -
-
-

Members


- {% for member in member_list %} -
-
- - {% for badge in member.user.user.account.badges.all %}{% endfor %} -
-
{{member.user}}
- {% if member.role > 0 %}{{ member.role_name }}{% endif %} -
-
-
- {% endfor %} -
-
-
-
{% endblock %} diff --git a/get_together/templates/get_together/teams/show_team.html b/get_together/templates/get_together/teams/show_team.html index e61c2cc..f0eed4b 100644 --- a/get_together/templates/get_together/teams/show_team.html +++ b/get_together/templates/get_together/teams/show_team.html @@ -1,47 +1,9 @@ -{% extends "get_together/base.html" %} +{% extends "get_together/teams/team_page_base.html" %} {% load static markup tz %} -{% block add_to_title %} | {{team.name}}{% endblock %} +{% block summary-button %}btn-default{% endblock %} -{% block styles %} - -{% endblock %} - -{% block content %} -
-
-
- {% if team.banner_img %} -
- {{team.name}}'s cover image -

Welcome to {{ team.name }}

-
- {% else %} -

Welcome to {{ team.name }}

- {% endif %} - - {% if can_edit_team %} - Edit Team - Manage Members - {% endif %} - {% if is_member %} - {% if not team.owner_profile == request.user.profile %}Leave Team{% endif %} - {% else %} - Join Team - {% endif %} -
- -
+{% block page_content %} {% if team.description %}

{{ team.description|markdown }}

@@ -57,12 +19,7 @@
Website:
{% endif %} - {% if team.about_page %} - - {% endif %} -
+

Upcoming Events @@ -79,7 +36,7 @@ {% if can_create_event %} {% endif %} @@ -99,26 +56,5 @@


{% endif %} -
- -
-
-

Members


- {% for member in member_list %} -
-
- - {% for badge in member.user.user.account.badges.all %}{% endfor %} -
-
{{member.user}}
- {% if member.role > 0 %}{{ member.role_name }}{% endif %} -
-
-
- {% endfor %} -
-
-
- {% endblock %} diff --git a/get_together/templates/get_together/teams/team_events.html b/get_together/templates/get_together/teams/team_events.html new file mode 100644 index 0000000..e341cc1 --- /dev/null +++ b/get_together/templates/get_together/teams/team_events.html @@ -0,0 +1,42 @@ +{% extends "get_together/teams/team_page_base.html" %} +{% load static markup tz %} + +{% block events-button %}btn-default{% endblock %} + + +{% block page_content %} + {% if can_create_event %} +
+
+ Host a Get Together +
+
+ {% endif %} +

Upcoming Events + +

+
+ {% for event in upcoming_events %} +
+
{% if event.status == event.CANCELED %}{% endif %}{{event.name}}{% if event.status == event.CANCELED %} (Canceled){% endif %}
+
{{ event.place }}
+
{{ event.local_start_time }}
+
+ {% endfor %} +
+
+ + {% if recent_events %} +

Past Events

+
+ {% for event in recent_events %} +
+ +
{{ event.place }}
+
{{ event.local_start_time }}
+
+ {% endfor %} +
+
+ {% endif %} +{% endblock %} \ No newline at end of file diff --git a/get_together/templates/get_together/teams/team_page_base.html b/get_together/templates/get_together/teams/team_page_base.html new file mode 100644 index 0000000..56e95f3 --- /dev/null +++ b/get_together/templates/get_together/teams/team_page_base.html @@ -0,0 +1,80 @@ +{% extends "get_together/base.html" %} +{% load static markup tz %} + +{% block add_to_title %} | {{team.name}}{% endblock %} + +{% block styles %} + +{% endblock %} + +{% block content %} +
+
+
+ {% if can_edit_team %} + + {% endif %} + {% if team.banner_img %} +
+ {{team.name}}'s cover image +

Welcome to {{ team.name }}

+
+ {% else %} +

Welcome to {{ team.name }}

+ {% endif %} + + +
+
+ Summary + Events + {% if team.about_page %} + About + {% endif %} +
+ {% if is_member %} + {% if not team.owner_profile == request.user.profile %}Leave Team{% endif %} + {% else %} + Join Team + {% endif %} +
+ +
+ {% block page_content %}{% endblock %} +
+
+ +
+
+

Members


+ {% for member in member_list %} +
+
+ + {% for badge in member.user.user.account.badges.all %}{% endfor %} +
+
{{member.user}}
+ {% if member.role > 0 %}{{ member.role_name }}{% endif %} +
+
+
+ {% endfor %} +
+
+
+
+{% endblock %} + diff --git a/get_together/urls.py b/get_together/urls.py index a6a26a0..4e87651 100644 --- a/get_together/urls.py +++ b/get_together/urls.py @@ -116,6 +116,7 @@ urlpatterns = [ path('/', views.show_team_by_slug, name='show-team-by-slug'), path('/about/', views.show_team_about_by_slug, name='show-team-about-by-slug'), + path('/events/', views.show_team_events_by_slug, name='show-team-events-by-slug'), ] if settings.DEBUG: urlpatterns = urlpatterns + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/get_together/views/teams.py b/get_together/views/teams.py index 2d080a8..9ebb415 100644 --- a/get_together/views/teams.py +++ b/get_together/views/teams.py @@ -67,6 +67,22 @@ def show_team(request, team): } return render(request, 'get_together/teams/show_team.html', context) +def show_team_events_by_slug(request, team_slug): + team = get_object_or_404(Team, slug=team_slug) + upcoming_events = Event.objects.filter(team=team, end_time__gt=datetime.datetime.now()).order_by('start_time') + recent_events = Event.objects.filter(team=team, end_time__lte=datetime.datetime.now()).order_by('-start_time') + context = { + 'team': team, + 'upcoming_events': upcoming_events, + 'recent_events': recent_events, + 'is_member': request.user.profile in team.members.all(), + 'member_list': Member.objects.filter(team=team).order_by('-role', 'joined_date'), + 'can_create_event': request.user.profile.can_create_event(team), + 'can_edit_team': request.user.profile.can_edit_team(team), + } + return render(request, 'get_together/teams/team_events.html', context) + + def show_team_about_by_slug(request, team_slug): team = get_object_or_404(Team, slug=team_slug) if team.about_page: