|
6 | 6 | rdfExported: Boolean, |
7 | 7 | extractionsStatus: Map[String, ExtractionGroup], outputFormats: Option[List[String]], spaceId: Option[String], access:String, |
8 | 8 | folderHierarchy: List[Folder], spaces:List[ProjectSpace], allDatasets: List[Dataset], |
9 | | - view_count: Int, view_date: java.util.Date)(implicit user: Option[models.User], request: RequestHeader) |
| 9 | + view_count: Int, view_date: java.util.Date, pager: models.Pager)(implicit user: Option[models.User], request: RequestHeader) |
10 | 10 |
|
11 | 11 | @import helper._ |
12 | 12 | @import play.api.Play.current |
|
156 | 156 | <div class="row"> |
157 | 157 | <div class="col-md-8 col-sm-8 col-lg-8"> |
158 | 158 | <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"> |
162 | 160 |
|
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> |
176 | 164 |
|
177 | | - </span> |
178 | | - </li> |
179 | 165 | } 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 | + } |
181 | 184 | } |
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) { |
184 | 200 | @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 | + <div class="row bottom-padding"> |
| 202 | + <div class="col-sm-12 col-md-12 col-lg-12"> |
| 203 | + @pager.prev match { |
| 204 | + case None => { |
| 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> |
| 206 | + } |
| 207 | + case Some(prev) => { |
| 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) { |
| 209 | + Some(datasets.head.id.stringify) |
| 210 | + } else { |
| 211 | + None |
| 212 | + }, spaceId, if(folders.length > 0) { |
| 213 | + Some(folders.head.id.stringify) |
| 214 | + } else { |
| 215 | + None |
| 216 | + })"><i class="glyphicon glyphicon-chevron-left"></i> Prev</a> |
| 217 | + } |
| 218 | + } |
| 219 | + @pager.next match { |
| 220 | + case None => { |
| 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> |
| 222 | + } |
| 223 | + case Some(next) => { |
| 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) { |
| 225 | + Some(datasets.head.id.stringify) |
| 226 | + } else { |
| 227 | + None |
| 228 | + }, spaceId, if(folders.length > 0) { |
| 229 | + Some(folders.head.id.stringify) |
| 230 | + } else { |
| 231 | + None |
| 232 | + })">Next <i class="glyphicon glyphicon-chevron-right"></i></a> |
| 233 | + } |
| 234 | + } |
| 235 | + |
| 236 | + </div> |
| 237 | + </div> |
186 | 238 | } |
187 | 239 | } |
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> |
| 240 | + </div> |
| 241 | + </div> |
| 242 | + <div class="row"> |
194 | 243 | <div id="file-name-div" class="file-title-div col-xs-12"> |
195 | 244 | <div id="prf-file-name" class="text-left inline"> |
196 | 245 | <h1 id="file-name-title" class="inline"> <span class="glyphicon glyphicon-file"></span> @Html(file.filename)</h1> |
@@ -587,8 +636,6 @@ <h4>Sections</h4> |
587 | 636 | } |
588 | 637 | } |
589 | 638 |
|
590 | | - |
591 | | - |
592 | 639 | <div class="tabbable" id="bottomDatasetTabbable"> <!-- Only required for left/right tabs --> |
593 | 640 | <ul class="nav nav-tabs margin-bottom-20" > |
594 | 641 | <li role="presentation" class="active"><a href="#tab-metadata" role="tab" data-toggle="tab">Metadata </a></li> |
|
0 commit comments