diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 6bf9977..f200a03 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -42,6 +42,11 @@ class DashboardController extends Controller return response()->json(['queue'=>$queue]); } + public function ping() { + Tweet::claimed_timeout(); + return response()->json(['result'=>'ok']); + } + public function claim_tweet(Request $request) { $tweet = Tweet::where('id', $request->input('tweet_id'))->first(); if($tweet) { diff --git a/public/css/app.css b/public/css/app.css index abbfc8c..92ca8bd 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -8586,6 +8586,11 @@ button.close { max-width: 100%; } +.multi-photo { + overflow: hidden; + border-radius: 6px; +} + .multi-photo .photo { position: relative; overflow: hidden; @@ -8608,6 +8613,11 @@ button.close { clear: both; } +.multi-photo.photos-1 .photo { + width: 100%; + height: 400px; +} + /* 2-up multi-photos use this layout */ .multi-photo.photos-2 .photo { diff --git a/public/js/app.js b/public/js/app.js index 3bfdcf8..11380fd 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -46538,6 +46538,13 @@ module.exports = { }); }.bind(this)); }, + dashboardPing: function dashboardPing() { + setTimeout(function () { + $.get('/dashboard/ping', function () { + this.dashboardPing(); + }.bind(this)); + }.bind(this), 15000); + }, findTweetInQueue: function findTweetInQueue(tweet_id) { var queueIndex = false; for (var i in this.queue) { @@ -46555,7 +46562,11 @@ module.exports = { } }, clickedTweet: function clickedTweet(tweet_index) { - // var tweet_data = this.removeTweetFromQueue(tweet_id); + // If another tweet was already open, dismiss that first + if (this.show) { + this.dismissTweet(); + } + var tweet_data = this.queue[tweet_index]; var tweet_id = tweet_data.tweet_id; @@ -46589,6 +46600,7 @@ module.exports = { }, created: function created() { this.loadQueue(); + this.dashboardPing(); } }; @@ -46737,13 +46749,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c staticClass: "tweet" }, [_c('div', { staticClass: "text" - }, [_vm._v(_vm._s(_vm.tweet.text))]), _vm._v(" "), (_vm.tweet.photos) ? _c('div', [(_vm.tweet.photos.length == 1) ? _vm._l((_vm.tweet.photos), function(img) { - return _c('div', [_c('img', { - attrs: { - "src": img - } - })]) - }) : [(_vm.tweet.photos) ? _c('div', { + }, [_vm._v(_vm._s(_vm.tweet.text))]), _vm._v(" "), (_vm.tweet.photos) ? _c('div', [(_vm.tweet.photos) ? _c('div', { class: 'multi-photo photos-' + _vm.tweet.photos.length }, _vm._l((_vm.tweet.photos), function(img) { return _c('div', { @@ -46759,7 +46765,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c })]) })) : _vm._e(), _vm._v(" "), _c('div', { staticClass: "multi-photo-clear" - })]], 2) : _vm._e()])]), _vm._v(" "), _c('div', { + })]) : _vm._e()])]), _vm._v(" "), _c('div', { staticClass: "col-md-4" }, [_c('div', [_vm._v(_vm._s(_vm.tweet.mission))])])])])]) : _vm._e() },staticRenderFns: []} @@ -46775,13 +46781,6 @@ if (false) { /* 61 */ /***/ (function(module, exports) { -// -// -// -// -// -// -// // // // diff --git a/resources/assets/js/components/Scorecard.vue b/resources/assets/js/components/Scorecard.vue index c166253..bb13faa 100644 --- a/resources/assets/js/components/Scorecard.vue +++ b/resources/assets/js/components/Scorecard.vue @@ -21,19 +21,12 @@