Skip to content
Snippets Groups Projects
Commit cbbb3a1c authored by srosse's avatar srosse
Browse files

CL-526: display user interest and user searched interests properties side by...

CL-526: display user  interest and user searched interests properties side by side if the two are present
parent 43c1c885
No related branches found
No related tags found
No related merge requests found
...@@ -91,13 +91,24 @@ public class HomePageDisplayController extends BasicController { ...@@ -91,13 +91,24 @@ public class HomePageDisplayController extends BasicController {
// do the looping in the velocity context // do the looping in the velocity context
List<UserPropertyHandler> userPropertyHandlers List<UserPropertyHandler> userPropertyHandlers
= new ArrayList<UserPropertyHandler>(userManager.getUserPropertyHandlersFor(usageIdentifyer, false)); = new ArrayList<UserPropertyHandler>(userManager.getUserPropertyHandlersFor(usageIdentifyer, false));
UserPropertyHandler userSearchedInterestsHandler = null;
UserPropertyHandler userInterestsHandler = null;
for(Iterator<UserPropertyHandler> propIt=userPropertyHandlers.iterator(); propIt.hasNext(); ) { for(Iterator<UserPropertyHandler> propIt=userPropertyHandlers.iterator(); propIt.hasNext(); ) {
UserPropertyHandler prop = propIt.next(); UserPropertyHandler prop = propIt.next();
if(!hpc.isEnabled(prop.getName()) && !userManager.isMandatoryUserProperty(usageIdentifyer, prop)) { if(!hpc.isEnabled(prop.getName()) && !userManager.isMandatoryUserProperty(usageIdentifyer, prop)) {
propIt.remove(); propIt.remove();
} else if("userInterests".equals(prop.getName())) {
userInterestsHandler = prop;
} else if("userSearchedInterests".equals(prop.getName())) {
userSearchedInterestsHandler = prop;
} }
} }
if(userInterestsHandler != null && userSearchedInterestsHandler != null) {
userPropertyHandlers.remove(userSearchedInterestsHandler);
}
mainVC.contextPut("userPropertyHandlers", userPropertyHandlers); mainVC.contextPut("userPropertyHandlers", userPropertyHandlers);
mainVC.contextPut("userSearchedInterestsHandler", userSearchedInterestsHandler);
mainVC.contextPut("homepageConfig", hpc); mainVC.contextPut("homepageConfig", hpc);
// Add external link to visiting card // Add external link to visiting card
......
<div class="o_visitingcard clearfix well"><div class="o_scrollblock"> <div class="o_visitingcard clearfix well"><div class="o_scrollblock">
<h2> <h2><i class="o_icon o_icon_visitingcard"></i> $r.translate("menu.homepage") $userFullname</h2>
<i class="o_icon o_icon_visitingcard"></i>
$r.translate("menu.homepage") $userFullname
</h2>
#if ($deleted) #if ($deleted)
<p class="o_warning"> <p class="o_warning">$r.translate("user.deleted")</p>
$r.translate("user.deleted")
</p>
#end #end
<div class="o_visitingcard_content"> <div class="o_visitingcard_content">
<div class="o_visitingcard_image o_block"> <div class="o_visitingcard_image o_block">$r.render("image")</div>
$r.render("image")
</div>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
#if($r.available("im.link")) #if($r.available("im.link"))
<tr class="o_im_status"> <tr class="o_im_status">
<th> <th>$r.translate("status")</th>
<label> <td colspan="3"><div id="o_im_buddy">$r.render("im.link")</div></td>
$r.translate("status")
</label>
</th>
<td>
<div id="o_im_buddy">
$r.render("im.link")
</div>
</td>
</tr> </tr>
#end #end
#foreach( $propertyHandler in $userPropertyHandlers ) #foreach($propertyHandler in $userPropertyHandlers )
<tr> <tr>
<th> <th>$r.translate($propertyHandler.i18nFormElementLabelKey()) </th>
<label> #if($propertyHandler.name == "userInterests" && $userSearchedInterestsHandler)
$r.translate($propertyHandler.i18nFormElementLabelKey()) <td>$!propertyHandler.getUserPropertyAsHTML($user, $locale)</td>
</label> <th>$r.translate($userSearchedInterestsHandler.i18nFormElementLabelKey())</th>
</th> <td>$!userSearchedInterestsHandler.getUserPropertyAsHTML($user, $locale)</td>
<td> #else
$!propertyHandler.getUserPropertyAsHTML($user, $locale) <td colspan="3">$!propertyHandler.getUserPropertyAsHTML($user, $locale)</td>
</td> #end
</tr> </tr>
#end #end
#if ( $homepageConfig.getTextAboutMe() && ($homepageConfig.getTextAboutMe() != "") ) #if( $homepageConfig.getTextAboutMe() && ($homepageConfig.getTextAboutMe() != "") )
<tr valign="top" class="o_user_aboutme"> <tr valign="top" class="o_user_aboutme">
<th> <th>$r.translate("form.text")</th>
<label> <td colspan="3">$!r.formatLatexFormulas($homepageConfig.getTextAboutMe())</td>
$r.translate("form.text")
</label>
</th>
<td>
$!r.formatLatexFormulas($homepageConfig.getTextAboutMe())
</td>
</tr> </tr>
#end #end
</table> </table>
......
...@@ -343,6 +343,7 @@ form.name.telPrivate.error.empty=Das Feld "Telefon Privat" darf nicht leer sein. ...@@ -343,6 +343,7 @@ form.name.telPrivate.error.empty=Das Feld "Telefon Privat" darf nicht leer sein.
form.name.telPrivate.error.valid=Bitte geben Sie eine g\u00FCltige Telefonnummer an. form.name.telPrivate.error.valid=Bitte geben Sie eine g\u00FCltige Telefonnummer an.
form.name.typeOfUser=Art von Benutzer form.name.typeOfUser=Art von Benutzer
form.name.userInterests=Expertise form.name.userInterests=Expertise
form.name.userSearchedInterests=Gesuchte Expertise
form.name.xing=Xing form.name.xing=Xing
form.name.xing.error=Bitte geben Sie einen g\u00FCltigen Xing-Namen an (Entspricht dem in der WWW-Adresse Ihres Xing-Profiles, http\://www.xing.com/profile/&lt;Ihr Benutzername&gt;) form.name.xing.error=Bitte geben Sie einen g\u00FCltigen Xing-Namen an (Entspricht dem in der WWW-Adresse Ihres Xing-Profiles, http\://www.xing.com/profile/&lt;Ihr Benutzername&gt;)
form.name.zipCode=Postleitzahl form.name.zipCode=Postleitzahl
......
...@@ -343,6 +343,7 @@ form.name.telPrivate.error.empty=The field "Phone number private" is mandatory. ...@@ -343,6 +343,7 @@ form.name.telPrivate.error.empty=The field "Phone number private" is mandatory.
form.name.telPrivate.error.valid=Please enter a valid phone number form.name.telPrivate.error.valid=Please enter a valid phone number
form.name.typeOfUser=Type of user form.name.typeOfUser=Type of user
form.name.userInterests=Expertise form.name.userInterests=Expertise
form.name.userSearchedInterests=Searched Expertise
form.name.xing=Xing form.name.xing=Xing
form.name.xing.error=Please indicate a valid Xing name (the one in the www address of your Xing profile, http\://www.xing.com/profile/<your user name>) form.name.xing.error=Please indicate a valid Xing name (the one in the www address of your Xing profile, http\://www.xing.com/profile/<your user name>)
form.name.zipCode=Zip code form.name.zipCode=Zip code
......
...@@ -343,6 +343,7 @@ form.name.telPrivate.error.empty=Le champ "t\u00E9l\u00E9phone priv\u00E9" ne do ...@@ -343,6 +343,7 @@ form.name.telPrivate.error.empty=Le champ "t\u00E9l\u00E9phone priv\u00E9" ne do
form.name.telPrivate.error.valid=Veuillez indiquer un num\u00E9ro de t\u00E9l\u00E9phone valide form.name.telPrivate.error.valid=Veuillez indiquer un num\u00E9ro de t\u00E9l\u00E9phone valide
form.name.typeOfUser=Type d'utilisateur form.name.typeOfUser=Type d'utilisateur
form.name.userInterests=Comp\u00E9tences form.name.userInterests=Comp\u00E9tences
form.name.userSearchedInterests=Comp\u00E9tences recherch\u00E9es
form.name.xing=Xing form.name.xing=Xing
form.name.xing.error=Veuillez indiquer un nom Xing valide (correspondant \u00E0 celui dans l'adresse www de votre profile Xing, http\://www.xing.com/profile/<votre nom d'utilisateur) form.name.xing.error=Veuillez indiquer un nom Xing valide (correspondant \u00E0 celui dans l'adresse www de votre profile Xing, http\://www.xing.com/profile/<votre nom d'utilisateur)
form.name.zipCode=NPA / Code postal form.name.zipCode=NPA / Code postal
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment