123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <template>
- <div class="project-settings-window">
- <h1>Project Settings</h1>
- <div class="content">
- <text-input placeholder="Name"
- :value="name"
- @input="nameF"
- :error="nameError"
- @clearError="nameError = false">
- Name
- </text-input>
- <textarea-input placeholder="Description"
- :value="description"
- @input="descriptionF"
- :error="descriptionError"
- @clearError="descriptionError = false">
- Description
- </textarea-input>
- <div class="text">Delete Project</div>
- <confirmed-button-input @click="deleteProject">
- <template v-slot:first>
- <button-input>
- Delete Project
- </button-input>
- </template>
- <template v-slot:second>
- <button-input type="error">
- Do you really want to delete this project? <br>
- This cannot be undone.
- </button-input>
- </template>
- </confirmed-button-input>
- </div>
- </div>
- </template>
- <script>
- import TextInput from "@/components/base/text-input";
- import TextareaInput from "@/components/base/textarea-input";
- import ConfirmedButtonInput from "@/components/base/confirmed-button-input";
- import ButtonInput from "@/components/base/button-input";
- export default {
- name: "project-settings-window",
- components: {ButtonInput, ConfirmedButtonInput, TextareaInput, TextInput},
- props: ['currentProject', 'socket'],
- data: function() {
- return {
- project: null,
- name: '',
- nameError: false,
- description: '',
- descriptionError: false
- }
- },
- computed: {
- path: function() {
- return '/projects/' + this.currentProject.id;
- }
- },
- methods: {
- nameF: function(value) {
- // TODO then / error
- this.socket.post(this.path, {
- name: value
- });
- },
- descriptionF: function(value) {
- // TODO then / error
- this.socket.post(this.path, {
- description: value
- });
- },
- deleteProject: function() {
- // TODO then / error
- this.socket.post(this.path, {
- delete: true
- });
- this.$emit('close', true);
- }
- },
- created: function() {
- this.name = this.currentProject.name;
- this.description = this.currentProject.description;
- }
- }
- </script>
- <style scoped>
- .project-settings-window {
- padding: 1rem;
- }
- h1 {
- margin: 0;
- font-family: "Roboto Condensed";
- text-overflow: ellipsis;
- width: 100%;
- white-space: nowrap;
- overflow: hidden;
- }
- .content {
- overflow: auto;
- flex-grow: 1;
- }
- .content > * {
- margin-bottom: 0.6rem;
- }
- .content > div.text {
- margin-bottom: 0.2rem;
- font-size: 80%;
- }
- /deep/ .content textarea {
- height: 4rem;
- }
- </style>
|