-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Hoogkamer/develop
Develop
- Loading branch information
Showing
40 changed files
with
1,124 additions
and
541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true | ||
"singleQuote": true, | ||
"printWidth": 70, | ||
"endOfLine": "auto" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,6 @@ | |
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
} | ||
}, | ||
"editor.formatOnSave": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
<template lang='pug'> | ||
div | ||
.property | ||
span.label Name | ||
br | ||
input.name(v-if='editMode' :class="{error:!activeDepartment_name}" v-model="activeDepartment_name") | ||
span(v-else).text {{activeDepartment_name}} | ||
|
||
.property | ||
span.label Manager | ||
i.material-icons.edit(v-if='editMode' v-on:click='personPicker="manager"') edit | ||
br | ||
span.text(v-if='activeDepartment.manager.name') {{activeDepartment.manager.name}} | ||
span.untext(v-else) No manager | ||
.property | ||
span.label Description | ||
br | ||
textarea.description(v-if='editMode' v-model="activeDepartment_description") | ||
span(v-else).text {{activeDepartment_description}} | ||
|
||
.property(v-for="field in activeDepartment.dataFields" v-if="field.value") | ||
span.label {{field.name}} | ||
br | ||
template(v-if='editMode') | ||
// todo edit extra properties | ||
templage(v-else) | ||
template(v-if='field.type==="url"') | ||
a(:href="field.value" target="_blank") Link | ||
template(v-else) | ||
span.text {{field.value}} | ||
|
||
.property | ||
template(v-if='!editMode') | ||
span.label Department type | ||
br | ||
span(v-if='activeDepartment_isStaff') Staff department | ||
span(v-else) Normal department | ||
template(v-else) | ||
span.label Staff department: | ||
input.isstaff(type='checkbox' v-model="activeDepartment_isStaff" :disabled="!editMode") | ||
.property | ||
span.label Hierarchy | ||
ul | ||
li.clickable(v-for='(parent, pnr) in parents' v-on:click="setActiveDepartment(parent)") | ||
span(v-for="n in pnr")   | ||
i(v-if="pnr !==0").material-icons.sub subdirectory_arrow_right | ||
span {{parent.name}} | ||
li.clickable(v-on:click="setActiveDepartment(activeDepartment)") | ||
span(v-for="n in parents.length")   | ||
i(v-if="parents.length").material-icons.sub subdirectory_arrow_right | ||
span.this-department {{activeDepartment.name}} | ||
li.clickable(v-for='child in activeDepartment.children' v-on:click="setActiveDepartment(child)") | ||
span(v-for="n in parents.length+5")   | ||
span {{child.name}} | ||
img.profile(:src='config.photoUrl.prefix+activeDepartment.manager.photo+config.photoUrl.suffix' v-on:click='visitProfile(activeDepartment.manager)' title='Goto profile') | ||
person-picker(v-if='personPicker' type='manager' v-on:close='personPicker=null') | ||
</template> | ||
|
||
<script> | ||
import { mapState, mapActions, mapMutations } from 'vuex' | ||
import PersonPicker from '~/components/PersonPicker.vue' | ||
export default { | ||
components: { PersonPicker }, | ||
data: function() { | ||
return { | ||
personPicker: null, | ||
activeTab: 1, | ||
noPhotos: [] | ||
} | ||
}, | ||
computed: { | ||
...mapState([ | ||
'showSideScreen', | ||
'activeDepartment', | ||
'editMode', | ||
'people', | ||
'config' | ||
]), | ||
activeDepartment_name: { | ||
get: function() { | ||
return this.$store.state.activeDepartment.name | ||
}, | ||
set: function(val) { | ||
this.$store.commit('updateActiveDepartmentName', val) | ||
} | ||
}, | ||
activeDepartment_description: { | ||
get: function() { | ||
return this.$store.state.activeDepartment.description | ||
}, | ||
set: function(val) { | ||
this.$store.commit('updateActiveDepartmentDescription', val) | ||
} | ||
}, | ||
activeDepartment_isStaff: { | ||
get: function() { | ||
return this.$store.state.activeDepartment.isStaff | ||
}, | ||
set: function(val) { | ||
this.updateActiveDepartmentIsStaff(val) | ||
} | ||
}, | ||
parents: function() { | ||
var parents = [] | ||
var department = this.activeDepartment | ||
while (department.parent) { | ||
department = department.parent | ||
parents.unshift(department) | ||
} | ||
return parents | ||
}, | ||
children: function() { | ||
return this.activeDepartment.children | ||
} | ||
}, | ||
methods: { | ||
...mapActions([ | ||
'setShowDepartment', | ||
'updateActiveDepartmentIsStaff' | ||
]), | ||
...mapMutations(['setShowPerson', 'updateRole']), | ||
setActiveDepartment(department) { | ||
this.setShowDepartment(department) | ||
}, | ||
visitProfile(person) { | ||
this.setShowPerson(person) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.profile { | ||
width: 80px; | ||
max-height: 80px; | ||
min-height: 60px; | ||
position: absolute; | ||
right: 16px; | ||
top: 154px; | ||
border: 1px solid grey; | ||
cursor: pointer; | ||
} | ||
.profile:hover { | ||
border: 2px solid orange; | ||
} | ||
.name { | ||
font-size: 16px; | ||
} | ||
.property { | ||
margin-bottom: 20px; | ||
} | ||
.clickable { | ||
cursor: pointer; | ||
font-size: 14px; | ||
} | ||
input.name { | ||
width: calc(100% - 10px); | ||
} | ||
textarea.description { | ||
width: calc(100% - 10px); | ||
height: 80px; | ||
} | ||
.clickable:hover { | ||
background-color: lightblue; | ||
} | ||
.noclickable { | ||
cursor: default; | ||
} | ||
.label { | ||
font-weight: 600; | ||
text-decoration: underline; | ||
} | ||
.untext { | ||
color: grey; | ||
font-style: italic; | ||
} | ||
ul { | ||
list-style: none; | ||
background-color: white; | ||
padding: 5px; | ||
} | ||
.this-department { | ||
font-weight: 600; | ||
} | ||
.sub { | ||
font-size: 16px; | ||
margin: -8px 0px; | ||
} | ||
.isstaff { | ||
margin: 0px 10px; | ||
} | ||
.material-icons.edit { | ||
font-size: 16px; | ||
cursor: pointer; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.