Skip to content

Commit 6e0046d

Browse files
committed
Move Next/Prev buttons to the top, add CHANGELOG entry
1 parent 59a8576 commit 6e0046d

File tree

2 files changed

+80
-74
lines changed

2 files changed

+80
-74
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ of these changes a reindex of Elasticsearch is required. This can be started by
1616
- Ability to search by creator name and email address for all resources.
1717
- List Spaces/Datasets/Collections created by each user on their User Profile.
1818
[CATS-1056](https://opensource.ncsa.illinois.edu/jira/browse/CATS-1056)
19+
- Allow user to easily flip through the files in a dataset.
20+
[CATS-1058](https://opensource.ncsa.illinois.edu/jira/browse/CATS-1058)
1921

2022

2123
### Fixed

app/views/file.scala.html

Lines changed: 78 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -156,41 +156,91 @@
156156
<div class="row">
157157
<div class="col-md-8 col-sm-8 col-lg-8">
158158
<div class="row">
159-
<ol class="breadcrumb">
160-
@if(spaces.length == 1 ) {
161-
<li><span class="glyphicon glyphicon-hdd"></span> <a href="@routes.Spaces.getSpace(spaces.head.id)" title="@spaces.head.name"> @Html(ellipsize(spaces.head.name, 18))</a></li>
159+
<div class="col-md-10 col-sm-10 col-lg-10">
162160

163-
} else {
164-
@if(spaces.length > 1) {
165-
<li>
166-
<span class="dropdown">
167-
<button class="btn-link dropdown-toggle" type="button" id="dropdown_space_list" data-toggle="dropdown"
168-
aria-haspopup="true" aria-expanded="true">
169-
<span class="glyphicon glyphicon-hdd"></span> <span class="caret"></span>
170-
</button>
171-
<ul class="dropdown-menu" arialanelledby="dropdown_space_list">
172-
@spaces.map{ s =>
173-
<li><a href="@routes.Spaces.getSpace(s.id)" title="s.name"><span class="glyphicon glyphicon-hdd"></span> @Html(ellipsize(s.name, 18))</a></li>
174-
}
175-
</ul>
161+
<ol class="breadcrumb">
162+
@if(spaces.length == 1 ) {
163+
<li><span class="glyphicon glyphicon-hdd"></span> <a href="@routes.Spaces.getSpace(spaces.head.id)" title="@spaces.head.name"> @Html(ellipsize(spaces.head.name, 18))</a></li>
176164

177-
</span>
178-
</li>
179165
} else {
180-
<li><span class="glyphicon glyphicon-user"></span> <a href = "@routes.Profile.viewProfileUUID(file.author.id)"> @file.author.fullName</a></li>
166+
@if(spaces.length > 1) {
167+
<li>
168+
<span class="dropdown">
169+
<button class="btn-link dropdown-toggle" type="button" id="dropdown_space_list" data-toggle="dropdown"
170+
aria-haspopup="true" aria-expanded="true">
171+
<span class="glyphicon glyphicon-hdd"></span> <span class="caret"></span>
172+
</button>
173+
<ul class="dropdown-menu" arialanelledby="dropdown_space_list">
174+
@spaces.map{ s =>
175+
<li><a href="@routes.Spaces.getSpace(s.id)" title="s.name"><span class="glyphicon glyphicon-hdd"></span> @Html(ellipsize(s.name, 18))</a></li>
176+
}
177+
</ul>
178+
179+
</span>
180+
</li>
181+
} else {
182+
<li><span class="glyphicon glyphicon-user"></span> <a href = "@routes.Profile.viewProfileUUID(file.author.id)"> @file.author.fullName</a></li>
183+
}
181184
}
182-
}
183-
@if(allDatasets.length == 1 ) {
185+
@if(allDatasets.length == 1 ) {
186+
@allDatasets.map { ds =>
187+
<li> <span class="glyphicon glyphicon-briefcase"></span> <a href="@routes.Datasets.dataset(ds.id)" title="@ds.name"> @Html(ellipsize(ds.name, 18))</a></li>
188+
}
189+
}
190+
@folderHierarchy.map { fd =>
191+
<li><span class="glyphicon glyphicon-folder-close"></span> <a href="@routes.Datasets.dataset(allDatasets(0).id)#[email protected]" title="@fd.displayName">@Html(ellipsize(fd.displayName, 18))</a></li>
192+
}
193+
<li><span class="glyphicon glyphicon-file"></span> <span title="@file.filename">@Html(ellipsize(file.filename, 18))</span></li>
194+
195+
</ol>
196+
</div>
197+
<div class="col-md-2 col-sm-2 col-lg-2">
198+
@** Only enable paging when viewing from a dataset? *@
199+
@if(allDatasets.length == 1) {
184200
@allDatasets.map { ds =>
185-
<li> <span class="glyphicon glyphicon-briefcase"></span> <a href="@routes.Datasets.dataset(ds.id)" title="@ds.name"> @Html(ellipsize(ds.name, 18))</a></li>
201+
@pager match {
202+
case None => {}
203+
case Some(pg) => {
204+
<div class="row bottom-padding">
205+
<div class="col-sm-12 col-md-12 col-lg-12">
206+
@pg.prev match {
207+
case None => {}
208+
case Some(prev) => {
209+
<a class="btn btn-sm btn-link" style="border-radius:15px;border-color:lightgray;" href="@routes.Files.file(prev, if(datasets.length > 0) {
210+
Some(datasets.head.id.stringify)
211+
} else {
212+
None
213+
}, spaceId, if(folders.length > 0) {
214+
Some(folders.head.id.stringify)
215+
} else {
216+
None
217+
})"><i class="glyphicon glyphicon-chevron-left"></i> Prev</a>
218+
}
219+
}
220+
@pg.next match {
221+
case None => {}
222+
case Some(next) => {
223+
<a class="btn btn-sm btn-link" style="border-radius:15px;border-color:lightgray;" href="@routes.Files.file(next, if(datasets.length > 0) {
224+
Some(datasets.head.id.stringify)
225+
} else {
226+
None
227+
}, spaceId, if(folders.length > 0) {
228+
Some(folders.head.id.stringify)
229+
} else {
230+
None
231+
})">Next <i class="glyphicon glyphicon-chevron-right"></i></a>
232+
}
233+
}
234+
235+
</div>
236+
</div>
237+
}
238+
}
186239
}
187240
}
188-
@folderHierarchy.map { fd =>
189-
<li><span class="glyphicon glyphicon-folder-close"></span> <a href="@routes.Datasets.dataset(allDatasets(0).id)#[email protected]" title="@fd.displayName">@Html(ellipsize(fd.displayName, 18))</a></li>
190-
}
191-
<li><span class="glyphicon glyphicon-file"></span> <span title="@file.filename">@Html(ellipsize(file.filename, 18))</span></li>
192-
193-
</ol>
241+
</div>
242+
</div>
243+
<div class="row">
194244
<div id="file-name-div" class="file-title-div col-xs-12">
195245
<div id="prf-file-name" class="text-left inline">
196246
<h1 id="file-name-title" class="inline"> <span class="glyphicon glyphicon-file"></span> @Html(file.filename)</h1>
@@ -587,52 +637,6 @@ <h4>Sections</h4>
587637
}
588638
}
589639

590-
591-
@** Only enable paging when viewing from a dataset? *@
592-
@if(allDatasets.length == 1) {
593-
@allDatasets.map { ds =>
594-
@pager match {
595-
case None => {}
596-
case Some(pg) => {
597-
<div class="row bottom-padding">
598-
<div class="col-sm-12 col-md-12 col-lg-12">
599-
@pg.prev match {
600-
case None => {}
601-
case Some(prev) => {
602-
<a class="btn btn-sm btn-link pull-left" style="border-radius:15px;border-color:lightgray;" href="@routes.Files.file(prev, if(datasets.length > 0) {
603-
Some(datasets.head.id.stringify)
604-
} else {
605-
None
606-
}, spaceId, if(folders.length > 0) {
607-
Some(folders.head.id.stringify)
608-
} else {
609-
None
610-
})"><i class="glyphicon glyphicon-arrow-left"></i> Prev</a>
611-
}
612-
}
613-
@pg.next match {
614-
case None => {}
615-
case Some(next) => {
616-
<a class="btn btn-sm btn-link pull-right" style="border-radius:15px;border-color:lightgray;" href="@routes.Files.file(next, if(datasets.length > 0) {
617-
Some(datasets.head.id.stringify)
618-
} else {
619-
None
620-
}, spaceId, if(folders.length > 0) {
621-
Some(folders.head.id.stringify)
622-
} else {
623-
None
624-
})">Next <i class="glyphicon glyphicon-arrow-right"></i></a>
625-
}
626-
}
627-
628-
</div>
629-
</div>
630-
}
631-
}
632-
}
633-
}
634-
635-
636640
<div class="tabbable" id="bottomDatasetTabbable"> <!-- Only required for left/right tabs -->
637641
<ul class="nav nav-tabs margin-bottom-20" >
638642
<li role="presentation" class="active"><a href="#tab-metadata" role="tab" data-toggle="tab">Metadata </a></li>

0 commit comments

Comments
 (0)