[ADD] content editable

bzr revid: fme@openerp.com-20130624162327-a0o7tgk2sv81fwuc
This commit is contained in:
Fabien Meghazi
2013-06-24 18:23:27 +02:00
parent b6aa736745
commit 20975ed27c
2 changed files with 95 additions and 86 deletions
+12 -2
View File
@@ -8,8 +8,18 @@ class Website(openerp.addons.web.controllers.main.Home):
@http.route('/', type='http', auth="db")
def index(self, **kw):
with open(openerp.addons.get_module_resource('website', 'views', 'homepage.html'), 'rb') as f:
return f.read()
editable = bool(request.session._uid)
# WIP !!!
html = open(openerp.addons.get_module_resource('website', 'views', 'homepage.html'), 'rb').read()
if editable:
html = html.replace('<!--editable-->', """
<script type="text/javascript">
$(function() {
$('.editable').css('outline', '1px solid red').attr('contentEditable', 'true').find('*').click(void(0));
});
</script>
""")
return html
@http.route('/admin', type='http', auth="none")
def admin(self, *args, **kw):
+83 -84
View File
@@ -1,41 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<base href="https://www.openerp.com"/>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>OpenERP - Beautiful Business Applications</title>
<link rel=icon href="/saas_master/static/site_new/img/favicon.ico">
<script src='/saas_master/static/site_new/js/lib/html5shiv.js'></script>
<script src="/web/static/lib/jquery/jquery-1.8.3.js"></script>
<script src='https://www.openerp.com/saas_master/static/site_new/js/lib/html5shiv.js'></script>
<script src="https://www.openerp.com/web/static/lib/jquery/jquery-1.8.3.js"></script>
<script src="//cdn.optimizely.com/js/238505250.js"></script>
<link href='/saas_master/static/site_new/fonts/lato/stylesheet.css' rel='stylesheet' type='text/css'></link>
<link href='https://www.openerp.com/saas_master/static/site_new/fonts/lato/stylesheet.css' rel='stylesheet' type='text/css'></link>
<link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,300,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/saas_master/static/site_new/css/normalize.css">
<link rel="stylesheet" href="/saas_master/static/site_new/css/common.css">
<link rel="stylesheet" href="/saas_master/static/site_new/css/website.css">
<link rel="stylesheet" href="/saas_master/static/site_new/css/font-awesome.css">
<script src="/web/static/lib/underscore/underscore.js"></script>
<script src="/web/static/lib/underscore/underscore.string.js"></script>
<script src='/saas_master/static/site_new/js/website.js'></script>
<link rel="stylesheet" href="https://www.openerp.com/saas_master/static/site_new/css/normalize.css">
<link rel="stylesheet" href="https://www.openerp.com/saas_master/static/site_new/css/common.css">
<link rel="stylesheet" href="https://www.openerp.com/saas_master/static/site_new/css/website.css">
<link rel="stylesheet" href="https://www.openerp.com/saas_master/static/site_new/css/font-awesome.css">
<script src="https://www.openerp.com/web/static/lib/underscore/underscore.js"></script>
<script src="https://www.openerp.com/web/static/lib/underscore/underscore.string.js"></script>
<script src='https://www.openerp.com/saas_master/static/site_new/js/website.js'></script>
<!--editable-->
</head>
<body class="oe_styling_v8">
<div class='oe_website_contents'>
<header class='oe_website_header'>
<div class='oe_row oe_fit'>
<div class='oe_span3 oe_logo_menu'>
<a href='/' class='ab_menu_logo'>
<img class='oe_logo_img' alt='OpenERP: Open Source Business Apps' src='/saas_master/static/site_new/img/logo_oe_top_old_and_small.png'>
<a href='https://www.openerp.com/' class='ab_menu_logo'>
<img class='oe_logo_img' alt='OpenERP: Open Source Business Apps' src='https://www.openerp.com/saas_master/static/site_new/img/logo_oe_top_old_and_small.png'>
</a>
</div>
<nav class='oe_span9 oe_right oe_top_menu' id='top-menu'>
<div class='oe_top_menu_entry'><a class='ab_menu_apps' href='/apps'>Applications</a></div>
<div class='oe_top_menu_entry'><a class='ab_menu_partners' href='/partners/directory'>Partners</a></div>
<div class='oe_top_menu_entry'><a class='ab_menu_training' href="/events#view=training">Training</a></div>
<div class='oe_top_menu_entry'><a class='ab_menu_freetrial' href='/start'>Free Trial</a></div>
<div class='oe_top_menu_entry'><a class='ab_menu_download' href='/start?download'>Download</a></div>
<div class='oe_top_menu_entry'><a class='ab_menu_contact' href='/contact'>Contact Us</a></div>
<div class='oe_top_menu_entry oe_sign_in '><a class='ab_menu_signin' href='https://accounts.openerp.com'>Sign In</a></div>
<div class='oe_top_menu_entry editable'><a class='ab_menu_apps' href='https://www.openerp.com/apps'>Applications</a></div>
<div class='oe_top_menu_entry editable'><a class='ab_menu_partners' href='https://www.openerp.com/partners/directory'>Partners</a></div>
<div class='oe_top_menu_entry editable'><a class='ab_menu_training' href="https://www.openerp.com/events#view=training">Training</a></div>
<div class='oe_top_menu_entry editable'><a class='ab_menu_freetrial' href='https://www.openerp.com/start'>Free Trial</a></div>
<div class='oe_top_menu_entry editable'><a class='ab_menu_download' href='https://www.openerp.com/start?download'>Download</a></div>
<div class='oe_top_menu_entry editable'><a class='ab_menu_contact' href='https://www.openerp.com/contact'>Contact Us</a></div>
<div class='oe_top_menu_entry editable oe_sign_in '><a class='ab_menu_signin' href='https://accounts.openerp.com'>Sign In</a></div>
</nav>
</div>
</header>
@@ -45,10 +44,10 @@
<div class='oe_slide oe_home_slide'>
<div class='oe_row'>
<div class='oe_slide_title oe_title_font'><span class='oe_open'>Open</span><span class='oe_erp'>ERP</span><span class='oe_version'>7.0</span></div>
<div class='oe_slide_subtitle'>
<div class='oe_slide_subtitle editable'>
Beautiful Business Applications<br />
Powerful, Integrated, Open Source<br />
<a href='/start' class='oe_button oe_medium oe_tacky ab_banner_freetrial'>Start your <span class='oe_emph'>free</span> trial <i class='icon-arrow-right'></i></a>
<a href='https://www.openerp.com/start' class='oe_button oe_medium oe_tacky ab_banner_freetrial'>Start your <span class='oe_emph'>free</span> trial <i class='icon-arrow-right'></i></a>
</div>
</div>
</div>
@@ -130,111 +129,111 @@
<h4 class='oe_slogan'>Choose Your Application</h4>
<div class='oe_row oe_appstore'>
<a href='/apps/crm/' title='CRM' class='oe_app ab_app_descr'>
<a href='https://www.openerp.com/apps/crm/' title='CRM' class='oe_app ab_app_descr'>
<div class='ab_app_descr'>
<div class='oe_app_icon'>
<img src="/saas_master/static/site_new/img/icons/crm.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/icons/crm.png">
</div>
</div>
<div class='oe_app_name'>CRM</div>
<div class='oe_app_descr'>
<div class='oe_app_name editable'>CRM</div>
<div class='oe_app_descr editable'>
Boost sales productivity, improve win rates, grow revenue
</div>
</a>
<a href='/apps/point_of_sale/' title='Point of Sale' class='oe_app ab_app_descr'>
<a href='https://www.openerp.com/apps/point_of_sale/' title='Point of Sale' class='oe_app ab_app_descr'>
<div class='ab_app_descr'>
<div class='oe_app_icon'>
<img src="/saas_master/static/site_new/img/icons/pos.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/icons/pos.png">
</div>
</div>
<div class='oe_app_name'>Point of Sale</div>
<div class='oe_app_descr'>
<div class='oe_app_name editable'>Point of Sale</div>
<div class='oe_app_descr editable'>
Touchscreen interface for shops
</div>
</a>
<a href='/apps/project/' title='Project Management' class='oe_app ab_app_descr'>
<a href='https://www.openerp.com/apps/project/' title='Project Management' class='oe_app ab_app_descr'>
<div class='ab_app_descr'>
<div class='oe_app_icon'>
<img src="/saas_master/static/site_new/img/icons/projects.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/icons/projects.png">
</div>
</div>
<div class='oe_app_name'>Project Management</div>
<div class='oe_app_descr'>
<div class='oe_app_name editable'>Project Management</div>
<div class='oe_app_descr editable'>
Get things done, together
</div>
</a>
<a href='/apps/account/' title='Accounting' class='oe_app ab_app_descr'>
<a href='https://www.openerp.com/apps/account/' title='Accounting' class='oe_app ab_app_descr'>
<div class='ab_app_descr'>
<div class='oe_app_icon'>
<img src="/saas_master/static/site_new/img/icons/accounting.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/icons/accounting.png">
</div>
</div>
<div class='oe_app_name'>Accounting</div>
<div class='oe_app_descr'>
<div class='oe_app_name editable'>Accounting</div>
<div class='oe_app_descr editable'>
All you need to run your business
</div>
</a>
<a href='/apps/hr/' title='Human Resources' class='oe_app ab_app_descr'>
<a href='https://www.openerp.com/apps/hr/' title='Human Resources' class='oe_app ab_app_descr'>
<div class='ab_app_descr'>
<div class='oe_app_icon'>
<img src="/saas_master/static/site_new/img/icons/hr.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/icons/hr.png">
</div>
</div>
<div class='oe_app_name'>Human Resources</div>
<div class='oe_app_descr'>
<div class='oe_app_name editable'>Human Resources</div>
<div class='oe_app_descr editable'>
Manage people, the most important asset in your company
</div>
</a>
<a href='/apps/stock/' title='Warehouse' class='oe_app ab_app_descr'>
<a href='https://www.openerp.com/apps/stock/' title='Warehouse' class='oe_app ab_app_descr'>
<div class='ab_app_descr'>
<div class='oe_app_icon'>
<img src="/saas_master/static/site_new/img/icons/warehouse.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/icons/warehouse.png">
</div>
</div>
<div class='oe_app_name'>Warehouse</div>
<div class='oe_app_descr'>
<div class='oe_app_name editable'>Warehouse</div>
<div class='oe_app_descr editable'>
A revolutionary double entry inventory system
</div>
</a>
<a href='/apps/sale/' title='Sales' class='oe_app ab_app_descr'>
<a href='https://www.openerp.com/apps/sale/' title='Sales' class='oe_app ab_app_descr'>
<div class='ab_app_descr'>
<div class='oe_app_icon'>
<img src="/saas_master/static/site_new/img/icons/sales.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/icons/sales.png">
</div>
</div>
<div class='oe_app_name'>Sales</div>
<div class='oe_app_descr'>
<div class='oe_app_name editable'>Sales</div>
<div class='oe_app_descr editable'>
From quotes to invoices, in just a few clicks
</div>
</a>
<a href='/apps/mrp/' title='Manufacturing' class='oe_app ab_app_descr'>
<a href='https://www.openerp.com/apps/mrp/' title='Manufacturing' class='oe_app ab_app_descr'>
<div class='ab_app_descr'>
<div class='oe_app_icon'>
<img src="/saas_master/static/site_new/img/icons/mrp.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/icons/mrp.png">
</div>
</div>
<div class='oe_app_name'>Manufacturing</div>
<div class='oe_app_descr'>
<div class='oe_app_name editable'>Manufacturing</div>
<div class='oe_app_descr editable'>
Manage Bill of Materials, Plan Manufacturing Orders, Track Work Orders
</div>
</a>
<a href='/apps/purchase/' title='Purchase' class='oe_app ab_app_descr'>
<a href='https://www.openerp.com/apps/purchase/' title='Purchase' class='oe_app ab_app_descr'>
<div class='ab_app_descr'>
<div class='oe_app_icon'>
<img src="/saas_master/static/site_new/img/icons/assets.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/icons/assets.png">
</div>
</div>
<div class='oe_app_name'>Purchase</div>
<div class='oe_app_descr'>
<div class='oe_app_name editable'>Purchase</div>
<div class='oe_app_descr editable'>
Automate procurements, control products and invoicing
</div>
</a>
@@ -243,7 +242,7 @@
</div>
<div class='oe_row'>
<div class='oe_span12 oe_centeralign'>
... <a id='app-more' href='/apps'>and 200 more applications</a> ...
... <a id='app-more' href='https://www.openerp.com/apps'>and 200 more applications</a> ...
</div>
</div>
</section>
@@ -260,7 +259,7 @@
it helps me a lot, especially to make right business decisions.
</div>
<cite class="oe_cite oe_clearfix">
<img class="oe_photo" src="/saas_master/static/site_new/img/testimonials/Tomas-Parnarauskas.png">
<img class="oe_photo" src="https://www.openerp.com/saas_master/static/site_new/img/testimonials/Tomas-Parnarauskas.png">
<div class="oe_author">Tomas Parnarauskas</div>
<div class="oe_job">CEO of NOD Baltic, JSC.</div>
</cite>
@@ -273,7 +272,7 @@
Things are better organized and much more visible with it.
</div>
<cite class="oe_cite oe_clearfix">
<img class="oe_photo" src="/saas_master/static/site_new/img/testimonials/Yoshi-Tashiro.png">
<img class="oe_photo" src="https://www.openerp.com/saas_master/static/site_new/img/testimonials/Yoshi-Tashiro.png">
<div class="oe_author">Yoshi Tashiro</div>
<div class="oe_job">Managing Director at RoomsFor (Hong Kong)</div>
</cite>
@@ -283,25 +282,25 @@
<div class="oe_row oe_flex oe_centeralign oe_mt64">
<div class="oe_span3 oe_fit">
<img src="/saas_master/static/site_new/img/logo_danone.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/logo_danone.png">
</div>
<div class="oe_span3 oe_fit">
<img src="/saas_master/static/site_new/img/logo_laposte.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/logo_laposte.png">
</div>
<div class="oe_span3 oe_fit">
<img src="/saas_master/static/site_new/img/logo_canonical.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/logo_canonical.png">
</div>
<div class="oe_span3 oe_fit">
<img src="/saas_master/static/site_new/img/logo_singer.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/logo_singer.png">
</div>
<div class="oe_span3 oe_fit">
<img src="/saas_master/static/site_new/img/logo_ena2.png">
<img src="https://www.openerp.com/saas_master/static/site_new/img/logo_ena2.png">
</div>
</div>
<div class="oe_row">
<div class="oe_span12 oe_centeralign">
... <a href="/references/directory">and many more</a> ...
... <a href="https://www.openerp.com/references/directory">and many more</a> ...
</div>
</div>
@@ -325,7 +324,7 @@
</div>
<div class='oe_span6'>
<img class="oe_picture oe_screenshot" src="/saas_master/static/site_new/img/homepage/screenshot01.png">
<img class="oe_picture oe_screenshot" src="https://www.openerp.com/saas_master/static/site_new/img/homepage/screenshot01.png">
</div>
</div>
</section>
@@ -334,7 +333,7 @@
<h2 class='oe_slogan'>Next Generation ERP Software</h2>
<h3 class='oe_slogan'>The advantages of ERPs, without the disadvantages</h3>
<div class='oe_span6'>
<img class="oe_picture oe_screenshot" src="/saas_master/static/site_new/img/homepage/screenshot02.png">
<img class="oe_picture oe_screenshot" src="https://www.openerp.com/saas_master/static/site_new/img/homepage/screenshot02.png">
</div>
<div class='oe_span6'>
<p class="oe_mt32">
@@ -361,7 +360,7 @@
</p>
</div>
<div class='oe_span6'>
<img class="oe_picture oe_screenshot" src="/saas_master/static/site_new/img/homepage/screenshot03.png">
<img class="oe_picture oe_screenshot" src="https://www.openerp.com/saas_master/static/site_new/img/homepage/screenshot03.png">
</div>
</div>
</section>
@@ -387,14 +386,14 @@
</p>
</div>
<div class="oe_span6">
<img class="oe_picture" src="/saas_master/static/site_new/img/apps/try_it_icon.png">
<img class="oe_picture" src="https://www.openerp.com/saas_master/static/site_new/img/apps/try_it_icon.png">
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row oe_centeralign oe_more_spaced">
<a id='app-bottom' href="/start" class="ab_footer_freetrial oe_button oe_big">Start your <span class="oe_emph">free</span> trial</a>
<a id='app-bottom' href="https://www.openerp.com/start" class="ab_footer_freetrial oe_button oe_big">Start your <span class="oe_emph">free</span> trial</a>
</div>
</section>
@@ -407,11 +406,11 @@
<section class="oe_span3">
<h1>About Us</h1>
<ul id='footer-about'>
<li><a href="/events">Events</a></li>
<li><a href="/news">News</a></li>
<li><a href="/jobs">Jobs</a></li>
<li><a href="/contact">Contact</a></li>
<li><a href="/references/directory/">References</a></li>
<li><a href="https://www.openerp.com/events">Events</a></li>
<li><a href="https://www.openerp.com/news">News</a></li>
<li><a href="https://www.openerp.com/jobs">Jobs</a></li>
<li><a href="https://www.openerp.com/contact">Contact</a></li>
<li><a href="https://www.openerp.com/references/directory/">References</a></li>
<li class="oe_mt16"><a href="http://twitter.com/openerp"><i class="icon-twitter-sign"></i>Twitter</a></li>
<li><a href="http://www.facebook.com/OpenERP"><i class="icon-facebook-sign"></i>Facebook</a></li>
<li><a href="https://plus.google.com/+openerp/posts"><i class="icon-google-plus-sign"></i>Google+</a></li>
@@ -420,7 +419,7 @@
<section class="oe_span3">
<h1>Developers</h1>
<ul id='footer-devs'>
<li><a href="/start?download">Download</a></li>
<li><a href="https://www.openerp.com/start?download">Download</a></li>
<li><a href="https://launchpad.net/openobject">Launchpad</a></li>
<li><a href="http://runbot.openerp.com">Automated Tests</a></li>
<li class="oe_mt16"><a href="https://bugs.launchpad.net/openobject-addons">Report a Bug</a></li>
@@ -430,10 +429,10 @@
<section class="oe_span3">
<h1>Services</h1>
<ul id='footer-services'>
<li><a href="/pricing">Pricing</a></li>
<li class="oe_mt16"><a href="/partners/directory">Find a Partner</a></li>
<li><a href="/partners">Become a Partner</a></li>
<li class="oe_mt16"><a href="/events#view=training">Training</a></li>
<li><a href="https://www.openerp.com/pricing">Pricing</a></li>
<li class="oe_mt16"><a href="https://www.openerp.com/partners/directory">Find a Partner</a></li>
<li><a href="https://www.openerp.com/partners">Become a Partner</a></li>
<li class="oe_mt16"><a href="https://www.openerp.com/events#view=training">Training</a></li>
</ul>
</section>
<section class="oe_span3">
@@ -442,7 +441,7 @@
<li><a href="http://help.openerp.com">Get Help</a></li>
<li><a href="https://doc.openerp.com/">Documentation</a></li>
<li class="oe_mt16"><a href="http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Dstripbooks&field-keywords=Openerp&rh=n%3A283155%2Ck%3AOpenerp">Paper Books</a></li>
<li><a href="/ebooks">Free E-Books</a></li>
<li><a href="https://www.openerp.com/ebooks">Free E-Books</a></li>
<li><a href="http://doc.openerp.com/memento/OpenERP_Technical_Memento_latest.pdf">Developer Memento</a></li>
<li><a href="http://www.slideshare.net/openobject/presentations">Presentations</a></li>
</ul>