Package: pretix-landing-pages
Everything you need to knowThis plugin allows you to upload custom pages using theDjango template language(and extra files like stylesheets etc.) for the Pretix starting page or individual organizer pages.Getting started in PretixPretix UserguideTable of contents1. Usage1.1. Roles and Rights1.2. Starting Page1.3. Landing Page for Organizers1.4. Additional Files1.5. Event List for Organizer1.6. Calendar for Organizer2. Administration2.1. Installation2.2. Plugin Activation3. Development Setup4. Terminology5. License1. Usage1.1. Roles and RightsPretix offers different roles with different corresponding rights, the relevant roles for this plugin are listed below.UserThe basic role for logged in accounts. Cannot change any settings.OrganizerCan change organisation specific settings like Landingpage-Settings or Team Assignment Rules.Admin with enabled Admin modeCan change global settings for the pretix instance like the startingpage settings or he can enable the landingpage plugin for a certain organisation. To access these functionalities you have to be in Admin mode, which is only accessable for admins.How to enable the admin mode :1.2. Starting PageThe following options are available for the starting page:Upload and set up a custom starting page (namedindex.html)Upload and use additional files in theindex.htmlSet up a redirect to another websiteYou need to belogged in as an adminand have theadmin modeactivated.To configure the starting page go to the corresponding settings page in theglobal settingsdropdown menu.You will land on the following page, where you can then configure said things.For the HTML you can use the load_path tag to embedadditional filesNote:
It is not possible to activate the custom starting page and a redirect at the same time.1.3. Landing Page for OrganizersTo upload an organizer specific landingpage, go to your organizer's control page.Then select the navigation itemLandingpage.You can now upload yourindex.htmland additional files. To make your custom landingpage visible select theUse custom landing pagebutton.You will land on the following page.Example for a landingpage:{% load load_path %}

<html>
<head>  

<link rel="stylesheet" type="text/css" href={% load_path "style.css" %}>

</head>
{% block page %}

    {% include 'pretixplugins/pretix_landing_pages/calendar.html' %}

{% endblock %}

{% include "pretixplugins/pretix_landing_pages/event_list.html" with events=upcoming_events %}

<body> 

<img src={% load_path "image.png" %}>    

</body>

</html>1.4. Additional FilesYou can use thetemplate tagload_pathto get the path of any of your additional uploaded files (exceptindex.html).
Remember to put{% load load_path %}at the start of your HTML to load the template tag. This template tag loads the path to user uploaded files, so you only have to know the filename.
If the path loading failes, e.g. because of a missing file, the file will not be available for the website it should be embedded in, but everything else will work fine.Example for usage of load path:{% load load_path %}

<html>

<body> 

<img src={% load_path "image.png" %}>    

</body>

</html>Note: You can only reference uploads of your current organizer or the starting page respectively.1.5. Event List for OrganizerTo include upcoming events as a table in your custom landing page, simply add{% include "pretixplugins/pretix_landing_pages/event_list.html" with events=upcoming_events %}at the desired place.Alternatively, you can putprevious_eventsinstead ofupcoming_eventsto display events that have already finished.<html>

    Your Html Code

{% include "pretixplugins/pretix_landing_pages/event_list.html" with events=upcoming_events %}


</html>Note: If you are not using the default Pretix style, you might want to add table-styling.1.6. Calendar for OrganizerTo include a calendar that includes your events as objects, simply add{% include "pretixplugins/pretix_landing_pages/calendar.html" %}at the desired place.
We recommend that if you want to use this, make yourhtmlextend the pretix-default template,
as styling is not straight forward:{% extends "pretixpresale/base.html" %}

{% block thetitle %} 
    Some fancy page title 
{% endblock %}

{% block page %}
    {% include 'pretixplugins/pretix_landing_pages/calendar.html' %}
{% endblock %}2. Administration2.1. InstallationPlease reference the corresponding Pretix documentation forsmall-scale manual deploymentorsmall-scale deployment with docker.There is an example Dockerfile provided in this project's repository.2.2. Plugin ActivationThis plugin is enabled by default.
Admins can, however, enable this plugin individually for each organizer.
To do soEnable theadmin modeand go to theglobal settings.Select the organizers you want to allow to use the plugin.There is also an option to enable the plugin for all organizers. (default)If an organizer is not selected he is not allowed to use the plugins functionalities.Note: Only enable this plugin for organizers you trust!
Uploading custom pages can result in serious security issues as organizers can put anything they want on their page.3. Development SetupPretixneeds to be installed.Clone this repository to any directory on your system.activate your local pretix environment.cd into pretix-landing-pagesrunpython setup.py developto package the plugincd into your pretix source code (pretix/src)runpython manage.py makemigrations pretix_landing_pagesto create the migrationsrunpython -m pretix migrateto migrate DB-model changes into pretix-DBOnce the setup is done, there is no need for actions after changes to the plugin, unless you make changes to the DB model=> In this case, you need to rerun step 6. (to 8)4. TerminologyLandingpageSite used by the organizer to represent an organizationStartingpageThe root page of a pretix instance (can only be changed by the admin in admin mode)Here are some otherPretix-Terminology5. LicenseCopyright 2019 - 2020, Benjamin Hättasch and TU Darmstadt Bachelorpraktikum 2019/2020 Group 45Released under the terms of the Apache License 2.0