| {#- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| -#} |
| {% import 'allura:templates/jinja_master/lib.html' as lib with context %} |
| |
| {% if page == 0 %} |
| {% set params = None %} |
| {% else %} |
| {% set params = dict(page=page, limit=limit) %} |
| {% endif %} |
| {% set shortlink_url = tg.url( |
| request.scheme + '://' + request.host + url.current(), params) |
| + '#' + value.slug %} |
| |
| <div> |
| <div id="{{value.slug}}" class="discussion-post"> |
| <div class="row"> |
| <div class="grid-2 tcenter gravatar"> |
| <p class="gravatar"> |
| {% set size = value.parent and 32 or 48 %} |
| {{lib.gravatar(value.author(), size=size)}}<br> |
| <small> |
| {{lib.user_link(value.author())}} |
| </small> |
| <br> |
| <small>{{lib.abbr_date(value.timestamp)}}</small> |
| </p> |
| </div> |
| <div class="grid-14" style="width: {{indent == 0 and 525 or (indent <= 40 and 515-indent*10 or 65)}}px"> |
| <div class="display_post{%if (value.status == 'pending') and h.has_access(value, 'moderate')()%} moderate{%endif%}"> |
| {% if (value.status == 'pending') and not h.has_access(value, 'moderate')() %} |
| <b>Post awaiting moderation.</b> |
| {% else %} |
| {% if show_subject %} |
| <b>{{value.subject or '(no subject)'}}<br/></b> |
| {% endif %} |
| {{g.markdown.cached_convert(value, 'text')|safe}} |
| {{lib.related_artifacts(value)}} |
| {% if value.edit_count %} |
| <br><small>Last edit: {{value.last_edit_by().display_name}} {{h.ago(value.last_edit_date)}}</small> |
| {% endif %} |
| {% endif %} |
| </div> |
| {% if h.has_access(value, 'moderate')() %} |
| <div class="edit_post_form reply" style="display:none"> |
| {{widgets.edit_post.display(value=value, submit_text='Post', action=value.url())}} |
| </div> |
| {% endif %} |
| {% if h.has_access(value, 'moderate')() %} |
| <div class="add_attachment_form" style="display:none; clear: both; overflow: auto;"> |
| {{widgets.attach_post.display(value=value, action=value.url() + 'attach')}} |
| </div> |
| {% endif %} |
| {% if value.attachments %} |
| <div> |
| <strong>Attachments</strong> |
| <div class="clear"></div> |
| {% for att in value.attachments %} |
| <div class="attachment_thumb"> |
| <form method="POST" action="{{att.url()}}"> |
| {% if att.is_image() %} |
| <a href="{{att.url()}}"><img src="{{att.url()}}/thumb" alt="Thumbnail"/></a> |
| <br/> |
| <a href="{{att.url()}}">{{att.filename}}</a> |
| {% if c.user._id and value.author_id==c.user._id %} |
| <br> |
| <input class="submit delete_attachment pic" type="submit" value="X"/> |
| {% endif %} |
| {% else %} |
| <a href="{{att.url()}}">{{att.filename}}</a> |
| {% if c.user._id and value.author_id==c.user._id %} |
| <input class="submit delete_attachment file" type="submit" value="X"/> |
| {% endif %} |
| {% endif %} |
| <input type="hidden" name="delete" value="True"> |
| {{lib.csrf_token()}} |
| </form> |
| </div> |
| {% endfor %} |
| </div> |
| {% endif %} |
| </div> |
| <div class="options grid-3"> |
| {% if h.has_access(value.thread, 'post')() %} |
| <a href="" class="reply_post btn"{%if value.status == 'pending'%} style="display:none"{%endif%}><b data-icon="{{g.icons['reply'].char}}" class="ico {{g.icons['reply'].css}}"></b>Reply</a> |
| {% endif %} |
| <div style="clear:both"> |
| <div class="little_link"> |
| <a href="{{shortlink_url}}" class="little_link shortlink"{%if value.status == 'pending'%} style="display:none"{%endif%}><span>Link</span></a><br/> |
| {% if h.has_access(value, 'moderate')()%} |
| <a href="" class="edit_post little_link"><span>Edit</span></a><br/> |
| {% endif %} |
| </div> |
| {% if h.has_access(value.thread, 'moderate')() %} |
| {{widgets.moderate_post.display(value=value, action=value.url()+'moderate', status = value.status)}} |
| {%endif%} |
| {% if h.has_access(value.thread, 'post')() %} |
| <a href="#" class="add_attachment little_link"><span>Attach</span></a> |
| {% endif %} |
| </div> |
| </div> |
| <div class="shortlink_popup modal" style="display: none"> |
| <b data-icon="{{g.icons['close'].char}}" class="ico {{g.icons['close'].css}} close"></b> |
| If you would like to refer to this comment somewhere else in this project, copy and paste the following link: |
| <input type="text" style="width:100%" value="{{shortlink_url}}"> |
| </div> |
| </div> |
| <ul> |
| <li> |
| {% if h.has_access(value.thread, 'post')() %} |
| <div class="row reply_post_form" style="display:none"> |
| <div class="reply"> |
| <div class="grid-2 tcenter"> |
| <p class="gravatar"> |
| {{lib.gravatar(c.user, size=32)}}<br> |
| <small> |
| {{lib.user_link(c.user)}} |
| </small> |
| </p> |
| </div> |
| <div class="grid-14" style="width: {{indent <= 40 and 625-indent*10 or 225}}px"> |
| {{widgets.edit_post.display( |
| submit_text='Post Reply', |
| action=value.url()+'reply', |
| value=dict( |
| text='', |
| subject=value.reply_subject()), |
| )}} |
| </div> |
| </div> |
| </div> |
| {% endif %} |
| </li> |
| </ul> |
| </div> |
| </div> |
| |
| {% block extra_css %} |
| <style type="text/css"> |
| div.moderate { |
| color:grey; |
| } |
| </style> |
| {% endblock %} |