-
Notifications
You must be signed in to change notification settings - Fork 49
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
Eventyay Common: Create an event dashboard #484
Open
HungNgien
wants to merge
9
commits into
fossasia:development
Choose a base branch
from
HungNgien:eventyay_c_dashboard
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ff423d7
Add dashboard eventyay common
HungNgien e1f4cce
Add custom css
HungNgien d37e202
Change background
HungNgien e20f937
Add component link for eventyay_common
HungNgien b014783
Update css style
HungNgien 958bc55
Fix isort
HungNgien a7ebdf0
Add custom style
HungNgien 7cb4273
Add alert pop up, add line break
HungNgien a9ed0f7
Resolve conversation: update template url
HungNgien File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/pretix/control/templates/pretixcontrol/event/component_link.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
from django.http import HttpRequest | ||
from django.urls import reverse | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from pretix.control.navigation import merge_in | ||
from pretix.control.signals import nav_event, nav_global | ||
|
||
|
||
def get_global_navigation(request): | ||
url = request.resolver_match | ||
if not url: | ||
return [] | ||
request.user.has_active_staff_session(request.session.session_key) | ||
nav = [ | ||
{ | ||
'label': _('Dashboard'), | ||
'url': reverse('eventyay_common:dashboard'), | ||
'active': (url.url_name == 'dashboard'), | ||
'icon': 'dashboard', | ||
}, | ||
{ | ||
'label': _('My Events'), | ||
'url': reverse('eventyay_common:events'), | ||
'active': 'events' in url.url_name, | ||
'icon': 'calendar', | ||
}, | ||
{ | ||
'label': _('Organizers'), | ||
'url': reverse('eventyay_common:organizers'), | ||
'active': 'organizers' in url.url_name, | ||
'icon': 'group', | ||
}, | ||
{ | ||
'label': _('Account'), | ||
'url': reverse('eventyay_common:account'), | ||
'active': 'account' in url.url_name, | ||
'icon': 'user', | ||
} | ||
|
||
] | ||
|
||
merge_in(nav, sorted( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this code tested? It looks weird because:
|
||
sum((list(a[1]) for a in nav_global.send(request, request=request)), []), | ||
key=lambda r: (1 if r.get('parent') else 0, r['label']) | ||
)) | ||
return nav | ||
|
||
|
||
def get_event_navigation(request: HttpRequest): | ||
url = request.resolver_match | ||
if not url: | ||
return [] | ||
request.user.has_active_staff_session(request.session.session_key) | ||
nav = [ | ||
{ | ||
'label': _('Dashboard'), | ||
'url': reverse('eventyay_common:event.index', kwargs={ | ||
'event': request.event.slug, | ||
'organizer': request.event.organizer.slug, | ||
}), | ||
'active': (url.url_name == 'event.index'), | ||
'icon': 'dashboard', | ||
}, | ||
{ | ||
'label': _('Settings'), | ||
'url': reverse('eventyay_common:event.update', kwargs={ | ||
'event': request.event.slug, | ||
'organizer': request.event.organizer.slug, | ||
}), | ||
'active': (url.url_name == 'event.update'), | ||
'icon': 'wrench', | ||
} | ||
] | ||
|
||
merge_in(nav, sorted( | ||
sum((list(a[1]) for a in nav_event.send(request.event, request=request)), []), | ||
key=lambda r: (1 if r.get('parent') else 0, r['label']) | ||
)) | ||
|
||
return nav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/pretix/eventyay_common/templates/eventyay_common/event/component_link.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% load i18n %} | ||
<div class="navigation-button"> | ||
{% if request.organizer and request.event %} | ||
<a href="#" class="header-nav btn btn-outline-success active"> | ||
<i class="fa fa-home"></i> {% trans "Home" %} | ||
</a> | ||
<a href='{% url "control:event.index" organizer=request.organizer.slug event=request.event.slug %}' class="header-nav btn btn-outline-success"> | ||
<i class="fa fa-ticket"></i> {% trans "Tickets" %} | ||
</a> | ||
{% if is_talk_event_created %} | ||
<a href="{{ talk_edit_url }}" class="header-nav btn btn-outline-success"> | ||
<i class="fa fa-group"></i> {% trans "Talk" %} | ||
</a> | ||
{% endif %} | ||
{% if is_video_enabled %} | ||
<a class="header-nav btn btn-outline-success" | ||
href='{% url "eventyay_common:event.create_access_to_video" organizer=request.organizer.slug event=request.event.slug %}' | ||
title="{% trans 'Access videos related to this event' %}"> | ||
<i class="fa fa-video-camera"></i> {% trans "Videos" %} | ||
</a> | ||
{% endif %} | ||
{% endif %} | ||
</div> |
92 changes: 92 additions & 0 deletions
92
src/pretix/eventyay_common/templates/eventyay_common/event/fragment_dashboard.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{% load i18n %} | ||
<div class="dashboard custom"> | ||
<div class="panel panel-default items widget-container widget-full no-padding"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title"> | ||
{% trans "Your Dashboard" %} | ||
</h3> | ||
</div> | ||
<div class="panel-body"> | ||
<p> | ||
{% trans "Your event dashboard offers an overview of three seamlessly integrated components, each customizable to meet your needs: Tickets for sales and registration management, Talks and Speakers for organizing content and creating schedules, and Video for hosting engaging and interactive virtual events with live interpretation." %} | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div class="panel panel-default widget-container widget-small no-padding column"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title"> | ||
{% trans "Tickets" %} | ||
</h3> | ||
</div> | ||
<div class="panel-body"> | ||
<p> | ||
{% trans "Set up and configure ticketing for your event and sell add-ons such as premium access or Swag Manage attendees and exhibitors, design custom badges, and streamline your event marketing by sending targeted emails." %} | ||
</p> | ||
<p> | ||
{% trans "Go to" %} <a href="{% url 'control:event.index' organizer=request.organizer.slug event=request.event.slug %}">{% trans "Tickets Dashboard" %}</a> | ||
</p> | ||
</div> | ||
</div> | ||
<div class="panel panel-default widget-container widget-small no-padding column"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title"> | ||
{% trans "Talks and Speakers" %} | ||
</h3> | ||
</div> | ||
<div class="panel-body"> | ||
<p> | ||
{% trans "Setup and configure content for your event, create calls for proposals and speakers and build a schedule. Manage the submission and review process, and select speakers." %} | ||
</p> | ||
{% if is_talk_event_created %} | ||
<p> | ||
{% trans "Go to" %} <a href="{{ talk_edit_url }}">{% trans "Talks Dashboard" %}</a> | ||
</p> | ||
{% else %} | ||
<p> | ||
{% trans "Go to" %} <a href="#" data-toggle="modal" data-target="#alert-modal">{% trans "Talks Dashboard" %}</a> | ||
</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
<div class="panel panel-default widget-container widget-small no-padding last-column"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title"> | ||
{% trans "Video" %} | ||
</h3> | ||
</div> | ||
<div class="panel-body"> | ||
<p> | ||
{% trans "Setup and configure live video streams, online workshops with live-audio interpretation and chats. Offer virtual exhibitor booths with rich content and social media integration." %} | ||
</p> | ||
{% if is_video_enabled %} | ||
<p> | ||
{% trans "Go to" %} <a href="{% url 'eventyay_common:event.create_access_to_video' organizer=request.organizer.slug event=request.event.slug %}">{% trans "Video Configuration" %}</a> | ||
</p> | ||
{% else %} | ||
<p> | ||
{% trans "Go to" %} <a href="#" data-toggle="modal" data-target="#alert-modal">{% trans "Video Configuration" %}</a> | ||
</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
<div class="modal fade" id="alert-modal" tabindex="-1" role="dialog"> | ||
<div class="modal-dialog modal-dialog-centered" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header bg-danger"> | ||
<h3 class="modal-title text-center text-danger">{% trans "Alert" %}</h3> | ||
</div> | ||
<div class="modal-body"> | ||
<div class="text-center"> | ||
<p> | ||
You need to enable this component first. | ||
</p> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-dismiss="modal">{% trans "Close" %}</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you explain why you access the session this way, whereas the
request
is already available.Note that, the documentation says that this way is for the code outside a view, like in Django commands, in background job, in unittest, etc...
But this code has
request
, meaning it is inside a view.