2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

fix: Show logo and its checkbox in Customizer

- Show selected color badge
- Hide checkbox label in TwoColumnForm
This commit is contained in:
Faris Ansari 2020-02-04 01:33:18 +05:30
parent c832baf585
commit 48e22e0419
5 changed files with 26 additions and 8 deletions

View File

@ -110,6 +110,8 @@ module.exports = {
}
],
quickEditFields: [
'logo',
'displayLogo',
'template',
'color',
'font',

View File

@ -10,7 +10,7 @@
@change="e => triggerChange(+e.target.checked)"
@focus="e => $emit('focus', e)"
/>
<div class="ml-3 text-gray-900 text-sm">
<div class="ml-3 text-gray-900 text-sm" v-if="showLabel">
{{ df.label }}
</div>
</label>

View File

@ -10,12 +10,18 @@
:class="inputClasses"
@click="!isReadOnly && togglePopover()"
>
<span v-if="value">
{{ selectedColorLabel }}
</span>
<span class="text-gray-400" v-else>
{{ inputPlaceholder }}
</span>
<div class="flex items-center">
<div
class="w-3 h-3 rounded mr-1"
:style="{ backgroundColor: value }"
></div>
<span v-if="value">
{{ selectedColorLabel }}
</span>
<span class="text-gray-400" v-else>
{{ inputPlaceholder }}
</span>
</div>
</div>
</template>
<div class="text-sm py-3 px-2 text-center" slot="content">

View File

@ -64,6 +64,7 @@
]
: doc[df.fieldname]
"
:class="{ 'p-2': df.fieldtype === 'Check' }"
@change="value => onChange(df, value)"
@focus="activateInlineEditing(df)"
@new-doc="newdoc => onChange(df, newdoc.name)"

View File

@ -22,6 +22,7 @@
class="mt-2"
:df="meta.getField('displayLogo')"
:value="doc.displayLogo"
:show-label="true"
@change="
value => {
doc.set('displayLogo', value);
@ -71,7 +72,15 @@ export default {
return frappe.getMeta('PrintSettings');
},
fields() {
return this.meta.getQuickEditFields();
return [
'template',
'color',
'font',
'email',
'phone',
'address',
'gstin'
].map(field => this.meta.getField(field));
}
},
methods: {