예제 #1
0
func ProjectNotes(writer io.Writer, indent int, project *data.Project) {
	if len(project.Notes()) == 0 {
		return
	}

	HeaderProject(writer, indent+1, project)
	Notes(writer, indent+2, project.Notes())
}
예제 #2
0
func ProjectTodos(writer io.Writer, indent int, project *data.Project) {
	if len(project.Todos()) == 0 {
		return
	}

	HeaderProject(writer, indent+1, project)
	Todos(writer, project.Todos())
}
예제 #3
0
func GetTestProject(suffix string, notes, todos int) data.Project {
	project := data.Project{
		Name: data.ProjectName([]string{"Test", "Project", suffix}),
	}

	for i := 0; i != notes; i++ {
		project.AddNote(GetTestNote(i, "note note note"))
	}

	for i := 0; i != todos; i++ {
		project.AddTodo(data.Todo{
			TimeStamp: time.Date(2010+i, time.November, 10, 23, 0, 0, 0, time.UTC),
			Value:     "todo todo todo",
			Active:    true,
		})
	}

	return project
}
예제 #4
0
func Project(writer io.Writer, indent int, project *data.Project) {
	todos := project.Todos()
	notes := project.Notes()

	if len(todos) == 0 && len(notes) == 0 {
		return
	}

	HeaderProject(writer, indent+1, project)

	if len(todos) != 0 {
		HeaderTodos(writer, indent+2)
		Todos(writer, todos)
	}

	if len(notes) != 0 {
		HeaderNotes(writer, indent+2)
		Notes(writer, indent+3, notes)
	}
}