Skip to content
Snippets Groups Projects
Verified Commit 70a5ccac authored by Marc Hanisch's avatar Marc Hanisch
Browse files

minor UI tweaks for the attachment forms

parent 2bd85b1b
No related branches found
No related tags found
2 merge requests!92Feature restructure frontend platforms,!82Restructure frontend
......@@ -34,10 +34,11 @@ permissions and limitations under the Licence.
v-model="isInProgress"
:dark="isSaving"
/>
<v-card-actions>
<v-card-actions
v-if="isLoggedIn && !(isAddAttachmentPage)"
>
<v-spacer />
<v-btn
v-if="isLoggedIn && !(isAddAttachmentPage)"
color="primary"
small
:disabled="isEditAttachmentPage"
......@@ -47,9 +48,7 @@ permissions and limitations under the Licence.
</v-btn>
</v-card-actions>
<template v-if="isAddAttachmentPage">
<v-card class="mb-2">
<NuxtChild @showsave="showsave" @input="addAttachmentToList" />
</v-card>
<NuxtChild @showsave="showsave" @input="addAttachmentToList" />
</template>
<template
v-for="(attachment, index) in attachments"
......
......@@ -29,74 +29,97 @@ implied. See the Licence for the specific language governing
permissions and limitations under the Licence.
-->
<template>
<v-form ref="attachmentsForm" class="pl-10" @submit.prevent>
<v-row>
<v-col cols="12" md="3">
<v-radio-group
v-model="attachmentType"
label="Type"
row
>
<v-radio label="File" value="file" />
<v-radio label="Url" value="url" />
</v-radio-group>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="4">
<v-file-input
v-if="attachmentType === 'file'"
v-model="file"
:accept="mimeTypeList"
label="File"
required
class="required"
:rules="[rules.required]"
show-size
/>
<v-text-field
v-if="attachmentType === 'url'"
v-model="attachment.url"
label="URL"
type="url"
placeholder="https://"
required
class="required"
:rules="[rules.required, rules.validUrl]"
/>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="4">
<v-text-field
v-model="attachment.label"
label="Label"
/>
</v-col>
</v-row>
<v-row>
<v-col cols="12">
<v-spacer />
<v-btn
v-if="isLoggedIn"
ref="cancelButton"
text
small
:to="'/devices/' + deviceId + '/attachments'"
>
Cancel
</v-btn>
<v-btn
v-if="isLoggedIn"
color="green"
small
data-role="add-attachment"
@click="add()"
>
{{ attachmentType === 'url' ? 'Add' : 'Upload' }}
</v-btn>
</v-col>
</v-row>
<v-form ref="attachmentsForm" class="pb-2" @submit.prevent>
<v-card-actions>
<v-spacer />
<v-btn
v-if="isLoggedIn"
ref="cancelButton"
text
small
nuxt
:to="'/devices/' + deviceId + '/attachments'"
>
Cancel
</v-btn>
<v-btn
v-if="isLoggedIn"
color="green"
small
data-role="add-attachment"
@click="add()"
>
{{ attachmentType === 'url' ? 'Add' : 'Upload' }}
</v-btn>
</v-card-actions>
<v-card-text>
<v-row>
<v-col cols="12" md="3">
<v-radio-group
v-model="attachmentType"
label="Type"
row
>
<v-radio label="File" value="file" />
<v-radio label="Url" value="url" />
</v-radio-group>
</v-col>
</v-row>
<v-row>
<v-col cols="12">
<v-file-input
v-if="attachmentType === 'file'"
v-model="file"
:accept="mimeTypeList"
label="File"
required
class="required"
:rules="[rules.required]"
show-size
/>
<v-text-field
v-if="attachmentType === 'url'"
v-model="attachment.url"
label="URL"
type="url"
placeholder="https://"
required
class="required"
:rules="[rules.required, rules.validUrl]"
/>
</v-col>
</v-row>
<v-row>
<v-col cols="12">
<v-text-field
v-model="attachment.label"
label="Label"
/>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
v-if="isLoggedIn"
ref="cancelButton"
text
small
nuxt
:to="'/devices/' + deviceId + '/attachments'"
>
Cancel
</v-btn>
<v-btn
v-if="isLoggedIn"
color="green"
small
data-role="add-attachment"
@click="add()"
>
{{ attachmentType === 'url' ? 'Add' : 'Upload' }}
</v-btn>
</v-card-actions>
</v-form>
</template>
......
......@@ -37,10 +37,11 @@ permissions and limitations under the Licence.
v-model="isInProgress"
:dark="isSaving"
/>
<v-card-actions>
<v-card-actions
v-if="isLoggedIn && !(isAddAttachmentPage)"
>
<v-spacer />
<v-btn
v-if="isLoggedIn && !(isAddAttachmentPage)"
color="primary"
small
:disabled="isEditAttachmentPage"
......@@ -50,9 +51,7 @@ permissions and limitations under the Licence.
</v-btn>
</v-card-actions>
<template v-if="isAddAttachmentPage">
<v-card class="mb-2">
<NuxtChild @showsave="showsave" @input="addAttachmentToList" />
</v-card>
<NuxtChild @showsave="showsave" @input="addAttachmentToList" />
</template>
<template
v-for="(attachment, index) in attachments"
......
......@@ -32,74 +32,97 @@ implied. See the Licence for the specific language governing
permissions and limitations under the Licence.
-->
<template>
<v-form ref="attachmentsForm" class="pl-10" @submit.prevent>
<v-row>
<v-col cols="12" md="3">
<v-radio-group
v-model="attachmentType"
label="Type"
row
>
<v-radio label="File" value="file" />
<v-radio label="Url" value="url" />
</v-radio-group>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="4">
<v-file-input
v-if="attachmentType === 'file'"
v-model="file"
:accept="mimeTypeList"
label="File"
required
class="required"
:rules="[rules.required]"
show-size
/>
<v-text-field
v-if="attachmentType === 'url'"
v-model="attachment.url"
label="URL"
type="url"
placeholder="https://"
required
class="required"
:rules="[rules.required, rules.validUrl]"
/>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="4">
<v-text-field
v-model="attachment.label"
label="Label"
/>
</v-col>
</v-row>
<v-row>
<v-col cols="12">
<v-spacer />
<v-btn
v-if="isLoggedIn"
ref="cancelButton"
text
small
:to="'/platforms/' + platformId + '/attachments'"
>
Cancel
</v-btn>
<v-btn
v-if="isLoggedIn"
color="green"
small
data-role="add-attachment"
@click="add()"
>
{{ attachmentType === 'url' ? 'Add' : 'Upload' }}
</v-btn>
</v-col>
</v-row>
<v-form ref="attachmentsForm" class="pb-2" @submit.prevent>
<v-card-actions>
<v-spacer />
<v-btn
v-if="isLoggedIn"
ref="cancelButton"
text
small
nuxt
:to="'/platforms/' + platformId + '/attachments'"
>
Cancel
</v-btn>
<v-btn
v-if="isLoggedIn"
color="green"
small
data-role="add-attachment"
@click="add()"
>
{{ attachmentType === 'url' ? 'Add' : 'Upload' }}
</v-btn>
</v-card-actions>
<v-card-text>
<v-row>
<v-col cols="12" md="3">
<v-radio-group
v-model="attachmentType"
label="Type"
row
>
<v-radio label="File" value="file" />
<v-radio label="Url" value="url" />
</v-radio-group>
</v-col>
</v-row>
<v-row>
<v-col cols="12">
<v-file-input
v-if="attachmentType === 'file'"
v-model="file"
:accept="mimeTypeList"
label="File"
required
class="required"
:rules="[rules.required]"
show-size
/>
<v-text-field
v-if="attachmentType === 'url'"
v-model="attachment.url"
label="URL"
type="url"
placeholder="https://"
required
class="required"
:rules="[rules.required, rules.validUrl]"
/>
</v-col>
</v-row>
<v-row>
<v-col cols="12">
<v-text-field
v-model="attachment.label"
label="Label"
/>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn
v-if="isLoggedIn"
ref="cancelButton"
text
small
nuxt
:to="'/platforms/' + platformId + '/attachments'"
>
Cancel
</v-btn>
<v-btn
v-if="isLoggedIn"
color="green"
small
data-role="add-attachment"
@click="add()"
>
{{ attachmentType === 'url' ? 'Add' : 'Upload' }}
</v-btn>
</v-card-actions>
</v-form>
</template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment