Commit f406fa52 authored by Ivan Tyagov's avatar Ivan Tyagov

Show author thumbnail (if available).

parent 0cf62a74
...@@ -58,12 +58,16 @@ portal = context.getPortalObject()\n ...@@ -58,12 +58,16 @@ portal = context.getPortalObject()\n
author = context.getSourceValue()\n author = context.getSourceValue()\n
result = {\'author_url\': None,\n result = {\'author_url\': None,\n
\'author_signature\': None,\n \'author_signature\': None,\n
\'author_title\': context.Base_translateString(\'Unknown User\')}\n \'author_title\': context.Base_translateString(\'Unknown User\'),\n
\'author_thumbnail_url\': None}\n
\n \n
if author is not None:\n if author is not None:\n
result[\'author_url\'] = \'%s/view\' %author.getAbsoluteUrl()\n result[\'author_url\'] = \'%s/view\' %author.getAbsoluteUrl()\n
result[\'author_signature\'] = portal.ERP5Site_getUserPreferredForumSettingsDict(author.getReference())[\'preferred_forum_signature\']\n result[\'author_signature\'] = portal.ERP5Site_getUserPreferredForumSettingsDict(author.getReference())[\'preferred_forum_signature\']\n
result[\'author_title\'] = author.getTitle()\n result[\'author_title\'] = author.getTitle()\n
thumbnail = author.getDefaultImage()\n
if thumbnail is not None:\n
result[\'author_thumbnail_url\'] = thumbnail.absolute_url()\n
\n \n
return result\n return result\n
</string> </value> </string> </value>
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <unicode encoding="cdata"><![CDATA[ <value> <unicode encoding="cdata"><![CDATA[
<!-- XXX: include only once not for every post item -->\n
\n
<script src="erp5_discussion.js" type="text/javascript"></script>\n <script src="erp5_discussion.js" type="text/javascript"></script>\n
<link href="erp5_discussion.css" rel="stylesheet" type="text/css">\n <link href="erp5_discussion.css" rel="stylesheet" type="text/css">\n
\n \n
...@@ -44,6 +46,8 @@ ...@@ -44,6 +46,8 @@
author_url author_dict/author_url;\n author_url author_dict/author_url;\n
author_signature author_dict/author_signature;\n author_signature author_dict/author_signature;\n
author_title author_dict/author_title;\n author_title author_dict/author_title;\n
author_thumbnail_url author_dict/author_thumbnail_url;\n
is_author_thumbnai_available python: author_thumbnail_url is not None;\n
discussion_post_id discussion_post_object/getId;\n discussion_post_id discussion_post_object/getId;\n
discussion_post_uid discussion_post_object/getUid;\n discussion_post_uid discussion_post_object/getUid;\n
discussion_post_title discussion_post_object/getTitle;\n discussion_post_title discussion_post_object/getTitle;\n
...@@ -53,42 +57,43 @@ ...@@ -53,42 +57,43 @@
discussion_post_stripped_html discussion_post_object/asStrippedHTML;\n discussion_post_stripped_html discussion_post_object/asStrippedHTML;\n
isUserAllowedToPost python: discussion_post_object.getParentValue().DiscussionThread_isUserAllowedToPost()">\n isUserAllowedToPost python: discussion_post_object.getParentValue().DiscussionThread_isUserAllowedToPost()">\n
\n \n
<div class="discussion-post-header">\n <div class="discussion-post-header"\n
tal:attributes="style python: test(is_author_thumbnai_available, \'height:96px\',\'\')">\n
\n
<div class="thumbnail"\n
tal:condition="is_author_thumbnai_available">\n
<img tal:attributes="src string:${author_thumbnail_url}?display=thumbnail&format=png"/>\n
</div>\n
\n \n
<div class="title">\n
<a class="discussion-post-title"\n <a class="discussion-post-title"\n
tal:attributes="href string:${discussion_post_url}/view;\n tal:attributes="href string:${discussion_post_url}/view;\n
name discussion_post_uid"\n name discussion_post_uid"\n
tal:content="discussion_post_title"></a>\n tal:content="discussion_post_title"/>\n
\n by\n
<div class="discussion-post-creator">\n
by \n
<a class="discussion-post-creator-title-link"\n <a class="discussion-post-creator-title-link"\n
tal:attributes="href author_url"\n tal:attributes="href author_url"\n
tal:content="author_title"></a> \n tal:content="author_title"/>\n
on \n at \n
<tal:block tal:replace="discussion_post_creation_date" />\n <span tal:content="discussion_post_creation_date" />\n
</div>\n </div>\n
\n \n
</div>\n </div>\n
\n \n
<!-- Post Body -->\n <div class="discussion-post-body-container"\n
<div class="discussion-post-body-container">\n tal:content="structure discussion_post_stripped_html"/>\n
\n \n
<div class="discussion-post-body"\n
tal:content="structure discussion_post_stripped_html"></div>\n
\n
</div>\n
\n
<!-- Signature -->\n
<div tal:condition="python: author_signature is not None"\n <div tal:condition="python: author_signature is not None"\n
class="discussion-post-author-signature-container"\n class="discussion-post-author-signature-container"\n
tal:content="author_signature"></div>\n tal:content="author_signature"/>\n
\n \n
<div class="discussion-post-actions">\n
<button tal:condition="isUserAllowedToPost" type="submit"\n <button tal:condition="isUserAllowedToPost" type="submit"\n
title="Reply"\n title="Reply"\n
name="DiscussionThread_redirectCreateNewDiscussionPost:method"\n name="DiscussionThread_redirectCreateNewDiscussionPost:method"\n
tal:attributes="onClick python: \'redirectCreateCitedNewDiscussionPost(\\\'%s\\\')\' %discussion_post_id"\n tal:attributes="onClick python: \'redirectCreateCitedNewDiscussionPost(\\\'%s\\\')\' %discussion_post_id"\n
class="discussion-post-action-button">Reply</button>\n class="discussion-post-action-button">Reply</button>\n
</div>\n
\n \n
</tal:block> </tal:block>
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
<string>selection_name</string> <string>selection_name</string>
<string>sort</string> <string>sort</string>
<string>title</string> <string>title</string>
<string>url_columns</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -157,6 +158,17 @@ ...@@ -157,6 +158,17 @@
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Discussion Posts</string> </value> <value> <string>Discussion Posts</string> </value>
</item> </item>
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>getSummaryAsHTML</string>
<string></string>
</tuple>
</list>
</value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts89832986.24</string> </value> <value> <string>ts06927933.02</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -28,25 +28,41 @@ ...@@ -28,25 +28,41 @@
ERP5 discussion forum.\n ERP5 discussion forum.\n
*/\n */\n
\n \n
div.discussion-post-header{\n .discussion-post-header{\n
background-color: #efefef;\n background-color: #efefef;\n
color:#000000;\n color:#000000;\n
padding: 3px; \n padding: 3px; \n
margin: 0em; \n margin: 0em;\n
height: 20px;\n
}\n }\n
\n \n
div.discussion-post-body-container{\n .discussion-post-header .thumbnail,\n
.discussion-post-creator .title{\n
float:left;\n
}\n
\n
.discussion-post-header .thumbnail{\n
width:14%;\n
}\n
\n
.discussion-post-header .title{\n
width:85%;\n
}\n
\n
a.discussion-post-title{\n
font-weight: bold;\n
}\n
\n
.discussion-post-body-container{\n
float: left;\n float: left;\n
margin-left: 10px;\n margin-left: 10px;\n
margin-top: 10px;\n margin-top: 10px;\n
margin-bottom: 10px;\n margin-bottom: 10px;\n
}\n
\n
div.discussion-post-body{\n
color: black;\n color: black;\n
}\n }\n
\n \n
div.discussion-post-author-signature-container{\n \n
.discussion-post-author-signature-container{\n
margin-left:10px; \n margin-left:10px; \n
margin-bottom:1em; \n margin-bottom:1em; \n
color:#aaa;\n color:#aaa;\n
...@@ -66,7 +82,10 @@ blockquote {\n ...@@ -66,7 +82,10 @@ blockquote {\n
margin:5px;\n margin:5px;\n
padding:10px 15px;\n padding:10px 15px;\n
}\n }\n
</string> </value> \n
.discussion-post-actions{\n
float:left;\n
}</string> </value>
</item> </item>
<item> <item>
<key> <string>precondition</string> </key> <key> <string>precondition</string> </key>
...@@ -74,7 +93,7 @@ blockquote {\n ...@@ -74,7 +93,7 @@ blockquote {\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>659</int> </value> <value> <int>913</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
96 97
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment