boxlet 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/boxlet/app.rb +1 -0
- data/lib/boxlet/app/controller.rb +5 -0
- data/lib/boxlet/app/views/gallery.html +41 -13
- data/lib/boxlet/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 22addba52278e369b28f8982c4677e755836f4d2c04fbe707b44801fb9f07ad1
|
4
|
+
data.tar.gz: 60efb6a881c856d933f01cca1dc4990994d9f51de84a284cc165dcb38d2b5fb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3f361c702384a91af6cc15ba8996d6971f39ed6ae40605c429537dd62c3e922ec765db8e447af822e00cb132eb8bc0fc902a9f10c64383f6ba525a27d08caa9
|
7
|
+
data.tar.gz: 248a1db5306eeac1def8e27c1cd3fd3b7df9d9e5895ea4f00f675cdf0ec5aa66de4fe2de7b3eece3e86f12a4fb04f7c43320c43b56ab586c2ee0ef8ebe332bd3
|
data/lib/boxlet/app.rb
CHANGED
@@ -18,6 +18,7 @@ require 'boxlet/app/templates'
|
|
18
18
|
# ["/flashback", :post] => :flashback,
|
19
19
|
# ["/gallery", :get] => :gallery,
|
20
20
|
# ["/gallery/images", :get] => :gallery_images,
|
21
|
+
# ["/hello", :get] => :hello,
|
21
22
|
# }
|
22
23
|
|
23
24
|
|
@@ -213,6 +214,10 @@ module Boxlet
|
|
213
214
|
end
|
214
215
|
end
|
215
216
|
|
217
|
+
def hello
|
218
|
+
'hi'
|
219
|
+
end
|
220
|
+
|
216
221
|
|
217
222
|
private
|
218
223
|
|
@@ -61,10 +61,13 @@
|
|
61
61
|
$scope.page = 1;
|
62
62
|
$scope.limit = 50;
|
63
63
|
$scope.images = [];
|
64
|
+
$scope.count = 0;
|
64
65
|
$scope.heroImage = null;
|
65
|
-
|
66
|
+
|
67
|
+
buildCounter = function(count) {
|
66
68
|
var a = [],
|
67
|
-
pages =
|
69
|
+
pages = getPageCount();
|
70
|
+
|
68
71
|
for (var i = 1; i <= pages; i++) {
|
69
72
|
a.push(i);
|
70
73
|
}
|
@@ -79,16 +82,39 @@
|
|
79
82
|
$scope.heroImage = image;
|
80
83
|
};
|
81
84
|
|
85
|
+
function getPageCount() {
|
86
|
+
var lastPage = Math.ceil($scope.count / $scope.limit);
|
87
|
+
|
88
|
+
if (lastPage < 1) {
|
89
|
+
lastPage = 1;
|
90
|
+
}
|
91
|
+
|
92
|
+
return lastPage;
|
93
|
+
}
|
94
|
+
|
82
95
|
$scope.fetchImages = function() {
|
83
|
-
var imagesUrl
|
84
|
-
|
85
|
-
$
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
$scope.
|
91
|
-
|
96
|
+
var imagesUrl;
|
97
|
+
|
98
|
+
$scope.limit = parseInt($scope.limit);
|
99
|
+
|
100
|
+
if ($scope.limit >= 1) {
|
101
|
+
var newLastPossiblePage = getPageCount();
|
102
|
+
|
103
|
+
if ($scope.page > newLastPossiblePage) {
|
104
|
+
$scope.page = newLastPossiblePage;
|
105
|
+
}
|
106
|
+
|
107
|
+
imagesUrl = "/gallery/images?page=" + $scope.page + "&limit=" + $scope.limit + "&uuid=" + uuid;
|
108
|
+
|
109
|
+
$http.get(imagesUrl).then(function(results) {
|
110
|
+
$scope.count = results.data.count;
|
111
|
+
$scope.basePath = results.data.base_path;
|
112
|
+
$scope.images = results.data.images;
|
113
|
+
$scope.heroImage = $scope.images[0];
|
114
|
+
|
115
|
+
$scope.imagePages = buildCounter($scope.count);
|
116
|
+
});
|
117
|
+
}
|
92
118
|
}
|
93
119
|
|
94
120
|
$scope.fetchImages();
|
@@ -101,9 +127,11 @@
|
|
101
127
|
<img ng-src="{{basePath}}/{{heroImage.filename}}" />
|
102
128
|
</div>
|
103
129
|
|
104
|
-
<select ng-change="fetchImages()" ng-model="page" ng-options="page for page in
|
105
|
-
<option ng-repeat="page in counter()" value="page">{{page}}</option>
|
130
|
+
<select ng-change="fetchImages()" ng-model="page" ng-options="page for page in imagePages track by page">
|
106
131
|
</select>
|
132
|
+
|
133
|
+
<input ng-model="limit" type="number" min="1" max="50" ng-change="fetchImages()" />
|
134
|
+
|
107
135
|
<ul class="image-row">
|
108
136
|
<li ng-repeat="image in images" style="background-image: url({{imageSource(image, 'thumbnail')}})" ng-click="setHeroImage(image)"></li>
|
109
137
|
</ul>
|
data/lib/boxlet/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxlet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- arktisklada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -241,9 +241,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
241
|
version: '0'
|
242
242
|
requirements: []
|
243
243
|
rubyforge_project:
|
244
|
-
rubygems_version: 2.
|
244
|
+
rubygems_version: 2.7.6
|
245
245
|
signing_key:
|
246
246
|
specification_version: 4
|
247
247
|
summary: Upload pics from your phone
|
248
248
|
test_files: []
|
249
|
-
has_rdoc:
|