File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 11package models
22
3+ /**
4+ * A simple structure to assist in handling paging through a list of resources.
5+ * `prev` and `next` contain the ID of the previous and next resources (respectively).
6+ *
7+ * Currently this class is used for paging through files in a dataset, but could
8+ * be used to handle paging for any list of arbitrary UUIDs / resources in other contexts.
9+ *
10+ * See:
11+ * {@link views.files},
12+ * {@link controllers.Files#file}
13+ *
14+ * @param prev UUID of the previous resource in the list
15+ * @param next UUID of the next resource in the list
16+ *
17+ * @author lambert8
18+ */
319case class Pager (
420 prev : Option [models.UUID ],
521 next : Option [models.UUID ]
Original file line number Diff line number Diff line change 202202 < div class ="col-sm-12 col-md-12 col-lg-12 ">
203203 @pager.prev match {
204204 case None => {
205- < button class ="btn btn-sm btn-link disabled " disabled ="true " style ="cursor:not-allowed;border-radius:15px;border-color:lightgray; "> < i class ="glyphicon glyphicon-chevron-left "> </ i > Prev</ button >
205+ < button class ="btn btn-sm btn-link disabled " title =" This is the first file in this dataset " disabled ="true " style ="cursor:not-allowed;border-radius:15px;border-color:lightgray; "> < i class ="glyphicon glyphicon-chevron-left "> </ i > Prev</ button >
206206 }
207207 case Some(prev) => {
208- < a class ="btn btn-sm btn-link " style ="border-radius:15px;border-color:lightgray; " href ="@routes.Files.file(prev, if(datasets.length > 0) {
208+ < a class ="btn btn-sm btn-link " title =" Previous file in this dataset " style ="border-radius:15px;border-color:lightgray; " href ="@routes.Files.file(prev, if(datasets.length > 0) {
209209 Some(datasets.head.id.stringify)
210210 } else {
211211 None
218218 }
219219 @pager.next match {
220220 case None => {
221- < button class ="btn btn-sm btn-link disabled " disabled ="true " style ="cursor:not-allowed;border-radius:15px;border-color:lightgray; "> Next < i class ="glyphicon glyphicon-chevron-right "> </ i > </ button >
221+ < button class ="btn btn-sm btn-link disabled " title =" This is the last file in this dataset " disabled ="true " style ="cursor:not-allowed;border-radius:15px;border-color:lightgray; "> Next < i class ="glyphicon glyphicon-chevron-right "> </ i > </ button >
222222 }
223223 case Some(next) => {
224- < a class ="btn btn-sm btn-link " style ="border-radius:15px;border-color:lightgray; " href ="@routes.Files.file(next, if(datasets.length > 0) {
224+ < a class ="btn btn-sm btn-link " title =" Next file in this dataset " style ="border-radius:15px;border-color:lightgray; " href ="@routes.Files.file(next, if(datasets.length > 0) {
225225 Some(datasets.head.id.stringify)
226226 } else {
227227 None
You can’t perform that action at this time.
0 commit comments