Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.

Conversation

@EloquentShashank
Copy link
Contributor

No description provided.

}

var taskNamePartial = [];
var taskChecked = [];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong datastructure

$(".tasklistUpdateButton").on("click", renderUpdateTasklist);
});

function inputForTask(tasklistId) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use moustache templates

if (taskChecked[taskId] == true) {
$("#checkbox" + taskId).attr("checked", "checked");
}
$(".taskname").on("click", renderUpdate);

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.

$("#newtasks").show();
$("#newtasks").addClass("card");
$("#newtasks").append(input);
$(".createNewTaskButton").on("click", createTask);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

$("#newtasklist")
.html(inputForTasklist())
.append("<br>");
$("#createTasklistButton").on("click", createTasklist);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

else
render 'edit'
end
@task = @tasklist.tasks.find(params[:id])

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}"}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"tasklist-#{@tasklist.id}"

@@ -0,0 +1,22 @@
.tab-content
-@tasks.each do |task|
.row

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use lists

%br
.row
%br
%button.btn.btn-primary#addTaskButton{"data-tasklistid": params[:id]} Add Task

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'

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stupid name

@@ -0,0 +1,370 @@
$(document).ready(function() {
const storage = localStorage.getItem("selectedTasklistCount");

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?

%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

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'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stupid name

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants