Skip to content

Allow hiding of event details #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions base-config.yaml
Original file line number Diff line number Diff line change
@@ -2,3 +2,4 @@ secret: "put a random password here"
base_command: "gitlab"
send_as_notice: true
time_format: "%d.%m.%Y %H:%M:%S %Z"
hide_details: false
1 change: 1 addition & 0 deletions gitlab_matrix/util/config.py
Original file line number Diff line number Diff line change
@@ -28,3 +28,4 @@ def do_update(self, helper: ConfigUpdateHelper) -> None:
helper.copy("base_command")
helper.copy("send_as_notice")
helper.copy("time_format")
helper.copy("hide_details")
1 change: 1 addition & 0 deletions gitlab_matrix/webhook.py
Original file line number Diff line number Diff line change
@@ -153,6 +153,7 @@ def abort() -> None:
**OTHER_ENUMS,
"abort": abort,
"util": TemplateUtil,
"hide_details": True,
}

for subevt in evt.preprocess():
8 changes: 5 additions & 3 deletions templates/messages/comment.html
Original file line number Diff line number Diff line change
@@ -14,7 +14,9 @@
{# unsupported comment target #}
{% do abort() %}
{% endif %}
<br/>
{% if object_attributes.description %}
<blockquote>{{ object_attributes.description|markdown }}</blockquote>
{% if not hide_details %}
<br/>
{% if object_attributes.description %}
<blockquote>{{ object_attributes.description|markdown }}</blockquote>
{% endif %}
{% endif %}
11 changes: 7 additions & 4 deletions templates/messages/issue_open.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{{ templates.repo_sender_prefix }}
opened {{ issue_link(object_attributes) }}<br/>
{% if object_attributes.description %}
<blockquote>{{ object_attributes.description|markdown }}</blockquote>
opened {{ issue_link(object_attributes) }}
{% if not hide_details %}
<br/>
{% if object_attributes.description %}
<blockquote>{{ object_attributes.description|markdown }}</blockquote>
{% endif %}
{{ fancy_labels(object_attributes.labels) }}
{% endif %}
{{ fancy_labels(object_attributes.labels) }}
8 changes: 5 additions & 3 deletions templates/messages/merge_request.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{{ templates.repo_sender_prefix }}
{% if action == OPEN %}
opened {{ merge_request_link(object_attributes) }}
{% if object_attributes.description %}
<blockquote>{{ object_attributes.description|markdown }}</blockquote>
{% if not hide_details %}
{% if object_attributes.description %}
<blockquote>{{ object_attributes.description|markdown }}</blockquote>
{% endif %}
{{ fancy_labels(labels) }}
{% endif %}
{{ fancy_labels(labels) }}
{% else %}
{{ object_attributes.action.past_tense }}
{{ merge_request_link(object_attributes) }}
2 changes: 1 addition & 1 deletion templates/messages/tag.html
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
created tag
<a data-mautrix-exclude-plaintext href="{{ ref_url }}">{{ ref_name }}</a>
{% endif %}
{%- if message -%}:
{%- if message and not hide_details -%}:
<blockquote>
{{ message | markdown }}
</blockquote>