-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathtile.scala.html
More file actions
69 lines (65 loc) · 4.08 KB
/
tile.scala.html
File metadata and controls
69 lines (65 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@(space: models.ProjectSpace, classes: String, route: Call, showFollow: Boolean)(implicit user: Option[models.User])
@import _root_.util.Formatters.ellipsize
@import api.Permission
@import play.api.i18n.Messages
<div class="post-box @classes" id="@space.id-tile">
<div class="panel panel-default space-panel">
<div class="panel-body">
@if(!space.logoURL.isEmpty) {
<a href="@routes.Spaces.getSpace(space.id)">
<img class="img-responsive" src="@(space.logoURL)" alt="Thumbnail of @(space.name)">
</a>
}
<div class="caption break-word">
<h4 class="no-overflow oneline"><a href="@routes.Spaces.getSpace(space.id)">@space.name</a></h4>
<p class = 'abstractsummary'>@space.description.replace("\n","<br>")</p>
</div>
</div>
<!-- Space Info -->
<ul class="list-group">
<li class="list-group-item space-panel-footer">
<span class="glyphicon glyphicon-briefcase" title="@space.datasetCount datasets"></span> @space.datasetCount
<span class="glyphicon glyphicon-th-large" title="@space.collectionCount collections"></span> @space.collectionCount
<span class="glyphicon glyphicon-user" title="@space.userCount users"></span> @space.userCount
@if(user.isDefined) {
<!-- If user can delete, the button is enabled, otherwise the button is present but disabled to provide consistent UE. -->
@if(Permission.checkPermission(Permission.DeleteSpace, ResourceRef(ResourceRef.space, space.id)) || user.get.identityId.userId.equals(space.creator)){
<button onclick="confirmDeleteResource('space','@Messages("space.title")','@(space.id)','@(space.name.replace("'","'"))',false, '@route')" class="btn btn-link" title="Delete the @Messages("space.title") but not its contents">
<span class="glyphicon glyphicon-trash"></span>
</button>
} else {
<div class="inline" title="Not enough permission to delete the @Messages("space.title")">
<button disabled class="btn btn-link"><span class="glyphicon glyphicon-trash"></span></button>
</div>
}
<!-- If user can view, the search button is enabled, otherwise the button is present but disabled to provide consistent UE. -->
@if(Permission.checkPermission(Permission.ViewSpace, ResourceRef(ResourceRef.space, space.id)) || user.get.identityId.userId.equals(space.creator)){
<a href="@routes.Metadata.search()?spaceid=@space.id" class="btn btn-link pull-right" style="display:contents" title="Search metadata within the @Messages("space.title")">
<span class="glyphicon glyphicon-search"></span>
</a>
} else {
<div class="inline" title="Not enough permission to search the @Messages("space.title")">
<button disabled class="btn btn-link"><span class="glyphicon glyphicon-search"></span></button>
</div>
}
}
</li>
</ul>
@if(showFollow) {
@user match {
case Some(viewer) => {
<ul class="list-group center-margin">
<button id="followButton" type="button" class="btn-link" data-toggle="button" autocomplete="off" objectType="space" objectId="@space.id.stringify">
@if(viewer.followedEntities.filter(x => (x.id == space.id)).nonEmpty) {
<span class='glyphicon glyphicon-star-empty'></span> Unfollow
} else {
<span class='glyphicon glyphicon-star'></span> Follow
}
</button>
</ul>
}
case None => {}
}
}
</div>
</div>