Skip to content

Commit

Permalink
use modal pattern for comment edit
Browse files Browse the repository at this point in the history
  • Loading branch information
vangheem committed May 30, 2015
1 parent 68665b6 commit e2192e5
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions plone/app/discussion/browser/comments.pt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
has_replies python:view.has_replies(canReview);
showCommenterImage view/show_commenter_image;
errors options/state/getErrors|nothing;
wtool context/@@plone_tools/workflow;"
wtool context/@@plone_tools/workflow;
auth_token context/@@authenticator/token|nothing"
tal:condition="python:isDiscussionAllowed or has_replies"
i18n:domain="plone">

Expand Down Expand Up @@ -115,19 +116,26 @@
/>
</form>

<form name="edit"
action=""
method="get"
class="commentactionsform"
tal:condition="python:isEditCommentAllowed and canEdit"
tal:attributes="action string:${reply/absolute_url}/@@edit-comment">
<input name="form.button.EditComment"
class="context"
type="submit"
value="Edit"
i18n:attributes="value label_edit;"
/>
</form>
<tal:edit tal:condition="python:isEditCommentAllowed and canEdit">
<!-- plone 5 will have auth_token available
so we'll use modal pattern -->
<a class="commentactionsform pat-plone-modal"
tal:condition="auth_token"
tal:attributes="href string:${reply/absolute_url}/@@edit-comment?_authenticator=${auth_token}">Edit</a>
<form name="edit"
action=""
method="get"
class="commentactionsform"
tal:condition="not: auth_token"
tal:attributes="action string:${reply/absolute_url}/@@edit-comment">
<input name="form.button.EditComment"
class="context"
type="submit"
value="Edit"
i18n:attributes="value label_edit;"
/>
</form>
</tal:edit>


<!-- Workflow actions (e.g. 'publish') -->
Expand Down

2 comments on commit e2192e5

@gforcada
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vangheem
Copy link
Member Author

@vangheem vangheem commented on e2192e5 May 30, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.