+
+
Recently added
diff --git a/front/src/filters.js b/front/src/filters.js
index 145a98253..1edea76f6 100644
--- a/front/src/filters.js
+++ b/front/src/filters.js
@@ -17,7 +17,15 @@ export function ago (date, locale) {
locale = locale || 'en'
const m = moment(date)
m.locale(locale)
- return m.fromNow()
+ return m.calendar(null, {
+ sameDay: 'LT',
+ nextDay: 'L',
+ nextWeek: 'L',
+ lastDay: 'L',
+ lastWeek: 'L',
+ sameElse: 'L'
+})
+
}
Vue.filter('ago', ago)
diff --git a/front/src/main.js b/front/src/main.js
index fbe676106..9f058d8ec 100644
--- a/front/src/main.js
+++ b/front/src/main.js
@@ -57,28 +57,17 @@ Vue.use(GetTextPlugin, {
Vue.use(VueMasonryPlugin)
Vue.use(VueLazyload)
Vue.config.productionTip = false
-Vue.directive('title', {
- inserted: (el, binding) => {
- let parts = []
- let instanceName = store.state.instance.settings.instance.name.value
- if (instanceName.length === 0) {
- instanceName = 'Funkwhale'
- }
- parts.unshift(instanceName)
- parts.unshift(binding.value)
- document.title = parts.join(' - ')
- },
- updated: (el, binding) => {
- let parts = []
- let instanceName = store.state.instance.settings.instance.name.value
- if (instanceName.length === 0) {
- instanceName = 'Funkwhale'
- }
- parts.unshift(instanceName)
- parts.unshift(binding.value)
- document.title = parts.join(' - ')
+Vue.directive('title', function (el, binding) {
+ let parts = []
+ let instanceName = store.state.instance.settings.instance.name.value
+ if (instanceName.length === 0) {
+ instanceName = 'Funkwhale'
}
-})
+ parts.unshift(instanceName)
+ parts.unshift(binding.value)
+ document.title = parts.join(' - ')
+ }
+)
axios.interceptors.request.use(function (config) {
// Do something before request is sent
if (store.state.auth.token) {
diff --git a/front/src/style/_main.scss b/front/src/style/_main.scss
index 311e0e9dc..76d0372f3 100644
--- a/front/src/style/_main.scss
+++ b/front/src/style/_main.scss
@@ -75,6 +75,9 @@
// see https://github.com/webpack/webpack/issues/215
@import "./vendor/media";
+$desktop-sidebar-width: 300px;
+$widedesktop-sidebar-width: 350px;
+
html,
body {
@include media("
desktop") {
+ width: $desktop-sidebar-width;
+ }
+
+ @include media(">widedesktop") {
+ width: $widedesktop-sidebar-width;
+ }
+}
.main.pusher,
.footer {
@include media(">desktop") {
- margin-left: 350px !important;
+ margin-left: $desktop-sidebar-width !important;
margin-top: 50px;
}
+
+ @include media(">widedesktop") {
+ margin-left: $widedesktop-sidebar-width !important;;
+ }
transform: none !important;
}
@@ -118,11 +134,14 @@ body {
}
@include media(">desktop") {
position: fixed;
- left: 350px;
+ left: $desktop-sidebar-width;
right: 0px;
top: 0px;
z-index: 99;
}
+ @include media(">widedesktop") {
+ left: $widedesktop-sidebar-width;
+ }
background-color: white;
.item {
padding-top: 1.5em;
@@ -135,7 +154,10 @@ body {
bottom: 1em;
left: 1em;
@include media(">desktop") {
- left: 350px;
+ left: $desktop-sidebar-width;
+ }
+ @include media(">widedesktop") {
+ left: $widedesktop-sidebar-width;
}
}
.main-pusher {
@@ -143,9 +165,12 @@ body {
}
.ui.stripe.segment,
#footer {
- padding: 2em;
+ padding: 1em;
@include media(">tablet") {
- padding: 4em;
+ padding: 2em;
+ }
+ @include media(">widedesktop") {
+ padding: 3em;
}
}
diff --git a/front/src/style/vendor/_media.scss b/front/src/style/vendor/_media.scss
index 2328eff8c..8d24baa71 100644
--- a/front/src/style/vendor/_media.scss
+++ b/front/src/style/vendor/_media.scss
@@ -34,7 +34,8 @@
$breakpoints: (
'phone': 320px,
'tablet': 768px,
- 'desktop': 1024px
+ 'desktop': 1024px,
+ 'widedesktop': 1200px
) !default;
diff --git a/front/src/views/content/libraries/FilesTable.vue b/front/src/views/content/libraries/FilesTable.vue
index d63ad6cee..dcdd4b87d 100644
--- a/front/src/views/content/libraries/FilesTable.vue
+++ b/front/src/views/content/libraries/FilesTable.vue
@@ -73,7 +73,7 @@
- {{ scope.obj.source }} |
+ {{ scope.obj.source | truncate(25) }} |
|
|
diff --git a/front/src/views/content/libraries/Upload.vue b/front/src/views/content/libraries/Upload.vue
index 1da3ad554..8547aa570 100644
--- a/front/src/views/content/libraries/Upload.vue
+++ b/front/src/views/content/libraries/Upload.vue
@@ -4,7 +4,7 @@
Loading library data…
-
+
@@ -20,6 +20,19 @@ export default {
components: {
DetailArea,
FileUpload
+ },
+ beforeRouteLeave (to, from, next){
+ if (this.$refs.fileupload.hasActiveUploads){
+ const answer = window.confirm('This page is asking you to confirm that you want to leave - data you have entered may not be saved.')
+ if (answer) {
+ next()
+ } else {
+ next(false)
+ }
+ }
+ else{
+ next()
+ }
}
}
diff --git a/front/tests/unit/specs/filters/filters.spec.js b/front/tests/unit/specs/filters/filters.spec.js
index 1464e5c97..f4f3610dc 100644
--- a/front/tests/unit/specs/filters/filters.spec.js
+++ b/front/tests/unit/specs/filters/filters.spec.js
@@ -1,5 +1,5 @@
import {expect} from 'chai'
-
+import moment from 'moment'
import {truncate, ago, capitalize, year} from '@/filters'
describe('filters', () => {
@@ -24,7 +24,15 @@ describe('filters', () => {
it('works', () => {
const input = new Date()
let output = ago(input)
- expect(output).to.equal('a few seconds ago')
+ let expected = moment(input).calendar(input, {
+ sameDay: 'LT',
+ nextDay: 'L',
+ nextWeek: 'L',
+ lastDay: 'L',
+ lastWeek: 'L',
+ sameElse: 'L'
+ })
+ expect(output).to.equal(expected)
})
})
describe('year', () => {