15-03-2024
This commit is contained in:
@@ -33,10 +33,12 @@ def compute_resource_action_constants():
|
||||
'RESOURCE_MANAGE_WALLET': resource_action.RESOURCE_MANAGE_WALLET,
|
||||
'RESOURCE_MANAGE_PAYMENT': resource_action.RESOURCE_MANAGE_PAYMENT,
|
||||
'RESOURCE_MANAGE_EVENTS': resource_action.RESOURCE_MANAGE_EVENTS,
|
||||
'RESOURCE_MANAGE_VENUES': resource_action.RESOURCE_MANAGE_VENUES,
|
||||
'RESOURCE_MANAGE_CONTACT_US': resource_action.RESOURCE_MANAGE_CONTACT_US,
|
||||
'RESOURCE_MANAGE_CMS': resource_action.RESOURCE_MANAGE_CMS,
|
||||
'RESOURCE_MANAGE_REPORTS': resource_action.RESOURCE_MANAGE_REPORTS,
|
||||
'RESOURCE_MANAGE_SUBSCRIPTIONS': resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS,
|
||||
'RESOURCE_PRINCIPAL_SUBSCRIPTIONS': resource_action.RESOURCE_PRINCIPAL_SUBSCRIPTIONS,
|
||||
'RESOURCE_MANAGE_NOTIFICATIONS': resource_action.RESOURCE_MANAGE_NOTIFICATIONS,
|
||||
'RESOURCE_MANAGE_REFERRALS': resource_action.RESOURCE_MANAGE_REFERRALS,
|
||||
'RESOURCE_MANAGE_FEEDBACK': resource_action.RESOURCE_MANAGE_FEEDBACK,
|
||||
|
||||
@@ -18,10 +18,12 @@ from accounts.resource_action import (
|
||||
RESOURCE_MANAGE_WALLET,
|
||||
RESOURCE_MANAGE_PAYMENT,
|
||||
RESOURCE_MANAGE_EVENTS,
|
||||
RESOURCE_MANAGE_VENUES,
|
||||
RESOURCE_MANAGE_CONTACT_US,
|
||||
RESOURCE_MANAGE_CMS,
|
||||
RESOURCE_MANAGE_REPORTS,
|
||||
RESOURCE_MANAGE_SUBSCRIPTIONS,
|
||||
RESOURCE_PRINCIPAL_SUBSCRIPTIONS,
|
||||
RESOURCE_MANAGE_REFERRALS,
|
||||
RESOURCE_MANAGE_FEEDBACK,
|
||||
)
|
||||
@@ -282,4 +284,28 @@ fixture_data = [
|
||||
"action": [1, 2, 3, 4],
|
||||
},
|
||||
},
|
||||
{
|
||||
"model": "accounts.iamappresource",
|
||||
"pk": 14,
|
||||
"fields": {
|
||||
"name": RESOURCE_MANAGE_VENUES,
|
||||
"label": RESOURCE_MANAGE_VENUES,
|
||||
"slug": RESOURCE_MANAGE_VENUES,
|
||||
"created_on": "2023-09-28T16:17:42.815",
|
||||
"modified_on": "2023-09-28T16:17:42.815",
|
||||
"action": [1, 2, 3, 4],
|
||||
},
|
||||
},
|
||||
{
|
||||
"model": "accounts.iamappresource",
|
||||
"pk": 15,
|
||||
"fields": {
|
||||
"name": RESOURCE_PRINCIPAL_SUBSCRIPTIONS,
|
||||
"label": RESOURCE_PRINCIPAL_SUBSCRIPTIONS,
|
||||
"slug": RESOURCE_PRINCIPAL_SUBSCRIPTIONS,
|
||||
"created_on": "2023-09-28T16:17:42.815",
|
||||
"modified_on": "2023-09-28T16:17:42.815",
|
||||
"action": [1, 2, 3, 4],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
@@ -318,5 +318,39 @@
|
||||
4
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "accounts.iamappresource",
|
||||
"pk": 14,
|
||||
"fields": {
|
||||
"name": "manage_venues",
|
||||
"label": "manage_venues",
|
||||
"slug": "manage_venues",
|
||||
"created_on": "2023-09-28T16:17:42.815",
|
||||
"modified_on": "2023-09-28T16:17:42.815",
|
||||
"action": [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "accounts.iamappresource",
|
||||
"pk": 15,
|
||||
"fields": {
|
||||
"name": "principal_subscription",
|
||||
"label": "principal_subscription",
|
||||
"slug": "principal_subscription",
|
||||
"created_on": "2023-09-28T16:17:42.815",
|
||||
"modified_on": "2023-09-28T16:17:42.815",
|
||||
"action": [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -16,11 +16,13 @@ RESOURCE_MANAGE_CUSTOMER = "manage_customer"
|
||||
RESOURCE_MANAGE_WALLET = "manage_wallet"
|
||||
RESOURCE_MANAGE_PAYMENT = "manage_payment"
|
||||
RESOURCE_MANAGE_EVENTS = "manage_events"
|
||||
RESOURCE_MANAGE_VENUES = "manage_venues"
|
||||
RESOURCE_MANAGE_CONTACT_US = "manage_contact_us"
|
||||
RESOURCE_MANAGE_TICKET = "manage_ticket"
|
||||
RESOURCE_MANAGE_CMS = "manage_cms"
|
||||
RESOURCE_MANAGE_REPORTS = "manage_reports"
|
||||
RESOURCE_MANAGE_SUBSCRIPTIONS = "manage_subscriptions"
|
||||
RESOURCE_PRINCIPAL_SUBSCRIPTIONS = "principal_subscriptions"
|
||||
RESOURCE_MANAGE_FEEDBACK = "manage_feedback"
|
||||
RESOURCE_MANAGE_REFERRALS = "manage_referrals"
|
||||
RESOURCE_MANAGE_NOTIFICATIONS = "manage_notifications"
|
||||
|
||||
@@ -277,7 +277,7 @@ LOGGING = {
|
||||
# jwt configuration
|
||||
# https://django-rest-framework-simplejwt.readthedocs.io/en/latest/settings.html#settings
|
||||
SIMPLE_JWT = {
|
||||
"ACCESS_TOKEN_LIFETIME": datetime.timedelta(days=10),
|
||||
"ACCESS_TOKEN_LIFETIME": datetime.timedelta(minutes=1),
|
||||
"REFRESH_TOKEN_LIFETIME": datetime.timedelta(days=15),
|
||||
"ROTATE_REFRESH_TOKENS": False,
|
||||
"BLACKLIST_AFTER_ROTATION": False,
|
||||
@@ -332,3 +332,7 @@ CRONJOBS = [
|
||||
]
|
||||
|
||||
GOOGLE_MAPS_API_KEY = env.str("GOOGLE_MAPS_API_KEY")
|
||||
PLACES_MAPS_API_KEY = env.str("GOOGLE_MAPS_API_KEY")
|
||||
PLACES_MAP_WIDGET_HEIGHT = 480
|
||||
PLACES_MAP_OPTIONS = '{"center": { "lat": 38.971584, "lng": -95.235072 }, "zoom": 10}'
|
||||
PLACES_MARKER_OPTIONS = '{"draggable": true}'
|
||||
|
||||
@@ -32,6 +32,8 @@ urlpatterns = [
|
||||
path('faq/', views.FaqListView.as_view(), name='faq_list'),
|
||||
path('faq/add/', views.FaqCreateOrUpdateView.as_view(), name='faq_add'),
|
||||
path('faq/edit/<int:pk>/', views.FaqCreateOrUpdateView.as_view(), name='faq_edit'),
|
||||
path('faq/delete/<int:pk>/', views.FAQDeleteView.as_view(), name='faq_delete'),
|
||||
|
||||
path('faq/category/add/', views.FaqCategoryCreateOrUpdateView.as_view(), name='faq_category_add'),
|
||||
path('faq/category/edit/<int:pk>/', views.FaqCategoryCreateOrUpdateView.as_view(), name='faq_category_edit'),
|
||||
|
||||
|
||||
@@ -541,6 +541,28 @@ class FaqCreateOrUpdateView(LoginRequiredMixin, generic.View):
|
||||
return redirect(self.success_url)
|
||||
|
||||
|
||||
class FAQDeleteView(LoginRequiredMixin, generic.View):
|
||||
page_name = resource_action.RESOURCE_MANAGE_CMS
|
||||
resource = resource_action.RESOURCE_MANAGE_CMS
|
||||
action = resource_action.ACTION_DELETE
|
||||
model = Faqs
|
||||
success_url = reverse_lazy("manage_cms:faq_list")
|
||||
success_message = constants.RECORD_DELETED
|
||||
error_message = constants.RECORD_NOT_FOUND
|
||||
|
||||
def get(self, request, pk):
|
||||
try:
|
||||
faq_obj = self.model.objects.get(id=pk)
|
||||
faq_obj.deleted = True
|
||||
faq_obj.active = False
|
||||
faq_obj.save()
|
||||
messages.success(request, self.success_message)
|
||||
except self.model.DoesNotExist:
|
||||
messages.success(request, self.error_message)
|
||||
|
||||
return redirect(self.success_url)
|
||||
|
||||
|
||||
class FaqCategoryCreateOrUpdateView(LoginRequiredMixin, generic.View):
|
||||
# Set the page_name and resource
|
||||
page_name = resource_action.RESOURCE_MANAGE_CMS
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from django import forms
|
||||
from manage_events.models import EventMaster, Event, EventCategory
|
||||
from manage_events.models import EventMaster, Event, EventCategory, Venue
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
|
||||
class EventCategoryForm(forms.ModelForm):
|
||||
@@ -18,7 +20,7 @@ class EventForm(forms.ModelForm):
|
||||
model = Event
|
||||
fields = [
|
||||
"title",
|
||||
"event_master",
|
||||
# "event_master",
|
||||
"description",
|
||||
"image",
|
||||
"status",
|
||||
@@ -62,13 +64,57 @@ class EventForm(forms.ModelForm):
|
||||
"image": forms.FileInput(attrs={"class": "form-control-file"}),
|
||||
# For ForeignKey fields like 'EventMaster' and 'venue', Django uses a select widget by default.
|
||||
# You can customize it further if needed:
|
||||
"event_master": forms.Select(attrs={"class": "form-control"}),
|
||||
# "event_master": forms.Select(attrs={"class": "form-control"}),
|
||||
"venue": forms.Select(attrs={"class": "form-control"}),
|
||||
"category": forms.Select(attrs={"class": "form-control"}),
|
||||
}
|
||||
|
||||
def clean(self):
|
||||
cleaned_data = super().clean()
|
||||
|
||||
# Get the start and end dates from cleaned_data
|
||||
start_date = cleaned_data.get("start_date")
|
||||
end_date = cleaned_data.get("end_date")
|
||||
|
||||
# Validation 1: end_date should not be less than start_date
|
||||
if end_date and start_date and end_date < start_date:
|
||||
self.add_error("end_date", _("End date cannot be before the start date."))
|
||||
|
||||
# Get the from and to times from cleaned_data
|
||||
from_time = cleaned_data.get("from_time")
|
||||
to_time = cleaned_data.get("to_time")
|
||||
|
||||
# Validation 2: to_time should not be less than or equal to from_time
|
||||
if to_time and from_time and to_time <= from_time:
|
||||
self.add_error("to_time", _("End time must be after the start time."))
|
||||
|
||||
return cleaned_data
|
||||
|
||||
|
||||
class EventMasterForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = EventMaster
|
||||
fields = "__all__" # Includes all fields from the model
|
||||
|
||||
|
||||
class VenueForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Venue
|
||||
fields = [
|
||||
"title",
|
||||
"description",
|
||||
"address",
|
||||
"image",
|
||||
"url",
|
||||
"latitude",
|
||||
"longitude",
|
||||
]
|
||||
widgets = {
|
||||
"title": forms.TextInput(attrs={"class": "form-control"}),
|
||||
"description": forms.Textarea(attrs={"class": "form-control", "rows": 4}),
|
||||
"address": forms.Textarea(attrs={"class": "form-control", "rows": 3}),
|
||||
"image": forms.FileInput(attrs={"class": "form-control"}),
|
||||
"url": forms.URLInput(attrs={"class": "form-control"}),
|
||||
"latitude": forms.NumberInput(attrs={"class": "form-control"}),
|
||||
"longitude": forms.NumberInput(attrs={"class": "form-control"}),
|
||||
}
|
||||
|
||||
@@ -68,4 +68,25 @@ urlpatterns = [
|
||||
views.EventDeleteView.as_view(),
|
||||
name="event_delete",
|
||||
),
|
||||
# Venue
|
||||
path(
|
||||
"venue/list/",
|
||||
views.VenueView.as_view(),
|
||||
name="venue_list",
|
||||
),
|
||||
path(
|
||||
"venue/add/",
|
||||
views.VenueCreateOrUpdateView.as_view(),
|
||||
name="venue_add",
|
||||
),
|
||||
path(
|
||||
"venue/edit/<int:pk>/",
|
||||
views.VenueCreateOrUpdateView.as_view(),
|
||||
name="venue_edit",
|
||||
),
|
||||
path(
|
||||
"venue/delete/<int:pk>",
|
||||
views.VenueDeleteView.as_view(),
|
||||
name="venue_delete",
|
||||
),
|
||||
]
|
||||
|
||||
@@ -4,9 +4,10 @@ from manage_events.forms import (
|
||||
EventMasterForm,
|
||||
EventCategoryForm,
|
||||
EventForm,
|
||||
VenueForm,
|
||||
)
|
||||
from django.core.paginator import Paginator
|
||||
from .models import EventMaster, Event, EventCategory
|
||||
from .models import EventMaster, Event, EventCategory, Venue
|
||||
from django.views import generic
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.urls import reverse_lazy
|
||||
@@ -351,3 +352,106 @@ class EventDeleteView(LoginRequiredMixin, generic.View):
|
||||
messages.success(request, self.error_message)
|
||||
|
||||
return redirect(self.success_url)
|
||||
|
||||
|
||||
class VenueCreateOrUpdateView(LoginRequiredMixin, generic.View):
|
||||
# Set the page_name and resource
|
||||
page_name = resource_action.RESOURCE_MANAGE_VENUES
|
||||
resource = resource_action.RESOURCE_MANAGE_VENUES
|
||||
|
||||
# Initialize the action as ACTION_CREATE (can change based on logic)
|
||||
action = resource_action.ACTION_CREATE # Default action
|
||||
|
||||
template_name = "manage_venues/venue_add.html"
|
||||
model = Venue
|
||||
form_class = VenueForm
|
||||
success_url = reverse_lazy("manage_events:venue_list")
|
||||
error_message = "An error occurred while saving the data."
|
||||
|
||||
# Determine the success message dynamically based on whether it's an update or create
|
||||
def get_success_message(self):
|
||||
self.success_message = (
|
||||
constants.RECORD_CREATED if not self.object else constants.RECORD_UPDATED
|
||||
)
|
||||
return self.success_message
|
||||
|
||||
# Get the object (if exists) based on URL parameter 'pk'
|
||||
def get_object(self):
|
||||
pk = self.kwargs.get("pk")
|
||||
return get_object_or_404(self.model, pk=pk) if pk else None
|
||||
|
||||
# Add page_name and operation to the context
|
||||
def get_context_data(self, **kwargs):
|
||||
context = {
|
||||
"page_name": self.page_name,
|
||||
"operation": "Add" if not self.object else "Edit",
|
||||
}
|
||||
context.update(kwargs) # Include any additional context data passed to the view
|
||||
return context
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
self.object = self.get_object()
|
||||
|
||||
# If an object is found, change action to ACTION_UPDATE
|
||||
if self.object is not None:
|
||||
self.action = resource_action.ACTION_UPDATE
|
||||
|
||||
form = self.form_class(instance=self.object)
|
||||
context = self.get_context_data(form=form)
|
||||
return render(request, self.template_name, context=context)
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
self.object = self.get_object()
|
||||
|
||||
# If an object is found, change action to ACTION_UPDATE
|
||||
if self.object is not None:
|
||||
self.action = resource_action.ACTION_UPDATE
|
||||
|
||||
form = self.form_class(request.POST, request.FILES, instance=self.object)
|
||||
if not form.is_valid():
|
||||
print(form.errors)
|
||||
context = self.get_context_data(form=form)
|
||||
return render(request, self.template_name, context=context)
|
||||
form.save()
|
||||
messages.success(self.request, self.get_success_message())
|
||||
return redirect(self.success_url)
|
||||
|
||||
|
||||
class VenueView(LoginRequiredMixin, generic.ListView):
|
||||
page_name = resource_action.RESOURCE_MANAGE_VENUES
|
||||
resource = resource_action.RESOURCE_MANAGE_VENUES
|
||||
action = resource_action.ACTION_READ
|
||||
model = Venue
|
||||
template_name = "manage_venues/venue_list.html"
|
||||
context_object_name = "venue_obj"
|
||||
# paginate_by = 10
|
||||
|
||||
def get_queryset(self):
|
||||
return super().get_queryset().filter(deleted=False, active=True)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["page_name"] = self.page_name
|
||||
return context
|
||||
|
||||
|
||||
class VenueDeleteView(LoginRequiredMixin, generic.View):
|
||||
page_name = resource_action.RESOURCE_MANAGE_VENUES
|
||||
resource = resource_action.RESOURCE_MANAGE_VENUES
|
||||
action = resource_action.ACTION_DELETE
|
||||
model = Venue
|
||||
success_url = reverse_lazy("manage_events:venue_list")
|
||||
success_message = constants.RECORD_DELETED
|
||||
error_message = constants.RECORD_NOT_FOUND
|
||||
|
||||
def get(self, request, pk):
|
||||
try:
|
||||
type_obj = self.model.objects.get(id=pk)
|
||||
type_obj.deleted = True
|
||||
type_obj.active = False
|
||||
type_obj.save()
|
||||
messages.success(request, self.success_message)
|
||||
except self.model.DoesNotExist:
|
||||
messages.success(request, self.error_message)
|
||||
|
||||
return redirect(self.success_url)
|
||||
|
||||
@@ -8,7 +8,7 @@ class PushNotificationForm(forms.ModelForm):
|
||||
fields = [
|
||||
"title",
|
||||
"notification_category",
|
||||
"banner_image",
|
||||
# "banner_image",
|
||||
"principal_type",
|
||||
"message",
|
||||
]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import json
|
||||
import requests
|
||||
from django.db.models import Q
|
||||
from onesignal_sdk.client import Client as OneSignalClient
|
||||
from django.conf import settings
|
||||
from .models import IAmPrincipalNotificationSettings, IAmPrincipal, PrincipalType
|
||||
@@ -33,6 +34,8 @@ def onesignal_send_notification(
|
||||
|
||||
if image_url:
|
||||
# Include image URL if provided (requires additional OneSignal configuration)
|
||||
data["big_picture"] = str(image_url.url)
|
||||
data["small_icon"] = str(image_url.url)
|
||||
data["large_icon"] = str(image_url.url)
|
||||
|
||||
# data = json.dumps(data)
|
||||
@@ -68,14 +71,16 @@ def send_notification(title, message, image_url=None, eligible_principals=None):
|
||||
"headings": {"en": title},
|
||||
"contents": {"en": message},
|
||||
"include_player_ids": eligible_principals,
|
||||
"big_picture": image_url.url,
|
||||
}
|
||||
|
||||
if image_url:
|
||||
image_url_str = image_url.url
|
||||
notification_payload["big_picture"] = image_url_str
|
||||
# if image_url:
|
||||
# # image_url_str = image_url.url
|
||||
# notification_payload["big_picture"] = image_url
|
||||
# notification_payload["small_icon"] = image_url
|
||||
# notification_payload["large_icon"] = image_url
|
||||
|
||||
# Send notification
|
||||
print("notification_payload: ", notification_payload)
|
||||
response = onesignal_client.send_notification(notification_payload)
|
||||
print(response.status_code, response.body)
|
||||
|
||||
@@ -88,37 +93,44 @@ def get_eligible_principals_for_notification(push_notification):
|
||||
|
||||
if principal_type == PrincipalType.BOTH:
|
||||
# If BOTH is selected, fetch users categorized under both EVENT_USER and EVENT_MANAGER
|
||||
event_user_principals = IAmPrincipal.objects.filter(
|
||||
principal_type__name=PrincipalType.EVENT_USER,
|
||||
notifications_principal__notification_category=notification_category,
|
||||
notifications_principal__is_enabled=True,
|
||||
eligible_principals = list(
|
||||
IAmPrincipal.objects.filter(
|
||||
Q(principal_type__name=PrincipalType.EVENT_USER)
|
||||
| Q(principal_type__name=PrincipalType.EVENT_MANAGER),
|
||||
notifications_principal__notification_category=notification_category,
|
||||
notifications_principal__is_enabled=True,
|
||||
).values_list("player_id", flat=True)
|
||||
)
|
||||
|
||||
event_manager_principals = IAmPrincipal.objects.filter(
|
||||
principal_type__name=PrincipalType.EVENT_MANAGER,
|
||||
notifications_principal__notification_category=notification_category,
|
||||
notifications_principal__is_enabled=True,
|
||||
)
|
||||
# event_manager_principals = IAmPrincipal.objects.filter(
|
||||
# principal_type__name=PrincipalType.EVENT_MANAGER,
|
||||
# notifications_principal__notification_category=notification_category,
|
||||
# notifications_principal__is_enabled=True,
|
||||
# )
|
||||
|
||||
# Combine the QuerySets. Use | operator for OR query (union) and distinct() to avoid duplicates.
|
||||
eligible_principals = (
|
||||
event_user_principals | event_manager_principals
|
||||
).distinct()
|
||||
# # Combine the QuerySets. Use | operator for OR query (union) and distinct() to avoid duplicates.
|
||||
# eligible_principals = (
|
||||
# event_user_principals | event_manager_principals
|
||||
# )
|
||||
|
||||
elif principal_type == PrincipalType.EVENT_USER:
|
||||
# Fetch only EVENT_USER principals
|
||||
eligible_principals = IAmPrincipal.objects.filter(
|
||||
principal_type__name=PrincipalType.EVENT_USER,
|
||||
notifications_principal__notification_category=notification_category,
|
||||
notifications_principal__is_enabled=True,
|
||||
eligible_principals = list(
|
||||
IAmPrincipal.objects.filter(
|
||||
principal_type__name=PrincipalType.EVENT_USER,
|
||||
notifications_principal__notification_category=notification_category,
|
||||
notifications_principal__is_enabled=True,
|
||||
).values_list("player_id", flat=True)
|
||||
)
|
||||
|
||||
elif principal_type == PrincipalType.EVENT_MANAGER:
|
||||
# Fetch only EVENT_MANAGER principals
|
||||
eligible_principals = IAmPrincipal.objects.filter(
|
||||
principal_type__name=PrincipalType.EVENT_MANAGER,
|
||||
notifications_principal__notification_category=notification_category,
|
||||
notifications_principal__is_enabled=True,
|
||||
eligible_principals = list(
|
||||
IAmPrincipal.objects.filter(
|
||||
principal_type__name=PrincipalType.EVENT_MANAGER,
|
||||
notifications_principal__notification_category=notification_category,
|
||||
notifications_principal__is_enabled=True,
|
||||
).values_list("player_id", flat=True)
|
||||
)
|
||||
|
||||
return eligible_principals
|
||||
|
||||
@@ -5,6 +5,8 @@ from django.views import generic
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.contrib import messages
|
||||
from django.core.serializers import serialize
|
||||
from django.contrib.sites.shortcuts import get_current_site
|
||||
from django.conf import settings
|
||||
from accounts import resource_action
|
||||
from goodtimes import constants
|
||||
from manage_notifications.forms import PushNotificationForm
|
||||
@@ -64,6 +66,12 @@ class PushNotificationsCreateOrUpdateView(LoginRequiredMixin, generic.View):
|
||||
context = self.get_context_data(form=form)
|
||||
return render(request, self.template_name, context=context)
|
||||
|
||||
def get_image_url(self, obj, field_name, request):
|
||||
image_field = getattr(obj, field_name, None)
|
||||
if image_field:
|
||||
return request.build_absolute_uri(image_field.url)
|
||||
return ""
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
self.object = self.get_object()
|
||||
# If an object is found, change action to ACTION_UPDATE
|
||||
@@ -76,36 +84,23 @@ class PushNotificationsCreateOrUpdateView(LoginRequiredMixin, generic.View):
|
||||
context = self.get_context_data(form=form)
|
||||
return render(request, self.template_name, context=context)
|
||||
|
||||
push_notification = form.instance
|
||||
push_notification = form.save()
|
||||
eligible_principals = get_eligible_principals_for_notification(
|
||||
push_notification
|
||||
)
|
||||
print("eligible_principals: ", eligible_principals)
|
||||
eligible_principals_json = serialize('json', eligible_principals)
|
||||
eligible_principals_list = json.loads(eligible_principals_json)
|
||||
player_ids = [principal['fields']['player_id'] for principal in eligible_principals_list]
|
||||
# Send notification
|
||||
title = push_notification.title
|
||||
message = push_notification.message
|
||||
image_url = push_notification.banner_image
|
||||
# onesignal_send_notification(title, message, image_url, player_ids)
|
||||
send_notification(title, message, image_url, player_ids)
|
||||
print(onesignal_send_notification)
|
||||
# if onesignal_send_notification(
|
||||
# push_notification.title,
|
||||
# push_notification.message,
|
||||
# None,
|
||||
# eligible_principals,
|
||||
# ):
|
||||
# form.save()
|
||||
# messages.success(request, self.get_success_message())
|
||||
# return redirect(self.success_url)
|
||||
# else:
|
||||
# messages.error(request, "Failed to send notification. Form not saved.")
|
||||
# context = self.get_context_data(form=form)
|
||||
# return render(request, self.template_name, context=context)
|
||||
|
||||
form.save()
|
||||
# image_url = self.get_image_url(push_notification, "banner_image", request)
|
||||
# print(f"image url=========={image_url}")
|
||||
send_notification(
|
||||
title=title,
|
||||
message=message,
|
||||
# image_url=image_url,
|
||||
eligible_principals=eligible_principals,
|
||||
)
|
||||
print(send_notification)
|
||||
messages.success(request, self.get_success_message())
|
||||
return redirect(self.success_url)
|
||||
|
||||
|
||||
@@ -30,10 +30,8 @@ class PrincipalSubscriptionForm(forms.ModelForm):
|
||||
model = PrincipalSubscription
|
||||
fields = "__all__" # Includes all fields from the model
|
||||
widgets = {
|
||||
'start_date': forms.DateInput(attrs={'type': 'date'}),
|
||||
'end_date': forms.DateInput(attrs={'type': 'date'}),
|
||||
'grace_period_end_date': forms.DateInput(attrs={'type': 'date'}),
|
||||
'cancelled_date_time': forms.DateTimeInput(attrs={'type': 'datetime'}),
|
||||
"start_date": forms.DateInput(attrs={"type": "date"}),
|
||||
"end_date": forms.DateInput(attrs={"type": "date"}),
|
||||
"grace_period_end_date": forms.DateInput(attrs={"type": "date"}),
|
||||
"cancelled_date_time": forms.DateTimeInput(attrs={"type": "datetime"}),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,39 +17,39 @@ urlpatterns = [
|
||||
views.SubscriptionCreateOrUpdateView.as_view(),
|
||||
name="subscription_edit",
|
||||
),
|
||||
path(
|
||||
"subscription/delete/<int:pk>",
|
||||
views.SubscriptionDeleteView.as_view(),
|
||||
name="subscription_delete",
|
||||
),
|
||||
# path(
|
||||
# "subscription/delete/<int:pk>",
|
||||
# views.SubscriptionDeleteView.as_view(),
|
||||
# name="subscription_delete",
|
||||
# ),
|
||||
# PLANS
|
||||
path("plan/list/", views.PlanView.as_view(), name="plan_list"),
|
||||
path(
|
||||
"plan/add/",
|
||||
views.PlanCreateOrUpdateView.as_view(),
|
||||
name="plan_add",
|
||||
),
|
||||
path(
|
||||
"plan/edit/<int:pk>/",
|
||||
views.PlanCreateOrUpdateView.as_view(),
|
||||
name="plan_edit",
|
||||
),
|
||||
path(
|
||||
"plan/delete/<int:pk>",
|
||||
views.PlanDeleteView.as_view(),
|
||||
name="plan_delete",
|
||||
),
|
||||
# path(
|
||||
# "plan/add/",
|
||||
# views.PlanCreateOrUpdateView.as_view(),
|
||||
# name="plan_add",
|
||||
# ),
|
||||
# path(
|
||||
# "plan/edit/<int:pk>/",
|
||||
# views.PlanCreateOrUpdateView.as_view(),
|
||||
# name="plan_edit",
|
||||
# ),
|
||||
# path(
|
||||
# "plan/delete/<int:pk>",
|
||||
# views.PlanDeleteView.as_view(),
|
||||
# name="plan_delete",
|
||||
# ),
|
||||
# Principal Subscription
|
||||
path(
|
||||
"principal_subscription/list/",
|
||||
views.PrincipalSubscriptionView.as_view(),
|
||||
name="principal_subscriptions_list",
|
||||
),
|
||||
path(
|
||||
"principal_subscription/add/",
|
||||
views.PrincipalSubscriptionCreateOrUpdateView.as_view(),
|
||||
name="principal_subscription_add",
|
||||
),
|
||||
# path(
|
||||
# "principal_subscription/add/",
|
||||
# views.PrincipalSubscriptionCreateOrUpdateView.as_view(),
|
||||
# name="principal_subscription_add",
|
||||
# ),
|
||||
path(
|
||||
"principal_subscription/edit/<int:pk>/",
|
||||
views.PrincipalSubscriptionCreateOrUpdateView.as_view(),
|
||||
@@ -73,5 +73,5 @@ urlpatterns = [
|
||||
path("stripe/", views.SubscriptionPageView.as_view(), name="stripe"),
|
||||
path("success/", views.SuccessView.as_view(), name="success"),
|
||||
path("cancel/", views.CancelView.as_view(), name="cancel"),
|
||||
path("join-now/", views.IndexView.as_view(), name="index"),
|
||||
# path("join-now/", views.IndexView.as_view(), name="index"),
|
||||
]
|
||||
|
||||
@@ -115,89 +115,89 @@ class SubscriptionView(LoginRequiredMixin, generic.ListView):
|
||||
return context
|
||||
|
||||
|
||||
class SubscriptionDeleteView(LoginRequiredMixin, generic.View):
|
||||
page_name = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
resource = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
action = resource_action.ACTION_DELETE
|
||||
model = Subscription
|
||||
success_url = reverse_lazy("manage_subscriptions:subscription_list")
|
||||
success_message = constants.RECORD_DELETED
|
||||
error_message = constants.RECORD_NOT_FOUND
|
||||
# class SubscriptionDeleteView(LoginRequiredMixin, generic.View):
|
||||
# page_name = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
# resource = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
# action = resource_action.ACTION_DELETE
|
||||
# model = Subscription
|
||||
# success_url = reverse_lazy("manage_subscriptions:subscription_list")
|
||||
# success_message = constants.RECORD_DELETED
|
||||
# error_message = constants.RECORD_NOT_FOUND
|
||||
|
||||
def get(self, request, pk):
|
||||
try:
|
||||
type_obj = self.model.objects.get(id=pk)
|
||||
type_obj.deleted = True
|
||||
type_obj.active = False
|
||||
type_obj.save()
|
||||
messages.success(request, self.success_message)
|
||||
except self.model.DoesNotExist:
|
||||
messages.success(request, self.error_message)
|
||||
# def get(self, request, pk):
|
||||
# try:
|
||||
# type_obj = self.model.objects.get(id=pk)
|
||||
# type_obj.deleted = True
|
||||
# type_obj.active = False
|
||||
# type_obj.save()
|
||||
# messages.success(request, self.success_message)
|
||||
# except self.model.DoesNotExist:
|
||||
# messages.success(request, self.error_message)
|
||||
|
||||
return redirect(self.success_url)
|
||||
# return redirect(self.success_url)
|
||||
|
||||
|
||||
class PlanCreateOrUpdateView(LoginRequiredMixin, generic.View):
|
||||
# Set the page_name and resource
|
||||
page_name = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
resource = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
# class PlanCreateOrUpdateView(LoginRequiredMixin, generic.View):
|
||||
# # Set the page_name and resource
|
||||
# page_name = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
# resource = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
|
||||
# Initialize the action as ACTION_CREATE (can change based on logic)
|
||||
action = resource_action.ACTION_CREATE # Default action
|
||||
# # Initialize the action as ACTION_CREATE (can change based on logic)
|
||||
# action = resource_action.ACTION_CREATE # Default action
|
||||
|
||||
template_name = "manage_subscriptions/plan_add.html"
|
||||
model = Plan
|
||||
form_class = PlanForm
|
||||
success_url = reverse_lazy("manage_subscriptions:plan_list")
|
||||
error_message = "An error occurred while saving the data."
|
||||
# template_name = "manage_subscriptions/plan_add.html"
|
||||
# model = Plan
|
||||
# form_class = PlanForm
|
||||
# success_url = reverse_lazy("manage_subscriptions:plan_list")
|
||||
# error_message = "An error occurred while saving the data."
|
||||
|
||||
# Determine the success message dynamically based on whether it's an update or create
|
||||
def get_success_message(self):
|
||||
self.success_message = (
|
||||
constants.RECORD_CREATED if not self.object else constants.RECORD_UPDATED
|
||||
)
|
||||
return self.success_message
|
||||
# # Determine the success message dynamically based on whether it's an update or create
|
||||
# def get_success_message(self):
|
||||
# self.success_message = (
|
||||
# constants.RECORD_CREATED if not self.object else constants.RECORD_UPDATED
|
||||
# )
|
||||
# return self.success_message
|
||||
|
||||
# Get the object (if exists) based on URL parameter 'pk'
|
||||
def get_object(self):
|
||||
pk = self.kwargs.get("pk")
|
||||
return get_object_or_404(self.model, pk=pk) if pk else None
|
||||
# # Get the object (if exists) based on URL parameter 'pk'
|
||||
# def get_object(self):
|
||||
# pk = self.kwargs.get("pk")
|
||||
# return get_object_or_404(self.model, pk=pk) if pk else None
|
||||
|
||||
# Add page_name and operation to the context
|
||||
def get_context_data(self, **kwargs):
|
||||
context = {
|
||||
"page_name": self.page_name,
|
||||
"operation": "Add" if not self.object else "Edit",
|
||||
}
|
||||
context.update(kwargs) # Include any additional context data passed to the view
|
||||
return context
|
||||
# # Add page_name and operation to the context
|
||||
# def get_context_data(self, **kwargs):
|
||||
# context = {
|
||||
# "page_name": self.page_name,
|
||||
# "operation": "Add" if not self.object else "Edit",
|
||||
# }
|
||||
# context.update(kwargs) # Include any additional context data passed to the view
|
||||
# return context
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
self.object = self.get_object()
|
||||
# def get(self, request, *args, **kwargs):
|
||||
# self.object = self.get_object()
|
||||
|
||||
# If an object is found, change action to ACTION_UPDATE
|
||||
if self.object is not None:
|
||||
self.action = resource_action.ACTION_UPDATE
|
||||
# # If an object is found, change action to ACTION_UPDATE
|
||||
# if self.object is not None:
|
||||
# self.action = resource_action.ACTION_UPDATE
|
||||
|
||||
form = self.form_class(instance=self.object)
|
||||
context = self.get_context_data(form=form)
|
||||
return render(request, self.template_name, context=context)
|
||||
# form = self.form_class(instance=self.object)
|
||||
# context = self.get_context_data(form=form)
|
||||
# return render(request, self.template_name, context=context)
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
self.object = self.get_object()
|
||||
# def post(self, request, *args, **kwargs):
|
||||
# self.object = self.get_object()
|
||||
|
||||
# If an object is found, change action to ACTION_UPDATE
|
||||
if self.object is not None:
|
||||
self.action = resource_action.ACTION_UPDATE
|
||||
# # If an object is found, change action to ACTION_UPDATE
|
||||
# if self.object is not None:
|
||||
# self.action = resource_action.ACTION_UPDATE
|
||||
|
||||
form = self.form_class(request.POST, instance=self.object)
|
||||
if not form.is_valid():
|
||||
print(form.errors)
|
||||
context = self.get_context_data(form=form)
|
||||
return render(request, self.template_name, context=context)
|
||||
form.save()
|
||||
messages.success(self.request, self.get_success_message())
|
||||
return redirect(self.success_url)
|
||||
# form = self.form_class(request.POST, instance=self.object)
|
||||
# if not form.is_valid():
|
||||
# print(form.errors)
|
||||
# context = self.get_context_data(form=form)
|
||||
# return render(request, self.template_name, context=context)
|
||||
# form.save()
|
||||
# messages.success(self.request, self.get_success_message())
|
||||
# return redirect(self.success_url)
|
||||
|
||||
|
||||
class PlanView(LoginRequiredMixin, generic.ListView):
|
||||
@@ -217,26 +217,26 @@ class PlanView(LoginRequiredMixin, generic.ListView):
|
||||
return context
|
||||
|
||||
|
||||
class PlanDeleteView(LoginRequiredMixin, generic.View):
|
||||
page_name = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
resource = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
action = resource_action.ACTION_DELETE
|
||||
model = Plan
|
||||
success_url = reverse_lazy("manage_subscriptions:plan_list")
|
||||
success_message = constants.RECORD_DELETED
|
||||
error_message = constants.RECORD_NOT_FOUND
|
||||
# class PlanDeleteView(LoginRequiredMixin, generic.View):
|
||||
# page_name = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
# resource = resource_action.RESOURCE_MANAGE_SUBSCRIPTIONS
|
||||
# action = resource_action.ACTION_DELETE
|
||||
# model = Plan
|
||||
# success_url = reverse_lazy("manage_subscriptions:plan_list")
|
||||
# success_message = constants.RECORD_DELETED
|
||||
# error_message = constants.RECORD_NOT_FOUND
|
||||
|
||||
def get(self, request, pk):
|
||||
try:
|
||||
type_obj = self.model.objects.get(id=pk)
|
||||
type_obj.deleted = True
|
||||
type_obj.active = False
|
||||
type_obj.save()
|
||||
messages.success(request, self.success_message)
|
||||
except self.model.DoesNotExist:
|
||||
messages.success(request, self.error_message)
|
||||
# def get(self, request, pk):
|
||||
# try:
|
||||
# type_obj = self.model.objects.get(id=pk)
|
||||
# type_obj.deleted = True
|
||||
# type_obj.active = False
|
||||
# type_obj.save()
|
||||
# messages.success(request, self.success_message)
|
||||
# except self.model.DoesNotExist:
|
||||
# messages.success(request, self.error_message)
|
||||
|
||||
return redirect(self.success_url)
|
||||
# return redirect(self.success_url)
|
||||
|
||||
|
||||
class PrincipalSubscriptionCreateOrUpdateView(LoginRequiredMixin, generic.View):
|
||||
@@ -386,7 +386,6 @@ def stripe_config(request):
|
||||
@csrf_exempt
|
||||
def create_checkout_session(request):
|
||||
if request.method == "GET":
|
||||
domain_url = "http://localhost:8000/"
|
||||
stripe.api_key = settings.STRIPE_SECRET_KEY
|
||||
|
||||
subscription_id = None # Assuming 3 is a default or fallback subscription ID
|
||||
@@ -485,36 +484,36 @@ class CancelView(TemplateView):
|
||||
template_name = "stripe_html/cancel.html"
|
||||
|
||||
|
||||
class IndexView(TemplateView):
|
||||
template_name = "stripe_html/index.html"
|
||||
# class IndexView(TemplateView):
|
||||
# template_name = "stripe_html/index.html"
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
# Example of extracting the token from a query parameter or cookie
|
||||
token = request.GET.get("token")
|
||||
# token = request.GET.get("token") or request.COOKIES.get("jwt")
|
||||
print("token: ", token)
|
||||
if token:
|
||||
try:
|
||||
# Decode and validate token
|
||||
payload = jwt.decode(token, settings.SECRET_KEY, algorithms=["HS256"])
|
||||
print("payload: ", payload)
|
||||
try:
|
||||
UserModel = get_user_model()
|
||||
user = UserModel.objects.get(id=payload["user_id"])
|
||||
# Manually specify the authentication backend
|
||||
user.backend = "django.contrib.auth.backends.ModelBackend"
|
||||
# Log the user in
|
||||
login(request, user)
|
||||
print("Logged in user: ", user)
|
||||
# def get(self, request, *args, **kwargs):
|
||||
# # Example of extracting the token from a query parameter or cookie
|
||||
# token = request.GET.get("token")
|
||||
# # token = request.GET.get("token") or request.COOKIES.get("jwt")
|
||||
# print("token: ", token)
|
||||
# if token:
|
||||
# try:
|
||||
# # Decode and validate token
|
||||
# payload = jwt.decode(token, settings.SECRET_KEY, algorithms=["HS256"])
|
||||
# print("payload: ", payload)
|
||||
# try:
|
||||
# UserModel = get_user_model()
|
||||
# user = UserModel.objects.get(id=payload["user_id"])
|
||||
# # Manually specify the authentication backend
|
||||
# user.backend = "django.contrib.auth.backends.ModelBackend"
|
||||
# # Log the user in
|
||||
# login(request, user)
|
||||
# print("Logged in user: ", user)
|
||||
|
||||
except IAmPrincipal.DoesNotExist:
|
||||
# Handle expired token
|
||||
return HttpResponseBadRequest("No Principal Found")
|
||||
# except IAmPrincipal.DoesNotExist:
|
||||
# # Handle expired token
|
||||
# return HttpResponseBadRequest("No Principal Found")
|
||||
|
||||
except jwt.ExpiredSignatureError:
|
||||
# Handle expired token
|
||||
return HttpResponseBadRequest("Expired Signature Error")
|
||||
except jwt.InvalidTokenError:
|
||||
return HttpResponseBadRequest("Invalid Token Error")
|
||||
# except jwt.ExpiredSignatureError:
|
||||
# # Handle expired token
|
||||
# return HttpResponseBadRequest("Expired Signature Error")
|
||||
# except jwt.InvalidTokenError:
|
||||
# return HttpResponseBadRequest("Invalid Token Error")
|
||||
|
||||
return super().get(request, *args, **kwargs)
|
||||
# return super().get(request, *args, **kwargs)
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
style="width: 98.875px;">Modified On</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Active</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Delete</th>
|
||||
<!-- <th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Delete</th> -->
|
||||
<th class="text-center dt-no-sorting" tabindex="0"
|
||||
aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 51.625px;">Action</th>
|
||||
@@ -91,11 +91,11 @@
|
||||
{{ data_obj.is_active }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<!-- <td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.deleted %}badge-primary{% else %}badge-danger{% endif %}">
|
||||
{{ data_obj.deleted }}
|
||||
</span>
|
||||
</td>
|
||||
</td> -->
|
||||
<td class="text-center">
|
||||
<ul class="table-controls">
|
||||
<li><a href="{% url 'accounts:principal_edit' data_obj.id%}" class="bs-tooltip"
|
||||
@@ -110,7 +110,7 @@
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="javascript:void(0);" class="bs-tooltip"
|
||||
<!-- <li><a href="javascript:void(0);" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -122,7 +122,7 @@
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</svg></a></li> -->
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
<!-- <li
|
||||
class="menu {% if page_name == resource_context.RESOURCE_IAM_PRINCIPAL or page_name == resource_context.RESOURCE_IAM_PRINCIPAL_GROUP or page_name == resource_context.RESOURCE_IAM_GROUP or page_name == resource_context.RESOURCE_IAM_ROLE %}active{% endif %}">
|
||||
<a href="#iam" data-bs-toggle="collapse" aria-expanded="true" class="dropdown-toggle">
|
||||
<div class="">
|
||||
@@ -79,7 +79,7 @@
|
||||
<a href="{% url 'accounts:role_list'%}"> IAM Role </a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</li> -->
|
||||
<li class="menu {% if page_name == resource_context.RESOURCE_MANAGE_CUSTOMER %}active{% endif %}">
|
||||
<a href="{% url 'accounts:customer_list'%}" aria-expanded="false" class="dropdown-toggle">
|
||||
<div class="{% if page_name == RESOURCE_MANAGE_CUSTOMER %}active{% endif %}">
|
||||
@@ -115,6 +115,17 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu {% if page_name == resource_context.RESOURCE_PRINCIPAL_SUBSCRIPTIONS %}active{% endif %}">
|
||||
<a href="{% url 'manage_subscriptions:principal_subscriptions_list'%}" aria-expanded="false"
|
||||
class="dropdown-toggle">
|
||||
<div class="">
|
||||
<span class="material-symbols-outlined">
|
||||
loyalty
|
||||
</span>
|
||||
<span>Principal Subscriptions</span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu {% if page_name == resource_context.RESOURCE_MANAGE_REFERRALS %}active{% endif %}">
|
||||
<a href="{% url 'manage_referrals:record_list'%}" aria-expanded="false" class="dropdown-toggle">
|
||||
<div class="">
|
||||
@@ -123,8 +134,18 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu {% if page_name == resource_context.RESOURCE_MANAGE_VENUES %}active{% endif %}">
|
||||
<a href="{% url 'manage_events:venue_list'%}" aria-expanded="false" class="dropdown-toggle">
|
||||
<div class="">
|
||||
<span class="material-symbols-outlined">
|
||||
pin_drop
|
||||
</span>
|
||||
<span>Manage Venues</span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="menu {% if page_name == resource_context.RESOURCE_MANAGE_EVENTS %}active{% endif %}">
|
||||
<a href="{% url 'manage_events:event_list'%}" aria-expanded="false" class="dropdown-toggle">
|
||||
<a href="{% url 'manage_events:event_list' %}" aria-expanded="false" class="dropdown-toggle">
|
||||
<div class="">
|
||||
<span class="material-symbols-outlined">event</span>
|
||||
<span>Manage Events</span>
|
||||
@@ -182,7 +203,8 @@
|
||||
</a>
|
||||
</li> -->
|
||||
<li class="menu {% if page_name == resource_context.RESOURCE_MANAGE_NOTIFICATIONS %}active{% endif %}">
|
||||
<a href="{% url 'manage_notifications:notification_list'%}" aria-expanded="false" class="dropdown-toggle">
|
||||
<a href="{% url 'manage_notifications:notification_list'%}" aria-expanded="false"
|
||||
class="dropdown-toggle">
|
||||
<div class="">
|
||||
<span class="material-symbols-outlined">notifications</span>
|
||||
<span>Notification</span>
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="{% url 'manage_cms:faq_edit' data_obj.id %}" class="bs-tooltip"
|
||||
<li><a href="{% url 'manage_cms:faq_delete' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<div class="col">
|
||||
<h3>{{operation}} {{page_title}}</h3>
|
||||
</div>
|
||||
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-dark mb-2 me-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
@@ -30,7 +31,7 @@
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
<form method="POST" enctype="multipart/form-data" novalidate>
|
||||
{% csrf_token %}
|
||||
{% include 'includes/dynamic_template_form.html' with form=form %}
|
||||
<div class="mt-4 mb-0">
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3>Manage Event Category</h3>
|
||||
<h3>Event Categories</h3>
|
||||
</div>
|
||||
<div class="col-sm-6 text-md-end">
|
||||
<!--
|
||||
@@ -21,9 +21,9 @@
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_events:event_category_add' %}">Add Event Category</a>
|
||||
<!-- <a class="btn btn-primary mb-2" href="{% url 'manage_events:event_category_add' %}">Add Event Category</a> -->
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_events:event_list' %}">Events</a>
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_events:event_master_list' %}">Event Master</a>
|
||||
<!-- <a class="btn btn-primary mb-2" href="{% url 'manage_events:event_master_list' %}">Event Master</a> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="{% url 'manage_events:event_category_delete' data_obj.id %}" class="bs-tooltip"
|
||||
<!-- <li><a href="{% url 'manage_events:event_category_delete' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -103,7 +103,7 @@
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</svg></a></li> -->
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
-->
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_events:event_add' %}">Add Event</a>
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_events:event_category_list' %}">Event Category</a>
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_events:event_master_list' %}">Event Master</a>
|
||||
<!-- <a class="btn btn-primary mb-2" href="{% url 'manage_events:event_master_list' %}">Event Master</a> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_css.html" %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3>Manage Games</h3>
|
||||
</div>
|
||||
<div class="col-sm-6 text-md-end">
|
||||
<!--
|
||||
<button class="btn btn-dark mb-2 me-md-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
{% comment %} <a class="btn btn-primary mb-2 me-md-4" href="{% url 'manage_games:game_commission_add' %}">Example form</a> {% endcomment %}
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_games:game_commission_add' %}">Add Commission</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
<div id="style-3_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
<div class="table-responsive">
|
||||
<table id="style-3" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column text-center sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" rowspan="1" colspan="1" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1"
|
||||
style="width: 44.2344px;">Commission Percentage</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Default User Commission</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Active</th>
|
||||
<th class="text-center dt-no-sorting" tabindex="0"
|
||||
aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 51.625px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in data_obj %}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{ data_obj.id }} </td>
|
||||
|
||||
<td>{{ data_obj.commission }}</td>
|
||||
<td>{{ data_obj.user_game_comm }}</td>
|
||||
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.is_active %}badge-primary{% else %}badge-danger{% endif %}">
|
||||
{{ data_obj.is_active }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:game_commission_edit' data_obj.id%}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="javascript:void(0);" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required js cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_js.html" %}
|
||||
|
||||
<script>
|
||||
c3 = $('#style-3').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
||||
"oLanguage": {
|
||||
"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
|
||||
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [5, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
multiCheck(c3);
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,135 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_css.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_css.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_css.html" %}
|
||||
{{form.media}}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<h3>Add Commission Percentage</h3>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-dark mb-2 me-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
|
||||
<form method="POST" novalidate>
|
||||
{% csrf_token %}
|
||||
{% include 'includes/dynamic_template_form.html' with form=form %}
|
||||
<div class="mt-4 mb-0">
|
||||
<div class="d-grid"><button class="btn btn-primary btn-block" type="submit">Submit</button></div>
|
||||
</div>
|
||||
{% comment %} <div class="mb-3">
|
||||
<label for="title" class="form-label">Title</label>
|
||||
<input type="text" class="form-control" id="title" aria-describedby="title">
|
||||
<div id="emailHelp" class="form-text" style="color: grey;">We'll never share your email with anyone else.</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description</label>
|
||||
<div id="description"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="product-images">Image</label>
|
||||
<div class="multiple-file-upload">
|
||||
<div class="filepond--root filepond file-upload-multiple filepond--hopper" id="images" data-style-button-remove-item-position="left" data-style-button-process-item-position="right" data-style-load-indicator-position="right" data-style-progress-indicator-position="right" data-style-button-remove-item-align="false" style="height: 57px;"><input class="filepond--browser" type="file" id="filepond--browser-feeq8o6dj" name="filepond" aria-controls="filepond--assistant-feeq8o6dj" aria-labelledby="filepond--drop-label-feeq8o6dj" multiple=""><a class="filepond--credits" aria-hidden="true" href="https://pqina.nl/" target="_blank" rel="noopener noreferrer" style="transform: translateY(49px);">Powered by PQINA</a><div class="filepond--drop-label" style="transform: translate3d(0px, 0px, 0px); opacity: 1;"><label for="filepond--browser-feeq8o6dj" id="filepond--drop-label-feeq8o6dj" aria-hidden="true">Drag & Drop your files or <span class="filepond--label-action" tabindex="0">Browse</span></label></div><div class="filepond--list-scroller" style="transform: translate3d(0px, 41px, 0px);"><ul class="filepond--list" role="list"></ul></div><div class="filepond--panel filepond--panel-root" data-scalable="true"><div class="filepond--panel-top filepond--panel-root"></div><div class="filepond--panel-center filepond--panel-root" style="transform: translate3d(0px, 8px, 0px) scale3d(1, 0.41, 1);"></div><div class="filepond--panel-bottom filepond--panel-root" style="transform: translate3d(0px, 49px, 0px);"></div></div><span class="filepond--assistant" id="filepond--assistant-feeq8o6dj" role="status" aria-live="polite" aria-relevant="additions"></span><div class="filepond--drip"></div><fieldset class="filepond--data"></fieldset></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="tags">Tags</label>
|
||||
<input id="tags" class="tags" value="">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button> {% endcomment %}
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_js.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_js.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_js.html" %}
|
||||
|
||||
|
||||
<script>
|
||||
/**
|
||||
* ===================================
|
||||
* Blog Description Editor
|
||||
* ===================================
|
||||
*/
|
||||
var quill = new Quill('#description', {
|
||||
modules: {
|
||||
toolbar: [
|
||||
[{ header: [1, 2, false] }],
|
||||
['bold', 'italic', 'underline'],
|
||||
['image', 'code-block']
|
||||
]
|
||||
},
|
||||
placeholder: 'Write description...',
|
||||
theme: 'snow' // or 'bubble'
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* ====================
|
||||
* File Pond
|
||||
* ====================
|
||||
*/
|
||||
|
||||
// We want to preview images, so we register
|
||||
// the Image Preview plugin, We also register
|
||||
// exif orientation (to correct mobile image
|
||||
// orientation) and size validation, to prevent
|
||||
// large files from being added
|
||||
FilePond.registerPlugin(
|
||||
FilePondPluginImagePreview,
|
||||
FilePondPluginImageExifOrientation,
|
||||
FilePondPluginFileValidateSize,
|
||||
// FilePondPluginImageEdit
|
||||
);
|
||||
|
||||
// Select the file input and use
|
||||
// create() to turn it into a pond
|
||||
var ecommerce = FilePond.create(document.querySelector('.file-upload-multiple'));
|
||||
|
||||
|
||||
/**
|
||||
* =====================
|
||||
* Blog Tags
|
||||
* =====================
|
||||
*/
|
||||
// The DOM element you wish to replace with Tagify
|
||||
var input = document.querySelector('#id_tags');
|
||||
|
||||
// initialize Tagify on the above input node reference
|
||||
new Tagify(input,{
|
||||
originalInputValueFormat: valuesArr => valuesArr.map(item => item.value).join(', ')
|
||||
})
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,144 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_css.html" %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3>Manage Games</h3>
|
||||
</div>
|
||||
<div class="col-sm-6 text-md-end">
|
||||
<!--
|
||||
<button class="btn btn-dark mb-2 me-md-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
{% comment %} <a class="btn btn-primary mb-2 me-md-4" href="{% url 'manage_games:game_commission_add' %}">Example form</a> {% endcomment %}
|
||||
{% comment %} <a class="btn btn-primary mb-2" href="{% url 'manage_games:game_commission_add' %}">Add Commission</a> {% endcomment %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
<div id="style-3_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
<div class="table-responsive">
|
||||
<table id="style-3" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column text-center sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" rowspan="1" colspan="1" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1"
|
||||
style="width: 44.2344px;">Game</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Title</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Player</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Team Rank</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Team Score</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Active</th>
|
||||
{% comment %}<th class="text-center dt-no-sorting" tabindex="0"
|
||||
aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 51.625px;">Action</th>{% endcomment %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in teams_obj %}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{ data_obj.id }} </td>
|
||||
|
||||
<td>{{ data_obj.game.id }}</td>
|
||||
<td>{{ data_obj.title }}</td>
|
||||
<td>{{ data_obj.principal }}</td>
|
||||
<td>{{ data_obj.team_rank }}</td>
|
||||
<td>{{ data_obj.team_score }}</td>
|
||||
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.is_active %}badge-primary{% else %}badge-danger{% endif %}">
|
||||
{{ data_obj.is_active }}
|
||||
</span>
|
||||
</td>
|
||||
{% comment %}<td class="text-center">
|
||||
<ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:game_commission_edit' data_obj.id%}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="javascript:void(0);" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul>
|
||||
</td>{% endcomment %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required js cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_js.html" %}
|
||||
|
||||
<script>
|
||||
c3 = $('#style-3').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
||||
"oLanguage": {
|
||||
"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
|
||||
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [5, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
multiCheck(c3);
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,132 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_css.html" %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3>Manage Games</h3>
|
||||
</div>
|
||||
<div class="col-sm-6 text-md-end">
|
||||
<!--
|
||||
<button class="btn btn-dark mb-2 me-md-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
{% comment %} <a class="btn btn-primary mb-2 me-md-4" href="{% url 'manage_games:game_entryfee_add' %}">Example form</a> {% endcomment %}
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_games:game_entryfee_add' %}">Add Entry Fee</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
<div id="style-3_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
<div class="table-responsive">
|
||||
<table id="style-3" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column text-center sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" rowspan="1" colspan="1" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1"
|
||||
style="width: 44.2344px;">Game Enrty Fee</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Active</th>
|
||||
<th class="text-center dt-no-sorting" tabindex="0"
|
||||
aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 51.625px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in data_obj %}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{ data_obj.id }} </td>
|
||||
|
||||
<td>{{ data_obj.entry_fee }}</td>
|
||||
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.is_active %}badge-primary{% else %}badge-danger{% endif %}">
|
||||
{{ data_obj.is_active }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:game_entryfee_edit' data_obj.id%}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="javascript:void(0);" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required js cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_js.html" %}
|
||||
|
||||
<script>
|
||||
c3 = $('#style-3').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
||||
"oLanguage": {
|
||||
"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
|
||||
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [5, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
multiCheck(c3);
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,393 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_css.html" %}
|
||||
{% include "cdn_through_html/tabs_cdn_css.html" %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<h3>Manage News & Article</h3>
|
||||
</div>
|
||||
<!-- <div class="col text-end">
|
||||
{% comment %} <button class="btn btn-dark mb-2 me-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button> {% endcomment %}
|
||||
<a class="btn btn-success mb-2 me-4" href="{% url 'manage_cms:news_article_category_add' %}">Add Category</a>
|
||||
<a class="btn btn-primary mb-2 me-4" href="{% url 'manage_cms:news_article_add' %}">Add New</a>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="tabsSimple" class="col-xl-12 col-12 layout-spacing">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
<div class="simple-pill">
|
||||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-previous-games-tab" data-bs-toggle="pill" data-bs-target="#pills-previous-games" type="button" role="tab" aria-controls="pills-previous-games" aria-selected="false">Previous Games</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="pills-live-games-tab" data-bs-toggle="pill" data-bs-target="#pills-live-games" type="button" role="tab" aria-controls="pills-live-games" aria-selected="true">Live Games</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-upcoming-games-tab" data-bs-toggle="pill" data-bs-target="#pills-upcoming-games" type="button" role="tab" aria-controls="pills-upcoming-games" aria-selected="true">Upcoming Games</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane fade" id="pills-previous-games" role="tabpanel" aria-labelledby="pills-previous-games-tab" tabindex="0">
|
||||
<div id="previous-games_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="previous-games" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Index</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Game Type</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Title</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Description</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Entry Fee</th>
|
||||
<th class="sorting" tabindex="3" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Commission</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Winner Type</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Link</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Participate</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Live</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Open Game</th>
|
||||
<th class="sorting" tabindex="7" aria-controls="style-3"
|
||||
style="width: 79.7969px;">Active</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 100.625px;">Action</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 100.625px;">Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in game_obj%}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{data_obj.id}}</td>
|
||||
<td>{{data_obj.game_index}}</td>
|
||||
<td>{{data_obj.get_game_type_display}}</td>
|
||||
<td>{{data_obj.title}}</td>
|
||||
<td>{{data_obj.description}}</td>
|
||||
<td>{{data_obj.entry_fee}}</td>
|
||||
<td>{{data_obj.commission_percentage}}</td>
|
||||
<td>{{data_obj.get_winner_type_display}}</td>
|
||||
<td>{{data_obj.link}}</td>
|
||||
<td>{{data_obj.participate_date}}</td>
|
||||
<td>{{data_obj.live_date}}</td>
|
||||
<td>{{data_obj.open_pool}}</td>
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.active}}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<!-- <ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:player_game_edit' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul> -->
|
||||
<ul class="table-controls">
|
||||
<li>
|
||||
<a href="{% url 'manage_games:game_team_list_view' data_obj.id %}">
|
||||
<span class="material-symbols-outlined">
|
||||
visibility
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'manage_games:game_detail' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade active show" id="pills-live-games" role="tabpanel" aria-labelledby="pills-live-games-tab" tabindex="0">
|
||||
<div id="live-games_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
<div class="table-responsive">
|
||||
<table id="live-games" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Index</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Game Type</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Title</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Description</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Entry Fee</th>
|
||||
<th class="sorting" tabindex="3" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Commission</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Winner Type</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Link</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Participate</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Live</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Open Game</th>
|
||||
<th class="sorting" tabindex="7" aria-controls="style-3"
|
||||
style="width: 79.7969px;">Active</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 100.625px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in live_games %}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{data_obj.id}}</td>
|
||||
<td>{{data_obj.game_index}}</td>
|
||||
<td>{{data_obj.get_game_type_display}}</td>
|
||||
<td>{{data_obj.title}}</td>
|
||||
<td>{{data_obj.description}}</td>
|
||||
<td>{{data_obj.entry_fee}}</td>
|
||||
<td>{{data_obj.commission_percentage}}</td>
|
||||
<td>{{data_obj.get_winner_type_display}}</td>
|
||||
<td>{{data_obj.link}}</td>
|
||||
<td>{{data_obj.participate_date}}</td>
|
||||
<td>{{data_obj.live_date}}</td>
|
||||
<td>{{data_obj.open_pool}}</td>
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.active}}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<!-- <ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:player_game_edit' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul> -->
|
||||
<ul class="table-controls">
|
||||
<li>
|
||||
<a href="{% url 'manage_games:game_team_list_view' data_obj.id %}">
|
||||
<span class="material-symbols-outlined">
|
||||
visibility
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="pills-upcoming-games" role="tabpanel" aria-labelledby="pills-upcoming-games-tab" tabindex="0">
|
||||
<div id="upcoming-games_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="upcoming-games" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Index</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Game Type</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Title</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Description</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Entry Fee</th>
|
||||
<th class="sorting" tabindex="3" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Commission</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Winner Type</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Link</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Participate</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Live</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Open Game</th>
|
||||
<th class="sorting" tabindex="7" aria-controls="style-3"
|
||||
style="width: 79.7969px;">Active</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 100.625px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in upcoming_games %}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{data_obj.id}}</td>
|
||||
<td>{{data_obj.game_index}}</td>
|
||||
<td>{{data_obj.get_game_type_display}}</td>
|
||||
<td>{{data_obj.title}}</td>
|
||||
<td>{{data_obj.description}}</td>
|
||||
<td>{{data_obj.entry_fee}}</td>
|
||||
<td>{{data_obj.commission_percentage}}</td>
|
||||
<td>{{data_obj.get_winner_type_display}}</td>
|
||||
<td>{{data_obj.link}}</td>
|
||||
<td>{{data_obj.participate_date}}</td>
|
||||
<td>{{data_obj.live_date}}</td>
|
||||
<td>{{data_obj.open_pool}}</td>
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.active}}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<!-- <ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:player_game_edit' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul> -->
|
||||
<ul class="table-controls">
|
||||
<li>
|
||||
<a href="{% url 'manage_games:game_team_list_view' data_obj.id %}">
|
||||
<span class="material-symbols-outlined">
|
||||
visibility
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required js cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_js.html" %}
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,143 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_css.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_css.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_css.html" %}
|
||||
{% include "cdn_through_html/flatpicker_cdn_css.html" %}
|
||||
{{form.media}}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<h3>Add Game Entry Fee</h3>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-dark mb-2 me-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
|
||||
<form method="POST" novalidate>
|
||||
{% csrf_token %}
|
||||
{% include 'includes/dynamic_template_form.html' with form=form %}
|
||||
<div class="mt-4 mb-0">
|
||||
<div class="d-grid"><button class="btn btn-primary btn-block" type="submit">Submit</button></div>
|
||||
</div>
|
||||
{% comment %} <div class="mb-3">
|
||||
<label for="title" class="form-label">Title</label>
|
||||
<input type="text" class="form-control" id="title" aria-describedby="title">
|
||||
<div id="emailHelp" class="form-text" style="color: grey;">We'll never share your email with anyone else.</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description</label>
|
||||
<div id="description"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="product-images">Image</label>
|
||||
<div class="multiple-file-upload">
|
||||
<div class="filepond--root filepond file-upload-multiple filepond--hopper" id="images" data-style-button-remove-item-position="left" data-style-button-process-item-position="right" data-style-load-indicator-position="right" data-style-progress-indicator-position="right" data-style-button-remove-item-align="false" style="height: 57px;"><input class="filepond--browser" type="file" id="filepond--browser-feeq8o6dj" name="filepond" aria-controls="filepond--assistant-feeq8o6dj" aria-labelledby="filepond--drop-label-feeq8o6dj" multiple=""><a class="filepond--credits" aria-hidden="true" href="https://pqina.nl/" target="_blank" rel="noopener noreferrer" style="transform: translateY(49px);">Powered by PQINA</a><div class="filepond--drop-label" style="transform: translate3d(0px, 0px, 0px); opacity: 1;"><label for="filepond--browser-feeq8o6dj" id="filepond--drop-label-feeq8o6dj" aria-hidden="true">Drag & Drop your files or <span class="filepond--label-action" tabindex="0">Browse</span></label></div><div class="filepond--list-scroller" style="transform: translate3d(0px, 41px, 0px);"><ul class="filepond--list" role="list"></ul></div><div class="filepond--panel filepond--panel-root" data-scalable="true"><div class="filepond--panel-top filepond--panel-root"></div><div class="filepond--panel-center filepond--panel-root" style="transform: translate3d(0px, 8px, 0px) scale3d(1, 0.41, 1);"></div><div class="filepond--panel-bottom filepond--panel-root" style="transform: translate3d(0px, 49px, 0px);"></div></div><span class="filepond--assistant" id="filepond--assistant-feeq8o6dj" role="status" aria-live="polite" aria-relevant="additions"></span><div class="filepond--drip"></div><fieldset class="filepond--data"></fieldset></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="tags">Tags</label>
|
||||
<input id="tags" class="tags" value="">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button> {% endcomment %}
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_js.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_js.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_js.html" %}
|
||||
{% include "cdn_through_html/flatpicker_cdn_js.html" %}
|
||||
|
||||
|
||||
<script>
|
||||
/**
|
||||
* ===================================
|
||||
* Blog Description Editor
|
||||
* ===================================
|
||||
*/
|
||||
var quill = new Quill('#description', {
|
||||
modules: {
|
||||
toolbar: [
|
||||
[{ header: [1, 2, false] }],
|
||||
['bold', 'italic', 'underline'],
|
||||
['image', 'code-block']
|
||||
]
|
||||
},
|
||||
placeholder: 'Write description...',
|
||||
theme: 'snow' // or 'bubble'
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* ====================
|
||||
* File Pond
|
||||
* ====================
|
||||
*/
|
||||
|
||||
// We want to preview images, so we register
|
||||
// the Image Preview plugin, We also register
|
||||
// exif orientation (to correct mobile image
|
||||
// orientation) and size validation, to prevent
|
||||
// large files from being added
|
||||
FilePond.registerPlugin(
|
||||
FilePondPluginImagePreview,
|
||||
FilePondPluginImageExifOrientation,
|
||||
FilePondPluginFileValidateSize,
|
||||
// FilePondPluginImageEdit
|
||||
);
|
||||
|
||||
// Select the file input and use
|
||||
// create() to turn it into a pond
|
||||
var ecommerce = FilePond.create(document.querySelector('.file-upload-multiple'));
|
||||
|
||||
|
||||
/**
|
||||
* =====================
|
||||
* Blog Tags
|
||||
* =====================
|
||||
*/
|
||||
// The DOM element you wish to replace with Tagify
|
||||
var input = document.querySelector('#id_tags');
|
||||
|
||||
// initialize Tagify on the above input node reference
|
||||
new Tagify(input,{
|
||||
originalInputValueFormat: valuesArr => valuesArr.map(item => item.value).join(', ')
|
||||
})
|
||||
|
||||
$("#id_upcoming_date ,#id_participate_date , #id_live_date_time").flatpickr({
|
||||
enableTime: true,
|
||||
dateFormat: "Y-m-dTH:i",
|
||||
allowInput: true
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,153 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_css.html" %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3>{{teams_obj.0.game.title}}</h3>
|
||||
</div>
|
||||
<div class="col-sm-6 text-md-end">
|
||||
<!--
|
||||
<button class="btn btn-dark mb-2 me-md-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
{% comment %} <a class="btn btn-primary mb-2 me-md-4" href="{% url 'manage_games:game_commission_add' %}">Example form</a> {% endcomment %}
|
||||
{% comment %} <a class="btn btn-primary mb-2" href="{% url 'manage_games:game_commission_add' %}">Add Commission</a> {% endcomment %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
<div id="style-3_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
<div class="table-responsive">
|
||||
<table id="style-3" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column text-center sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" rowspan="1" colspan="1" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1"
|
||||
style="width: 44.2344px;">Game</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Title</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Player</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Team Rank</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Team Score</th>
|
||||
<th class="text-center sorting" tabindex="0" aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 98.875px;">Active</th>
|
||||
<th class="text-center dt-no-sorting" tabindex="0"
|
||||
aria-controls="style-3" rowspan="1" colspan="1"
|
||||
style="width: 51.625px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in teams_obj %}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{ data_obj.id }} </td>
|
||||
|
||||
<td>{{ data_obj.game.id }}</td>
|
||||
<td>{{ data_obj.title }}</td>
|
||||
<td>{{ data_obj.principal }}</td>
|
||||
<td>{{ data_obj.team_rank }}</td>
|
||||
<td>{{ data_obj.team_score }}</td>
|
||||
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">
|
||||
{{ data_obj.active }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<!-- <ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:game_commission_edit' data_obj.id%}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="javascript:void(0);" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul> -->
|
||||
<ul class="table-controls">
|
||||
<li>
|
||||
<a href="{% url 'manage_stock:team_stock_list' data_obj.id %}">
|
||||
<span class="material-symbols-outlined">
|
||||
visibility
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required js cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_js.html" %}
|
||||
|
||||
<script>
|
||||
c3 = $('#style-3').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
||||
"oLanguage": {
|
||||
"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
|
||||
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [5, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
multiCheck(c3);
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,135 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_css.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_css.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_css.html" %}
|
||||
{{form.media}}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<h3>Add Game</h3>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-dark mb-2 me-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
|
||||
<form method="POST" novalidate>
|
||||
{% csrf_token %}
|
||||
{% include 'includes/dynamic_template_form.html' with form=form %}
|
||||
<div class="mt-4 mb-0">
|
||||
<div class="d-grid"><button class="btn btn-primary btn-block" type="submit">Submit</button></div>
|
||||
</div>
|
||||
{% comment %} <div class="mb-3">
|
||||
<label for="title" class="form-label">Title</label>
|
||||
<input type="text" class="form-control" id="title" aria-describedby="title">
|
||||
<div id="emailHelp" class="form-text" style="color: grey;">We'll never share your email with anyone else.</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description</label>
|
||||
<div id="description"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="product-images">Image</label>
|
||||
<div class="multiple-file-upload">
|
||||
<div class="filepond--root filepond file-upload-multiple filepond--hopper" id="images" data-style-button-remove-item-position="left" data-style-button-process-item-position="right" data-style-load-indicator-position="right" data-style-progress-indicator-position="right" data-style-button-remove-item-align="false" style="height: 57px;"><input class="filepond--browser" type="file" id="filepond--browser-feeq8o6dj" name="filepond" aria-controls="filepond--assistant-feeq8o6dj" aria-labelledby="filepond--drop-label-feeq8o6dj" multiple=""><a class="filepond--credits" aria-hidden="true" href="https://pqina.nl/" target="_blank" rel="noopener noreferrer" style="transform: translateY(49px);">Powered by PQINA</a><div class="filepond--drop-label" style="transform: translate3d(0px, 0px, 0px); opacity: 1;"><label for="filepond--browser-feeq8o6dj" id="filepond--drop-label-feeq8o6dj" aria-hidden="true">Drag & Drop your files or <span class="filepond--label-action" tabindex="0">Browse</span></label></div><div class="filepond--list-scroller" style="transform: translate3d(0px, 41px, 0px);"><ul class="filepond--list" role="list"></ul></div><div class="filepond--panel filepond--panel-root" data-scalable="true"><div class="filepond--panel-top filepond--panel-root"></div><div class="filepond--panel-center filepond--panel-root" style="transform: translate3d(0px, 8px, 0px) scale3d(1, 0.41, 1);"></div><div class="filepond--panel-bottom filepond--panel-root" style="transform: translate3d(0px, 49px, 0px);"></div></div><span class="filepond--assistant" id="filepond--assistant-feeq8o6dj" role="status" aria-live="polite" aria-relevant="additions"></span><div class="filepond--drip"></div><fieldset class="filepond--data"></fieldset></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="tags">Tags</label>
|
||||
<input id="tags" class="tags" value="">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button> {% endcomment %}
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_js.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_js.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_js.html" %}
|
||||
|
||||
|
||||
<script>
|
||||
/**
|
||||
* ===================================
|
||||
* Blog Description Editor
|
||||
* ===================================
|
||||
*/
|
||||
var quill = new Quill('#description', {
|
||||
modules: {
|
||||
toolbar: [
|
||||
[{ header: [1, 2, false] }],
|
||||
['bold', 'italic', 'underline'],
|
||||
['image', 'code-block']
|
||||
]
|
||||
},
|
||||
placeholder: 'Write description...',
|
||||
theme: 'snow' // or 'bubble'
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* ====================
|
||||
* File Pond
|
||||
* ====================
|
||||
*/
|
||||
|
||||
// We want to preview images, so we register
|
||||
// the Image Preview plugin, We also register
|
||||
// exif orientation (to correct mobile image
|
||||
// orientation) and size validation, to prevent
|
||||
// large files from being added
|
||||
FilePond.registerPlugin(
|
||||
FilePondPluginImagePreview,
|
||||
FilePondPluginImageExifOrientation,
|
||||
FilePondPluginFileValidateSize,
|
||||
// FilePondPluginImageEdit
|
||||
);
|
||||
|
||||
// Select the file input and use
|
||||
// create() to turn it into a pond
|
||||
var ecommerce = FilePond.create(document.querySelector('.file-upload-multiple'));
|
||||
|
||||
|
||||
/**
|
||||
* =====================
|
||||
* Blog Tags
|
||||
* =====================
|
||||
*/
|
||||
// The DOM element you wish to replace with Tagify
|
||||
var input = document.querySelector('#id_tags');
|
||||
|
||||
// initialize Tagify on the above input node reference
|
||||
new Tagify(input,{
|
||||
originalInputValueFormat: valuesArr => valuesArr.map(item => item.value).join(', ')
|
||||
})
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,221 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_css.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_css.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_css.html" %}
|
||||
{% include "cdn_through_html/flatpicker_cdn_css.html" %}
|
||||
{{form.media}}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<h3>{{operation}} {{page_title}}</h3>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-dark mb-2 me-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{% include 'includes/dynamic_template_form.html' with form=form %}
|
||||
<fieldset id="contestPrizes">
|
||||
<legend>Contest Prizes</legend>
|
||||
<div id="formset">
|
||||
{% if contest_prize %}
|
||||
{% for prize_form in contest_prize %}
|
||||
<div class="formset-row row g-3 mb-2">
|
||||
<div class="col">
|
||||
<input type="text" name="prize" class="form-control" placeholder="Prize" aria-label="Prize" value="{% if prize_form.prize %}{{ prize_form.prize }}{% endif %}">
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="number" name="min_downloads" class="form-control" placeholder="Min Downloads" aria-label="Min Downloads" value="{% if prize_form.min_downloads %}{{ prize_form.min_downloads }}{% endif %}">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="delete-row btn btn-danger">-</button>
|
||||
<button type="button" class="add-row btn btn-primary">+</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="formset-row row g-3 mb-2">
|
||||
<div class="col">
|
||||
<input type="text" name="prize" class="form-control" placeholder="Prize" aria-label="Prize">
|
||||
</div>
|
||||
<div class="col">
|
||||
<input type="number" name="min_downloads" class="form-control" placeholder="Min Downloads" aria-label="Min Downloads">
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button type="button" class="delete-row btn btn-danger">-</button>
|
||||
<button type="button" class="add-row btn btn-primary">+</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<div class="mt-4 mb-0">
|
||||
<div class="d-grid"><button class="btn btn-primary btn-block" type="submit">Submit</button></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_js.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_js.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_js.html" %}
|
||||
{% include "cdn_through_html/flatpicker_cdn_js.html" %}
|
||||
|
||||
|
||||
<script>
|
||||
/**
|
||||
* ===================================
|
||||
* Description Editor
|
||||
* ===================================
|
||||
*/
|
||||
var quill = new Quill('#description', {
|
||||
modules: {
|
||||
toolbar: [
|
||||
[{ header: [1, 2, false] }],
|
||||
['bold', 'italic', 'underline'],
|
||||
['image', 'code-block']
|
||||
]
|
||||
},
|
||||
placeholder: 'Write description...',
|
||||
theme: 'snow' // or 'bubble'
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* ====================
|
||||
* File Pond
|
||||
* ====================
|
||||
*/
|
||||
|
||||
|
||||
FilePond.registerPlugin(
|
||||
FilePondPluginImagePreview,
|
||||
FilePondPluginImageExifOrientation,
|
||||
FilePondPluginFileValidateSize,
|
||||
// FilePondPluginImageEdit
|
||||
);
|
||||
|
||||
// Select the file input and use
|
||||
// create() to turn it into a Pond
|
||||
const existingImageUrl = "{{ form.image.value.url}}"
|
||||
const inputElement = document.getElementById('id_image');
|
||||
const pond = FilePond.create(inputElement, {
|
||||
storeAsFile: true,
|
||||
dropOnPage: true
|
||||
});
|
||||
if (existingImageUrl){
|
||||
pond.addFile(existingImageUrl)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).on('click', '.add-row', function() {
|
||||
var formCount = $('.formset-row').length; // Count existing rows
|
||||
var newForm = $('.formset-row:first').clone(); // Clone the first row
|
||||
newForm.find('input').val(''); // Clear input values in the cloned row
|
||||
$('#formset').append(newForm); // Append the new form to the formset container
|
||||
});
|
||||
|
||||
$(document).on('click', '.delete-row', function() {
|
||||
var formCount = $('.formset-row').length; // Count existing rows
|
||||
if (formCount > 1) {
|
||||
$(this).closest('.formset-row').remove(); // Remove the row
|
||||
} else {
|
||||
alert("At least one prize is required");
|
||||
}
|
||||
});
|
||||
|
||||
const startDatePicker = flatpickr("#id_start_date", {
|
||||
enableTime: true,
|
||||
dateFormat: "Y-m-dTH:i",
|
||||
allowInput: true
|
||||
});
|
||||
|
||||
const endDatePicker = flatpickr("#id_end_date", {
|
||||
enableTime: true,
|
||||
dateFormat: "Y-m-dTH:i",
|
||||
allowInput: true
|
||||
});
|
||||
|
||||
function setContestDates(contestType) {
|
||||
startDatePicker.set('minDate', null);
|
||||
startDatePicker.clear();
|
||||
endDatePicker.clear();
|
||||
|
||||
// Listen for change event on the start date input
|
||||
document.getElementById('id_start_date').addEventListener("change", function() {
|
||||
const selectedDate = startDatePicker.selectedDates[0];
|
||||
const newDate = new Date(selectedDate);
|
||||
|
||||
// Add 7 days to the selected date for weekly contest
|
||||
if (contestType === 'weekly') {
|
||||
newDate.setDate(newDate.getDate() + 7);
|
||||
}
|
||||
// Add 30 days to the selected date for monthly contest
|
||||
else if (contestType === 'monthly') {
|
||||
newDate.setDate(newDate.getDate() + 30);
|
||||
}
|
||||
|
||||
// Set the new date in the end date input
|
||||
endDatePicker.setDate(newDate);
|
||||
|
||||
// Disable the end date input after setting the date
|
||||
endDatePicker._input.readOnly = true;
|
||||
});
|
||||
}
|
||||
|
||||
// Listen for change event on the contest type select input
|
||||
$('#id_contest_type').on('change', function() {
|
||||
const selectedType = $(this).val();
|
||||
startDatePicker.clear();
|
||||
endDatePicker.clear();
|
||||
|
||||
// Enable the end date input when changing the contest type
|
||||
endDatePicker._input.readOnly = false;
|
||||
|
||||
// Call the function to set contest dates
|
||||
setContestDates(selectedType);
|
||||
});
|
||||
|
||||
// Call the function to set contest dates initially
|
||||
setContestDates($('#id_contest_type').val());
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -1,309 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/datatable_cdn_css.html" %}
|
||||
{% include "cdn_through_html/animate_cdn_css.html" %}
|
||||
{% include "cdn_through_html/modal_cdn_css.html" %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<h3>Merchant Contest</h3>
|
||||
</div>
|
||||
<div class="col text-end">
|
||||
{% comment %} <button class="btn btn-dark mb-2 me-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button> {% endcomment %}
|
||||
<a class="btn btn-primary mb-2 me-4" href="{%url 'manage_games:merchant_contest_add' %}">Add Contest</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div id="tabsSimple" class="col-xl-12 col-12 layout-spacing">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
<div id="table1_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
<div class="table-responsive">
|
||||
<table id="table1" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Title</th>
|
||||
<th tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Description</th>
|
||||
<th tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Contest Type</th>
|
||||
<th tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Prize</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Published Date</th>
|
||||
<th class="sorting" tabindex="3" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Start Date</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">End Date</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Status</th>
|
||||
<th class="sorting" tabindex="7" aria-controls="style-3"
|
||||
style="width: 79.7969px;">Active</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 51.625px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in contest_obj%}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{data_obj.id}}</td>
|
||||
<td>{{data_obj.title}}</td>
|
||||
d <td class="text-center">
|
||||
<button type="button" class="btn btn-info mb-2 me-4" data-bs-toggle="modal" data-bs-target="#tabsModaldescription" onclick="descriptionModal('{{ data_obj.description }}')">
|
||||
View
|
||||
</button>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-info mb-2 me-4" data-bs-toggle="modal" data-bs-target="#tabsModalprize" onclick="fetchAndDisplayPrizes('{{ data_obj.id }}')">
|
||||
View
|
||||
</button>
|
||||
</td>
|
||||
<td>{{data_obj.published_at}}</td>
|
||||
<td>{{data_obj.start_date}}</td>
|
||||
<td>{{data_obj.end_date}}</td>
|
||||
<td>{{data_obj.status}}</td>
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.active}}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<ul class="table-controls">
|
||||
<li>
|
||||
<a href="{%url 'manage_games:merchant_contest_edit' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- modal for View Prize -->
|
||||
<div class="modal fade" id="prizemodal" tabindex="-1" role="dialog" aria-labelledby="prizeModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="prizeModalLabel">Prize</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="card mb-2">
|
||||
<div class="card-body">
|
||||
<p class="mb-0" id=""></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-dark" data-bs-dismiss="modal">Discard</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="descriptionmodal" tabindex="-1" role="dialog" aria-labelledby="descriptionModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content" >
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="descriptionModalLabel">Description</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close">
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="card mb-2">
|
||||
<div class="card-body">
|
||||
<p class="mb-0" id="description"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-dark" data-bs-dismiss="modal">Discard</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
|
||||
<!-- include required css cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_js.html" %}
|
||||
|
||||
<script>
|
||||
var contestTable = $('#table1').DataTable({
|
||||
processing : true,
|
||||
serverSide : true,
|
||||
ajax: {
|
||||
url: "{% url 'manage_games:merchant_contest_list' %}",
|
||||
type: "GET",
|
||||
},
|
||||
columns: [
|
||||
{data: "id"},
|
||||
{data: "title"},
|
||||
{
|
||||
data: "description",
|
||||
render: function(data) {
|
||||
var button = '<button type="button" class="btn btn-info mb-2 me-4" data-bs-toggle="modal" data-bs-target="#tabsModalprize" onclick="showDescription(this)">View</button>';
|
||||
return button;
|
||||
}
|
||||
},
|
||||
{data: "contest_type"},
|
||||
{
|
||||
data: "prize",
|
||||
render: function(data, type, row) {
|
||||
var button = '<button type="button" class="btn btn-info mb-2 me-4" data-bs-toggle="modal" data-bs-target="#tabsModalprize" onclick="showPrizeModal(this)">View</button>';
|
||||
return button;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "published_at"
|
||||
},
|
||||
{data: "start_date"},
|
||||
{data: "end_date"},
|
||||
{data: "status"},
|
||||
{
|
||||
data: "active",
|
||||
render: function(data, type, row){
|
||||
var badgeClass = (row.active) ? 'badge-primary' : 'badge-danger';
|
||||
var span = `<span class="shadow-none badge ${badgeClass}">${data}</span>`;
|
||||
return span;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: null,
|
||||
render: function (data, type, row) {
|
||||
var editURL = "{% url 'manage_games:merchant_contest_edit' 0 %}".replace('0', row.id);
|
||||
return `<ul class="table-controls">
|
||||
<li><a href="${editURL}" class="bs-tooltip" data-bs-toggle="tooltip" data-bs-placement="top" title="" data-original-title="Edit" data-bs-original-title="Edit" aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2 p-1 br-8 mb-1"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg></a></li>
|
||||
<li><a href="" class="bs-tooltip" data-bs-toggle="tooltip" data-bs-placement="top" title="" data-original-title="Delete" data-bs-original-title="Delete" aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash p-1 br-8 mb-1"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path></svg></a></li>
|
||||
</ul>`;
|
||||
}
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
targets: [0,1,4,5,6,7,8],
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
},
|
||||
{
|
||||
targets: [2,3],
|
||||
searchable: true,
|
||||
orderable: false,
|
||||
},
|
||||
],
|
||||
dom: "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
||||
oLanguage: {
|
||||
oPaginate: { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
|
||||
sInfo: "Showing page _PAGE_ of _PAGES_",
|
||||
sSearch: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
sSearchPlaceholder: "Search...",
|
||||
sLengthMenu: "Results : _MENU_",
|
||||
},
|
||||
stripeClasses: [],
|
||||
lengthMenu: [5, 10, 20, 50],
|
||||
pageLength: 10
|
||||
});
|
||||
|
||||
// Function to display prize modal
|
||||
function showPrizeModal(button){
|
||||
// Get the corresponding row data using DataTables API
|
||||
var rowData = contestTable.row($(button).closest('tr')).data();
|
||||
|
||||
// Access the prize data from the row data
|
||||
var prizeDetails = rowData.prize;
|
||||
|
||||
// Show modal with prize data
|
||||
let modalBody = $('#prizemodal').find('.modal-body .card-body');
|
||||
modalBody.empty();
|
||||
|
||||
if (prizeDetails.length > 0) {
|
||||
let table = $('<table class="table"></table>');
|
||||
let tableHeader = $('<thead><tr><th>Prize</th><th>Min-Downloads</th></tr></thead>');
|
||||
let tableBody = $('<tbody></tbody>');
|
||||
|
||||
prizeDetails.forEach(function(prize) {
|
||||
let row = $('<tr></tr>');
|
||||
row.append('<td>' + prize.prize + '</td>');
|
||||
row.append('<td>' + prize.min_downloads + '</td>');
|
||||
tableBody.append(row);
|
||||
});
|
||||
|
||||
table.append(tableHeader);
|
||||
table.append(tableBody);
|
||||
modalBody.append(table);
|
||||
}
|
||||
// Show the modal
|
||||
$('#prizemodal').modal('show');
|
||||
}
|
||||
|
||||
function showDescription(button) {
|
||||
// Get the corresponding row data using DataTables API
|
||||
var rowData = contestTable.row($(button).closest('tr')).data();
|
||||
|
||||
let modalBody = $('#prizemodal').find('.modal-body .card-body');
|
||||
modalBody.empty();
|
||||
// Set the data in the modal content
|
||||
$("#description").text(rowData.description);
|
||||
// Show the modal
|
||||
$('#descriptionmodal').modal('show');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -21,7 +21,7 @@
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_subscriptions:plan_add' %}">Add Plans</a>
|
||||
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_subscriptions:subscription_list' %}">Subscriptions</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -48,9 +48,9 @@
|
||||
style="width: 69.2656px;"> Days </th>
|
||||
<th class="sorting" tabindex="7" aria-controls="style-3"
|
||||
style="width: 79.7969px;">Active</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
<!-- <th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 100.625px;">Action</th>
|
||||
style="width: 100.625px;">Action</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -62,35 +62,7 @@
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.active}}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<ul class="table-controls">
|
||||
<li><a href="{% url 'manage_subscriptions:plan_edit' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="{% url 'manage_subscriptions:plan_delete' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
@@ -1,455 +0,0 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_css.html" %}
|
||||
{% include "cdn_through_html/tabs_cdn_css.html" %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<h3>Manage Games</h3>
|
||||
</div>
|
||||
<div class="col-sm-6 text-md-end">
|
||||
<!--
|
||||
<button class="btn btn-dark mb-2 me-md-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
{% comment %} <a class="btn btn-primary mb-2 me-md-4" href="{% url 'manage_games:game_commission_add' %}">Example form</a> {% endcomment %}
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_games:player_game_add' %}">Add Game</a>
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_games:game_entryfee_list' %}">Entry Fee</a>
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_games:game_commission_list' %}">Commission</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="tabsSimple" class="col-xl-12 col-12 layout-spacing">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
<div class="simple-pill">
|
||||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-previous-games-tab" data-bs-toggle="pill" data-bs-target="#pills-previous-games" type="button" role="tab" aria-controls="pills-previous-games" aria-selected="false">Previous Games</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="pills-live-games-tab" data-bs-toggle="pill" data-bs-target="#pills-live-games" type="button" role="tab" aria-controls="pills-live-games" aria-selected="true">Live Games</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="pills-upcoming-games-tab" data-bs-toggle="pill" data-bs-target="#pills-upcoming-games" type="button" role="tab" aria-controls="pills-upcoming-games" aria-selected="true">Upcoming Games</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane fade" id="pills-previous-games" role="tabpanel" aria-labelledby="pills-previous-games-tab" tabindex="0">
|
||||
<div id="previous-games_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="previous-games" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Index</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Game Type</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Title</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Description</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Entry Fee</th>
|
||||
<th class="sorting" tabindex="3" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Commission</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Winner Type</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Status</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Link</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Participate</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Live</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Open Game</th>
|
||||
<th class="sorting" tabindex="7" aria-controls="style-3"
|
||||
style="width: 79.7969px;">Active</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 100.625px;">Action</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 100.625px;">Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in game_obj%}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{data_obj.id}}</td>
|
||||
<td>{{data_obj.game_index}}</td>
|
||||
<td>{{data_obj.get_game_type_display}}</td>
|
||||
<td>{{data_obj.title}}</td>
|
||||
<td>{{data_obj.description}}</td>
|
||||
<td>{{data_obj.entry_fee}}</td>
|
||||
<td>{{data_obj.commission_percentage}}</td>
|
||||
<td>{{data_obj.get_winner_type_display}}</td>
|
||||
<td>{{data_obj.status}}</td>
|
||||
<td>{{data_obj.link}}</td>
|
||||
<td>{{data_obj.participate_date}}</td>
|
||||
<td>{{data_obj.live_date}}</td>
|
||||
<td>{{data_obj.open_pool}}</td>
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.active}}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<!-- <ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:player_game_edit' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul> -->
|
||||
<ul class="table-controls">
|
||||
<li>
|
||||
<a href="{% url 'manage_games:game_team_list_view' data_obj.id %}">
|
||||
<span class="material-symbols-outlined">
|
||||
visibility
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url 'manage_games:game_detail' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade active show" id="pills-live-games" role="tabpanel" aria-labelledby="pills-live-games-tab" tabindex="0">
|
||||
<div id="live-games_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
<div class="table-responsive">
|
||||
<table id="live-games" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Index</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Game Type</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Title</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Description</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Entry Fee</th>
|
||||
<th class="sorting" tabindex="3" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Commission</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Winner Type</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Status</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Link</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Participate</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Live</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Open Game</th>
|
||||
<th class="sorting" tabindex="7" aria-controls="style-3"
|
||||
style="width: 79.7969px;">Active</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 100.625px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in live_games %}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{data_obj.id}}</td>
|
||||
<td>{{data_obj.game_index}}</td>
|
||||
<td>{{data_obj.get_game_type_display}}</td>
|
||||
<td>{{data_obj.title}}</td>
|
||||
<td>{{data_obj.description}}</td>
|
||||
<td>{{data_obj.entry_fee}}</td>
|
||||
<td>{{data_obj.commission_percentage}}</td>
|
||||
<td>{{data_obj.get_winner_type_display}}</td>
|
||||
<td>{{data_obj.status}}</td>
|
||||
<td>{{data_obj.link}}</td>
|
||||
<td>{{data_obj.participate_date}}</td>
|
||||
<td>{{data_obj.live_date}}</td>
|
||||
<td>{{data_obj.open_pool}}</td>
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.active}}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<!-- <ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:player_game_edit' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul> -->
|
||||
<ul class="table-controls">
|
||||
<li>
|
||||
<a href="{% url 'manage_games:game_team_list_view' data_obj.id %}">
|
||||
<span class="material-symbols-outlined">
|
||||
visibility
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="pills-upcoming-games" role="tabpanel" aria-labelledby="pills-upcoming-games-tab" tabindex="0">
|
||||
<div id="upcoming-games_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="upcoming-games" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column sorting_asc" tabindex="0"
|
||||
aria-controls="style-3" aria-sort="ascending"
|
||||
style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Index</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Game Type</th>
|
||||
<th class="sorting" tabindex="1" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Title</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Description</th>
|
||||
<th class="sorting" tabindex="2" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Entry Fee</th>
|
||||
<th class="sorting" tabindex="3" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Commission</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Winner Type</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Status</th>
|
||||
<th class="sorting" tabindex="4" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Link</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Participate</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Live</th>
|
||||
<th class="sorting" tabindex="5" aria-controls="style-3"
|
||||
colspan="1" style="width: 44.2344px;">Open Game</th>
|
||||
<th class="sorting" tabindex="7" aria-controls="style-3"
|
||||
style="width: 79.7969px;">Active</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8"
|
||||
aria-controls="style-3"
|
||||
style="width: 100.625px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in upcoming_games %}
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{data_obj.id}}</td>
|
||||
<td>{{data_obj.game_index}}</td>
|
||||
<td>{{data_obj.get_game_type_display}}</td>
|
||||
<td>{{data_obj.title}}</td>
|
||||
<td>{{data_obj.description}}</td>
|
||||
<td>{{data_obj.entry_fee}}</td>
|
||||
<td>{{data_obj.commission_percentage}}</td>
|
||||
<td>{{data_obj.get_winner_type_display}}</td>
|
||||
<td>{{data_obj.status}}</td>
|
||||
<td>{{data_obj.link}}</td>
|
||||
<td>{{data_obj.participate_date}}</td>
|
||||
<td>{{data_obj.live_date}}</td>
|
||||
<td>{{data_obj.open_pool}}</td>
|
||||
<td class="text-center">
|
||||
<span class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.active}}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<!-- <ul class="table-controls">
|
||||
<li><a href="{% url 'manage_games:player_game_edit' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Edit" data-bs-original-title="Edit"
|
||||
aria-label="Edit"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul> -->
|
||||
<ul class="table-controls">
|
||||
<li>
|
||||
<a href="{% url 'manage_games:game_team_list_view' data_obj.id %}">
|
||||
<span class="material-symbols-outlined">
|
||||
visibility
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required js cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_js.html" %}
|
||||
|
||||
<script>
|
||||
prev = $('#previous-games').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
||||
"oLanguage": {
|
||||
"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
|
||||
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [5, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
live = $('#live-games').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
||||
"oLanguage": {
|
||||
"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
|
||||
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [5, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
upcoming = $('#upcoming-games').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
||||
"oLanguage": {
|
||||
"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
|
||||
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [5, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -12,7 +12,7 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3>Manage Subscriptions</h3>
|
||||
<h3>Principal Subscriptions</h3>
|
||||
</div>
|
||||
<div class="col-sm-6 text-md-end">
|
||||
<!--
|
||||
@@ -21,9 +21,8 @@
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_subscriptions:principal_subscription_add' %}">Add Principal Subscriptions</a>
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_subscriptions:subscription_list' %}">Subscriptions</a>
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_subscriptions:plan_list' %}">Plans</a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -74,7 +73,7 @@
|
||||
<tr role="row">
|
||||
<td class="checkbox-column text-center sorting_1"> {{data_obj.id}}</td>
|
||||
<td>{{data_obj.subscription}}</td>
|
||||
<td>{{data_obj.prinpal}}</td>
|
||||
<td>{{data_obj.principal}}</td>
|
||||
<td>{{data_obj.is_paid}}</td>
|
||||
<td>{{data_obj.status}}</td>
|
||||
<td>{{data_obj.start_date}}</td>
|
||||
@@ -97,7 +96,7 @@
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="{% url 'manage_subscriptions:principal_subscription_delete' data_obj.id %}" class="bs-tooltip"
|
||||
<!-- <li><a href="{% url 'manage_subscriptions:principal_subscription_delete' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
@@ -109,7 +108,7 @@
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</svg></a></li> -->
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_subscriptions:subscription_add' %}">Add Subscriptions</a>
|
||||
<!-- <a class="btn btn-primary mb-2" href="{% url 'manage_subscriptions:subscription_add' %}">Add Subscriptions</a> -->
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_subscriptions:plan_list' %}">Plans</a>
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_subscriptions:principal_subscriptions_list' %}">Principal Subscription</a>
|
||||
</div>
|
||||
@@ -81,19 +81,7 @@
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="{% url 'manage_subscriptions:subscription_delete' data_obj.id %}" class="bs-tooltip"
|
||||
data-bs-toggle="tooltip" data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
122
templates/manage_venues/venue_add.html
Normal file
122
templates/manage_venues/venue_add.html
Normal file
@@ -0,0 +1,122 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_css.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_css.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_css.html" %}
|
||||
{{form.media}}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row mb-2">
|
||||
<div class="col">
|
||||
<h3>{{operation}} {{page_title}}</h3>
|
||||
</div>
|
||||
|
||||
<div class="col text-end">
|
||||
<button class="btn btn-dark mb-2 me-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
|
||||
<form method="POST" enctype="multipart/form-data" novalidate>
|
||||
{% csrf_token %}
|
||||
{% include 'includes/dynamic_template_form.html' with form=form %}
|
||||
<div class="mt-4 mb-0">
|
||||
<div class="d-grid"><button class="btn btn-primary btn-block"
|
||||
type="submit">Submit</button></div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- include required css cdn link through html here -->
|
||||
|
||||
{% include "cdn_through_html/filepond_cdn_js.html" %}
|
||||
{% include "cdn_through_html/quill_cdn_js.html" %}
|
||||
{% include "cdn_through_html/tagify_cdn_js.html" %}
|
||||
|
||||
|
||||
<script>
|
||||
/**
|
||||
* ===================================
|
||||
* Blog Description Editor
|
||||
* ===================================
|
||||
*/
|
||||
var quill = new Quill('#description', {
|
||||
modules: {
|
||||
toolbar: [
|
||||
[{ header: [1, 2, false] }],
|
||||
['bold', 'italic', 'underline'],
|
||||
['image', 'code-block']
|
||||
]
|
||||
},
|
||||
placeholder: 'Write description...',
|
||||
theme: 'snow' // or 'bubble'
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* ====================
|
||||
* File Pond
|
||||
* ====================
|
||||
*/
|
||||
|
||||
// We want to preview images, so we register
|
||||
// the Image Preview plugin, We also register
|
||||
// exif orientation (to correct mobile image
|
||||
// orientation) and size validation, to prevent
|
||||
// large files from being added
|
||||
FilePond.registerPlugin(
|
||||
FilePondPluginImagePreview,
|
||||
FilePondPluginImageExifOrientation,
|
||||
FilePondPluginFileValidateSize,
|
||||
// FilePondPluginImageEdit
|
||||
);
|
||||
|
||||
// Select the file input and use
|
||||
// create() to turn it into a pond
|
||||
var ecommerce = FilePond.create(document.querySelector('.file-upload-multiple'));
|
||||
|
||||
|
||||
/**
|
||||
* =====================
|
||||
* Blog Tags
|
||||
* =====================
|
||||
*/
|
||||
// The DOM element you wish to replace with Tagify
|
||||
var input = document.querySelector('#id_tags');
|
||||
|
||||
// initialize Tagify on the above input node reference
|
||||
new Tagify(input, {
|
||||
originalInputValueFormat: valuesArr => valuesArr.map(item => item.value).join(', ')
|
||||
})
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
139
templates/manage_venues/venue_list.html
Normal file
139
templates/manage_venues/venue_list.html
Normal file
@@ -0,0 +1,139 @@
|
||||
{% extends 'layout/base_template.html' %}
|
||||
{% load static %}
|
||||
{% block stylesheet %}
|
||||
<!-- include required css cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_css.html" %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row layout-top-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h3>Manage Venues</h3>
|
||||
</div>
|
||||
<div class="col-sm-6 text-md-end">
|
||||
<!--
|
||||
<button class="btn btn-dark mb-2 me-md-4" onclick="history.back()">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Back
|
||||
</button>
|
||||
-->
|
||||
<a class="btn btn-primary mb-2" href="{% url 'manage_events:venue_add' %}">Add Venue</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row layout-spacing">
|
||||
<div class="col-lg-12">
|
||||
<div class="statbox widget box box-shadow">
|
||||
<div class="widget-content widget-content-area">
|
||||
<div id="style-3_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
|
||||
<div class="table-responsive">
|
||||
<table id="style-3" class="table style-3 dt-table-hover dataTable no-footer" role="grid"
|
||||
aria-describedby="style-3_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="checkbox-column sorting_asc" tabindex="0" aria-controls="style-3"
|
||||
aria-sort="ascending" style="width: 69.2656px;"> Record Id </th>
|
||||
<th class="checkbox-column sorting_asc" tabindex="0" aria-controls="style-3"
|
||||
aria-sort="ascending" style="width: 69.2656px;"> Title </th>
|
||||
<th class="checkbox-column sorting_asc" tabindex="0" aria-controls="style-3"
|
||||
aria-sort="ascending" style="width: 69.2656px;"> Address </th>
|
||||
<th class="checkbox-column sorting_asc" tabindex="0" aria-controls="style-3"
|
||||
aria-sort="ascending" style="width: 69.2656px;"> Latitude </th>
|
||||
<th class="checkbox-column sorting_asc" tabindex="0" aria-controls="style-3"
|
||||
aria-sort="ascending" style="width: 69.2656px;"> Longitude </th>
|
||||
<th class="sorting" tabindex="7" aria-controls="style-3"
|
||||
style="width: 79.7969px;">Active</th>
|
||||
<th class="dt-no-sorting sorting" tabindex="8" aria-controls="style-3"
|
||||
style="width: 100.625px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data_obj in venue_obj %}
|
||||
<tr role="row">
|
||||
<td>{{data_obj.id}}</td>
|
||||
<td>{{data_obj.title}}</td>
|
||||
<td>{{data_obj.address}}</td>
|
||||
<td>{{data_obj.latitude}}</td>
|
||||
<td>{{data_obj.longitude}}</td>
|
||||
<td class="text-center">
|
||||
<span
|
||||
class="shadow-none badge {% if data_obj.active %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.active}}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<ul class="table-controls">
|
||||
<li><a href="{% url 'manage_events:venue_edit' data_obj.id %}"
|
||||
class="bs-tooltip" data-bs-toggle="tooltip"
|
||||
data-bs-placement="top" title="" data-original-title="Edit"
|
||||
data-bs-original-title="Edit" aria-label="Edit"><svg
|
||||
xmlns="http://www.w3.org/2000/svg" width="24"
|
||||
height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-edit-2 p-1 br-8 mb-1">
|
||||
<path
|
||||
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
<li><a href="{% url 'manage_events:venue_delete' data_obj.id %}"
|
||||
class="bs-tooltip" data-bs-toggle="tooltip"
|
||||
data-bs-placement="top" title=""
|
||||
data-original-title="Delete" data-bs-original-title="Delete"
|
||||
aria-label="Delete"><svg xmlns="http://www.w3.org/2000/svg"
|
||||
width="24" height="24" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round"
|
||||
class="feather feather-trash p-1 br-8 mb-1">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path
|
||||
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2">
|
||||
</path>
|
||||
</svg></a></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
|
||||
{% block javascript %}
|
||||
<!-- include required js cdn link through html here -->
|
||||
{% include "cdn_through_html/datatable_cdn_js.html" %}
|
||||
|
||||
<script>
|
||||
c3 = $('#style-3').DataTable({
|
||||
"dom": "<'dt--top-section'<'row'<'col-12 col-sm-6 d-flex justify-content-sm-start justify-content-center'l><'col-12 col-sm-6 d-flex justify-content-sm-end justify-content-center mt-sm-0 mt-3'f>>>" +
|
||||
"<'table-responsive'tr>" +
|
||||
"<'dt--bottom-section d-sm-flex justify-content-sm-between text-center'<'dt--pages-count mb-sm-0 mb-3'i><'dt--pagination'p>>",
|
||||
"oLanguage": {
|
||||
"oPaginate": { "sPrevious": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>', "sNext": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-right"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>' },
|
||||
"sInfo": "Showing page _PAGE_ of _PAGES_",
|
||||
"sSearch": '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',
|
||||
"sSearchPlaceholder": "Search...",
|
||||
"sLengthMenu": "Results : _MENU_",
|
||||
},
|
||||
"stripeClasses": [],
|
||||
"lengthMenu": [5, 10, 20, 50],
|
||||
"pageLength": 10
|
||||
});
|
||||
|
||||
multiCheck(c3);
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -251,16 +251,15 @@
|
||||
<div class="accordion-body">
|
||||
<strong>This is the second item's accordion
|
||||
body.</strong> It is hidden by default,
|
||||
until the collapse plugin adds the
|
||||
appropriate classes that we use to style
|
||||
each element. These classes control the
|
||||
overall appearance, as well as the showing
|
||||
and hiding via CSS transitions. You can
|
||||
modify any of this with custom CSS or
|
||||
overriding our default variables. It's also
|
||||
worth noting that just about any HTML can go
|
||||
within the <code>.accordion-body</code>,
|
||||
though the transition does limit overflow.
|
||||
until the collapse plugin adds the
|
||||
appropriate classes that we use to style
|
||||
each element. These classes control the
|
||||
overall appearance, as well as the showing
|
||||
and hiding via CSS transitions. You can
|
||||
modify any of this with custom CSS or
|
||||
overriding our default variables. It's also
|
||||
worth noting that just about any HTML can go
|
||||
within the transition does limit overflow.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -276,16 +275,15 @@
|
||||
<div class="accordion-body">
|
||||
<strong>This is the third item's accordion
|
||||
body.</strong> It is hidden by default,
|
||||
until the collapse plugin adds the
|
||||
appropriate classes that we use to style
|
||||
each element. These classes control the
|
||||
overall appearance, as well as the showing
|
||||
and hiding via CSS transitions. You can
|
||||
modify any of this with custom CSS or
|
||||
overriding our default variables. It's also
|
||||
worth noting that just about any HTML can go
|
||||
within the <code>.accordion-body</code>,
|
||||
though the transition does limit overflow.
|
||||
until the collapse plugin adds the
|
||||
appropriate classes that we use to style
|
||||
each element. These classes control the
|
||||
overall appearance, as well as the showing
|
||||
and hiding via CSS transitions. You can
|
||||
modify any of this with custom CSS or
|
||||
overriding our default variables. It's also
|
||||
worth noting that just about any HTML can go
|
||||
within the transition does limit overflow.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -301,16 +299,15 @@
|
||||
<div class="accordion-body">
|
||||
<strong>This is the third item's accordion
|
||||
body.</strong> It is hidden by default,
|
||||
until the collapse plugin adds the
|
||||
appropriate classes that we use to style
|
||||
each element. These classes control the
|
||||
overall appearance, as well as the showing
|
||||
and hiding via CSS transitions. You can
|
||||
modify any of this with custom CSS or
|
||||
overriding our default variables. It's also
|
||||
worth noting that just about any HTML can go
|
||||
within the <code>.accordion-body</code>,
|
||||
though the transition does limit overflow.
|
||||
until the collapse plugin adds the
|
||||
appropriate classes that we use to style
|
||||
each element. These classes control the
|
||||
overall appearance, as well as the showing
|
||||
and hiding via CSS transitions. You can
|
||||
modify any of this with custom CSS or
|
||||
overriding our default variables. It's also
|
||||
worth noting that just about any HTML can go
|
||||
within the transition does limit overflow.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -333,8 +330,7 @@
|
||||
modify any of this with custom CSS or
|
||||
overriding our default variables. It's also
|
||||
worth noting that just about any HTML can go
|
||||
within the <code>.accordion-body</code>,
|
||||
though the transition does limit overflow.
|
||||
within the transition does limit overflow.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user