Skip to content

Commit add5b9e

Browse files
committed
Updating frontend pages Homepage.vue and Categories.vue.
1 parent 5c4f9c6 commit add5b9e

File tree

3 files changed

+110
-189
lines changed

3 files changed

+110
-189
lines changed

public/js/app.js

+95-172
Original file line numberDiff line numberDiff line change
@@ -2823,6 +2823,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
28232823

28242824
if (response.data.error) {
28252825
_this.error = response.data.error;
2826+
} else if (response.data.data.length == 0) {
2827+
_this.error = "Sorry, looks like there's no results.";
28262828
} else {
28272829
_this.videos = response.data;
28282830
}
@@ -2851,7 +2853,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
28512853
$route: function $route(to, from) {
28522854
this.videos = [];
28532855
this.getVideos();
2854-
document.cookie = 'category=' + this.$route.params.category + '; expires=Sun, 25 December 2022 00:00:00 UTC; path=/';
28552856
}
28562857
}
28572858
});
@@ -24387,128 +24388,107 @@ var render = function() {
2438724388
: _c(
2438824389
"div",
2438924390
[
24390-
_c("page-header", {
24391-
directives: [
24392-
{
24393-
name: "show",
24394-
rawName: "v-show",
24395-
value: _vm.loaded,
24396-
expression: "loaded"
24397-
}
24398-
],
24399-
attrs: { title: _vm.category_title, icon: "" }
24400-
}),
24401-
_vm._v(" "),
24402-
_c(
24403-
"div",
24404-
{
24405-
staticClass:
24406-
"d-flex justify-content-between align-items-center mb-3"
24407-
},
24408-
[
24409-
_c(
24410-
"div",
24411-
{
24412-
directives: [
24413-
{
24414-
name: "show",
24415-
rawName: "v-show",
24416-
value: _vm.loaded,
24417-
expression: "loaded"
24418-
}
24419-
]
24420-
},
24421-
[
24422-
_vm._v(
24423-
"\n Showing: " +
24424-
_vm._s(_vm.videos.current_page) +
24425-
" of\n " +
24426-
_vm._s(_vm.videos.last_page) +
24427-
"\n "
24428-
)
24429-
]
24430-
),
24431-
_vm._v(" "),
24432-
_c(
24391+
_vm.loaded
24392+
? _c(
2443324393
"div",
2443424394
{
24435-
directives: [
24436-
{
24437-
name: "show",
24438-
rawName: "v-show",
24439-
value: _vm.loaded,
24440-
expression: "loaded"
24441-
}
24442-
]
24395+
staticClass:
24396+
"d-flex justify-content-between align-items-center mb-3"
2444324397
},
2444424398
[
2444524399
_c(
24446-
"select",
24447-
{
24448-
directives: [
24449-
{
24450-
name: "model",
24451-
rawName: "v-model",
24452-
value: _vm.sort,
24453-
expression: "sort"
24454-
}
24455-
],
24456-
staticClass: "custom-select",
24457-
attrs: { name: "sortby" },
24458-
on: {
24459-
change: [
24460-
function($event) {
24461-
var $$selectedVal = Array.prototype.filter
24462-
.call($event.target.options, function(
24463-
o
24464-
) {
24465-
return o.selected
24466-
})
24467-
.map(function(o) {
24468-
var val =
24469-
"_value" in o ? o._value : o.value
24470-
return val
24471-
})
24472-
_vm.sort = $event.target.multiple
24473-
? $$selectedVal
24474-
: $$selectedVal[0]
24475-
},
24476-
function($event) {
24477-
return _vm.sortBy()
24478-
}
24479-
]
24480-
}
24481-
},
24400+
"div",
2448224401
[
24483-
_c(
24484-
"option",
24485-
{
24486-
attrs: { selected: "", value: "most_views" }
24487-
},
24488-
[_vm._v("Most Views")]
24489-
),
24490-
_vm._v(" "),
24491-
_c(
24492-
"option",
24493-
{ attrs: { value: "top_rated" } },
24494-
[_vm._v("Top Rated")]
24495-
),
24496-
_vm._v(" "),
24497-
_c("option", { attrs: { value: "duration" } }, [
24498-
_vm._v("Duration")
24499-
]),
24402+
_c("page-header", {
24403+
attrs: { title: _vm.category_title, icon: "" }
24404+
}),
2450024405
_vm._v(" "),
24501-
_c(
24502-
"option",
24503-
{ attrs: { value: "most_recent" } },
24504-
[_vm._v("Most Recent")]
24505-
)
24506-
]
24507-
)
24406+
_c("div", { staticClass: "text-sage" }, [
24407+
_vm._v(
24408+
"\n Showing: " +
24409+
_vm._s(_vm.videos.current_page) +
24410+
" of\n " +
24411+
_vm._s(_vm.videos.last_page) +
24412+
"\n "
24413+
)
24414+
])
24415+
],
24416+
1
24417+
),
24418+
_vm._v(" "),
24419+
_c("div", [
24420+
_c(
24421+
"select",
24422+
{
24423+
directives: [
24424+
{
24425+
name: "model",
24426+
rawName: "v-model",
24427+
value: _vm.sort,
24428+
expression: "sort"
24429+
}
24430+
],
24431+
staticClass: "custom-select",
24432+
attrs: { name: "sortby" },
24433+
on: {
24434+
change: [
24435+
function($event) {
24436+
var $$selectedVal = Array.prototype.filter
24437+
.call($event.target.options, function(
24438+
o
24439+
) {
24440+
return o.selected
24441+
})
24442+
.map(function(o) {
24443+
var val =
24444+
"_value" in o ? o._value : o.value
24445+
return val
24446+
})
24447+
_vm.sort = $event.target.multiple
24448+
? $$selectedVal
24449+
: $$selectedVal[0]
24450+
},
24451+
function($event) {
24452+
return _vm.sortBy()
24453+
}
24454+
]
24455+
}
24456+
},
24457+
[
24458+
_c(
24459+
"option",
24460+
{
24461+
attrs: {
24462+
selected: "",
24463+
value: "most_views"
24464+
}
24465+
},
24466+
[_vm._v("Most Views")]
24467+
),
24468+
_vm._v(" "),
24469+
_c(
24470+
"option",
24471+
{ attrs: { value: "top_rated" } },
24472+
[_vm._v("Top Rated")]
24473+
),
24474+
_vm._v(" "),
24475+
_c(
24476+
"option",
24477+
{ attrs: { value: "duration" } },
24478+
[_vm._v("Duration")]
24479+
),
24480+
_vm._v(" "),
24481+
_c(
24482+
"option",
24483+
{ attrs: { value: "most_recent" } },
24484+
[_vm._v("Most Recent")]
24485+
)
24486+
]
24487+
)
24488+
])
2450824489
]
2450924490
)
24510-
]
24511-
),
24491+
: _vm._e(),
2451224492
_vm._v(" "),
2451324493
_vm.loaded
2451424494
? _c("video-list", {
@@ -24643,64 +24623,7 @@ var render = function() {
2464324623
: _vm._e()
2464424624
],
2464524625
1
24646-
),
24647-
_vm._v(" "),
24648-
_c("div", [
24649-
_c(
24650-
"select",
24651-
{
24652-
directives: [
24653-
{
24654-
name: "model",
24655-
rawName: "v-model",
24656-
value: _vm.sort,
24657-
expression: "sort"
24658-
}
24659-
],
24660-
staticClass: "custom-select",
24661-
attrs: { id: "sortby", name: "sortby" },
24662-
on: {
24663-
change: [
24664-
function($event) {
24665-
var $$selectedVal = Array.prototype.filter
24666-
.call($event.target.options, function(o) {
24667-
return o.selected
24668-
})
24669-
.map(function(o) {
24670-
var val = "_value" in o ? o._value : o.value
24671-
return val
24672-
})
24673-
_vm.sort = $event.target.multiple
24674-
? $$selectedVal
24675-
: $$selectedVal[0]
24676-
},
24677-
function($event) {
24678-
return _vm.sortBy()
24679-
}
24680-
]
24681-
}
24682-
},
24683-
[
24684-
_c(
24685-
"option",
24686-
{ attrs: { selected: "", value: "most_views" } },
24687-
[_vm._v("Most Views")]
24688-
),
24689-
_vm._v(" "),
24690-
_c("option", { attrs: { value: "top_rated" } }, [
24691-
_vm._v("Top Rated")
24692-
]),
24693-
_vm._v(" "),
24694-
_c("option", { attrs: { value: "duration" } }, [
24695-
_vm._v("Duration")
24696-
]),
24697-
_vm._v(" "),
24698-
_c("option", { attrs: { value: "most_recent" } }, [
24699-
_vm._v("Most Recent")
24700-
])
24701-
]
24702-
)
24703-
])
24626+
)
2470424627
]
2470524628
),
2470624629
_vm._v(" "),

resources/js/views/Categories.vue

+13-15
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
</div>
1111

1212
<div v-else>
13-
<page-header
14-
:title="category_title"
15-
icon=""
16-
v-show="loaded"
17-
></page-header>
18-
19-
<div class="d-flex justify-content-between align-items-center mb-3">
20-
<div v-show="loaded">
21-
Showing: {{ videos.current_page }} of
22-
{{ videos.last_page }}
13+
<div
14+
v-if="loaded"
15+
class="d-flex justify-content-between align-items-center mb-3"
16+
>
17+
<div>
18+
<page-header :title="category_title" icon=""></page-header>
19+
<div class="text-sage">
20+
Showing: {{ videos.current_page }} of
21+
{{ videos.last_page }}
22+
</div>
2323
</div>
24-
<div v-show="loaded">
24+
<div>
2525
<select
2626
v-model="sort"
2727
name="sortby"
@@ -137,6 +137,8 @@ export default {
137137
this.$Progress.finish()
138138
if (response.data.error) {
139139
this.error = response.data.error
140+
} else if (response.data.data.length == 0) {
141+
this.error = "Sorry, looks like there's no results."
140142
} else {
141143
this.videos = response.data
142144
}
@@ -164,10 +166,6 @@ export default {
164166
$route(to, from) {
165167
this.videos = []
166168
this.getVideos()
167-
document.cookie =
168-
'category=' +
169-
this.$route.params.category +
170-
'; expires=Sun, 25 December 2022 00:00:00 UTC; path=/'
171169
}
172170
}
173171
}

resources/js/views/HomePage.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
{{ uf_num(videos.last_page) }}
1919
</div>
2020
</div>
21-
<div>
21+
<!-- <div>
2222
<select
2323
id="sortby"
2424
v-model="sort"
@@ -31,7 +31,7 @@
3131
<option value="duration">Duration</option>
3232
<option value="most_recent">Most Recent</option>
3333
</select>
34-
</div>
34+
</div> -->
3535
</div>
3636

3737
<video-list

0 commit comments

Comments
 (0)