diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index ca83b831..baeaa03c 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ diff --git a/osinaweb/osinacore/__pycache__/models.cpython-310.pyc b/osinaweb/osinacore/__pycache__/models.cpython-310.pyc index eec19d90..7787f23e 100644 Binary files a/osinaweb/osinacore/__pycache__/models.cpython-310.pyc and b/osinaweb/osinacore/__pycache__/models.cpython-310.pyc differ diff --git a/osinaweb/osinacore/__pycache__/views.cpython-310.pyc b/osinaweb/osinacore/__pycache__/views.cpython-310.pyc index d2a65bf3..ac45bc43 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/migrations/0053_pointactivity.py b/osinaweb/osinacore/migrations/0053_pointactivity.py new file mode 100644 index 00000000..d68c44fd --- /dev/null +++ b/osinaweb/osinacore/migrations/0053_pointactivity.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.5 on 2024-01-30 19:40 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('osinacore', '0052_note_project'), + ] + + operations = [ + migrations.CreateModel( + name='PointActivity', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('start_time', models.DateTimeField()), + ('end_time', models.DateTimeField()), + ('point', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='osinacore.point')), + ], + ), + ] diff --git a/osinaweb/osinacore/migrations/__pycache__/0052_note_project.cpython-310.pyc b/osinaweb/osinacore/migrations/__pycache__/0052_note_project.cpython-310.pyc new file mode 100644 index 00000000..6a1d1208 Binary files /dev/null and b/osinaweb/osinacore/migrations/__pycache__/0052_note_project.cpython-310.pyc differ diff --git a/osinaweb/osinacore/migrations/__pycache__/0053_pointactivity.cpython-310.pyc b/osinaweb/osinacore/migrations/__pycache__/0053_pointactivity.cpython-310.pyc new file mode 100644 index 00000000..9c5b5965 Binary files /dev/null and b/osinaweb/osinacore/migrations/__pycache__/0053_pointactivity.cpython-310.pyc differ diff --git a/osinaweb/osinacore/models.py b/osinaweb/osinacore/models.py index b481741b..9072d3f5 100644 --- a/osinaweb/osinacore/models.py +++ b/osinaweb/osinacore/models.py @@ -259,6 +259,13 @@ class Point(models.Model): time_completed = models.CharField(max_length=200, null=True, blank=True) +class PointActivity(models.Model): + point = models.ForeignKey(Point, on_delete=models.CASCADE, null=True) + start_time = models.DateTimeField() + end_time = models.DateTimeField() + + + class Status(models.Model): text = models.TextField(blank=True) diff --git a/osinaweb/osinacore/views.py b/osinaweb/osinacore/views.py index c746c5fa..a90f1c84 100644 --- a/osinaweb/osinacore/views.py +++ b/osinaweb/osinacore/views.py @@ -332,9 +332,14 @@ def createtask_project(request, project_id): @login_required -def create_user_story_task(request): +def create_user_story_task(request, requirement_id): + requirement = get_object_or_404(ProjectRequirement, id=requirement_id) + members_list = list(requirement.project.members.all()) context = { + 'requirement' : requirement, + 'members_list' : members_list, + } return render(request, 'add_pages/create-user-story-task.html', context) @@ -829,6 +834,13 @@ def save_task(request): description = request.POST.get('description') start_date = request.POST.get('start_date') end_date = request.POST.get('end_date') + requirement_id = request.POST.get('requirement') + + if requirement_id: + requirement = get_object_or_404(ProjectRequirement, id =requirement_id) + + else: + requirement = None project_id = request.POST.get('project') @@ -850,7 +862,8 @@ def save_task(request): description=description, start_date=start_date, end_date=end_date, - assigned_to = assigned_to + assigned_to = assigned_to, + requirement = requirement, ) @@ -860,7 +873,11 @@ def save_task(request): # Redirect to the task detailed page task_details_url = reverse('detailed-task', args=[task.task_id]) - return HttpResponseRedirect(task_details_url) + if requirement: + return redirect('detailed-project', project_id=project.project_id) + else: + return HttpResponseRedirect(task_details_url) + diff --git a/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc b/osinaweb/osinaweb/__pycache__/urls.cpython-310.pyc index 7cd21658..b66428c2 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 c675ad54..294ca4b6 100644 --- a/osinaweb/osinaweb/urls.py +++ b/osinaweb/osinaweb/urls.py @@ -41,7 +41,7 @@ urlpatterns = [ path('createepic//', views.create_epic, name='createepic'), path('createtask/', views.create_task, name='createtask'), path('createtask//', views.createtask_project, name='createtaskproject'), - path('createuserstorytask/', views.create_user_story_task, name='createuserstorytask'), + path('createuserstorytask//', views.create_user_story_task, name='createuserstorytask'), path('createtaskepic/', views.createtask_epic, name='createtaskepic'), path('projecttypes/', views.project_types, name='projecttypes'), path('businesstypes/', views.business_types, name='businesstypes'), @@ -107,7 +107,6 @@ urlpatterns = [ #Save Urls path('save_note/', views.save_note, name='save_note'), path('save_project_note/', views.save_project_note, name='save_project_note'), - path('save_project/', views.save_project, name='save_project'), path('save_epic/', views.save_epic, name='save_epic'), path('save_task/', views.save_task, name='save_task'), diff --git a/osinaweb/templates/add_pages/create-user-story-task.html b/osinaweb/templates/add_pages/create-user-story-task.html index 3fcdfff1..7a4b4959 100644 --- a/osinaweb/templates/add_pages/create-user-story-task.html +++ b/osinaweb/templates/add_pages/create-user-story-task.html @@ -7,108 +7,114 @@

- Create Task + Create Task for {{requirement.content}}

-
-
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
- -
- - -
+
+ {% csrf_token %} +
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- -
-
- - Upload - Document(s) - +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ + Upload + Document(s) + +
-
-
- -
- -
+ +
+ +
+
diff --git a/osinaweb/templates/details_pages/project-details.html b/osinaweb/templates/details_pages/project-details.html index b9f1f2e3..fc1a516e 100644 --- a/osinaweb/templates/details_pages/project-details.html +++ b/osinaweb/templates/details_pages/project-details.html @@ -297,36 +297,43 @@ {% if project.projectrequirement_set.all %} {% for requirement in project.projectrequirement_set.all %} - - -

{{requirement.content}}

- - - -

-

- - - - -