Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0611b33
Merge branch 'fardin' of https://github.com/IEEE-NSU-SB/STEP-Platform…
rahiq-rahman Sep 18, 2025
ecc2ffe
Merge branch 'production' of https://github.com/IEEE-NSU-SB/STEP-Plat…
rahiq-rahman Sep 18, 2025
a369e7f
Merge branch 'production' of https://github.com/IEEE-NSU-SB/STEP-Plat…
rahiq-rahman Sep 21, 2025
fa489cf
update
ArmanMokammel Sep 22, 2025
8bd9707
Access backend updated
ArmanMokammel Sep 22, 2025
bc4532f
.
ArmanMokammel Sep 22, 2025
a1a28f3
Merge branch 'rahiq' of https://github.com/IEEE-NSU-SB/STEP-Platform …
ArmanMokammel Sep 22, 2025
488f7b5
back btn added, margin top added
rahiq-rahman Sep 22, 2025
f73af05
response count , form publish css changed
rahiq-rahman Sep 22, 2025
540046a
cursor pointer added, sticky header, logout btn added, statistics mod…
rahiq-rahman Sep 22, 2025
33ae249
Merge branch 'rahiq' of https://github.com/IEEE-NSU-SB/STEP-Platform …
ArmanMokammel Sep 22, 2025
09d9b6e
Merge branch 'arman' of https://github.com/IEEE-NSU-SB/STEP-Platform …
rahiq-rahman Sep 22, 2025
54bc1ef
favicon added
rahiq-rahman Sep 22, 2025
cc0fdca
finance modal update
ArmanMokammel Sep 22, 2025
ea15f77
Merge branch 'rahiq' of https://github.com/IEEE-NSU-SB/STEP-Platform …
ArmanMokammel Sep 22, 2025
753d462
small fix
ArmanMokammel Sep 22, 2025
ac55dea
error fix
ArmanMokammel Sep 22, 2025
8ea4996
correction
ArmanMokammel Sep 22, 2025
30298a1
.
ArmanMokammel Sep 22, 2025
b71157e
update gitignore
ArmanMokammel Sep 22, 2025
f5e658f
Merge branch 'production' of https://github.com/IEEE-NSU-SB/STEP-Plat…
ArmanMokammel Sep 22, 2025
7220a8d
form close update
ArmanMokammel Sep 22, 2025
8eeca87
update
ArmanMokammel Sep 22, 2025
5233621
.
ArmanMokammel Sep 22, 2025
a1a7806
form closing update
ArmanMokammel Sep 22, 2025
332a9cf
statistics updated
rahiq-rahman Sep 23, 2025
d8d35e7
statistics updated
rahiq-rahman Sep 23, 2025
cf6f17e
Permissions complete
ArmanMokammel Sep 23, 2025
841b3a9
Merge branch 'production' of https://github.com/IEEE-NSU-SB/STEP-Plat…
ArmanMokammel Sep 23, 2025
396084d
Merge branch 'rahiq' of https://github.com/IEEE-NSU-SB/STEP-Platform …
ArmanMokammel Sep 23, 2025
840aa37
update finance stats
ArmanMokammel Sep 23, 2025
0233b7c
fix
ArmanMokammel Sep 23, 2025
a7d5e1b
Updated form for t-shirt
ArmanMokammel Sep 23, 2025
0e58cdf
.
ArmanMokammel Sep 23, 2025
dba0085
update
ArmanMokammel Sep 23, 2025
7e45b55
.
ArmanMokammel Sep 23, 2025
6359714
Added stats for t-shirt
ArmanMokammel Sep 23, 2025
084ad02
minor bug
rahiq-rahman Sep 23, 2025
b312b97
small update
ArmanMokammel Sep 23, 2025
100ab0a
again
ArmanMokammel Sep 23, 2025
6c144e2
tshirt size update
ArmanMokammel Sep 24, 2025
67792f9
.
ArmanMokammel Sep 24, 2025
3935a25
.
ArmanMokammel Sep 24, 2025
28abef3
.
ArmanMokammel Sep 24, 2025
c44665f
Removed T-shirt reg forms
ArmanMokammel Sep 24, 2025
2ca4e23
update
ArmanMokammel Sep 24, 2025
9583987
Update
ArmanMokammel Sep 26, 2025
7e4252a
footer added
rahiq-rahman Sep 26, 2025
8d530bc
Merge pull request #24 from IEEE-NSU-SB/rahiq
rahiq-rahman Sep 26, 2025
c7b3f9e
footer updated
rahiq-rahman Sep 26, 2025
8bf12d7
footer updated
rahiq-rahman Sep 26, 2025
ae5031c
Merge pull request #26 from IEEE-NSU-SB/rahiq
rahiq-rahman Sep 26, 2025
eb07e36
footer updated
rahiq-rahman Sep 26, 2025
7edd8f3
Merge pull request #27 from IEEE-NSU-SB/rahiq
rahiq-rahman Sep 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.swp
**/__pycache__
db.sqlite3
*.sqlite3
media

# Backup files #
Expand Down
32 changes: 30 additions & 2 deletions access_ctrl/admin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
from django.contrib import admin
from .models import *
from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin

# Register your models here.

class CustomUserAdmin(BaseUserAdmin):
# Remove 'groups' and 'user_permissions' from the fieldsets
fieldsets = (
(None, {'fields': ('username', 'password')}),
('Personal info', {'fields': ('first_name', 'last_name', 'email')}),
('Important dates', {'fields': ('last_login', 'date_joined')}),
('Status', {'fields': ('is_active', 'is_staff', 'is_superuser', 'user_permissions')}),
)

# Remove them from add_fieldsets too (user creation form)
add_fieldsets = (
(None, {
'classes': ('wide',),
'fields': ('username', 'password1', 'password2'),
}),
)

# Hide columns in the list display if you don’t want them there
def get_fieldsets(self, request, obj=None):
return super().get_fieldsets(request, obj)

# Unregister the original UserAdmin
admin.site.unregister(User)
# Register our custom one
admin.site.register(User, CustomUserAdmin)

# -----------------------------
# Permission Admin
# -----------------------------
Expand All @@ -27,7 +55,7 @@ class RoleAdmin(admin.ModelAdmin):
@admin.register(RolePermission)
class RolePermissionAdmin(admin.ModelAdmin):
list_display = ("role",)
filter_horizontal = ("permissions",) # Makes ManyToMany easy to edit
filter_horizontal = ("permissions",)
search_fields = ("role__name",)

# -----------------------------
Expand All @@ -36,7 +64,7 @@ class RolePermissionAdmin(admin.ModelAdmin):
@admin.register(UserPermission)
class UserPermissionAdmin(admin.ModelAdmin):
list_display = ("user",)
filter_horizontal = ("permissions",) # Makes ManyToMany easy to edit
filter_horizontal = ("permissions",)
search_fields = ("user__username",)

# -----------------------------
Expand Down
16 changes: 16 additions & 0 deletions access_ctrl/apps.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
from django.apps import AppConfig
from django.contrib.auth.apps import AuthConfig as BaseAuthConfig


class AccessCtrlConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'access_ctrl'

class CustomAuthConfig(BaseAuthConfig):
verbose_name = "User Management"

def ready(self):
super().ready() # registers User & Group
from django.contrib import admin
from django.contrib.auth.models import Group

# Unregister Group after it's registered
try:
admin.site.unregister(Group)
except admin.sites.NotRegistered:
pass

3 changes: 3 additions & 0 deletions access_ctrl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ def user_has_permission(user, codename, obj=None):
"""
Check if a user has a permission, directly, via role, or object-level.
"""
if user.is_superuser:
return True

try:
perm = Perms.objects.get(codename=codename)
except Perms.DoesNotExist:
Expand Down
1 change: 1 addition & 0 deletions core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from core.models import Token_Session, Registered_Participant, Token_Participant

# Register your models here.

@admin.register(Token_Session)
class SessionAdmin(admin.ModelAdmin):

Expand Down
Binary file added core/static/img/Footer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/static/img/Footer1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/static/img/Footer2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/static/img/Stepclosed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 24 additions & 15 deletions core/templates/coordinator_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,21 @@
justify-content: space-between;
}
.footer {
display: flex;
margin: auto;
justify-content: center;
gap: 250px;
background-color: #f8f8f8;
/* color: white; */
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
padding: 10px 0;
/* padding: 10px 0; */
/* z-index: -1; */
}
.footer img {
height: 68px;
height: 90px;
}
.count {
font-size: 1.5rem;
Expand Down Expand Up @@ -485,8 +489,12 @@
td {
padding: 5px;
}
.footer{
gap: 40px;
}
.footer img {
height: 27px;
height: 30px;
/* scale: 1.3; */
}
.count {
font-size: 1rem;
Expand Down Expand Up @@ -529,11 +537,11 @@
<div class="button-group-outerdiv">
<div class="button-group">
<button id="view-status">View Status</button>
{% if request.user|has_perm:"update_session" %}
{% if has_perm.update_session %}
<button id="set-session">Set Session</button>
{% endif %}
<a href="{% url 'registration:registration_form' %}" >Registration Form</a>
{% if request.user|has_perm:"scan_session" %}
<a href="{% url 'registration:registration_admin' %}" >Registration Form</a>
{% if has_perm.scan_session %}
<button id="tap-to-scan">Tap to Scan</button>
{% endif %}
</div>
Expand Down Expand Up @@ -611,10 +619,10 @@
<th>Name</th>
<th>University</th>
<th>Tshirt Size</th>
<th>Role</th>
{% comment %} <th>Role</th> {% endcomment %}
<th>Contact</th>
{% for session in token_sessions_all %}
{% if request.user|has_perm:"scan_any_session" or session.is_active %}
{% if has_perm.scan_any_session or session.is_active %}
<th>{{session.session_name}}</th>
{% endif %}
{% endfor %}
Expand All @@ -628,10 +636,10 @@
<td>{{participant.name}}</td>
<td>{{participant.university}}</td>
<td>{{participant.t_shirt_size}}</td>
<td>{{participant.role}}</td>
{% comment %} <td>{{participant.role}}</td> {% endcomment %}
<td>{{participant.contact_no}}</td>
{% for session in token_sessions_all %}
{% if request.user|has_perm:"scan_any_session" or session.is_active %}
{% if has_perm.scan_any_session or session.is_active %}
<td>
<input type="checkbox" id="{{participant.id}}_{{session.id}}" data-sl="{{participant.id}}" data-session-id={{session.id}} {% for token in participant.tokens %}{% if token.token_session.id == session.id %}checked{% endif %}{% endfor %} />
</td>
Expand All @@ -654,7 +662,8 @@
</form>
</div>
<div class="footer">
<img src="{% static '/img/Logos-For-DOC-1.png' %}" alt="logo" />
<img src="{% static '/img/Footer1.png' %}" alt="logo" />
<img src="{% static '/img/Footer2.png' %}" alt="logo" />
</div>
<!-- Modal -->
<div
Expand Down Expand Up @@ -701,7 +710,7 @@ <h2 style="font-size: 1.5em; text-align: center">Select a Session</h2>
</div>


{% if request.user|has_perm:"update_session" %}
{% if has_perm.update_session %}
<!-- Modal -->
<div class="modal-overlay" id="modal-overlay">
<div class="modal" id="set-session-modal">
Expand Down Expand Up @@ -756,7 +765,7 @@ <h2 style="font-size: 1.5em; text-align: center">Select a Session</h2>
const modalOverlay = document.getElementById("modal-overlay");
const navbarSessionText = document.querySelector(".navbar > div");

{% if request.user|has_perm:"update_session" %}
{% if has_perm.update_session %}
// Open the modal
setSessionBtn.addEventListener("click", () => {
modalOverlay.style.display = "block";
Expand Down Expand Up @@ -836,7 +845,7 @@ <h2 style="font-size: 1.5em; text-align: center">Select a Session</h2>
// Example session URLs
const sessions = [
{% for session in token_sessions_all %}
{% if request.user|has_perm:"scan_any_session" or session.is_active %}
{% if has_perm.scan_any_session or session.is_active %}
{ id: {{session.id}}, name: "{{session.session_name}}" },
{% endif %}
{% endfor %}
Expand Down Expand Up @@ -1175,7 +1184,7 @@ <h2 style="font-size: 1.5em; text-align: center">Select a Session</h2>
.then((data) => {
last_updated_date_time = new Date();

{% if request.user|has_perm:"scan_any_session" %}
{% if has_perm.scan_any_session %}
for (var d in data['status']) {
document.getElementById(`session_${d}`).innerHTML = data['status'][d];
}
Expand Down
13 changes: 10 additions & 3 deletions core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ def dashboard(request):
registered_participants = Core.get_all_reg_participants_with_sessions()

total_participants = len(registered_participants)

permissions = {
'update_session':Site_Permissions.user_has_permission(request.user, 'update_session'),
'scan_session':Site_Permissions.user_has_permission(request.user, 'scan_session'),
'scan_any_session':Site_Permissions.user_has_permission(request.user, 'scan_any_session')
}

request.session['active_sessions'] = active_sessions

Expand All @@ -108,14 +114,15 @@ def dashboard(request):
'registered_participants':registered_participants,
'total_participants':total_participants,
'participant_universities':universities,
'has_perm':permissions,
}

return render(request, 'coordinator_dashboard.html', context)

class SessionUpdateAjax(View):
def post(self, request):
try:
if request.user.is_authenticated and Site_Permissions.user_has_permission(request.user, 'update_session'):
if Site_Permissions.user_has_permission(request.user, 'update_session'):
sessions = json.loads(request.body)['sessions']

if(Core.update_session(sessions=sessions)):
Expand All @@ -139,7 +146,7 @@ def get(self, request):
class GetSessionStatusAjax(View):
def post(self, request):
try:
if request.user.is_authenticated and Site_Permissions.user_has_permission(request.user, 'view_qr_dashboard'):
if Site_Permissions.user_has_permission(request.user, 'view_qr_dashboard'):
last_updated_date_time = json.loads(request.body)['last_updated_date_time']
token_sessions_with_participant_count = Core.get_all_token_sessions_with_participant_counts()

Expand Down Expand Up @@ -170,7 +177,7 @@ def get(self, request):
class UpdateParticipantSessionAjax(View):
def post(self, request):
try:
if request.user.is_authenticated and Site_Permissions.user_has_permission(request.user, 'scan_session'):
if Site_Permissions.user_has_permission(request.user, 'scan_session'):
data = json.loads(request.body)

response = Core.update_participant_session(data['participant_id'], data['session_id'], data['status'])
Expand Down
Loading