Parent: [014b4e] (diff)

Child: [d69cb3] (diff)

Download this file

post_widget.html    118 lines (111 with data), 4.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{% import 'jinja_master/lib.html' as lib with context %}
<div>
<div id="{{value.slug}}" class="discussion-post">
<div class="row">
<div class="column grid_1 tcenter">
<p class="gravatar">
{% set size = value.parent and 32 or 48 %}
<a href="{{value.author().url()}}">{{lib.gravatar(value.author(), size=size)}}</a><br/>
<a href="{{value.author().url()}}">{{value.author().display_name}}</a><br />{{h.ago(value.timestamp)}}
</p>
</div>
<div class="column grid_8">
<div class="display_post">
{% if show_subject %}
<b>{{value.subject or '(no subject)'}}<br/></b>
{% endif %}
{{g.markdown.convert(value.text)|safe}}
</div>
{% if h.has_artifact_access('post', value.thread)() %}
<div class="edit_post_form reply" style="display:none">
{{widgets.edit_post.display(value=value, submit_text='Save', action=value.url())}}
</div>
{% endif %}
{% if h.has_artifact_access('moderate', value)() %}
<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" style="min-height: 130px;">
{% if att.is_image() %}
<a href="{{att.url()}}"><img src="{{att.url()}}/thumb"/></a>
<br/>
<a href="{{att.url()}}">{{att.metadata.filename}}</a>
{% else %}
<a href="{{att.url()}}">{{att.metadata.filename}}</a>
{% endif %}
{% if c.user._id and value.author_id==c.user._id %}
<br>
<form method="POST" action="{{att.url()}}">
<input class="submit delete_attachment" type="submit" name="delete" value="X"/>
</form>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
</div>
<div class="options">
<a href="" class="reply_post btn">Reply</a>
<div style="clear:both">
<a href="{{tg.url(url.current(),dict(page=page,limit=limit))}}#{{value.slug}}" class="little_link shortlink"><span>Link</span></a><br/>
<a href="" class="edit_post little_link"><span>Edit</span></a><br/>
{% if h.has_artifact_access('moderate', value)() %}
{{widgets.moderate_post.display(value=value, action=value.url()+'moderate')}}
{% endif %}
{% if h.has_artifact_access('post', value.thread)() %}
<a href="#" class="add_attachment little_link"><span>Attach</span></a>
{% endif %}
</div>
</div>
<div class="shortlink_popup" style="display: none">
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='<a href="{{tg.url(url.current(),dict(page=page,limit=limit))}}#{{value.slug}}">{{value.subject or "comment"}}</a>'>
</div>
</div>
<ul>
<li>
{% if h.has_artifact_access('post', value.thread)() %}
<div class="row reply_post_form" style="display:none">
<div class="reply">
<div class="column grid_1 tcenter">
<p class="gravatar">
{{lib.gravatar(c.user, size=32)}}<br/><br/>
<a href="{{c.user.url()}}">{{c.user.display_name}}</a>
</p>
</div>
<div class="column grid_8">
{{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 class="span-2" py:if="has_artifact_access('post', value.thread)()">
<a href="" class="add_attachment"><span class="ui-icon ui-icon-document"></span>Attach</a>
</div>
<div class="span-2" py:if="has_artifact_access('moderate', value.thread)() and 'promote_to_thread' in widgets and not supress_promote">
<a href="" class="promote_to_thread"><span class="ui-icon ui-icon-arrowthick-1-n"></span>Promote</a>
</div>
</div>-->
{% if h.has_artifact_access('moderate', value.thread)() and 'promote_to_thread' in widgets and not supress_promote %}
<div class="promote_to_thread_form push-{{3+indent}} span-{{16-indent}} last clear" style="display:none">
{{widgets.promote_to_thread.display(value=value, action=value.url()+'moderate')}}
</div>
{% endif %}
</div>