@@ -2,7 +2,7 @@ | |||
{ | |||
"creation": "2013-01-10 16:34:01", | |||
"docstatus": 0, | |||
"modified": "2013-01-22 14:19:55", | |||
"modified": "2013-11-03 11:04:45", | |||
"modified_by": "Administrator", | |||
"owner": "Administrator" | |||
}, | |||
@@ -135,7 +135,7 @@ | |||
"label": "Mail Server" | |||
}, | |||
{ | |||
"description": "Enter Email Id to receive Error Report sent by users.\nE.g.: support@iwebnotes.com", | |||
"description": "Email Id where users will send support request e.g. support@example.com", | |||
"doctype": "DocField", | |||
"fieldname": "support_email_id", | |||
"fieldtype": "Data", | |||
@@ -104,3 +104,19 @@ def get_fields_label(dt=None, form=1): | |||
field_list = [cstr(d.fieldname) for d in docfields] | |||
return idx_label_list, field_list | |||
def delete_and_create_custom_field_if_values_exist(doctype, df): | |||
df = webnotes._dict(df) | |||
if webnotes.conn.sql("""select count(*) from `tab{doctype}` | |||
where ifnull({fieldname},'')!=''""".format(doctype=doctype, fieldname=df.fieldname))[0][0]: | |||
webnotes.bean({ | |||
"doctype":"Custom Field", | |||
"dt": doctype, | |||
"permlevel": df.permlevel or 0, | |||
"label": df.label, | |||
"fieldname": df.fieldname, | |||
"fieldtype": df.fieldtype, | |||
"options": df.options, | |||
"insert_after": df.insert_after | |||
}).insert() | |||
@@ -2,7 +2,7 @@ | |||
{ | |||
"creation": "2013-01-29 17:54:08", | |||
"docstatus": 0, | |||
"modified": "2013-07-05 14:34:41", | |||
"modified": "2013-11-03 11:06:11", | |||
"modified_by": "Administrator", | |||
"owner": "Administrator" | |||
}, | |||
@@ -86,15 +86,6 @@ | |||
"fieldname": "column_break1", | |||
"fieldtype": "Column Break" | |||
}, | |||
{ | |||
"description": "Load Print View on opening of an existing form", | |||
"doctype": "DocField", | |||
"fieldname": "read_only_onload", | |||
"fieldtype": "Check", | |||
"label": "Show Print First", | |||
"no_copy": 0, | |||
"search_index": 0 | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "allow_print", | |||
@@ -2,7 +2,7 @@ | |||
{ | |||
"creation": "2013-02-18 13:36:19", | |||
"docstatus": 0, | |||
"modified": "2013-10-14 17:09:57", | |||
"modified": "2013-11-02 23:01:10", | |||
"modified_by": "Administrator", | |||
"owner": "Administrator" | |||
}, | |||
@@ -12,6 +12,7 @@ | |||
"allow_email": 0, | |||
"allow_print": 0, | |||
"autoname": "Prompt", | |||
"custom": 0, | |||
"description": "DocType is a Table / Form in the application.", | |||
"doctype": "DocType", | |||
"hide_heading": 0, | |||
@@ -68,12 +69,28 @@ | |||
"reqd": 1 | |||
}, | |||
{ | |||
"description": "Child Tables are shown as a Grid in other DocTypes.", | |||
"doctype": "DocField", | |||
"fieldname": "plugin", | |||
"fieldtype": "Data", | |||
"hidden": 1, | |||
"label": "Plugin", | |||
"read_only": 0 | |||
"fieldname": "istable", | |||
"fieldtype": "Check", | |||
"hidden": 0, | |||
"label": "Is Child Table", | |||
"oldfieldname": "istable", | |||
"oldfieldtype": "Check", | |||
"reqd": 0, | |||
"search_index": 0 | |||
}, | |||
{ | |||
"description": "Single Types have only one record no tables associated. Values are stored in tabSingles", | |||
"doctype": "DocField", | |||
"fieldname": "issingle", | |||
"fieldtype": "Check", | |||
"hidden": 0, | |||
"label": "Is Single", | |||
"oldfieldname": "issingle", | |||
"oldfieldtype": "Check", | |||
"reqd": 0, | |||
"search_index": 0 | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
@@ -90,7 +107,12 @@ | |||
"options": "\nMaster\nTransaction\nSystem\nOther" | |||
}, | |||
{ | |||
"description": "Is it a Custom DocType created by you?", | |||
"doctype": "DocField", | |||
"fieldname": "icon", | |||
"fieldtype": "Data", | |||
"label": "Icon" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "custom", | |||
"fieldtype": "Check", | |||
@@ -99,19 +121,11 @@ | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "sb0_5", | |||
"fieldtype": "Section Break" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "description", | |||
"fieldtype": "Small Text", | |||
"hidden": 0, | |||
"label": "Description", | |||
"oldfieldname": "description", | |||
"oldfieldtype": "Text", | |||
"reqd": 0, | |||
"search_index": 0 | |||
"fieldname": "plugin", | |||
"fieldtype": "Data", | |||
"hidden": 1, | |||
"label": "Plugin", | |||
"read_only": 0 | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
@@ -140,51 +154,6 @@ | |||
"fieldname": "sb1", | |||
"fieldtype": "Section Break" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "cb10", | |||
"fieldtype": "Column Break", | |||
"label": "Database" | |||
}, | |||
{ | |||
"description": "No table is created for Single DocTypes, all values are stored in tabSingles as a tuple.", | |||
"doctype": "DocField", | |||
"fieldname": "issingle", | |||
"fieldtype": "Check", | |||
"hidden": 0, | |||
"label": "Is Single", | |||
"oldfieldname": "issingle", | |||
"oldfieldtype": "Check", | |||
"reqd": 0, | |||
"search_index": 0 | |||
}, | |||
{ | |||
"description": "Child Tables are shown as a Grid in other DocTypes.", | |||
"doctype": "DocField", | |||
"fieldname": "istable", | |||
"fieldtype": "Check", | |||
"hidden": 0, | |||
"label": "Is Child Table", | |||
"oldfieldname": "istable", | |||
"oldfieldtype": "Check", | |||
"reqd": 0, | |||
"search_index": 0 | |||
}, | |||
{ | |||
"description": "Allow Import via Data Import Tool", | |||
"doctype": "DocField", | |||
"fieldname": "allow_import", | |||
"fieldtype": "Check", | |||
"label": "Allow Import" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "cb11", | |||
"fieldtype": "Column Break", | |||
"label": "Naming", | |||
"oldfieldtype": "Column Break", | |||
"width": "50%" | |||
}, | |||
{ | |||
"description": "<a onclick=\"msgprint('<ol>\\\n<li><b>field:[fieldname]</b> - By Field\\\n<li><b>naming_series:</b> - By Naming Series (field called naming_series must be present\\\n<li><b>eval:[expression]</b> - Evaluate an expression in python (self is doc)\\\n<li><b>Prompt</b> - Prompt user for a name\\\n<li><b>[series]</b> - Series by prefix (separated by a dot); for example PRE.#####\\\n</ol>')\">Naming Options</a>", | |||
"doctype": "DocField", | |||
@@ -206,6 +175,11 @@ | |||
"oldfieldtype": "Select", | |||
"options": "\nTitle Case\nUPPER CASE" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "column_break_15", | |||
"fieldtype": "Column Break" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "search_fields", | |||
@@ -271,6 +245,13 @@ | |||
"fieldtype": "Check", | |||
"label": "Is Submittable" | |||
}, | |||
{ | |||
"description": "Allow Import via Data Import Tool", | |||
"doctype": "DocField", | |||
"fieldname": "allow_import", | |||
"fieldtype": "Check", | |||
"label": "Allow Import" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "allow_rename", | |||
@@ -279,6 +260,39 @@ | |||
"oldfieldname": "allow_rename", | |||
"oldfieldtype": "Check" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "in_dialog", | |||
"fieldtype": "Check", | |||
"label": "In Dialog", | |||
"oldfieldname": "in_dialog", | |||
"oldfieldtype": "Check" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "read_only_onload", | |||
"fieldtype": "Check", | |||
"label": "Show Print First", | |||
"oldfieldname": "read_only_onload", | |||
"oldfieldtype": "Check" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "allow_attach", | |||
"fieldtype": "Check", | |||
"label": "Allow Attach", | |||
"oldfieldname": "allow_attach", | |||
"oldfieldtype": "Check" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "max_attachments", | |||
"fieldtype": "Int", | |||
"hidden": 1, | |||
"label": "Max Attachments", | |||
"oldfieldname": "max_attachments", | |||
"oldfieldtype": "Int" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "cb31", | |||
@@ -340,28 +354,6 @@ | |||
"reqd": 0, | |||
"search_index": 0 | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "sb4", | |||
"fieldtype": "Section Break", | |||
"hidden": 0, | |||
"oldfieldtype": "Column Break", | |||
"reqd": 0, | |||
"search_index": 0, | |||
"width": "50%" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "cb41", | |||
"fieldtype": "Column Break", | |||
"label": "Display" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "icon", | |||
"fieldtype": "Data", | |||
"label": "Icon" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "default_print_format", | |||
@@ -370,42 +362,14 @@ | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "read_only_onload", | |||
"fieldtype": "Check", | |||
"label": "Show Print First", | |||
"oldfieldname": "read_only_onload", | |||
"oldfieldtype": "Check" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "in_dialog", | |||
"fieldtype": "Check", | |||
"label": "In Dialog", | |||
"oldfieldname": "in_dialog", | |||
"oldfieldtype": "Check" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "cb42", | |||
"fieldtype": "Column Break", | |||
"label": "Attachments" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "allow_attach", | |||
"fieldtype": "Check", | |||
"label": "Allow Attach", | |||
"oldfieldname": "allow_attach", | |||
"oldfieldtype": "Check" | |||
}, | |||
{ | |||
"doctype": "DocField", | |||
"fieldname": "max_attachments", | |||
"fieldtype": "Int", | |||
"hidden": 1, | |||
"label": "Max Attachments", | |||
"oldfieldname": "max_attachments", | |||
"oldfieldtype": "Int" | |||
"fieldname": "description", | |||
"fieldtype": "Small Text", | |||
"hidden": 0, | |||
"label": "Description", | |||
"oldfieldname": "description", | |||
"oldfieldtype": "Text", | |||
"reqd": 0, | |||
"search_index": 0 | |||
}, | |||
{ | |||
"cancel": 0, | |||
@@ -2,7 +2,7 @@ | |||
{ | |||
"creation": "2013-06-10 13:17:47", | |||
"docstatus": 0, | |||
"modified": "2013-07-26 14:41:43", | |||
"modified": "2013-11-03 11:08:35", | |||
"modified_by": "Administrator", | |||
"owner": "Administrator" | |||
}, | |||
@@ -126,7 +126,7 @@ | |||
}, | |||
{ | |||
"depends_on": "repeat_this_event", | |||
"description": "Leave blank if you have not decided the end date.", | |||
"description": "Leave blank to repeat always", | |||
"doctype": "DocField", | |||
"fieldname": "repeat_till", | |||
"fieldtype": "Date", | |||
@@ -2,7 +2,7 @@ | |||
{ | |||
"creation": "2012-11-22 17:45:46", | |||
"docstatus": 0, | |||
"modified": "2013-07-25 15:27:38", | |||
"modified": "2013-11-03 11:09:55", | |||
"modified_by": "Administrator", | |||
"owner": "Administrator" | |||
}, | |||
@@ -68,7 +68,7 @@ | |||
}, | |||
{ | |||
"depends_on": "letter_head_name", | |||
"description": "Your letter head content", | |||
"description": "Letter Head in HTML", | |||
"doctype": "DocField", | |||
"fieldname": "content", | |||
"fieldtype": "Text Editor", | |||
@@ -2,7 +2,7 @@ | |||
{ | |||
"creation": "2013-01-23 19:54:43", | |||
"docstatus": 0, | |||
"modified": "2013-07-05 14:50:50", | |||
"modified": "2013-11-03 11:10:24", | |||
"modified_by": "Administrator", | |||
"owner": "Administrator" | |||
}, | |||
@@ -68,7 +68,7 @@ | |||
"search_index": 1 | |||
}, | |||
{ | |||
"description": "Associate a DocType to the Print Format", | |||
"description": "Belongs to", | |||
"doctype": "DocField", | |||
"fieldname": "doc_type", | |||
"fieldtype": "Select", | |||
@@ -2,7 +2,7 @@ | |||
{ | |||
"creation": "2013-03-07 11:54:44", | |||
"docstatus": 0, | |||
"modified": "2013-09-18 12:10:54", | |||
"modified": "2013-11-03 11:10:54", | |||
"modified_by": "Administrator", | |||
"owner": "Administrator" | |||
}, | |||
@@ -70,7 +70,6 @@ | |||
"label": "Unsubscribed" | |||
}, | |||
{ | |||
"description": "Id of the profile will be the email.", | |||
"doctype": "DocField", | |||
"fieldname": "email", | |||
"fieldtype": "Data", | |||
@@ -217,7 +216,6 @@ | |||
"label": "Short Bio" | |||
}, | |||
{ | |||
"description": "Bio will be displayed in blog section etc.", | |||
"doctype": "DocField", | |||
"fieldname": "bio", | |||
"fieldtype": "Small Text", | |||
@@ -1825,7 +1825,6 @@ legend { | |||
label { | |||
display: inline-block; | |||
margin-bottom: 5px; | |||
font-weight: bold; | |||
} | |||
input[type="search"] { | |||
@@ -4248,7 +4247,7 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
.navbar { | |||
position: relative; | |||
min-height: 50px; | |||
min-height: 30px; | |||
margin-bottom: 20px; | |||
border: 1px solid transparent; | |||
} | |||
@@ -4418,7 +4417,7 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
.navbar-brand { | |||
float: left; | |||
padding: 15px 15px; | |||
padding: 5px 15px; | |||
font-size: 18px; | |||
line-height: 20px; | |||
} | |||
@@ -4437,10 +4436,10 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
.navbar-toggle { | |||
position: relative; | |||
float: right; | |||
padding: 9px 10px; | |||
margin-top: 8px; | |||
padding: 5px 10px; | |||
margin-top: -2px; | |||
margin-right: 15px; | |||
margin-bottom: 8px; | |||
margin-bottom: -2px; | |||
background-color: transparent; | |||
border: 1px solid transparent; | |||
border-radius: 4px; | |||
@@ -4464,7 +4463,7 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
} | |||
.navbar-nav { | |||
margin: 7.5px -15px; | |||
margin: 2.5px -15px; | |||
} | |||
.navbar-nav > li > a { | |||
@@ -4505,8 +4504,9 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
float: left; | |||
} | |||
.navbar-nav > li > a { | |||
padding-top: 15px; | |||
padding-bottom: 15px; | |||
padding-top: 5px; | |||
padding-bottom: 5px; | |||
font-size: 12px; | |||
} | |||
} | |||
@@ -4521,9 +4521,9 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
.navbar-form { | |||
padding: 10px 15px; | |||
margin-top: 8px; | |||
margin-top: -2px; | |||
margin-right: -15px; | |||
margin-bottom: 8px; | |||
margin-bottom: -2px; | |||
margin-left: -15px; | |||
border-top: 1px solid transparent; | |||
border-bottom: 1px solid transparent; | |||
@@ -4591,14 +4591,14 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
} | |||
.navbar-btn { | |||
margin-top: 8px; | |||
margin-bottom: 8px; | |||
margin-top: -2px; | |||
margin-bottom: -2px; | |||
} | |||
.navbar-text { | |||
float: left; | |||
margin-top: 15px; | |||
margin-bottom: 15px; | |||
margin-top: 5px; | |||
margin-bottom: 5px; | |||
} | |||
@media (min-width: 768px) { | |||
@@ -4726,12 +4726,12 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
} | |||
.navbar-inverse { | |||
background-color: #222222; | |||
border-color: #080808; | |||
background-color: #333333; | |||
border-color: #1a1a1a; | |||
} | |||
.navbar-inverse .navbar-brand { | |||
color: #999999; | |||
color: #eeeeee; | |||
} | |||
.navbar-inverse .navbar-brand:hover, | |||
@@ -4741,11 +4741,11 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
} | |||
.navbar-inverse .navbar-text { | |||
color: #999999; | |||
color: #eeeeee; | |||
} | |||
.navbar-inverse .navbar-nav > li > a { | |||
color: #999999; | |||
color: #eeeeee; | |||
} | |||
.navbar-inverse .navbar-nav > li > a:hover, | |||
@@ -4758,7 +4758,7 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
.navbar-inverse .navbar-nav > .active > a:hover, | |||
.navbar-inverse .navbar-nav > .active > a:focus { | |||
color: #ffffff; | |||
background-color: #080808; | |||
background-color: #1a1a1a; | |||
} | |||
.navbar-inverse .navbar-nav > .disabled > a, | |||
@@ -4783,14 +4783,14 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
.navbar-inverse .navbar-collapse, | |||
.navbar-inverse .navbar-form { | |||
border-color: #101010; | |||
border-color: #212121; | |||
} | |||
.navbar-inverse .navbar-nav > .open > a, | |||
.navbar-inverse .navbar-nav > .open > a:hover, | |||
.navbar-inverse .navbar-nav > .open > a:focus { | |||
color: #ffffff; | |||
background-color: #080808; | |||
background-color: #1a1a1a; | |||
} | |||
.navbar-inverse .navbar-nav > .dropdown > a:hover .caret { | |||
@@ -4799,8 +4799,8 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
} | |||
.navbar-inverse .navbar-nav > .dropdown > a .caret { | |||
border-top-color: #999999; | |||
border-bottom-color: #999999; | |||
border-top-color: #eeeeee; | |||
border-bottom-color: #eeeeee; | |||
} | |||
.navbar-inverse .navbar-nav > .open > a .caret, | |||
@@ -4812,10 +4812,10 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
@media (max-width: 767px) { | |||
.navbar-inverse .navbar-nav .open .dropdown-menu > .dropdown-header { | |||
border-color: #080808; | |||
border-color: #1a1a1a; | |||
} | |||
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a { | |||
color: #999999; | |||
color: #eeeeee; | |||
} | |||
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover, | |||
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus { | |||
@@ -4826,7 +4826,7 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover, | |||
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus { | |||
color: #ffffff; | |||
background-color: #080808; | |||
background-color: #1a1a1a; | |||
} | |||
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a, | |||
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover, | |||
@@ -4837,7 +4837,7 @@ textarea.input-group-sm > .input-group-btn > .btn { | |||
} | |||
.navbar-inverse .navbar-link { | |||
color: #999999; | |||
color: #eeeeee; | |||
} | |||
.navbar-inverse .navbar-link:hover { | |||
@@ -1,6 +1,6 @@ | |||
body { | |||
margin: 0px; | |||
padding-top: 70px; | |||
padding-top: 50px; | |||
padding-bottom: 50px; | |||
} | |||
@@ -98,13 +98,12 @@ div#freeze { | |||
} | |||
.icon-in-circle { | |||
color: white; | |||
background-color: #b7b7b7; | |||
color: #b7b7b7; | |||
background-color: white; | |||
border-radius:50%; | |||
padding: 9px; | |||
text-align: center; | |||
width: 38px; | |||
height: 38px; | |||
width: 20px; | |||
height: 20px; | |||
font-size: 20px; | |||
display: inline-block; | |||
} | |||
@@ -131,9 +130,10 @@ div#freeze { | |||
margin-bottom: 3px; | |||
} | |||
.link-field .btn { | |||
padding-left: 6px; | |||
padding-right: 6px; | |||
.link-field-btn a, .link-field-btn a:hover { | |||
color: #888; | |||
text-decoration: none; | |||
margin-left: 3px; | |||
} | |||
/* list */ | |||
@@ -261,8 +261,8 @@ div#freeze { | |||
} | |||
.appframe .sub-title-area { | |||
margin-top: -26px; | |||
margin-left: 47px; | |||
margin-top: -24px; | |||
margin-left: 42px; | |||
font-size: 100%; | |||
} | |||
@@ -277,8 +277,6 @@ div#freeze { | |||
.navbar-icon-home { | |||
vertical-align: middle; | |||
opacity: 0.7; | |||
Filter:alpha(opacity=70); /* For IE8 and earlier */ | |||
} | |||
.navbar-icon-home:hover, | |||
@@ -428,9 +426,14 @@ textarea.form-control { | |||
/* form grid */ | |||
.grid-heading-row { | |||
padding: 8px; | |||
border-bottom: 1px solid #dddddd; | |||
} | |||
.rows .grid-row .divider { | |||
padding-bottom: 8px; | |||
margin-bottom: 8px; | |||
padding-bottom: 5px; | |||
margin-bottom: 5px; | |||
border-bottom: 1px solid #dddddd; | |||
} | |||
@@ -43,7 +43,7 @@ | |||
display: block; | |||
position: fixed; | |||
z-index: 1050; | |||
top: 15px; | |||
top: 7px; | |||
right: 15px; | |||
} | |||
@@ -103,7 +103,9 @@ wn.ui.form.ControlImage = wn.ui.form.Control.extend({ | |||
make: function() { | |||
this._super(); | |||
var me = this; | |||
this.$wrapper.on("refresh", function() { | |||
this.$wrapper | |||
.css({"margin-bottom": "10px"}) | |||
.on("refresh", function() { | |||
me.$wrapper.empty(); | |||
if(me.df.options && me.frm.doc[me.df.options]) { | |||
$("<img src='"+me.frm.doc[me.df.options]+"' style='max-width: 70%;'>") | |||
@@ -144,7 +146,7 @@ wn.ui.form.ControlInput = wn.ui.form.Control.extend({ | |||
this.$wrapper = $('<div class="form-group">').appendTo(this.parent); | |||
} else { | |||
this.$wrapper = $('<div class="form-horizontal">\ | |||
<div class="form-group row" style="margin: 0px 0px 7px 0px">\ | |||
<div class="form-group row" style="margin: 0px">\ | |||
<label class="control-label col-xs-'+(this.horizontal?"3":"12")+'" style="padding-right: 0px"></label>\ | |||
<div class="col-xs-'+(this.horizontal?"9":"12")+'">\ | |||
<div class="control-input"></div>\ | |||
@@ -631,7 +633,7 @@ wn.ui.form.ControlSelect = wn.ui.form.ControlData.extend({ | |||
var me = this; | |||
$(this.input).css({"width": "85%", "display": "inline-block"}); | |||
this.$attach = $("<button class='btn btn-default' title='"+ wn._("Add attachment") + "'\ | |||
style='padding-left: 6px; padding-right: 6px; margin-left: 6px;'>\ | |||
style='padding-left: 6px; padding-right: 6px; margin-right: 6px;'>\ | |||
<i class='icon-plus'></i></button>") | |||
.click(function() { | |||
me.frm.attachments.new_attachment(me.df.fieldname); | |||
@@ -695,17 +697,16 @@ wn.ui.form.ControlSelect = wn.ui.form.ControlData.extend({ | |||
wn.ui.form.ControlLink = wn.ui.form.ControlData.extend({ | |||
make_input: function() { | |||
var me = this; | |||
$('<div class="input-group link-field">\ | |||
<input type="text" class="input-with-feedback form-control">\ | |||
<span class="input-group-btn">\ | |||
<button class="btn btn-default btn-search" title="Search Link">\ | |||
$('<div class="link-field">\ | |||
<input type="text" class="input-with-feedback form-control" style="width: 80%; display: inline-block">\ | |||
<span class="link-field-btn">\ | |||
<a class="btn-search" title="Search Link">\ | |||
<i class="icon-search"></i>\ | |||
</button>\ | |||
<button class="btn btn-default btn-open" title="Open Link">\ | |||
</a><a class="btn-open" title="Open Link">\ | |||
<i class="icon-play"></i>\ | |||
</button><button class="btn btn-default btn-new" title="Make New">\ | |||
</a><a class="btn-new" title="Make New">\ | |||
<i class="icon-plus"></i>\ | |||
</button>\ | |||
</a>\ | |||
</span>\ | |||
</div>').prependTo(this.input_area); | |||
this.$input_area = $(this.input_area); | |||
@@ -95,9 +95,9 @@ wn.ui.form.Footer = Class.extend({ | |||
refresh: function() { | |||
this.toggle_save(); | |||
if(this.frm.doc.__islocal) { | |||
this.wrapper.find(".after-save").toggle(false); | |||
this.wrapper.toggle(false); | |||
} else { | |||
this.wrapper.find(".after-save").toggle(true); | |||
this.wrapper.toggle(true); | |||
this.frm.attachments.refresh(); | |||
this.frm.comments.refresh(); | |||
this.frm.assign_to.refresh(); | |||
@@ -11,8 +11,8 @@ wn.ui.form.Grid = Class.extend({ | |||
var me = this; | |||
this.wrapper = $('<div>\ | |||
<div class="panel panel-default">\ | |||
<div class="panel-heading" style="font-size: 15px;"></div>\ | |||
<div class="" style="border: 1px solid #ddd; margin-bottom: 15px; border-radius: 3px;">\ | |||
<div class="grid-heading-row" style="font-size: 15px; background-color: #f9f9f9;"></div>\ | |||
<div class="panel-body">\ | |||
<div class="rows"></div>\ | |||
<div style="margin-top: 5px; margin-bottom: -5px;">\ | |||
@@ -31,7 +31,7 @@ wn.ui.form.Grid = Class.extend({ | |||
make_head: function() { | |||
// labels | |||
this.header_row = new wn.ui.form.GridRow({ | |||
parent: $(this.parent).find(".panel-heading"), | |||
parent: $(this.parent).find(".grid-heading-row"), | |||
parent_df: this.df, | |||
docfields: this.docfields, | |||
frm: this.frm, | |||
@@ -245,7 +245,7 @@ wn.ui.form.GridRow = Class.extend({ | |||
var txt = this.doc ? | |||
wn.format(this.doc[df.fieldname], df, null, this.doc) : | |||
wn._(df.label); | |||
if(df.fieldtype === "Select") { | |||
if(this.doc && df.fieldtype === "Select") { | |||
txt = wn._(txt); | |||
} | |||
var add_class = (["Text", "Small Text"].indexOf(df.fieldtype)===-1) ? | |||
@@ -258,6 +258,7 @@ wn.ui.form.GridRow = Class.extend({ | |||
.attr("data-fieldname", df.fieldname) | |||
.data("df", df) | |||
.appendTo(this.row) | |||
if(!this.doc) $col.css({"font-weight":"bold"}) | |||
} | |||
// TODO find a better solution | |||
@@ -405,7 +406,6 @@ wn.ui.form.GridRow = Class.extend({ | |||
.appendTo(me.form_area); | |||
var row = $('<div class="row">') | |||
.css({"padding": "0px 15px"}) | |||
.appendTo(me.form_area); | |||
var col_spans = 6; | |||
@@ -108,11 +108,11 @@ wn.ui.form.Layout = Class.extend({ | |||
if(df) { | |||
if(df.label) { | |||
this.labelled_section_count++; | |||
var head = $('<h3 class="col-md-12 text-muted">' | |||
var head = $('<h4 class="col-md-12 text-muted">' | |||
+ (df.options ? (' <i class="icon-in-circle '+df.options+'"></i> ') : "") | |||
+ '<span class="section-count-label">' + this.labelled_section_count + "</span>. " | |||
+ wn._(df.label) | |||
+ "</h3>") | |||
+ "</h4>") | |||
.appendTo(this.section); | |||
if(df && df.idx===1) | |||
@@ -118,7 +118,7 @@ wn.print.Table = Class.extend({ | |||
var tr = $("<tr>").appendTo(table); | |||
$.each(me.columns, function(ci, fieldname) { | |||
if(ci==0) | |||
if(fieldname==="Sr") | |||
var value = row.idx; | |||
else | |||
var value = row[fieldname]; | |||
@@ -183,7 +183,7 @@ wn.ui.AppFrame = Class.extend({ | |||
.appendTo($right); | |||
if(e.type===active_view) { | |||
btn.css({"color": "#4CD964"}); | |||
btn.css({"color": "#428bca"}); | |||
} | |||
}); | |||
}, | |||
@@ -24,8 +24,7 @@ wn.ui.toolbar.Toolbar = Class.extend({ | |||
}) | |||
}, | |||
make: function() { | |||
$('header').append('<div class="navbar navbar-fixed-top navbar-inverse" \ | |||
style="min-height: 50px;" role="navigation">\ | |||
$('header').append('<div class="navbar navbar-fixed-top navbar-inverse" role="navigation">\ | |||
<div class="container">\ | |||
<div class="navbar-header">\ | |||
<button type="button" class="navbar-toggle" data-toggle="collapse" \ | |||
@@ -94,19 +94,24 @@ wn.views.Page = Class.extend({ | |||
}) | |||
wn.show_not_found = function(page_name) { | |||
var page = wn.pages[page_name] || wn.container.add_page(page_name); | |||
$(page).html('<div class="appframe col-md-12">\ | |||
<h3><i class="icon-exclamation-sign"></i> '+wn._('Not Found')+'</h3><br>\ | |||
<p>'+wn._('Sorry we were unable to find what you were looking for.')+'</p>\ | |||
<p><a href="#">'+wn._('Go back to home')+'</a></p>\ | |||
</div>'); | |||
wn.show_message_page(page_name, '<i class="icon-exclamation-sign"></i> ' + wn._("Not Found"), | |||
wn._("Sorry we were unable to find what you were looking for.")); | |||
} | |||
wn.show_not_permitted = function(page_name) { | |||
wn.show_message_page(page_name, '<i class="icon-exclamation-sign"></i> ' +wn._("Not Permitted"), | |||
wn._("Sorry you are not permitted to view this page.")); | |||
} | |||
wn.show_message_page = function(page_name, title, message) { | |||
if(!page_name) page_name = wn.get_route_str(); | |||
var page = wn.pages[page_name] || wn.container.add_page(page_name); | |||
$(page).html('<div class="appframe col-md-12">\ | |||
<h3><i class="icon-minus-sign"></i> '+wn._('Not Permitted')+'</h3><br>\ | |||
<p>'+wn._('Sorry you are not permitted to view this page.')+'.</p>\ | |||
<p><a href="#">'+wn._('Go back to home')+'</a></p>\ | |||
<div style="margin: 50px; text-align:center;">\ | |||
<h3>'+title+'</h3><br>\ | |||
<p>'+message+'</p><br>\ | |||
<p><a href="#">Home <i class="icon-home"></i></a></p>\ | |||
</div>\ | |||
</div>'); | |||
wn.container.change_to(page_name); | |||
} |
@@ -33,7 +33,7 @@ def set_value(doctype, name, fieldname, value): | |||
doc = webnotes.conn.get_value(doctype, name, ["parenttype", "parent"], as_dict=True) | |||
if doc and doc.parent: | |||
bean = webnotes.bean(doc.parenttype, doc.parent) | |||
child = bean.doclist.getone({"doctype": doctype, "name": docname}) | |||
child = bean.doclist.getone({"doctype": doctype, "name": name}) | |||
child.fields[fieldname] = value | |||
else: | |||
bean = webnotes.bean(doctype, name) | |||