-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #351 from scidsg/contact-method
Add optional contact method field
- Loading branch information
Showing
9 changed files
with
209 additions
and
66 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
document.addEventListener('DOMContentLoaded', function() { | ||
// Handle message deletion confirmation | ||
document.getElementById('deleteMessageButton')?.addEventListener('click', function(event) { | ||
const confirmed = confirm('Are you sure you want to delete this message? This cannot be undone.'); | ||
if (!confirmed) { | ||
event.preventDefault(); | ||
// Listen for clicks anywhere in the document | ||
document.addEventListener('click', function(event) { | ||
// Check if the clicked element or its parents have the 'btn-danger' class | ||
let targetElement = event.target; | ||
while (targetElement != null) { | ||
if (targetElement.classList && targetElement.classList.contains('btn-danger')) { | ||
// Confirm before deletion | ||
const confirmed = confirm('Are you sure you want to delete this message? This cannot be undone.'); | ||
if (!confirmed) { | ||
event.preventDefault(); | ||
} | ||
return; // Exit the loop and function after handling the click | ||
} | ||
targetElement = targetElement.parentElement; | ||
} | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""empty message | ||
Revision ID: 2e5a6b20908d | ||
Revises: cab44a7264a5 | ||
Create Date: 2024-05-24 19:57:36.878591 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "2e5a6b20908d" | ||
down_revision = "cab44a7264a5" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("message", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("contact_method", sa.String(length=255), nullable=True)) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("message", schema=None) as batch_op: | ||
batch_op.drop_column("contact_method") | ||
|
||
# ### end Alembic commands ### |
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,33 @@ | ||
"""empty message | ||
Revision ID: 73306df7f74c | ||
Revises: 2e5a6b20908d | ||
Create Date: 2024-05-25 01:04:44.495978 | ||
""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "73306df7f74c" | ||
down_revision = "2e5a6b20908d" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("message", schema=None) as batch_op: | ||
batch_op.drop_column("contact_method") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("message", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("contact_method", sa.VARCHAR(length=255), nullable=True)) | ||
|
||
# ### end Alembic commands ### |
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,25 @@ | ||
"""empty message | ||
Revision ID: cab44a7264a5 | ||
Revises: 9803e4dcb0a6 | ||
Create Date: 2024-05-24 19:55:09.067118 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "cab44a7264a5" | ||
down_revision = "9803e4dcb0a6" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
pass | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
pass | ||
# ### end Alembic commands ### |
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