Skip to content

Commit

Permalink
show author page (instead of Member folder) on member search
Browse files Browse the repository at this point in the history
  • Loading branch information
Markos Gogoulos committed Feb 22, 2012
1 parent ca2ec69 commit ac146b8
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plumi/skin/browser/templates/authorlist.pt
Expand Up @@ -33,7 +33,7 @@

<tal:rep tal:repeat="user batch">
<div class="card">
<a href="#" tal:attributes="href user/home_folder">
<a href="#" tal:attributes="href string:author/${user/userid}">
<img src="defaultUser.gif"
alt=""
border="0"
Expand Down
@@ -0,0 +1,76 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
lang="en"
metal:use-macro="here/main_template/macros/master"
i18n:domain="plone">

<metal:block fill-slot="top_slot"
tal:define="dummy python:request.set('disable_border',1)" />

<metal:main fill-slot="main"
tal:define="search_view here/@@pas_search;
listing_allowed python: checkPermission('List portal members', here);
results python:listing_allowed and search_view.searchUsersByRequest(request, sort_by='fullname') or [];
Batch python:modules['Products.CMFPlone'].Batch;
DateTime python:modules['DateTime'].DateTime;
b_size python:12;b_start python:0;b_start request/b_start | b_start;">

<h1 class="documentFirstHeading"
i18n:translate="heading_search_results">Search results</h1>

<div id="content-core">
<p tal:condition="not: listing_allowed"
i18n:translate="member_listing_not_allowed">
You are not allowed to list portal members.
</p>
<div tal:condition="results"
tal:define="batch python:Batch(results, b_size, int(b_start), orphan=1)">

<strong i18n:translate="batch_x_items_matching_your_criteria">
<span i18n:name="number" tal:omit-tag="" tal:content="python:len(results)">234</span> items matching your search terms
</strong>

<div metal:use-macro="here/batch_macros/macros/navigation"/>

<div tal:define="pm context/@@plone_tools/membership;
portal_url context/@@plone_portal_state/portal_url">
<metal:block tal:repeat="result batch">
<div class="card" tal:define="userid result/userid | nothing;
personal_info python:pm.getMemberInfo(userid) or {};
home python:pm.getHomeUrl(userid, verifyPermission=1);
portrait python:pm.getPersonalPortrait(userid);">

<a href="#"
tal:attributes="href python:'%s/author/%s' % (portal_url, userid) or home">
<img src="defaultUser.png"
alt=""
border="0"
width="75"
height="100"
tal:attributes="src portrait/absolute_url" />
<br />
<span tal:content="python:personal_info.get('fullname', userid)">user id</span>
</a>

</div>
</metal:block>
</div>

<div class="visualClear" id="clear-space-before-navigation"><!-- --></div>

<div metal:use-macro="here/batch_macros/macros/navigation" />

<div class="visualClear" id="clear-space-after-navigation"><!-- --></div>

</div>

<div tal:condition="not: results">
<p><strong i18n:translate="description_no_results_found">No results were found.</strong></p>
</div>
</div>

</metal:main>

</html>
@@ -0,0 +1,2 @@
[default]
title=Search for users

0 comments on commit ac146b8

Please sign in to comment.