<#-- ~ 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. --> <#include "/WEB-INF/freemarker/common/globals.ftl"> <#import "/WEB-INF/freemarker/repository/repository_macros.ftl" as repoMacros> <#assign userId><@security.authentication property="principal.userId" /> <#-- determin if this user is an APPLICATION_ADMIN --> <#assign isApplicationAdmin = false> <@security.authorize access="hasAnyRole('APPLICATION_ADMIN')"> <#assign isApplicationAdmin = true> <#include "/WEB-INF/freemarker/repository/search_template.ftl">
<#include "/WEB-INF/freemarker/repository/repository_list_left.ftl">
<#if gadget.screenshotUrl?? >
<#if gadget.thumbnailUrl?? >
${gadgetStatistics.userLike}
${gadgetStatistics.userDislike}
${gadget.gadgetCommentList?size}
${gadgetStatistics.userCount} users
Version: ${gadget.version}
Last Updated: ${gadget.modifiedDate?date?string("MM/d/yyyy")}
${gadget.title?xhtml}
<#-- if the gadget is hidden display the "hidden" div only to admins. normal users can still get to the detail page to comment even if the gadget is hidden from the repository --> <#if gadget.hidden && isApplicationAdmin>
Hidden
<#-- if the gadget is not hidden, or if it is hidden and user is an admin display the add gadget button. we only want users to be able to add a gadget if it is not "hidden" and we want admins to always be able to add a gadget --> <#if !gadget.hidden || isApplicationAdmin>
<@security.authorize access="hasAnyRole('OFFICIAL_GADGET_DEVELOPER','UNOFFICIAL_GADGET_DEVELOPER')"> <@security.authorize access="hasRole('REPOSITORY_ADMIN')">
/delete" onSubmit="return portal.repository.admin.deleteGadget();" style="display: inline;" >
<@repoMacros.renderGadgetAuthor gadget />
${gadget.description?xhtml}
<#if gadget.gadgetAudienceList?size > 0>
Intended Audience: <#list gadget.gadgetAudienceList as gadgetAudience> <#if gadget.gadgetAudienceList?seq_contains(gadgetAudience)> ${gadgetAudience.description?xhtml}<#if gadgetAudience_has_next>,
<#if gadget.gadgetTagList?size > 0>
Tags: <#list gadget.gadgetTagList as gadgetTags> <#if gadget.gadgetTagList?seq_contains(gadgetTags)> ${gadgetTags.tagName?xhtml}<#if gadgetTags_has_next>,
Gadget Preview
<#if gadget.gadgetSupportLinkType.code != "NONE">
Having problems? <#if gadget.gadgetSupportLinkType.code ="HD" && .globals.helpDeskURL?? > Contact the Help Desk <#elseif gadget.gadgetSupportLinkType.code ="URL"> Click Here <#else > Email the Author
Rate & Comment <#-- display comment mode toggle if user is an admin --> <#if isApplicationAdmin>
Rate This Gadget:
<#assign userRating = "${gadgetStatistics.userRating}"/>
useful

not useful
Add a comment:
/addComment" method="POST">
<#-- list the gadget comments --> <#list gadgetComments as gadgetComment> <#assign person = personsWithCommentsMap[gadgetComment.userId] > <#if person?? && person.avatarUrl?? > <#assign photoUrl = person.avatarUrl> <#else> <#assign photoUrl = .globals.staticContentImages + "/pictureNotFound.gif"> <#-- lookup the display names of the commentor and last update user, if applicable --> <#if gadgetComment.createdByAdmin> <#assign personDisplayName = "${.globals.appName} Team"> <#else> <#assign personDisplayName = getDisplayNameFromUserId(gadgetComment.userId)> <#if gadgetComment.lastModifiedByAdmin> <#assign lastModPersonDisplayName = "${.globals.appName} Team"> <#else> <#assign lastModPersonDisplayName = getDisplayNameFromUserId(gadgetComment.lastModifiedUserId!"")>
<#if gadgetComment.createdByAdmin> <#else> <#if gadgetComment.gadgetRating??> <#if gadgetComment.gadgetRating == 0> <#assign gadgetRatingLike = false> <#else> <#assign gadgetRatingLike = true>
  ${personDisplayName?xhtml} ${gadgetComment.createdDate?string("M/d/yyyy")} v${gadgetComment.gadgetVersion?xhtml}<#if gadgetComment.userId == userId || isApplicationAdmin>   class="notmyComment">edit
${gadgetComment.commentText?xhtml}
<#if gadgetComment.commentModified && !gadgetComment.createdByAdmin>
Updated by ${lastModPersonDisplayName?xhtml} ${gadgetComment.lastModifiedDate?string("M/d/yyyy")}
<#include "/WEB-INF/freemarker/repository/also_by.ftl">
<#-- display the non-linkable app store image in the left side when displaying the all view--> <#-- function getDisplayNameFromUserId: lookup a person's display name given a userId Parameters: 1) userId - the userId to search for in the user map --> <#function getDisplayNameFromUserId userId> <#if personsWithCommentsMap[userId]??> <#assign displayName = personsWithCommentsMap[userId].displayName> <#else> <#assign displayName = "Former Employee"> <#return displayName>