Failed to execute template. Cause: [Access denied when checking [script] access to [xwiki:Collaboratory.UX.HbpSkin.WebHome] for user [xwiki:XWiki.Admin]]. Click on this message for details.

Apps - HBP Wiki

IAM21 instance, do not create collab nor modify a team, your changes will be lost


Wiki source code of Apps

Version 2.3 by bougault on 2023/02/06 15:09

Hide last authors
hbpadmin 1.1 1 {{include reference="Collaboratory.Apps.Apps.Code.AppsMacros"/}}
2
3 {{velocity output="no"}}
4 $xwiki.ssx.use('Collaboratory.UX.SSX.noheader')
5 #set($displayDocExtra = false)
6
7 ## Get filter parameters from Query String, build the query and get applications that match
8 #set($searchTerm = $request.getParameter('text'))
9 #if(!$searchTerm) #set($searchTerm = '') #end
10 #set($categoryTerm = $request.getParameter('category'))
11 #if(!$categoryTerm) #set($categoryTerm = '') #end
12 #set($displayInDevApps = 0)
13 #if($request.getParameter('development') == '1')
14 #set($displayInDevApps = 1)
15 #end
16
17 #set($query = "select doc from Document doc, doc.object(Collaboratory.Apps.Apps.Catalogue.Code.CatalogueClass) as app where (app.description like :search or app.name like :search) and (:category = '' or app.category = :category) and app.development = :indev")
18 #set($applications = $services.query.xwql($query).bindValue('search', "%$searchTerm%").bindValue('category', $categoryTerm).bindValue('indev', $displayInDevApps).addFilter('hidden').execute())
19 #set($totalApplications = $applications.size()) ## Get how many applications match. Used to custom view if none or more than 0.
20
21 ## Get categories list for Category filter
22 #set($categories = $xwiki.getClass('Collaboratory.Apps.Apps.Catalogue.Code.CatalogueClass').category.getValue('values').split('[|]'))
23
24 ## Has current user permission to create an App?
25 #set($createAppGroup = $services.user.group.getMembers('xwiki:XWiki.feature:create_app', false))
26 #set($isUserAppCreator = $createAppGroup.contains($xcontext.userReference))
27 {{/velocity}}
28 {{velocity}}
29 {{html clean="false"}}
bougault 1.4 30 <h1 style="color: red;">localhost call for dev !!</h1>
bougault 2.3 31 ## we need to import the javascript like that so we have the `module` type
bougault 2.2 32 <!--script type="module" src="$services.webjars.url('eu.hbp.wiki:xwiki-webapp-collaboratory', 'collab.esm.js')"></script-->
bougault 2.3 33 <script src="http://127.0.0.1:5500/clb-modal.js"></script>
hbpadmin 1.1 34 <div class="row external-apps-header">
35 <div class="col-md-8">
36 <h1>Community Apps</h1>
37 </div>
38 <div class="col-md-4">
39 #if($isUserAppCreator)
40 <a class="btn btn-primary pull-right" href="$doc.getURL('create')"><span class="fa fa-plus"></span> Create App</a>
41 #end
42 </div>
43 </div> ## /.row.externap-apps-header
44
45 <div class="row">
46 <div class="col-md-3">
47 ## Filter form
48 <form action="$doc.getURL('view')" method="get">
49 <div class="form-group">
50 <label for="application-text-filter">Filter by text</label>
51 <input type="text" name="text" id="application-text-filter" value="$searchTerm">
52 </div>
53 <div class="form-group">
54 <label for="application-category-filter">Filter by category</label>
55 <select name="category">
56 <option value="">All</option>
57 #foreach($category in $categories)
58 <option value="$category" #if($categoryTerm == $category)selected#end>$category</option>
59 #end
60 </select>
61 </div>
62
63 <div class="checkbox">
64 <label>
65 <input type="checkbox" name="development" value="1"#if($displayInDevApps == 1) checked#end> Show In Development Apps
66 </label>
67 </div>
68 <button class="btn btn-primary" type="submit">Filter</button>
69 <a class="btn btn-primary-inverted" href="$doc.getURL('view')">Reset</a>
70 </form>
71 </div> ## /.col-md-3
72 <div class="col-md-9">
73 ## Applications list
74 #if($totalApplications > 0)
75 ## There are applications that match, display them.
76 <div class="applications-count">
77 <strong>$totalApplications</strong> application#if($totalApplications > 1)s#end found
78 #if($searchTerm != '') for <strong>$escapetool.html($searchTerm)</strong>#end
79 #if($categoryTerm != '') in <strong>$escapetool.html($categoryTerm)</strong> category#end
80 </div>
81 #applications($applications false)
82 #else
83 ## No Application corresponds to filter, display a message to inform the user
84 <div class="applications-no-results">
85 <h3>
86 No Application Found
87 #if($searchTerm != '') for <i>'$escapetool.html($searchTerm)'</i>#end
88 #if($categoryTerm != '') in <i>'$escapetool.html($categoryTerm)'</i> category#end
89 </h3>
90 <a class="btn btn-primary-inverted" href="$doc.getURL('view')">Reset Filters</a>
91 #end
92 </div> ## /.col-md-9
93 </div> ## /.row
94 {{/html}}
95 {{/velocity}}