-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ignore custom settings file * create view for udpating comment * create views for deleting comments * add comment_update and comment_delete to urls * add date_updated field to comment model * comment_date_updated * add author field to commentform * remove author field from commentform * change comment url from comments/ to comment/ * import comment model in views file * reduce comment buttons to 10px * add edit and delete buttons under comments * rename add_comment.html to comment.html * update comment.html to handle editing and creating * create success url for leaving comments * comment out create-comment endpoint * delete create-comment endpoint * seperate template for updating comment * update commentUpdateView * run black test * delete js code from post_detail.html * properly configure gitignore * add unit tests for update and delete urls * Merge master into edit delete comments (#309) * Fix failing test * add tests * Refactor add comment code (#307) * update urls for editing and deleting comments * use form for delete button to POST post slug * use class-based view for delete endpoint * run black tests * update tests for comments ednpoints * update commentUpdateView * comment-out comment tests * delete views import for updating/deleting comments * Add test * import comment model and form * remove comment form and model imports * add view tests for update_comment * add view test for deleting posts * import comment model * fix error in test_update_comment * add url tests for updating/deleting comments * comment test_profliew_view test * comment test_profile_view * run ruff checks * modified: django_project/tests/test_views.py * uncomment profile view tests * rename user in test * improve styling on comment edit and delete buttons * refactoring * refactoring --------- Co-authored-by: John Solly <[email protected]> Co-authored-by: John Solly <[email protected]>
- Loading branch information
1 parent
333043d
commit 430718c
Showing
14 changed files
with
294 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,5 +32,8 @@ migration_backup | |
|
||
# Other | ||
logs/ | ||
.vscode/ | ||
|
||
db.sqlite3 | ||
db.sqlite3-journal | ||
db.sqlite3-journal | ||
|
17 changes: 17 additions & 0 deletions
17
django_project/blog/migrations/0033_comment_date_updated.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.2 on 2023-06-28 13:44 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("blog", "0032_remove_comment_body_comment_content"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="comment", | ||
name="date_updated", | ||
field=models.DateTimeField(auto_now=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,4 @@ <h3>Comment</h3> | |
</section> | ||
|
||
{% endblock content %} | ||
|
||
|
||
|
10 changes: 10 additions & 0 deletions
10
django_project/blog/templates/blog/comment/update_comment.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% extends 'blog/post/post_detail.html' %} | ||
|
||
{% block content %} | ||
<h2>Update Comment</h2> | ||
<form method="post"> | ||
{% csrf_token %} | ||
{{ form.as_p }} | ||
<button type="submit">Update</button> | ||
</form> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.