Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thomasDOTwtf
hub
Commits
46889708
Commit
46889708
authored
5 months ago
by
Roang
Browse files
Options
Downloads
Patches
Plain Diff
Add render of original message to reply form
parent
21cfcd5d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plainui/jinja2/plainui/personal_message_send.html.j2
+10
-1
10 additions, 1 deletion
src/plainui/jinja2/plainui/personal_message_send.html.j2
src/plainui/views/personal_messages.py
+9
-0
9 additions, 0 deletions
src/plainui/views/personal_messages.py
with
19 additions
and
1 deletion
src/plainui/jinja2/plainui/personal_message_send.html.j2
+
10
−
1
View file @
46889708
{% import "plainui/components/form_elements.html.j2" as form_elements %}
{% import "plainui/components/form_elements.html.j2" as form_elements %}
{% import "plainui/components/nav.html.j2" as navMacro with context %}
{% import "plainui/components/nav.html.j2" as navMacro with context %}
{% from "plainui/components/markdown.html.j2" import markdown %}
{% extends "plainui/base.html.j2" %}
{% extends "plainui/base.html.j2" %}
...
@@ -42,6 +43,14 @@
...
@@ -42,6 +43,14 @@
</div>
</div>
</div>
</div>
</form>
</form>
{% if in_reply_to %}
<hr class="hub-spacer">
<div class="p-0 m-0">
<div class="hub-card">
<h2 class="hub-head-main">{{ in_reply_to.subject }}</h2>
<div class="card-body">{{ markdown(in_reply_to_body, border=False) }}</div>
</div>
</div>
{% endif %}
<hr class="hub-spacer">
<hr class="hub-spacer">
{% endblock content %}
{% endblock content %}
This diff is collapsed.
Click to expand it.
src/plainui/views/personal_messages.py
+
9
−
0
View file @
46889708
...
@@ -5,6 +5,8 @@ __all__ = (
...
@@ -5,6 +5,8 @@ __all__ = (
'
PersonalMessageShowView
'
,
'
PersonalMessageShowView
'
,
)
)
import
contextlib
from
django_ratelimit.decorators
import
ratelimit
from
django_ratelimit.decorators
import
ratelimit
from
django.contrib
import
messages
from
django.contrib
import
messages
...
@@ -67,10 +69,17 @@ class PersonalMessageSendView(ConferenceRequiredMixin, FormView):
...
@@ -67,10 +69,17 @@ class PersonalMessageSendView(ConferenceRequiredMixin, FormView):
form_class
=
NewDirectMessageForm
form_class
=
NewDirectMessageForm
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
in_reply_to_uuid
=
self
.
request
.
POST
.
get
(
'
in_reply_to
'
,
self
.
request
.
GET
.
get
(
'
in_reply_to
'
,
''
))
in_reply_to
=
None
if
in_reply_to_uuid
:
with
contextlib
.
suppress
(
DirectMessage
.
DoesNotExist
):
in_reply_to
=
DirectMessage
.
objects
.
filter
(
recipient
=
self
.
request
.
user
,
deleted_by_recipient
=
False
).
get
(
id
=
in_reply_to_uuid
)
return
{
return
{
**
super
().
get_context_data
(
**
kwargs
),
**
super
().
get_context_data
(
**
kwargs
),
'
conf
'
:
self
.
conf
,
'
conf
'
:
self
.
conf
,
'
disable_share
'
:
True
,
'
disable_share
'
:
True
,
'
in_reply_to
'
:
in_reply_to
,
'
in_reply_to_body
'
:
render_markdown
(
self
.
conf
,
in_reply_to
.
body
)
if
in_reply_to
else
''
,
}
}
def
get_initial
(
self
):
def
get_initial
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment