diff --git a/.DS_Store b/.DS_Store index 18f18875..2e450c13 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/osinaweb/.DS_Store b/osinaweb/.DS_Store index 5b4a4802..c78a0b7c 100644 Binary files a/osinaweb/.DS_Store and b/osinaweb/.DS_Store differ diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index eb594ca2..0e1fecf9 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/custom_context.cpython-310.pyc b/osinaweb/osinacore/__pycache__/custom_context.cpython-310.pyc index 7e8d4dee..749ac85b 100644 Binary files a/osinaweb/osinacore/__pycache__/custom_context.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/custom_context.cpython-310.pyc differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc index 96c18632..7e835955 100644 Binary files a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index 5e2873bf..db74d32c 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -1270,9 +1270,42 @@ def edit_business(request, business_id): @login_required -def edit_staff(request, *args, **kwargs): +def edit_staff(request, staff_id): + staff = get_object_or_404(StaffProfile, staff_id=staff_id) + positions = StaffPosition.objects.all().order_by('name') + current_position = staff.staff_position + + + if request.method == 'POST': + + staff.user.first_name= request.POST.get('first_name') + staff.user.last_name = request.POST.get('last_name') + staff.user.email = request.POST.get('email') + staff.user.save() + + staff.mobile_number = request.POST.get('mobile_number') + staff.active = request.POST.get('active') + staff.intern = request.POST.get('intern') + + new_position_id = request.POST.get('staff_position') + new_position = get_object_or_404(StaffPosition, id=new_position_id) + staff.staff_position = new_position + + + new_image = request.FILES.get('image') + if new_image: + staff.image = new_image + + + staff.save() + + + return redirect('userdetails', staff_id=staff.staff_id) context = { + 'staff' : staff, + 'positions' : positions, + 'current_position' : current_position, } return render(request, 'edit_pages/edit-staff.html', context) diff --git a/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc b/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc index c31b9d5a..6131bdd8 100644 Binary files a/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc and b/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc differ diff --git a/osinaweb/osinaweb/urls.py b/osinaweb/osinaweb/urls.py index a37c6515..c3f76524 100644 --- a/osinaweb/osinaweb/urls.py +++ b/osinaweb/osinaweb/urls.py @@ -109,7 +109,7 @@ urlpatterns = [ path('edit-task/', views.edit_task, name='edittask'), path('edit-customer//', views.edit_customer, name='editcustomer'), path('edit-business//', views.edit_business, name='editbusiness'), - path('edit-staff/', views.edit_staff, name='editstaff'), + path('edit-staff//', views.edit_staff, name='editstaff'), path('edit-projecttype/', views.edit_project_type, name='editprojecttype'), path('edit-businesstype/', views.edit_business_type, name='editbusinesstype'), path('edit-reference/', views.edit_reference, name='editreference'), diff --git a/osinaweb/static/images/IMG_1044.JPG b/osinaweb/static/images/IMG_1044.JPG new file mode 100644 index 00000000..7e7c268d Binary files /dev/null and b/osinaweb/static/images/IMG_1044.JPG differ diff --git a/osinaweb/static/images/WhatsApp_Image_2024-01-02_at_1.31.29_PM_bpjQhHj.jpeg b/osinaweb/static/images/WhatsApp_Image_2024-01-02_at_1.31.29_PM_bpjQhHj.jpeg new file mode 100644 index 00000000..d37729c9 Binary files /dev/null and b/osinaweb/static/images/WhatsApp_Image_2024-01-02_at_1.31.29_PM_bpjQhHj.jpeg differ diff --git a/osinaweb/static/images/footer-logo_2.png b/osinaweb/static/images/footer-logo_2.png new file mode 100644 index 00000000..863af724 Binary files /dev/null and b/osinaweb/static/images/footer-logo_2.png differ diff --git a/osinaweb/static/images/ositcom_ny_post_2024-06_p7SbgQt.jpg b/osinaweb/static/images/ositcom_ny_post_2024-06_p7SbgQt.jpg new file mode 100644 index 00000000..d00aabb5 Binary files /dev/null and b/osinaweb/static/images/ositcom_ny_post_2024-06_p7SbgQt.jpg differ diff --git a/osinaweb/templates/details_pages/staff-details.html b/osinaweb/templates/details_pages/staff-details.html index f9263c15..3247cee8 100644 --- a/osinaweb/templates/details_pages/staff-details.html +++ b/osinaweb/templates/details_pages/staff-details.html @@ -69,7 +69,7 @@ - + @@ -84,17 +84,17 @@

First Name: Nataly

+ class="text-slate-800 text-xl font-semibold">{{staff.user.first_name}}

Last Name: Nataly

+ class="text-slate-800 text-xl font-semibold">{{staff.user.last_name}}

Email: {{staff.email}}

+ class="text-slate-800 text-xl font-semibold">{{staff.user.email}}

Mobile Number: {% csrf_token %} + + +

+
+ {% if business.logo %} + + {% else %} + + {% endif %} +
+
+ +
+
+ + Upload + New Logo + +
+
+ +
@@ -19,39 +43,43 @@ required>
-
-
-
- - Upload New Business - Logo - - -
-
- - + +
diff --git a/osinaweb/templates/edit_pages/edit-staff.html b/osinaweb/templates/edit_pages/edit-staff.html index e011fd9e..e7c32907 100644 --- a/osinaweb/templates/edit_pages/edit-staff.html +++ b/osinaweb/templates/edit_pages/edit-staff.html @@ -8,18 +8,22 @@ Edit Staff -
+ {% csrf_token %}
-
+
+ {% if staff.image %} + + {% else %} + {% endif %}
Upload - Profile Picture + New Profile Picture @@ -65,52 +69,60 @@ - +
+ + +
- +
+ + +
- +
+ + +
- +
+ + +
- +
+ + +
-
- -

Active

-
- -
- -

Intern

-
- - +
+ +

Active

+ +
+ +
+ +

Intern

+ +
+ + + -
- +