From 039438847cf85d146d2d8e7dd1ef784e905912e4 Mon Sep 17 00:00:00 2001 From: faizahmed Date: Mon, 2 Jan 2023 21:02:58 +0500 Subject: [PATCH 1/3] design a view to create a list or project --- js/index.js | 14 +++++- views/view-task.html | 101 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 106 insertions(+), 9 deletions(-) diff --git a/js/index.js b/js/index.js index 856ea83..cf41eb8 100644 --- a/js/index.js +++ b/js/index.js @@ -25,12 +25,20 @@ let upcoming = [{ title: "Lorem3", description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." }] + + + let projectList = { "today": today, - "upcoming": upcoming + "upcoming": upcoming, + "project1": project1, + "project2": project2, + "project3": project3 } -let currentView; + + +let currentView; function removeTask(id) { @@ -87,3 +95,5 @@ function showProject(listId) { + + diff --git a/views/view-task.html b/views/view-task.html index 249af41..d7e87f7 100644 --- a/views/view-task.html +++ b/views/view-task.html @@ -100,7 +100,7 @@
+
+ + +
+
+ +
+ +
+
+ +
+ +

Today

@@ -265,8 +285,10 @@
@@ -299,6 +321,37 @@ + +
+ +
+ @@ -311,4 +364,38 @@ - \ No newline at end of file + + + \ No newline at end of file From 29349f6b4a2f250aac1400c59554f0a2450da025 Mon Sep 17 00:00:00 2001 From: faizahmed Date: Mon, 2 Jan 2023 21:17:49 +0500 Subject: [PATCH 2/3] list should be displayed based on object array --- js/index.js | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/js/index.js b/js/index.js index cf41eb8..c6f9a21 100644 --- a/js/index.js +++ b/js/index.js @@ -26,6 +26,47 @@ let upcoming = [{ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." }] +let project1 = [{ + id: 10, + title: "Lorem1", + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +}, { + id: 12, + title: "Lorem2", + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +}, { + id: 11, + title: "Lorem3", + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +}] + +let project2 = [{ + id: 13, + title: "Lorem1", + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +}, { + id: 15, + title: "Lorem2", + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +}, { + id: 14, + title: "Lorem3", + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +}] + +let project3 = [{ + id: 16, + title: "Lorem1", + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +}, { + id: 18, + title: "Lorem2", + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +}, { + id: 17, + title: "Lorem3", + description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." +}] let projectList = { @@ -36,7 +77,11 @@ let projectList = { "project3": project3 } - +let projectList1 = { + "project1": project1, + "project2": project2, + "project3": project3 +} let currentView; @@ -92,6 +137,23 @@ function showProject(listId) { } +function showProjectList() { + projectListArray = Object.keys(projectList1); + let projects = ""; + for (let i = 0; i < projectListArray.length; i++) { + projects +="
  • " + + "
    " + + ""+ projectListArray[i]+"" + + "" + + "
    " + + "
  • "; + } + document.getElementById("projects").innerHTML = projects; +} + + From 6ee81132a75a5b27f0a6853f0dcd254b23547d5a Mon Sep 17 00:00:00 2001 From: faizahmed Date: Mon, 2 Jan 2023 21:51:57 +0500 Subject: [PATCH 3/3] remove comments from code --- views/view-task.html | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/views/view-task.html b/views/view-task.html index d7e87f7..7f4d92b 100644 --- a/views/view-task.html +++ b/views/view-task.html @@ -364,38 +364,4 @@ - - - \ No newline at end of file + \ No newline at end of file