diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 8b38b2f3..c647587d 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc index d051294b..ff92ef67 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 8c5887bd..fe5afc1c 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -80,10 +80,10 @@ def my_projects(request, *args, **kwargs): if user.is_superuser: # Superadmin can see all projects - projects = Project.objects.all() + projects = Project.objects.all().order_by('-project_id') else: # Non-superuser, filter projects where the user is either the manager or a member - projects = Project.objects.filter(Q(manager=user.staffprofile) | Q(members=user.staffprofile)).distinct() + projects = Project.objects.filter(Q(manager=user.staffprofile) | Q(members=user.staffprofile)).distinct().order_by('-project_id') context = { @@ -96,8 +96,10 @@ def my_projects(request, *args, **kwargs): @login_required def my_tasks(request, *args, **kwargs): + my_tasks = Task.objects.all().filter(assigned_to=request.user.staffprofile).order_by('-id') context = { + 'my_tasks' : my_tasks } return render(request, 'tasks.html', context) @@ -963,27 +965,41 @@ def edit_staff_position(request): @login_required -def edit_project_type(request, *args, **kwargs): +def edit_project_type(request, projecttype_id): + + projecttype = get_object_or_404(ProjectType, id=projecttype_id) - context = { + if request.method == 'POST': + projecttype.name = request.POST.get('name') + projecttype.save() - } - return render(request, 'edit_pages/edit-project-type.html', context) + return redirect('projecttypes') + + return render(request, 'edit_pages/edit-project-type.html', {'projecttype': projecttype}) @login_required -def edit_reference(request, *args, **kwargs): +def edit_reference(request, reference_id): + reference = get_object_or_404(Reference, id=reference_id) - context = { + if request.method == 'POST': + reference.name = request.POST.get('name') + reference.date = request.POST.get('date') + reference.save() - } - return render(request, 'edit_pages/edit-reference.html', context) + return redirect('references') + + return render(request, 'edit_pages/edit-reference.html', {'reference': reference}) @login_required -def edit_tag(request, *args, **kwargs): +def edit_tag(request, tag_id): + tag = get_object_or_404(Tag, id=tag_id) - context = { + if request.method == 'POST': + tag.name = request.POST.get('name') + tag.save() - } - return render(request, 'edit_pages/edit-tag.html', context) \ No newline at end of file + return redirect('tags') + + return render(request, 'edit_pages/edit-tag.html', {'tag': tag}) \ No newline at end of file diff --git a/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc b/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc index 279d9eaf..949a0d9c 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 7dc91c2e..8ca94787 100644 --- a/osinaweb/osinaweb/urls.py +++ b/osinaweb/osinaweb/urls.py @@ -96,9 +96,9 @@ urlpatterns = [ path('editcustomer/', views.edit_customer, name='editcustomer'), path('editbusiness/', views.edit_business, name='editbusiness'), path('editstaff/', views.edit_staff, name='editstaff'), - path('editprojecttype/', views.edit_project_type, name='editprojecttype'), - path('editreference/', views.edit_reference, name='editreference'), - path('edittag/', views.edit_tag, name='edittag'), + path('editprojecttype/', views.edit_project_type, name='editprojecttype'), + path('editreference/', views.edit_reference, name='editreference'), + path('edittag/', views.edit_tag, name='edittag'), path('editstaffposition/', views.edit_staff_position, name='editstaffposition'), ] diff --git a/osinaweb/templates/create-project.html b/osinaweb/templates/create-project.html index 6e348956..9c9af77b 100644 --- a/osinaweb/templates/create-project.html +++ b/osinaweb/templates/create-project.html @@ -48,7 +48,7 @@ - diff --git a/osinaweb/templates/edit_pages/edit-reference.html b/osinaweb/templates/edit_pages/edit-reference.html index 40c53f3e..72c7e8e6 100644 --- a/osinaweb/templates/edit_pages/edit-reference.html +++ b/osinaweb/templates/edit_pages/edit-reference.html @@ -8,12 +8,12 @@ Edit Reference -
+ {% csrf_token %}
diff --git a/osinaweb/templates/edit_pages/edit-tag.html b/osinaweb/templates/edit_pages/edit-tag.html index 9f8606fe..0b631bb8 100644 --- a/osinaweb/templates/edit_pages/edit-tag.html +++ b/osinaweb/templates/edit_pages/edit-tag.html @@ -8,12 +8,12 @@ Edit Tag - + {% csrf_token %}
diff --git a/osinaweb/templates/index.html b/osinaweb/templates/index.html index e02bd631..2c0d0fc1 100644 --- a/osinaweb/templates/index.html +++ b/osinaweb/templates/index.html @@ -126,11 +126,11 @@

Files:

-

Documentation.pdf, Project.doc

+

Tags:

-

Live Streaming, Media Streaming

+

diff --git a/osinaweb/templates/project-types.html b/osinaweb/templates/project-types.html index 3ef18f52..877af42b 100644 --- a/osinaweb/templates/project-types.html +++ b/osinaweb/templates/project-types.html @@ -99,7 +99,7 @@

{{type.name}}

- +
diff --git a/osinaweb/templates/tasks.html b/osinaweb/templates/tasks.html index d11a1482..3b612c56 100644 --- a/osinaweb/templates/tasks.html +++ b/osinaweb/templates/tasks.html @@ -100,188 +100,114 @@
-
- -
-
-

Task Name

-
-
-

Open

-
-
-

1/2/2021

-
-
-

1/2/2022

-
-
- - -
- -
- -
-
-

Project:

-

Osina Project

-
- -
-

Epic:

-

epic

-
- -
-

Assigned To:

-

Nataly

-
- -
-

Files:

-

Documentation.pdf, Project.doc

-
-
-

Tags:

-

Live Streaming, Media Streaming

-
-
-

Extra:

-

Yes

-
+ {% for task in my_tasks %} +
- - -