Skip to content

Commit

Permalink
Merge pull request #458 from LibCrowds/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
alexandermendes authored Nov 5, 2017
2 parents 1e7bdf1 + 8ec71f1 commit 345a30a
Show file tree
Hide file tree
Showing 71 changed files with 1,183 additions and 1,164 deletions.
5 changes: 3 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
],
"plugins": [
["module-resolver", {
"root": ["./"],
"alias": {
"~": "./",
"@": "./"
"~": ".",
"@": "."
}
}]
]
Expand Down
3 changes: 2 additions & 1 deletion assets/style/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
'partials/images',
'partials/modals',
'partials/tables',
'partials/labels'
'partials/labels',
'partials/transitions'
;
24 changes: 24 additions & 0 deletions assets/style/partials/_transitions.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.fade-enter-active,
.fade-leave-active {
transition: opacity 350ms ease-in;
}

.fade-enter,
.fade-leave-to {
opacity: 0;
}

.fade-up-enter-active {
transition: all .3s ease;
}

.fade-up-leave-active {
transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
}

.fade-up-enter,
.fade-up-leave-to {
-webkit-transform: translateY(20px);
transform: translateY(20px);
opacity: 0;
}
4 changes: 2 additions & 2 deletions components/InfiniteLoad.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
this.$emit('input', this.value.concat(data))
$state.loaded()
} catch (err) {
this.$nuxt.error({ statusCode: err.statusCode, message: err.message })
this.$nuxt.error(err)
}
},
Expand Down Expand Up @@ -112,7 +112,7 @@ export default {
items = items.concat(enrichedData)
} catch (err) {
this.$nuxt.error({ statusCode: err.statusCode, message: err.message })
this.$nuxt.error(err)
break
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/cards/Favourites.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
this.$axios.$get('/api/favorites').then(data => {
this.images = this.getImageData(data)
}).catch(err => {
this.$nuxt.error({ statusCode: err.statusCode, message: err.message })
this.$nuxt.error(err)
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/forms/ImageUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default {
type: 'success'
})
}).catch(err => {
this.$nuxt.error({ statusCode: err.statusCode, message: err.message })
this.$nuxt.error(err)
}).then(() => {
this.processing = false
})
Expand Down
10 changes: 8 additions & 2 deletions components/forms/PybossaForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,17 @@ export default {
if (r.data.status === 'error') {
this.alert = r.data.flash
this.status = r.data.status
this.notify({
type: 'warn',
title: 'Invalid form data',
message: r.data.flash
})
this.injectErrors(r.data.form.errors)
} else {
return
} else if (r.data.status === 'success') {
this.handleSuccess(r.data)
this.flash(r.data)
}
this.flash(r.data)
}).catch(err => {
this.notify({
type: 'error',
Expand Down
9 changes: 5 additions & 4 deletions components/lists/Announcements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,17 @@ export default {
return this.$store.state.lastAnnouncement
},
lastReadId () {
const userAnnouncements = this.currentUser.info.announcements || {}
return userAnnouncements['last_read'] || 0
lastRead () {
const annoucements = this.currentUser.info.announcements || {}
return annoucements.last_read
},
hasUnread () {
if (this.noAnnouncements) {
return false
}
return this.lastReadId < this.lastAnnouncement.id
const last = Date.parse(this.lastAnnouncement.created)
return !this.lastRead || Date.parse(this.lastRead) < last
}
},
Expand Down
2 changes: 1 addition & 1 deletion components/modals/Data.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default {
}).then(data => {
exportFile(data, `${this.project.short_name}_${type}`, 'zip')
}).catch(err => {
this.$nuxt.error({ statusCode: err.statusCode, message: err.message })
this.$nuxt.error(err)
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion components/modals/ProjectStats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
this.userStats = data.userStats || {}
this.projectStats = data.projectStats || {}
}).catch(err => {
this.$nuxt.error({ statusCode: err.statusCode, message: err.message })
this.$nuxt.error(err)
})
}
},
Expand Down
9 changes: 4 additions & 5 deletions components/navbars/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@
<div role="separator" class="dropdown-divider"></div>
<b-dropdown-item
:to="{
name: 'project-open',
params: {
name: currentUser.name
}
name: 'project-open'
}">
Projects Admin
Project Admin
</b-dropdown-item>
<b-dropdown-item
:to="{
Expand All @@ -73,6 +70,7 @@
<span class="app-navbar-right" v-else>
<b-nav id="sign-in-up" is-nav-bar right>
<b-nav-item
exact
:to="{
name: 'account-signin',
query: {
Expand All @@ -82,6 +80,7 @@
Sign in
</b-nav-item>
<b-nav-item
exact
id="btn-register"
:to="{
name: 'account-register'
Expand Down
27 changes: 15 additions & 12 deletions components/navbars/Collection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,29 @@
<!-- Main menu -->
<b-nav is-nav-bar>
<b-nav-item
exact
:to="{
name: 'collection-short_name-about',
params: {
short_name: collection.short_name
}
}"
@click.native="toggleCollapsibleSidebar">
@click="toggleCollapsibleSidebar">
About
</b-nav-item>
<b-nav-item
exact
:to="{
name: 'collection-short_name-projects',
params: {
short_name: collection.short_name
}
}"
@click.native="toggleCollapsibleSidebar">
@click="toggleCollapsibleSidebar">
Contribute
</b-nav-item>
<b-nav-item
exact
:href="collection.info.forum"
v-if="collection.info.forum">
Discuss
Expand All @@ -73,17 +76,18 @@
short_name: collection.short_name
}
}"
@click.native="toggleCollapsibleSidebar">
@click="toggleCollapsibleSidebar">
Results
</b-nav-item> -->
<b-nav-item
exact
:to="{
name: 'collection-short_name-data',
params: {
short_name: collection.short_name
}
}"
@click.native="toggleCollapsibleSidebar">
@click="toggleCollapsibleSidebar">
Data
</b-nav-item>
</b-nav>
Expand All @@ -104,7 +108,7 @@
name: currentUser.name
}
}"
@click.native="toggleCollapsibleSidebar">Profile
@click="toggleCollapsibleSidebar">Profile
</b-dropdown-item>
<b-dropdown-item
:to="{
Expand All @@ -113,26 +117,23 @@
name: currentUser.name
}
}"
@click.native="toggleCollapsibleSidebar">Settings
@click="toggleCollapsibleSidebar">Settings
</b-dropdown-item>

<!-- Project management -->
<span v-if="currentUser.admin">
<div role="separator" class="dropdown-divider"></div>
<b-dropdown-item
:to="{
name: 'project-open',
params: {
name: currentUser.name
}
name: 'project-open'
}">
Projects Admin
Project Admin
</b-dropdown-item>
<b-dropdown-item
:to="{
name: 'admin-dashboard'
}"
@click.native="toggleCollapsibleSidebar">
@click="toggleCollapsibleSidebar">
Site Admin
</b-dropdown-item>
</span>
Expand All @@ -146,6 +147,7 @@
<b-nav is-nav-bar v-else>
<b-nav is-nav-bar>
<b-nav-item
exact
:to="{
name: 'account-signin',
query: {
Expand All @@ -155,6 +157,7 @@
Sign in
</b-nav-item>
<b-nav-item
exact
class="nav-button"
:to="{
name: 'account-register'
Expand Down
Loading

0 comments on commit 345a30a

Please sign in to comment.