Giter Club home page Giter Club logo

dostogircse171 / django_events_timetable Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 111 KB

An easy-to-use and adaptable Events/Agenda Timetable app for Django, requiring no additional dependencies. Designed to integrate smoothly into any Django project including Wagtail CMS and Django CMS, it can be effortlessly embedded on any webpage. With its straightforward design, this app package is perfect for displaying events timetable easily.

Home Page: https://eventdemoapp-ceaa9c531c9c.herokuapp.com/

License: MIT License

Python 54.44% CSS 23.08% HTML 18.23% JavaScript 4.25%
agenda django django-application django-components django-project python scheduler css django-app html

django_events_timetable's Introduction

Django Events Timetable (App Component)

PyPi version

Django Events Timetable is an app component offering easy integration with Django, Django CMS, and Wagtail CMS. It features a user-friendly interface for managing event items, customizable and responsive templates with Dark and Light themes, and a color picker for design personalization. Designed to complement any project seamlessly, it is also extendable and customizable to meet specific needs.

Logo Event Demo PyPi Project

Seamlessly integrate with both Django CMS and Wagtail to supercharge your content management experience.

Logo

Authors

Key Features

  • Seamless Integration: Effortlessly integrates with Django, Django CMS, and Wagtail CMS, ensuring a smooth workflow.
  • Django CMS Compatibility: Comes with a Placeholder Plugin specifically designed for Django CMS, enhancing content management capabilities.
  • Efficient Management: Simplifies the management of event items through the Django admin panel, Wagtail CMS, or Django CMS, offering a user-friendly interface.
  • Organized Content: Enables the grouping of event items, allowing for structured and organized display across different events or pages.
  • Customizable Templates: Includes customizable display templates with two default themes: Dark and Light, catering to different aesthetic preferences.
  • Design Personalization: Features an easy-to-use color picker, allowing for personalized design touches to match your project's theme.
  • Responsive Design: Boasts a responsive and clean design that adapts to various devices and screen sizes, ensuring compatibility and user-friendliness without interfering with existing CSS or HTML.
  • Flexibility and Extensibility: Designed to be extendable and customizable, meeting specific project requirements and allowing for future enhancements.

1. Installation

1.1 You can install the django-events-timetable package in several ways:

Using Pypi

  pip install django-events-timetable

Using Poetry

  poetry add django-events-timetable

Downloading/Cloning the Repository
If you prefer, you can also download or clone the app repository directly to your Django project directory. Use the following git command to clone the repository:

  git clone https://github.com/dostogircse171/django_events_timetable.git

1.2 Add django_events_timetable to Installed Apps Add the app to your INSTALLED_APPS in your Django project's settings.py or appropriate project settings file:

   INSTALLED_APPS = [
       # Other installed apps
       'django_events_timetable',
       'wagtail.contrib.modeladmin', # Add this only if you are installing it for Wagtail CMS if not already there.
   ]

Note: wagtail.contrib.modeladmin this is important to add under INSTALLED_APPS if you are using the app on Wagtail CMS otherwise skip.

1.3 Run Migrations

Create and apply migrations specifically for the django_events_timetable app:

   python manage.py makemigrations django_events_timetable
   python manage.py migrate django_events_timetable

1.4 Include CSS for Default Design

Add the following line to the <head> section of your base template (e.g., base.html) to include the default stylesheet:

   <link rel="stylesheet" href="{% static 'django_events_timetable/css/styles.css' %}">

Note: Make sure your base.html or appropriate file has {% load static %} at the beginning of the file

2. How to use

2.1 After applying migrate you will see 2 table in django admin under EVENTS TIMETABLE app which should look like as below depending on your project setup.

a) Django default project View

djproject

b) Django CMS project View

cms

c) Wagtail CMS project View

wagtail

2.2 Making Events: To display an event and its timetable content you need to create an event first. Consider this event as a Group and under this event group you can add as many event timetables as needed. Once you create an Events it will autogenerate a template tag for example {% display_event "ID" %}

wagtail

2.3 Events TimeTable: After adding an event, you need to add the timetable under that event. For that, you need to add timetable data and select appropriate events.

wagtail

2.3 Displaying the Event: To display the event in your templates, the app provides custom Django template tags for easy integration. For Django CMS the app provides a Plugin Placeholder to drag and drop events into the template.

To display agenda items in your Django templates, first load the dynamic_agenda template tags:

{% load display_events_tag %}

Note: This is not required for Django CMS

2.3.1. To show the most recent event's items: {% display_event %}

2.3.2 To show items from a specific event: {% display_event "Event ID" %} [This auto generates and can be copied from the "Display Tag" field of Events table] [Replace "Event ID" with your specific event ID. You can use this tag multiple times in a single template as needed.]

2.3.3. To limit the number of event items displayed you can limit by passing an additional parameter items_limit like items_limit=1 here Number: 1 is the number of event item you want to display.

Django CMS Plugin Placeholder Preview

plugin_placeholder

License

MIT

Contributing

Contributions & ideas are always welcome! Please create an issue first before contributing so we can confirm if that is necessary or if someone else is already working on it.

django_events_timetable's People

Contributors

amitmodi06 avatar dostogircse171 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

amitmodi06

django_events_timetable's Issues

Add event passed message

Right now events days left are showing as 0 if the event passed. Need to add a condition if the event passed display "Event Passed!"

Adding hover functionality on the event item

To implement the hover functionality for the event items.
The following is the way it should work:

  • On hovering over the event item on the UI, the item description should be displayed as the hover text.

Under display_event tag is_negative need to initialise

There is a UnboundLocalError occurring when no data in the model and calling the tags because the variable is_negative is being referenced before it has been assigned. if neither if nor else conditions where is_negative is set are met, then is_negative will not be defined as it's getting a None value.

Need to initialize is_negative = False before try block.

Test Case:
Try removing all events and items and you will see the error.

Pluralize issue

Currently it is always showing "days" irrespective of the fact it is 1 day or more than 1 days like:

  • Upcoming event on in days
  • Event held on , days ago

So:

  • it should be "day" if n=1
  • It should be "days" if n>1

Update more meaningful name to the TimeTable model field.

The TimeTable model has a field named group as shown below:
group = models.ForeignKey(Event, on_delete=models.CASCADE, related_name='items')

A more meaningful name should be provided to it like item_field or something more understandable.

No way to group agenda

It would be better to have Agenda by group so different page or sections can have different agenda lists based on the group.

Event name uniqueness issue + Display Tag ID

Right now Events model doesn't allow same event name twice as it is marked as unique=True which is actually a good practice but in this case its not appropriate as we may have the same event name multiple times.

Instead of making the name unique, we should use the name and date bind to unique together. As it will be very rare to have same event name in same date.

Also, Right now we are passing Events name as a parameter to fetch the data which should be ID as this will conflict with same name issue.

Implement Feature for User-Controlled Data Display Limit

Right now we don't have any control over how many data will display when call {% show_agenda "Group Name" %} or {% show_agenda %}
It would be better if we can add feature like pass a limit perimeter with group data for example {% show_agenda "Group Name" 5 %} to display 5 latest data if available.

Displaying informative message for the past event

Add an informative message for the past event.
The message should look like:

  • Event held on , days ago

Here:

  • Event Date: Date when the event was scheduled
  • n: Number of days between today and the event date

Updated instructions for loading the tag library

Currently following it the Loading Template Tags instructions in the README file:
{% load display_event %}

It should be:
{% load display_events_tag %}

Also the occurrence of work "Group" is replaced with "Event" as per the new code update.

Adding the end-date to the event items

The following are the tasks to be performed:

  • Add the new field to the TimeTable model that can hold the end date of the event item
  • This new field should not be mandatory
  • If this newly added field is present, then it will be displayed on the UI else no end time for the event will be displayed
  • Changes need to be made in the admin.py file for showing and filtering the newly added field

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.