Merge branch 'feature/module_1' into development

This commit is contained in:
bobbyvish
2024-07-02 18:54:37 +05:30
8 changed files with 40 additions and 39 deletions

View File

@@ -141,16 +141,21 @@ class VenueForm(forms.ModelForm):
label="Non-transfer user list", label="Non-transfer user list",
required=True required=True
) )
image = forms.ImageField(required=True)
latitude = forms.DecimalField(
widget=forms.NumberInput()
)
longitude = forms.DecimalField(
widget=forms.NumberInput()
)
class Meta: class Meta:
model = Venue model = Venue
fields = [ fields = [
"principal", "principal",
"title", "title",
# "description",
"address", "address",
"image", "image",
# "url",
"latitude", "latitude",
"longitude", "longitude",
] ]

View File

@@ -100,7 +100,7 @@ class SubscriptionCreateOrUpdateView(LoginRequiredMixin, generic.View):
# This code ensures that only one free plan can be created by checking for existing free plans before saving a new one. # This code ensures that only one free plan can be created by checking for existing free plans before saving a new one.
if form.cleaned_data.get("is_free"): if form.cleaned_data.get("is_free"):
if self.model.objects.filter(Q(is_free=True) & Q(active=True)).exists: if self.model.objects.filter(Q(is_free=True) & Q(active=True)).exists():
messages.error(self.request, "A free plan is already available. Please deactivate the existing one before creating a new one.") messages.error(self.request, "A free plan is already available. Please deactivate the existing one before creating a new one.")
context = self.get_context_data(form=form) context = self.get_context_data(form=form)
return render(request, self.template_name, context=context) return render(request, self.template_name, context=context)

View File

@@ -61,13 +61,13 @@
<div class="col-md-3">End Date</div> <div class="col-md-3">End Date</div>
<div class="col-md-9">{% if principal_subscription %}{{ principal_subscription.end_date }}{% else %}No subscription found{% endif %}</div> <div class="col-md-9">{% if principal_subscription %}{{ principal_subscription.end_date }}{% else %}No subscription found{% endif %}</div>
</div> </div>
{% if principal_obj.extended_data and not principal_obj.extended_data.transferred and principal_obj.extended_data.onboarded and principal_obj.principal_type.name == 'event_manager' %} {% if principal_obj.extended_data and not principal_obj.extended_data.is_transferred and principal_obj.extended_data.is_onboarded and principal_obj.principal_type.name == 'event_manager' %}
<div class="col text-end"> <div class="col text-end">
<a class="btn btn-dark mb-2 me-4" href="{% url 'accounts:customer_transfer' principal_obj.id %}"> <a class="btn btn-dark mb-2 me-4" href="{% url 'accounts:customer_transfer' principal_obj.id %}">
Transfer Account Transfer Account
</a> </a>
</div> </div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div> </div>

View File

@@ -19,7 +19,7 @@
</a> </a>
</div> </div>
{% if principal_obj.extended_data and not principal_obj.extended_data.transferred and principal_obj.extended_data.onboarded and principal_obj.principal_type.name == 'event_manager' %} {% if principal_obj.extended_data and not principal_obj.extended_data.is_transferred and principal_obj.extended_data.is_onboarded and principal_obj.principal_type.name == 'event_manager' %}
<div class="col text-end"> <div class="col text-end">
<a class="btn btn-dark mb-2 me-4" href="{% url 'accounts:customer_transfer' principal_obj.id %}"> <a class="btn btn-dark mb-2 me-4" href="{% url 'accounts:customer_transfer' principal_obj.id %}">
Transfer Account Transfer Account

View File

@@ -21,7 +21,7 @@
</a> </a>
<a class="btn btn-dark mb-2 me-md-4" href="{% url 'accounts:import_customer_data' %}"> <a class="btn btn-dark mb-2 me-md-4" href="{% url 'accounts:import_customer_data' %}">
import Import
</a> </a>
<a class="btn btn-dark mb-2 me-md-4" href="{% url 'accounts:export_customer_data' %}"> <a class="btn btn-dark mb-2 me-md-4" href="{% url 'accounts:export_customer_data' %}">

View File

@@ -5,7 +5,6 @@
{% include "cdn_through_html/filepond_cdn_css.html" %} {% include "cdn_through_html/filepond_cdn_css.html" %}
{% include "cdn_through_html/flatpicker_cdn_css.html" %} {% include "cdn_through_html/flatpicker_cdn_css.html" %}
{% include "cdn_through_html/quill_cdn_css.html" %}
{% include "cdn_through_html/tagify_cdn_css.html" %} {% include "cdn_through_html/tagify_cdn_css.html" %}
{% include "cdn_through_html/sweetalert2_cdn_css.html" %} {% include "cdn_through_html/sweetalert2_cdn_css.html" %}
{{form.media}} {{form.media}}
@@ -60,20 +59,7 @@
<script> <script>
// Function to initialize Quill editor
function initializeQuillEditor(selector, placeholder) {
return new Quill(selector, {
modules: {
toolbar: [
[{ header: [1, 2, false] }],
['bold', 'italic', 'underline'],
['image', 'code-block']
]
},
placeholder: placeholder,
theme: 'snow' // or 'bubble'
});
}
// Function to initialize FilePond // Function to initialize FilePond
function initializeFilePond(selector, allowMultiple = false) { function initializeFilePond(selector, allowMultiple = false) {
@@ -140,8 +126,6 @@
// Set multiple attribute for event images // Set multiple attribute for event images
document.getElementById('id_event_images').setAttribute('multiple', ''); document.getElementById('id_event_images').setAttribute('multiple', '');
// Initialize Quill editor
var quill = initializeQuillEditor('#description', 'Write description...');
// Initialize FilePond // Initialize FilePond
var thumbnail = initializeFilePond('id_image'); var thumbnail = initializeFilePond('id_image');
@@ -347,8 +331,7 @@
// Disable the submit button to prevent multiple submissions // Disable the submit button to prevent multiple submissions
$('button[type="submit"]').prop('disabled', true); $('button[type="submit"]').prop('disabled', true);
event.prevent() form.submit();
//form.submit();
} }
}); });
}); });

View File

@@ -50,6 +50,9 @@
<th class="checkbox-column sorting_asc" tabindex="0" <th class="checkbox-column sorting_asc" tabindex="0"
aria-controls="style-3" aria-sort="ascending" aria-controls="style-3" aria-sort="ascending"
style="width: 69.2656px;"> Amount </th> style="width: 69.2656px;"> Amount </th>
{% comment %} <th class="checkbox-column sorting_asc" tabindex="0"
aria-controls="style-3" aria-sort="ascending"
style="width: 69.2656px;"> Customer Type</th> {% endcomment %}
<th class="checkbox-column sorting_asc" tabindex="0" <th class="checkbox-column sorting_asc" tabindex="0"
aria-controls="style-3" aria-sort="ascending" aria-controls="style-3" aria-sort="ascending"
style="width: 69.2656px;"> Free for Admin </th> style="width: 69.2656px;"> Free for Admin </th>
@@ -67,6 +70,8 @@
<td>{{data_obj.title}}</td> <td>{{data_obj.title}}</td>
<td>{{data_obj.plan.days}}</td> <td>{{data_obj.plan.days}}</td>
<td>{{data_obj.amount}}</td> <td>{{data_obj.amount}}</td>
{% comment %} <td>{{data_obj.principal_types.name}}</td> {% endcomment %}
<td class="text-center"> <td class="text-center">
<span class="shadow-none badge {% if data_obj.is_free %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.is_free}}</span> <span class="shadow-none badge {% if data_obj.is_free %}badge-primary{% else %}badge-danger{% endif %}">{{data_obj.is_free}}</span>
</td> </td>
@@ -86,8 +91,9 @@
<path <path
d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"> d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z">
</path> </path>
</svg></a></li> </svg>
</a>
</li>
</ul> </ul>
</td> </td>
</tr> </tr>

View File

@@ -3,6 +3,19 @@
{% block stylesheet %} {% block stylesheet %}
<!-- include required css cdn link through html here --> <!-- include required css cdn link through html here -->
<style>
/* Inline CSS for removing number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type="number"] {
-moz-appearance: textfield;
}
</style>
{% include "cdn_through_html/filepond_cdn_css.html" %} {% include "cdn_through_html/filepond_cdn_css.html" %}
{{form.media}} {{form.media}}
@@ -47,14 +60,9 @@
{% block javascript %} {% block javascript %}
<!-- include required css cdn link through html here --> <!-- include required css cdn link through html here -->
{% include "cdn_through_html/filepond_cdn_js.html" %} {% include "cdn_through_html/filepond_cdn_js.html" %}
{% include "cdn_through_html/jquery_validate_cdn_js.html" %} {% include "cdn_through_html/jquery_validate_cdn_js.html" %}
@@ -76,7 +84,6 @@
}, },
title: { title: {
required: true, required: true,
noSpace: true
}, },
address: { address: {
required: true required: true