-
Notifications
You must be signed in to change notification settings - Fork 0
Development #1
base: master
Are you sure you want to change the base?
Development #1
Conversation
errors, redirections and Ui changes need to be done
app/assets/javascripts/custom.js
Outdated
| } | ||
|
|
||
| var taskNamePartial = []; | ||
| var taskChecked = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong datastructure
app/assets/javascripts/custom.js
Outdated
| $(".tasklistUpdateButton").on("click", renderUpdateTasklist); | ||
| }); | ||
|
|
||
| function inputForTask(tasklistId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use moustache templates
app/assets/javascripts/custom.js
Outdated
| if (taskChecked[taskId] == true) { | ||
| $("#checkbox" + taskId).attr("checked", "checked"); | ||
| } | ||
| $(".taskname").on("click", renderUpdate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not the right place to do this.
app/assets/javascripts/custom.js
Outdated
| $("#newtasks").show(); | ||
| $("#newtasks").addClass("card"); | ||
| $("#newtasks").append(input); | ||
| $(".createNewTaskButton").on("click", createTask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
app/assets/javascripts/custom.js
Outdated
| $("#newtasklist") | ||
| .html(inputForTasklist()) | ||
| .append("<br>"); | ||
| $("#createTasklistButton").on("click", createTasklist); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
app/controllers/tasks_controller.rb
Outdated
| else | ||
| render 'edit' | ||
| end | ||
| @task = @tasklist.tasks.find(params[:id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use before_action
| @@ -0,0 +1,8 @@ | |||
| .row.algin-middle.tasklistname{id: "tasklist_list#{@tasklist.id}"} | |||
| .col-sm-8 | |||
| .tasklist_list{"data-index": current_user.tasklists.count - 1, "data-tasklistid": @tasklist.id, id: "tasklist#{@tasklist.id}"} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"tasklist-#{@tasklist.id}"
app/views/tasklists/_tasks.html.haml
Outdated
| @@ -0,0 +1,22 @@ | |||
| .tab-content | |||
| -@tasks.each do |task| | |||
| .row | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use lists
app/views/tasklists/_tasks.html.haml
Outdated
| %br | ||
| .row | ||
| %br | ||
| %button.btn.btn-primary#addTaskButton{"data-tasklistid": params[:id]} Add Task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params should be referenced in view
config/routes.rb
Outdated
| resources :tasklists do | ||
| resources :tasks | ||
| member do | ||
| get 'render_tasks' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tasks
consider using nested resource routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read up shallow nested routes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stupid name
Active tasklist set setActivetasklist fuction removed
app/assets/javascripts/custom.js
Outdated
| @@ -0,0 +1,370 @@ | |||
| $(document).ready(function() { | |||
| const storage = localStorage.getItem("selectedTasklistCount"); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why such a stupid name? storage
What does the store contain?
app/views/tasks/_task.html.haml
Outdated
| %span.fa.fa-edit#taskUpdate.updateTask{"data-tasklistid": @task.tasklist.id, "data-taskid": @task.id} | ||
| .col-sm-1.align-self-center | ||
| %span.far.fa-trash-alt.taskDelete#taskDelete{"data-tasklistid": @task.tasklist.id, "data-taskid": @task.id} | ||
| %br No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line at end of file
config/routes.rb
Outdated
| resources :tasklists do | ||
| resources :tasks | ||
| member do | ||
| get 'render_tasks' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stupid name
No description provided.