Skip to content

Commit

Permalink
Added edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekaterina-Vititneva committed Aug 3, 2024
1 parent 9876900 commit 9a0d18f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions project_1/wiki/encyclopedia/templates/encyclopedia/title.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@

{{ title_content|safe }}

<button type="submit" name="edit">Edit</button>

{% endblock %}
1 change: 1 addition & 0 deletions project_1/wiki/encyclopedia/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
path("search", views.search, name="search"),
path("create", views.create, name="create"),
path("save", views.save, name="save"),
path("edit", views.edit, name="edit"),
]
5 changes: 4 additions & 1 deletion project_1/wiki/encyclopedia/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@ def save(request):
file.write(f"# {new_title}\n\n{content}")
return redirect('title_1', title=new_title)
else:
raise Http404("Another encyclopedia entry already exists with the provided title")
raise Http404("Another encyclopedia entry already exists with the provided title")

def edit():
pass

0 comments on commit 9a0d18f

Please sign in to comment.