forked from bakerkretzmar/nova-settings-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for file type on settings
- Loading branch information
1 parent
819e5b4
commit 878ee43
Showing
5 changed files
with
106 additions
and
20 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,65 @@ | ||
<template> | ||
<div class="flex border-b border-40"> | ||
|
||
<setting-label>{{ name }}</setting-label> | ||
|
||
<div class="w-1/2 py-6 px-8"> | ||
|
||
<a tabindex="0" v-if="value && typeof value === 'string'" :href="setting.value" target="_blank" class="cursor-pointer dim btn btn-link text-primary inline-flex items-center mr-4"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" aria-labelledby="download" role="presentation" class="fill-current mr-2"> | ||
<path d="M17.56 17.66a8 8 0 0 1-11.32 0L1.3 12.7a1 1 0 0 1 0-1.42l4.95-4.95a8 8 0 0 1 11.32 0l4.95 4.95a1 1 0 0 1 0 1.42l-4.95 4.95zM11.9 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10z"/><circle cx="12" cy="12" r="3"/> | ||
</svg> | ||
<span class="class">{{ __('View File') }}</span> | ||
</a> | ||
|
||
<input | ||
type="file" | ||
@input="input" | ||
class="form-file-input" | ||
id="image" | ||
/> | ||
<label for="image" class="form-file-btn btn btn-default btn-primary"> | ||
{{ __('Choose File') }} | ||
</label> | ||
|
||
<setting-info v-if="description || link.text" :text="link.text || ''" :url="link.url || ''" class="pt-3">{{ description }}</setting-info> | ||
|
||
</div> | ||
|
||
</div> | ||
</template> | ||
|
||
<script> | ||
import SettingLabel from './Label' | ||
import SettingInfo from './Info' | ||
export default { | ||
props: { | ||
name: String, | ||
setting: Object, | ||
description: String, | ||
link: Object | ||
}, | ||
components: { | ||
SettingLabel, | ||
SettingInfo | ||
}, | ||
methods: { | ||
input(e) { | ||
let path = event.target.value | ||
this.$emit('input', { | ||
key: this.setting.key, | ||
value: e.target.files[0] | ||
}) | ||
} | ||
}, | ||
computed: { | ||
value() { | ||
return this.setting.value; | ||
} | ||
} | ||
} | ||
</script> |
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