Changes for page ExternalApps
Last modified by bougault on 2019/09/12 12:46
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,31 +1,104 @@ 1 1 {{velocity}} 2 -{{html}} 2 +{{html clean="false"}} 3 3 ## space: $spaceDoc <br /> 4 4 ## children: $spaceDoc.getChildren() 5 5 6 -#set($query = 'select app.title app.descriptionfrom Document doc, doc.object(ExternalApps.Code.ExternalAppsClass) as app')7 -#set($apps = $services.query.xwql($query).addFilter('hidden').execute()) 6 +#set($query = 'select doc from Document doc, doc.object(ExternalApps.Code.ExternalAppsClass) as app') 7 +#set($applications = $services.query.xwql($query).addFilter('hidden').execute()) 8 8 9 -#foreach($app in $apps) 10 - $app 11 -#end 12 -#* 13 -#foreach($child in $spaceDoc.getChildren()) 14 - #set($childDoc = $xwiki.getDocument($child)) 15 - #set($URL = $childDoc.display('url')) 16 - #set($title = $childDoc.display('title')) 17 - <div> 18 - #if($childDoc.getAttachment('logo.png').isImage()) 19 - <img src="$childDoc.getAttachmentURL('logo.png')" width="75" height="75" alt="$title.replace('"', '\"')"> 20 - #else 21 - <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mN89x8AAuEB74Y0o2cAAAAASUVORK5CYII=" width="75" height="75" alt=""> 22 - #end 23 - <h3>$title</h3> 24 - <a href="$URL">$URL</a> 25 - <p>$!childDoc.getValue('description')</p> 26 - <input id="$child.concat('-visibility')" type="checkbox" #if($childDoc.getValue('private') == 'Yes')checked#end disabled /><label for="$child.concat('-visibility')">Private</label> 27 - </div> 28 -#end 29 -*# 9 +<style> 10 +.applications { 11 + display: grid; 12 + grid-gap: 10px; 13 +} 14 + 15 +@media screen and (min-width: 640px) { 16 + .applications { 17 + grid-template-columns: 1fr 1fr; 18 + } 19 +} 20 +/* 21 +@media screen and (min-width: 900px) { 22 + .applications { 23 + grid-template-columns: 1fr 1fr 1fr; 24 + } 25 +} 26 +*/ 27 + 28 +@media screen and (min-width: 1200px) { 29 + .applications { 30 + grid-template-columns: 1fr 1fr 1fr; 31 + } 32 +} 33 + 34 +@media screen and (min-width: 1800px) { 35 + .applications { 36 + grid-template-columns: 1fr 1fr 1fr 1fr; 37 + } 38 +} 39 + 40 +.application { 41 + border: 1px solid var(--color-support-light); 42 + padding: 1rem; 43 + height: 100%; 44 +} 45 + 46 +.application img { 47 + display: block; 48 + margin: 0 auto 1.5rem auto; 49 +} 50 + 51 +.application .title { 52 + text-align: center; 53 + height: 3em; 54 +} 55 + 56 +.application .tags { 57 + display: flex; 58 + justify-content: space-around; 59 + margin-bottom: 1.5rem; 60 +} 61 + 62 +.application .tags span { 63 + font-size: .8rem; 64 + border: 1px solid var(--color-support-dark); 65 + padding: .2rem .3rem; 66 + border-radius: var(--border-radius-default); 67 +} 68 + 69 +.application .description { 70 + text-align: center; 71 +} 72 +</style> 73 + 74 + 75 +<div class="applications"> 76 + #foreach($application in $applications) 77 + #set($app = $xwiki.getDocument($application)) 78 + #set($URL = $app.display('url')) 79 + #set($title = $app.display('title')) 80 + #set($category = $app.display('category')) 81 + <div> 82 + <div class="application"> 83 + #if($app.getAttachment('logo.png').isImage()) 84 + <img src="$app.getAttachmentURL('logo.png')" width="75" height="75" alt="$title.replace('"', '\"')"> 85 + #else 86 + <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mN89x8AAuEB74Y0o2cAAAAASUVORK5CYII=" width="75" height="75" alt=""> 87 + #end 88 + <div class="tags"><span>$category</span></div> 89 + <h3 class="title">$title</h3> 90 + ##<a href="$URL">$URL</a> 91 + <p class="description">$!app.getValue('description')</p> 92 + ##<input id="$application.concat('-visibility')" type="checkbox" #if($app.getValue('private') == 1)checked#end disabled /><label for="$application.concat('-visibility')">Private</label> 93 + 94 + <div> 95 + ##$app.getValue('maintainers') 96 + ##$app.display('maintainers') 97 + </div> 98 + 99 + </div> 100 + </div> 101 + #end 102 +</div> 30 30 {{/html}} 31 31 {{/velocity}}