Skip to content

Commit

Permalink
ui revamped
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajan-007 committed Feb 9, 2025
1 parent d214503 commit 359f446
Show file tree
Hide file tree
Showing 42 changed files with 2,051 additions and 1,231 deletions.
Binary file modified QuizApp/__pycache__/settings.cpython-312.pyc
Binary file not shown.
Binary file modified QuizApp/__pycache__/urls.cpython-312.pyc
Binary file not shown.
9 changes: 9 additions & 0 deletions QuizApp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@
path('training-sessions-report/', training_sessions_report, name='training_sessions_report'),
]

iframe_url = [
path('iframe/', iframe, name='iframe'),
path('email/', email, name='email'),
path('portal/', portal, name='portal'),
]



urlpatterns.extend(auth)
urlpatterns.extend(chat)
urlpatterns.extend(group)
Expand Down Expand Up @@ -363,6 +371,7 @@
urlpatterns+=region_performance_report_url
urlpatterns+=chapter_roster_report_url
urlpatterns+=training_sessions_report_url
urlpatterns+=iframe_url

urlpatterns += static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Binary file modified base/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file modified base/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file modified base/form/__pycache__/forms.cpython-312.pyc
Binary file not shown.
Binary file modified base/templatetags/__pycache__/djtemp.cpython-312.pyc
Binary file not shown.
11 changes: 11 additions & 0 deletions base/views/Profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,14 @@ def delete_image(request):
except Gallery.DoesNotExist:
return JsonResponse({'error': 'Image not found'})
return JsonResponse({'error': 'Invalid request'})


def iframe(request):
return render(request, 'iframe.html')

def email(request):
return render(request, 'email.html')

def portal(request):
return render(request, 'portal.html')

Binary file modified base/views/__pycache__/common.cpython-312.pyc
Binary file not shown.
Binary file modified base/views/__pycache__/connections.cpython-312.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion base/views/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


def visitor_registration_portal(request):
return render(request, 'visitor_registration_portal.html')
return render(request, 'operations/Visitor_register.html')

def view_palms_summary(request):
return render(request, 'view_palms_summary.html')
Expand Down
156 changes: 108 additions & 48 deletions templates/Group/group_crud.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,116 @@
{% load form_tags %}

{% block content %}
<div class="container my-10 bg-white mx-2 md:mx-auto p-6 rounded-md shadow-md md:max-w-4xl" style="top: -27px !important; position:relative;">
<h1 class="text-2xl font-bold mb-5">Group CRUD Operations</h1>

{% if messages %}
<ul class="mb-4">
{% for message in messages %}
<li class="text-white px-4 py-2 rounded-md mb-2 {% if message.tags %}bg-red-500{% else %}bg-green-500{% endif %}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}

<form method="post" enctype="multipart/form-data" action="{% if group %}{% url 'group_crud' group.pk %}{% else %}{% url 'group_crud_new' %}{% endif %}">
{% csrf_token %}
<div class="mb-4">
<label for="name" class="block text-gray-700 font-medium mb-2">Name</label>
<input type="text" name="name" id="name" value="{{ group_data.name }}" class="border rounded w-full py-2 px-3 focus:outline-none focus:ring-2 focus:ring-indigo-500">
<div class="min-h-screen bg-gradient-to-br from-blue-50 via-blue-100 to-blue-200 py-8 px-4 sm:px-6 lg:px-8">
<div class="max-w-3xl mx-auto">
<!-- Elegant Header -->
<div class="relative mb-6">
<div class="absolute inset-0 flex items-center">
<div class="w-full border-t-2 border-blue-300/50"></div>
</div>
<div class="relative flex justify-center">
<span class="px-5 py-2 bg-gradient-to-r from-blue-100 to-blue-200 rounded-lg shadow-sm">
<h1 class="text-2xl font-bold text-blue-800 tracking-tight">
{% if group %}Edit Group{% else %}Create New Group{% endif %}
</h1>
</span>
</div>
</div>
<div class="mb-4">
<label for="group_type" class="block text-gray-700 font-medium mb-2">Group Type</label>
<select name="group_type" id="group_type" class="border rounded w-full py-2 px-3 focus:outline-none focus:ring-2 focus:ring-indigo-500">
<option value="Open" {% if group_data.group_type == "Open" %}selected{% endif %}>Open</option>
<option value="Invite Only" {% if group_data.group_type == "Invite Only" %}selected{% endif %}>Invite Only</option>
</select>
</div>
<div class="mb-4">
<label for="access_type" class="block text-gray-700 font-medium mb-2">Access Type</label>
<select name="access_type" id="access_type" class="border rounded w-full py-2 px-3 focus:outline-none focus:ring-2 focus:ring-indigo-500">
<option value="View and post" {% if group_data.access_type == "View and post" %}selected{% endif %}>View and post</option>
</select>
</div>
<div class="mb-4">
<label for="language" class="block text-gray-700 font-medium mb-2">Language</label>
<input type="text" name="language" id="language" value="{{ group_data.language }}" class="border rounded w-full py-2 px-3 focus:outline-none focus:ring-2 focus:ring-indigo-500">
</div>
<div class="mb-4">
<label for="description" class="block text-gray-700 font-medium mb-2">Description</label>
<textarea name="description" id="description" class="border rounded w-full py-2 px-3 focus:outline-none focus:ring-2 focus:ring-indigo-500">{{ group_data.description }}</textarea>
</div>
<div class="mb-4">
<label for="logo" class="block text-gray-700 font-medium mb-2">Group Logo</label>
<input type="file" name="logo" id="logo" class="border rounded w-full py-2 px-3 focus:outline-none focus:ring-2 focus:ring-indigo-500">
</div>
<div class="flex items-center">
<button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
{% if group %}Update{% else %}Create{% endif %}
</button>
{% if group %}
<button type="submit" name="delete" value="delete" class="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded ml-4">Delete</button>

<!-- Main Form Card -->
<div class="bg-white/90 backdrop-blur-sm rounded-xl shadow-lg border-2 border-blue-200 overflow-hidden transform transition-all duration-300 hover:shadow-xl hover:border-blue-300 hover:scale-[1.02]">
{% if messages %}
<div class="p-3 space-y-2">
{% for message in messages %}
<div class="px-3 py-2 rounded-md text-sm {% if message.tags %}bg-red-50 text-red-600 border border-red-200{% else %}bg-green-50 text-green-600 border border-green-200{% endif %} transition-all hover:shadow-sm">
{{ message }}
</div>
{% endfor %}
</div>
{% endif %}

<form method="post" enctype="multipart/form-data" class="p-6 space-y-4" action="{% if group %}{% url 'group_crud' group.pk %}{% else %}{% url 'group_crud_new' %}{% endif %}">
{% csrf_token %}

<!-- Form Fields -->
<div class="space-y-4">
<!-- Name Field -->
<div class="group">
<label for="name" class="block text-sm font-medium text-blue-700 mb-1 transition-colors group-hover:text-blue-600">Group Name</label>
<input type="text" name="name" id="name" value="{{ group_data.name }}"
class="w-full px-3 py-2 text-sm rounded-lg border-2 border-blue-100 focus:border-blue-300 focus:ring-2 focus:ring-blue-100 transition-all duration-200 hover:border-blue-200"
placeholder="Enter group name">
</div>

<!-- Group Type Field -->
<div class="group">
<label for="group_type" class="block text-sm font-medium text-blue-700 mb-1 transition-colors group-hover:text-blue-600">Group Type</label>
<select name="group_type" id="group_type"
class="w-full px-3 py-2 text-sm rounded-lg border-2 border-blue-100 focus:border-blue-300 focus:ring-2 focus:ring-blue-100 transition-all duration-200 hover:border-blue-200">
<option value="Open" {% if group_data.group_type == "Open" %}selected{% endif %}>Open</option>
<option value="Invite Only" {% if group_data.group_type == "Invite Only" %}selected{% endif %}>Invite Only</option>
</select>
</div>

<!-- Access Type Field -->
<div class="group">
<label for="access_type" class="block text-sm font-medium text-blue-700 mb-1 transition-colors group-hover:text-blue-600">Access Type</label>
<select name="access_type" id="access_type"
class="w-full px-3 py-2 text-sm rounded-lg border-2 border-blue-100 focus:border-blue-300 focus:ring-2 focus:ring-blue-100 transition-all duration-200 hover:border-blue-200">
<option value="View and post" {% if group_data.access_type == "View and post" %}selected{% endif %}>View and post</option>
</select>
</div>

<!-- Language Field -->
<div class="group">
<label for="language" class="block text-sm font-medium text-blue-700 mb-1 transition-colors group-hover:text-blue-600">Language</label>
<input type="text" name="language" id="language" value="{{ group_data.language }}"
class="w-full px-3 py-2 text-sm rounded-lg border-2 border-blue-100 focus:border-blue-300 focus:ring-2 focus:ring-blue-100 transition-all duration-200 hover:border-blue-200"
placeholder="Enter language">
</div>

<!-- Description Field -->
<div class="group">
<label for="description" class="block text-sm font-medium text-blue-700 mb-1 transition-colors group-hover:text-blue-600">Description</label>
<textarea name="description" id="description" rows="3"
class="w-full px-3 py-2 text-sm rounded-lg border-2 border-blue-100 focus:border-blue-300 focus:ring-2 focus:ring-blue-100 transition-all duration-200 hover:border-blue-200"
placeholder="Enter group description">{{ group_data.description }}</textarea>
</div>

<!-- Logo Field -->
<div class="group">
<label for="logo" class="block text-sm font-medium text-blue-700 mb-1 transition-colors group-hover:text-blue-600">Group Logo</label>
<div class="mt-1 flex justify-center px-4 py-4 border-2 border-blue-100 border-dashed rounded-lg hover:border-blue-200 transition-all duration-200">
<div class="space-y-1 text-center">
<svg class="mx-auto h-10 w-10 text-blue-400" stroke="currentColor" fill="none" viewBox="0 0 48 48">
<path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
</svg>
<div class="flex text-xs text-gray-600">
<label for="logo" class="relative cursor-pointer rounded-md font-medium text-blue-600 hover:text-blue-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-blue-500">
<span>Upload a file</span>
<input id="logo" name="logo" type="file" class="sr-only">
</label>
</div>
</div>
</div>
</div>
</div>

<!-- Action Buttons -->
<div class="flex items-center space-x-3 pt-4">
<button type="submit"
class="flex-1 bg-gradient-to-r from-blue-400 to-blue-500 text-white text-sm font-semibold py-2 px-4 rounded-lg transform transition-all duration-200 hover:from-blue-500 hover:to-blue-600 hover:scale-[1.02] hover:shadow-md focus:outline-none focus:ring-2 focus:ring-blue-300 focus:ring-offset-2">
{% if group %}Update Group{% else %}Create Group{% endif %}
</button>
{% if group %}
<button type="submit" name="delete" value="delete"
class="flex-1 bg-gradient-to-r from-red-400 to-red-500 text-white text-sm font-semibold py-2 px-4 rounded-lg transform transition-all duration-200 hover:from-red-500 hover:to-red-600 hover:scale-[1.02] hover:shadow-md focus:outline-none focus:ring-2 focus:ring-red-300 focus:ring-offset-2">
Delete Group
</button>
{% endif %}
</div>
</form>
</div>
</form>
</div>
</div>
{% endblock %}
Loading

0 comments on commit 359f446

Please sign in to comment.