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

Development #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Development #1

wants to merge 18 commits into from

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
[email protected] 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
devise_for :users, controllers: { session: 'users/session' }
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root 'tasklists#index'
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

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
devise_for :users, controllers: { session: 'users/session' }
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root 'tasklists#index'
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.

2 participants