mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-16 10:20:31 +00:00
fixes to website module and fixed rename and double column bugs
This commit is contained in:
@@ -2,8 +2,8 @@ div#body_div, header .container, .content, #opened-page-selector, footer {
|
||||
width: 900px;
|
||||
}
|
||||
|
||||
.layout_wrapper {
|
||||
padding: 27px;
|
||||
div#body_div {
|
||||
margin-top: 90px;
|
||||
}
|
||||
|
||||
p, li {
|
||||
@@ -21,10 +21,6 @@ pre {
|
||||
margin-bottom: 9px;
|
||||
}
|
||||
|
||||
.web-content input[type="text"], .web-content input[type="password"], .web-content select {
|
||||
min-width: 180px;
|
||||
}
|
||||
|
||||
.web-head-section {
|
||||
margin-bottom: 20px
|
||||
}
|
||||
@@ -47,6 +43,7 @@ pre {
|
||||
|
||||
.web-page-status {
|
||||
padding: 7px;
|
||||
margin-top: -20px;
|
||||
color: #777;
|
||||
clear: both;
|
||||
text-align: right;
|
||||
@@ -77,20 +74,12 @@ footer {
|
||||
}
|
||||
|
||||
.web-footer div, .web-footer a {
|
||||
font-size: 11px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.web-footer-menu {
|
||||
margin-bottom: 7px;
|
||||
}
|
||||
footer a, footer a:visited {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
footer a:hover {
|
||||
background-color: #777;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.web-footer-menu ul {
|
||||
list-style: none;
|
||||
@@ -136,9 +125,8 @@ footer a:hover {
|
||||
}
|
||||
|
||||
.two-column {
|
||||
width: 40%;
|
||||
width: 50%;
|
||||
float: left;
|
||||
padding: 5%;
|
||||
}
|
||||
|
||||
.clear {
|
||||
|
||||
@@ -3,6 +3,7 @@ body {
|
||||
background: url("files/{{ doc.background_image }}") repeat;
|
||||
{% elif doc.background_color %}
|
||||
background-color: #{{ doc.background_color }};
|
||||
background-image: none;
|
||||
{% endif %}
|
||||
{% if doc.font %}
|
||||
font-family: '{{ doc.font }}', Verdana, Sans !important;
|
||||
|
||||
@@ -28,6 +28,8 @@ class DocType:
|
||||
self.doc.small_font_size = str(int(self.doc.font_size[:-2])-2) + 'px'
|
||||
|
||||
self.doc.custom_css = temp.render(doc = self.doc)
|
||||
if self.doc.add_css:
|
||||
self.doc.custom_css += '\n\n/* User CSS */\n\n' + self.doc.add_css
|
||||
|
||||
from webnotes.session_cache import clear_cache
|
||||
clear_cache('Guest')
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-04-02 16:02:43',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-04-16 13:36:48',
|
||||
'modified': '2012-04-25 10:00:35',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@@ -23,7 +23,7 @@
|
||||
'name': '__common__',
|
||||
'section_style': u'Simple',
|
||||
'show_in_menu': 0,
|
||||
'version': 19
|
||||
'version': 23
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@@ -89,6 +89,27 @@
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Select a white footer foreground color if you have a dark background',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'footer_font_color',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Footer Font Color',
|
||||
'options': u'\nwhite',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldtype': u'Column Break',
|
||||
'label': u'Fonts',
|
||||
'permlevel': 0,
|
||||
'width': u'50%'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
@@ -121,13 +142,20 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Select a white footer foreground color if you have a dark background',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'footer_font_color',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Footer Font Color',
|
||||
'options': u'\nwhite',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'CSS',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'add your own CSS (careful!)',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'add_css',
|
||||
'fieldtype': u'Code',
|
||||
'label': u'Add CSS',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="layout-wrapper layout-wrapper-background">
|
||||
<div class="web-content" id="content-{{ doc.name }}"
|
||||
<div class="web-content"
|
||||
style="text-align: {{ doc.text_align }};">
|
||||
|
||||
{% if doc.layout.startswith('Two column') %}
|
||||
|
||||
@@ -1,15 +1,33 @@
|
||||
$.extend(cur_frm.cscript, {
|
||||
layout: function(doc) {
|
||||
if(!doc.layout) doc.layout = 'Two column with header'
|
||||
hide_field(['head_section', 'side_section']);
|
||||
hide_field(['head_section', 'side_section', 'javascript', 'css']);
|
||||
if(doc.layout=='Two column with header') {
|
||||
unhide_field(['head_section', 'side_section']);
|
||||
}
|
||||
if(doc.layout=='Two column') {
|
||||
unhide_field('side_section');
|
||||
}
|
||||
if(doc.insert_code) {
|
||||
if(!doc.javascript) {
|
||||
doc.javascript = 'wn.pages["'+doc.name+'"].onload = function(wrapper) { }';
|
||||
}
|
||||
unhide_field('javascript');
|
||||
}
|
||||
if(doc.insert_style) {
|
||||
if(!doc.css) {
|
||||
doc.css = '#page-'+doc.name+' { }';
|
||||
}
|
||||
unhide_field('css');
|
||||
}
|
||||
},
|
||||
refresh: function(doc) {
|
||||
cur_frm.cscript.layout(doc);
|
||||
},
|
||||
insert_style: function() {
|
||||
cur_frm.cscript.layout(doc);
|
||||
},
|
||||
insert_code: function() {
|
||||
cur_frm.cscript.layout(doc);
|
||||
}
|
||||
})
|
||||
@@ -44,6 +44,14 @@ class DocType:
|
||||
with open(os.path.join(os.path.dirname(__file__), 'template.html'), 'r') as f:
|
||||
p.content = Template(f.read()).render(doc=self.doc)
|
||||
|
||||
p.title = self.doc.title
|
||||
|
||||
if self.doc.insert_code:
|
||||
p.script = self.doc.javascript
|
||||
|
||||
if self.doc.insert_style:
|
||||
p.style = self.doc.css
|
||||
|
||||
p.save()
|
||||
|
||||
website.utils.add_guest_access_to_page(p.name)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
'creation': '2012-04-02 16:02:43',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-04-10 10:41:00',
|
||||
'modified': '2012-04-25 16:03:57',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
'name': '__common__',
|
||||
'section_style': u'Simple',
|
||||
'show_in_menu': 0,
|
||||
'version': 11
|
||||
'version': 16
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@@ -85,15 +85,6 @@
|
||||
'reqd': 1
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'layout',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Layout',
|
||||
'options': u'Two column with header\nTwo column\nSingle column'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
@@ -105,10 +96,10 @@
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'text_align',
|
||||
'fieldname': u'layout',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Text Align',
|
||||
'options': u'Left\nCenter\nRight'
|
||||
'label': u'Layout',
|
||||
'options': u'Two column with header\nTwo column\nSingle column'
|
||||
},
|
||||
|
||||
# DocField
|
||||
@@ -158,29 +149,49 @@
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'sb2',
|
||||
'fieldtype': u'Section Break',
|
||||
'label': u'Links'
|
||||
'label': u'More'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'text_align',
|
||||
'fieldtype': u'Select',
|
||||
'label': u'Text Align',
|
||||
'options': u'Left\nCenter\nRight'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Link for next page appears at the bottom of the page',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'next_page',
|
||||
'fieldtype': u'Link',
|
||||
'label': u'Next Page',
|
||||
'options': u'Page'
|
||||
'fieldname': u'insert_code',
|
||||
'fieldtype': u'Check',
|
||||
'label': u'Insert Code'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'colour': u'White:FFF',
|
||||
'description': u'Related pages appear on the right side of the link and are linked both ways.',
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'related_pages',
|
||||
'fieldtype': u'Table',
|
||||
'label': u'Related Pages',
|
||||
'options': u'Related Page'
|
||||
'fieldname': u'javascript',
|
||||
'fieldtype': u'Code',
|
||||
'label': u'Javascript'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'insert_style',
|
||||
'fieldtype': u'Check',
|
||||
'label': u'Insert Style'
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'fieldname': u'css',
|
||||
'fieldtype': u'Code',
|
||||
'label': u'CSS'
|
||||
},
|
||||
|
||||
# DocField
|
||||
|
||||
Reference in New Issue
Block a user