diff options
author | luxagraf <sng@luxagraf.net> | 2023-11-18 19:05:53 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-11-18 19:05:53 -0500 |
commit | 1c3509f17c4280c346587070b4a81647634de5df (patch) | |
tree | 83b2230ff0998ea7d1a62d3a1a2637a040bac5d4 | |
parent | b2f7894ed55eabf89089e318111f6dd06d480792 (diff) |
gtd: fixed a bug adding wirednotes and rearranged top menu
-rw-r--r-- | app/gtd/forms.py | 17 | ||||
-rw-r--r-- | app/gtd/urls.py | 2 | ||||
-rw-r--r-- | app/gtd/views.py | 10 | ||||
-rw-r--r-- | templates/base_gtd.html | 9 |
4 files changed, 12 insertions, 26 deletions
diff --git a/app/gtd/forms.py b/app/gtd/forms.py index 595611b..3e93a02 100644 --- a/app/gtd/forms.py +++ b/app/gtd/forms.py @@ -27,23 +27,6 @@ class GTDProjectUpdateForm(ModelForm): fields = ['title', 'body_markdown', 'date_goal', 'project_type', 'outcome', 'date_ended'] -class WiredNoteCreateForm(ModelForm): - - def __init__(self, *args, **kwargs): - user = kwargs.pop('user') - self.user = user - super(WiredNoteCreateForm, self).__init__(*args, **kwargs) - self.fields['post'].required = False - - def save(self, commit=True): - self.instance.user = self.user - return super().save(commit=commit) - - class Meta: - model = WiredNote - fields = ['title', 'url', 'body_markdown', 'post'] - - class WiredNoteEditForm(ModelForm): def __init__(self, *args, **kwargs): diff --git a/app/gtd/urls.py b/app/gtd/urls.py index a56bbf4..c47e968 100644 --- a/app/gtd/urls.py +++ b/app/gtd/urls.py @@ -8,7 +8,7 @@ urlpatterns = [ path( r'todo', views.GTDNoteTODOView.as_view(), - name="note-todo" + name="todo-list" ), path( r'notes', diff --git a/app/gtd/views.py b/app/gtd/views.py index db014b1..bb11030 100644 --- a/app/gtd/views.py +++ b/app/gtd/views.py @@ -8,7 +8,6 @@ from .forms import ( GTDNoteEditForm, GTDProjectCreateForm, GTDProjectUpdateForm, - WiredNoteCreateForm, WiredNoteEditForm, WiredPostUpdateForm ) @@ -46,7 +45,6 @@ class GTDNoteUpdateView(UpdateView): return reverse('gtd:note-list', kwargs={"pk": self.object.project.pk}) - class GTDNoteListView(ListView): model = GTDNote template_name = "gtd/note_list.html" @@ -78,8 +76,14 @@ class GTDNoteTODOView(ListView): template_name = "gtd/note_list.html" def get_queryset(self): + # need to get wired notes and gtd notes and blend them by + # date created maybe? return GTDNote.objects.filter(status=1) + def get_context_data(self, **kwargs): + context = super(GTDNoteTODOView, self).get_context_data(**kwargs) + return context + class GTDProjectCreateView(CreateView): model = GTDProject @@ -139,7 +143,7 @@ class GTDProjectDeleteView(DeleteView): class WiredNoteCreateView(CreateView): model = WiredNote - form_class = WiredNoteCreateForm + fields = ['title', 'url', 'body_markdown', 'post'] template_name = "gtd/wirednote_form.html" def get_success_url(self): diff --git a/templates/base_gtd.html b/templates/base_gtd.html index d429828..96dab38 100644 --- a/templates/base_gtd.html +++ b/templates/base_gtd.html @@ -20,13 +20,12 @@ <a class="logo-link" href="/" title="Home">L</span></a> </div> <nav> - <a class="nav-item" href="/gtd/todo" title="View things that need to be done">todo</a> - <a class="nav-item" href="{% url 'gtd:outcome-list' %}" title="View Guides">Outcomes</a> - <a class="nav-item" href="{% url 'gtd:project-list' %}" title="View Notes">Projects</a> <a class="nav-item" href="{% url 'gtd:note-list' %}" title="View Notes">Notes</a> - <a class="nav-item" href="{% url 'gtd:wiredpost-list' %}" title="View Notes">Wired Posts</a> <a class="nav-item" href="{% url 'gtd:wirednote-list' %}" title="View Notes">Wired Notes</a> - <a class="nav-item" href="{%url 'gtd:note-create'%}" title="View new stuff todo">new</a> + <a class="nav-item" href="{% url 'gtd:wiredpost-list' %}" title="View Notes">Wired Posts</a> + <a class="nav-item" href="{% url 'gtd:project-list' %}" title="View Notes">Projects</a> + <a class="nav-item" href="{% url 'gtd:todo-list' %}" title="View things that need to be done">todo</a> + <a class="nav-item" href="{% url 'gtd:outcome-list' %}" title="View Guides">Outcomes</a> </nav> </header> {% block breadcrumbs %}{% endblock %} |