Browse Source

[wiz][minor] style fixes, static label, first entry mandatory (#3647)

version-14
Prateeksha Singh 8 years ago
committed by Makarand Bauskar
parent
commit
a309b5696a
2 changed files with 27 additions and 18 deletions
  1. +9
    -12
      frappe/desk/page/setup_wizard/setup_wizard.css
  2. +18
    -6
      frappe/desk/page/setup_wizard/setup_wizard.js

+ 9
- 12
frappe/desk/page/setup_wizard/setup_wizard.css View File

@@ -1,5 +1,9 @@
#page-setup-wizard {
margin-top: 30px;
}

.setup-wizard-brand { .setup-wizard-brand {
margin: 40px;
margin: 30px;
text-align: center; text-align: center;
display: flex; display: flex;
justify-content: center; justify-content: center;
@@ -33,10 +37,10 @@
} }


.setup-wizard-slide .lead { .setup-wizard-slide .lead {
margin: 40px;
margin: 30px;
color: #777777; color: #777777;
text-align: center; text-align: center;
font-size: 30px;
font-size: 24px;
} }


.setup-wizard-slide .col-sm-12 { .setup-wizard-slide .col-sm-12 {
@@ -52,7 +56,6 @@
} }


.setup-wizard-slide .form-control { .setup-wizard-slide .form-control {
height: 35px;
font-weight: 500; font-weight: 500;
} }


@@ -69,7 +72,7 @@
} }


.setup-wizard-slide.with-form { .setup-wizard-slide.with-form {
margin: 40px auto;
margin: 30px auto;
padding: 10px 50px; padding: 10px 50px;
border: 1px solid #d1d8dd; border: 1px solid #d1d8dd;
box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1); box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.1);
@@ -79,12 +82,6 @@
padding: 30px 0px; padding: 30px 0px;
} }


.setup-wizard-slide a.next-btn,
.setup-wizard-slide a.complete-btn {
font-size: 14px;
padding: 7px 25px;
}

.setup-wizard-slide a.next-btn.disabled, .setup-wizard-slide a.next-btn.disabled,
.setup-wizard-slide a.complete-btn.disabled { .setup-wizard-slide a.complete-btn.disabled {
background-color: #b1bdca; background-color: #b1bdca;
@@ -117,7 +114,7 @@
width: 140px; width: 140px;
height: 180px; /*depends on presence of heading*/ height: 180px; /*depends on presence of heading*/
text-align: center; text-align: center;
margin-left: 33%;
margin-left: calc((100% - 140px)/2);
} }


.setup-wizard-slide .frappe-control[data-fieldtype="Attach Image"] .form-group, .setup-wizard-slide .frappe-control[data-fieldtype="Attach Image"] .form-group,


+ 18
- 6
frappe/desk/page/setup_wizard/setup_wizard.js View File

@@ -233,9 +233,16 @@ frappe.setup.WizardSlide = Class.extend({


if(this.add_more) { if(this.add_more) {
this.count = 1; this.count = 1;
fields = fields.map(field => {
if(field.fieldname) field.fieldname += '_1';
if(field.label) field.label += ' 1';
fields = fields.map((field, i) => {
if(field.fieldname) {
field.fieldname += '_1';
}
if(i === 1 && this.mandatory_entry) {
field.reqd = 1;
}
if(!field.static) {
if(field.label) field.label += ' 1';
}
return field; return field;
}); });
} }
@@ -278,6 +285,9 @@ frappe.setup.WizardSlide = Class.extend({
if(this.onload) { if(this.onload) {
this.onload(this); this.onload(this);
} }
this.set_reqd_fields();
this.bind_fields_to_next($primary_btn);

this.reset_next($primary_btn); this.reset_next($primary_btn);
this.focus_first_input(); this.focus_first_input();
}, },
@@ -322,7 +332,9 @@ frappe.setup.WizardSlide = Class.extend({
var fields = JSON.parse(JSON.stringify(this.fields)); var fields = JSON.parse(JSON.stringify(this.fields));
this.form.add_fields(fields.map(field => { this.form.add_fields(fields.map(field => {
if(field.fieldname) field.fieldname += '_' + this.count; if(field.fieldname) field.fieldname += '_' + this.count;
if(field.label) field.label += ' ' + this.count;
if(!field.static) {
if(field.label) field.label += ' ' + this.count;
}
return field; return field;
})); }));
if(this.count === this.max_count) { if(this.count === this.max_count) {
@@ -437,7 +449,7 @@ var frappe_slides = [


fields: [ fields: [
{ fieldname: "language", label: __("Your Language"), { fieldname: "language", label: __("Your Language"),
fieldtype: "Select", "default": "English" }
fieldtype: "Select", reqd: 1}
], ],


onload: function(slide) { onload: function(slide) {
@@ -497,7 +509,7 @@ var frappe_slides = [
label: __("Attach Your Picture"), is_private: 0}, label: __("Attach Your Picture"), is_private: 0},
{ "fieldname": "full_name", "label": __("Full Name"), "fieldtype": "Data", { "fieldname": "full_name", "label": __("Full Name"), "fieldtype": "Data",
reqd:1}, reqd:1},
{ "fieldname": "email", "label": __("Email Address") + ' <i>(' + __("Will be your login ID") + ')</i>',
{ "fieldname": "email", "label": __("Email Address") + ' (' + __("Will be your login ID") + ')',
"fieldtype": "Data", "options":"Email"}, "fieldtype": "Data", "options":"Email"},
{ "fieldname": "password", "label": __("Password"), "fieldtype": "Password" } { "fieldname": "password", "label": __("Password"), "fieldtype": "Password" }
], ],


Loading…
Cancel
Save