Skip to content

Commit

Permalink
Merge pull request #445 from akatsoulas/expose-event-date
Browse files Browse the repository at this point in the history
Expose event date in listing
  • Loading branch information
akatsoulas authored Feb 14, 2024
2 parents 1ad088c + e0210c2 commit 676ee81
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 68 deletions.
34 changes: 21 additions & 13 deletions moderator/moderate/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
@font-face {
font-family: "Open Sans";
src: url("/static/fonts/OpenSans-Regular.eot");
src: url("/static/fonts/OpenSans-Regular.eot?#iefix")
format("embedded-opentype"),
src: url("/static/fonts/OpenSans-Regular.eot?#iefix") format("embedded-opentype"),
url("/static/fonts/OpenSans-Regular.woff") format("woff"),
url("/static/fonts/OpenSans-Regular.ttf") format("truetype"),
url("/static/fonts/OpenSans-Regular.svg#open_sans") format("svg");
Expand All @@ -15,8 +14,7 @@
@font-face {
font-family: "Open Sans";
src: url("/static/fonts/OpenSans-Bold.eot");
src: url("/static/fonts/OpenSans-Bold.eot?#iefix")
format("embedded-opentype"),
src: url("/static/fonts/OpenSans-Bold.eot?#iefix") format("embedded-opentype"),
url("/static/fonts/OpenSans-Bold.woff") format("woff"),
url("/static/fonts/OpenSans-Bold.ttf") format("truetype"),
url("/static/fonts/OpenSans-Bold.svg#open_sansbold") format("svg");
Expand All @@ -27,21 +25,18 @@
@font-face {
font-family: "Open Sans";
src: url("/static/fonts/OpenSans-BoldItalic.eot");
src: url("/static/fonts/OpenSans-BoldItalic.eot?#iefix")
format("embedded-opentype"),
src: url("/static/fonts/OpenSans-BoldItalic.eot?#iefix") format("embedded-opentype"),
url("/static/fonts/OpenSans-BoldItalic.woff") format("woff"),
url("/static/fonts/OpenSans-BoldItalic.ttf") format("truetype"),
url("/static/fonts/OpenSans-BoldItalic.svg#open_sansbold_italic")
format("svg");
url("/static/fonts/OpenSans-BoldItalic.svg#open_sansbold_italic") format("svg");
font-weight: bold;
font-style: italic;
}

@font-face {
font-family: "Open Sans";
src: url("/static/fonts/OpenSans-Italic.eot");
src: url("/static/fonts/OpenSans-Italic.eot?#iefix")
format("embedded-opentype"),
src: url("/static/fonts/OpenSans-Italic.eot?#iefix") format("embedded-opentype"),
url("/static/fonts/OpenSans-Italic.woff") format("woff"),
url("/static/fonts/OpenSans-Italic.ttf") format("truetype"),
url("/static/fonts/OpenSans-Italic.svg#open_sansitalic") format("svg");
Expand Down Expand Up @@ -154,10 +149,20 @@ ul.errorlist {
.questions-counter {
float: right;
color: #999;
margin-top: -10px;
margin-top: -35px;
text-align: right;
}

.askedby {

.event-date {
float: right;
color: #999;
margin-top: -35px;
text-align: right;
padding-right: 35px;
}

*/ .askedby {
display: inline-block;
width: 10%;
vertical-align: top;
Expand Down Expand Up @@ -302,6 +307,7 @@ ul.errorlist {
padding: 5px 10px;
font-size: 12px;
}

@media only screen and (max-width: 1200px) {
.reply-button {
margin-top: 5px;
Expand Down Expand Up @@ -408,6 +414,7 @@ ul.errorlist {
.ribbon:before {
left: 0;
}

.ribbon::after {
right: 0;
}
Expand Down Expand Up @@ -483,6 +490,7 @@ ul.errorlist {
}

@media only screen and (max-width: 768px) {

.site-footer,
#wrapper:after {
height: 490px;
Expand Down Expand Up @@ -526,4 +534,4 @@ ul.errorlist {
text-align: center;
width: 100%;
}
}
}
109 changes: 54 additions & 55 deletions moderator/moderate/templates/index.jinja
Original file line number Diff line number Diff line change
@@ -1,71 +1,70 @@
{% extends "base.jinja" %}

{% block head %}
<title>Mozilla Moderator - Events</title>
<title>Mozilla Moderator - Events</title>
{% endblock %}

{% block content %}

{% if user.is_authenticated %}
<h3 class="text-center">Select event to view and ask questions.</h3>
<h3 class="text-center">Select event to view and ask questions.</h3>

{% for event in events.order_by('-created_at') %}
{% set display_moderation = False %}
{% set has_pending_questions = False %}
{% if event.is_moderated and request.user in event.moderators.all() %}
{% set display_moderation = True %}
{% endif %}
{% if event.questions.filter(is_accepted__isnull=True).exists() %}
{% set has_pending_questions = True %}
{% endif %}
<div class="panel panel-default">
<div class="panel-body">
<div class="event-listing">
<a href="{{ url('event', e_slug=event.slug) }}">
<h1>{{ event.name }}</h1>
{% if display_moderation %}
<span class="questions-counter">
{{ event.approved_count }} approved,
{{ event.rejected_count }} rejected,
{{ event.pending_count }} pending</span>
{% else %}
<span class="questions-counter"> {{ event.questions.filter(is_accepted=True).count() }} questions asked</span>
{% endif %}
</a>
<p>{{ event.body|to_markdown }}</p>
</div>
</div>
{% if event.created_by == request.user or request.user in event.moderators.all() %}
<div>
<div class="edit-container">
<a href="{{ url('edit_event', slug=event.slug) }}"
class="btn btn-primary btn-sm">edit</a>
{% if display_moderation and has_pending_questions %}
<a href="{{ url('moderate_event', slug=event.slug) }}"
class="btn btn-primary btn-sm">moderate</a>
{% endif %}
</div>
{% if event.created_by == request.user %}
<div class="delete-container">
<a href="{{ url('delete_event', slug=event.slug) }}"
class="btn btn-danger btn-sm">delete</a>
</div>
{% for event in events.order_by('-created_at') %}
{% set display_moderation = False %}
{% set has_pending_questions = False %}
{% if event.is_moderated and request.user in event.moderators.all() %}
{% set display_moderation = True %}
{% endif %}
{% if event.questions.filter(is_accepted__isnull=True).exists() %}
{% set has_pending_questions = True %}
{% endif %}
<div class="panel panel-default">
<div class="panel-body">
<div class="event-listing">
<a href="{{ url('event', e_slug=event.slug) }}">
<h1>{{ event.name }}</h1>
<span class="questions-counter">
{{ event.questions.filter(is_accepted=True).count() }} questions asked<br>
{% if display_moderation %}
{{ event.approved_count }} approved,
{{ event.rejected_count }} rejected,
{{ event.pending_count }} pending
{% endif %}
</div>
</span>
</a>
<p>{{ event.body|to_markdown }}</p>
</div>
</div>
{% if event.created_by == request.user or request.user in event.moderators.all() %}
<div>
<div class="edit-container">
<a href="{{ url('edit_event', slug=event.slug) }}" class="btn btn-primary btn-sm">edit</a>
{% if display_moderation and has_pending_questions %}
<a href="{{ url('moderate_event', slug=event.slug) }}" class="btn btn-primary btn-sm">moderate</a>
{% endif %}
</div>
{% endfor %}
{% if event.created_by == request.user %}
<div class="delete-container">
<a href="{{ url('delete_event', slug=event.slug) }}" class="btn btn-danger btn-sm">delete</a>
</div>
{% endif %}
</div>
{% endif %}
<div class="event-date">
{{ event.event_date|date('F j, Y') }}
</div>
</div>
{% endfor %}

{% else %}
<h3 class="text-center">Let your voice be heard.</h3>
<p class="text-center">
Mozilla Moderator is a panel moderation system for submitting and voting
on questions.
</p>
<p class="text-center">
<a class="login btn btn-primary"
href="{{ url('oidc_authentication_init') }}">Login</a>
</p>
<h3 class="text-center">Let your voice be heard.</h3>
<p class="text-center">
Mozilla Moderator is a panel moderation system for submitting and voting
on questions.
</p>
<p class="text-center">
<a class="login btn btn-primary" href="{{ url('oidc_authentication_init') }}">Login</a>
</p>
{% endif %}

{% endblock %}
{% endblock %}

0 comments on commit 676ee81

Please sign in to comment.