[MERGE] upstream
bzr revid: fme@openerp.com-20131030144813-xmjb6i9ayv23aqyi
This commit is contained in:
commit
90814d781a
|
@ -271,10 +271,21 @@ class Website(openerp.addons.web.controllers.main.Home):
|
|||
def robots(self):
|
||||
return request.website.render('website.robots', {'url_root': request.httprequest.url_root})
|
||||
|
||||
@website.route(['/sitemap.xml'], type='http', auth="public")
|
||||
@website.route('/sitemap', type='http', auth='public')
|
||||
def sitemap(self):
|
||||
return request.website.render('website.sitemap', {'pages': request.website.list_pages()})
|
||||
|
||||
@website.route('/sitemap.xml', type='http', auth="public")
|
||||
def sitemap_xml(self):
|
||||
body = request.website.render('website.sitemap_xml', {
|
||||
'pages': request.website.list_pages()
|
||||
})
|
||||
|
||||
return request.make_response(body, [
|
||||
('Content-Type', 'application/xml;charset=utf-8')
|
||||
])
|
||||
|
||||
|
||||
class Images(http.Controller):
|
||||
def placeholder(self, response):
|
||||
# file_open may return a StringIO. StringIO can be closed but are
|
||||
|
|
|
@ -9,5 +9,8 @@
|
|||
<field name="social_linkedin">http://www.linkedin.com/company/openerp</field>
|
||||
</record>
|
||||
|
||||
<record id="base.main_company" model="res.company">
|
||||
<field name="rml_header1">Great Product for Great People</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -56,7 +56,7 @@ def url_for(path, lang=None, keep_query=None):
|
|||
if request:
|
||||
path = urljoin(request.httprequest.path, path)
|
||||
langs = request.context.get('langs')
|
||||
if path[0] == '/' and len(langs) > 1:
|
||||
if path[0] == '/' and (len(langs) > 1 or lang):
|
||||
ps = path.split('/')
|
||||
lang = lang or request.context.get('lang')
|
||||
if ps[1] in langs:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
|
||||
*
|
||||
* css for editor buttons, openerp widget included in the website and other
|
||||
* stuff must go to the editor.css
|
||||
* stuff must go to the editor.css
|
||||
*
|
||||
*/
|
||||
/* ----- GENERIC LAYOUTING HELPERS ---- */
|
||||
|
@ -440,3 +440,7 @@ a[data-publish][data-publish='on']:hover .css_published {
|
|||
::selection {
|
||||
background: rgba(150, 150, 220, 0.3);
|
||||
}
|
||||
|
||||
.logo-img {
|
||||
width: 220px;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
@charset "utf-8"
|
||||
|
||||
/*
|
||||
/*
|
||||
* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
|
||||
*
|
||||
* css for editor buttons, openerp widget included in the website and other
|
||||
* stuff must go to the editor.css
|
||||
* stuff must go to the editor.css
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -133,7 +133,7 @@ html,body, #wrapwrap
|
|||
|
||||
header, #wrap, footer
|
||||
display: table-row
|
||||
|
||||
|
||||
footer
|
||||
height: 100%
|
||||
background: rgb(239, 248, 248)
|
||||
|
@ -183,7 +183,7 @@ footer
|
|||
// .navbar .nav > li a
|
||||
// text-shadow: none
|
||||
|
||||
// .nav > li a
|
||||
// .nav > li a
|
||||
// display: block
|
||||
|
||||
.carousel-inner .item
|
||||
|
@ -284,7 +284,6 @@ footer
|
|||
height: 300px
|
||||
&.oe_big
|
||||
height: 450px
|
||||
|
||||
/* -- Hack for removing double scrollbar from mobile preview -- */
|
||||
div#mobile-preview.modal
|
||||
overflow: hidden
|
||||
|
@ -335,3 +334,6 @@ a[data-publish]
|
|||
|
||||
::selection
|
||||
background: rgba(150, 150, 220, 0.3)
|
||||
|
||||
.logo-img
|
||||
width: 220px
|
||||
|
|
|
@ -1037,6 +1037,11 @@
|
|||
this.$target.attr("id", "myCarousel" + id);
|
||||
this.$target.find(".carousel-control").attr("href", "#myCarousel" + id);
|
||||
this.$target.find("[data-target='#myCarousel']").attr("data-target", "#myCarousel" + id);
|
||||
|
||||
this.$target.attr('contentEditable', 'false')
|
||||
.find('.content, .carousel-image img')
|
||||
.attr('contentEditable', 'true');
|
||||
|
||||
this.rebind_event();
|
||||
},
|
||||
onFocus: function () {
|
||||
|
@ -1053,6 +1058,9 @@
|
|||
if(!this.$target.find(".item.active").length) {
|
||||
this.$target.find(".item:first").addClass("active");
|
||||
}
|
||||
this.$target.removeAttr('contentEditable')
|
||||
.find('.content, .carousel-image img')
|
||||
.removeAttr('contentEditable');
|
||||
},
|
||||
start : function () {
|
||||
this._super();
|
||||
|
@ -1223,7 +1231,6 @@
|
|||
size = 'oe_small';
|
||||
else if ($el.hasClass('oe_medium'))
|
||||
size = 'oe_medium';
|
||||
|
||||
var $ul = this.$editor.find('ul[name="parallax-size"]');
|
||||
var $li = $ul.find("li");
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_banner.png"/>
|
||||
<span class="oe_snippet_thumbnail_title">Banner</span>
|
||||
</div>
|
||||
<div id="myCarousel" class="oe_snippet_body carousel slide oe_medium mb32" contenteditable="false">
|
||||
<div id="myCarousel" class="oe_snippet_body carousel slide oe_medium mb32">
|
||||
<!-- Indicators -->
|
||||
<ol class="carousel-indicators hidden">
|
||||
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
|
||||
|
@ -70,7 +70,7 @@
|
|||
<div class="carousel-inner">
|
||||
<div class="item image_text active" style="background-image: url('/website/static/src/img/banner/color_splash.jpg')">
|
||||
<div class="container">
|
||||
<div class="carousel-caption content" contenteditable="true">
|
||||
<div class="carousel-caption content">
|
||||
<h2>Your Banner Title</h2>
|
||||
<h3>Click to customize this text</h3>
|
||||
<p>
|
||||
|
@ -78,7 +78,7 @@
|
|||
</p>
|
||||
</div>
|
||||
<div class="carousel-image hidden-xs">
|
||||
<img src="/website/static/src/img/banner/banner_picture.png" contenteditable="true" alt="Banner OpenERP Image"/>
|
||||
<img src="/website/static/src/img/banner/banner_picture.png" alt="Banner OpenERP Image"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -692,6 +692,7 @@
|
|||
<li data-value="/website/static/src/img/banner/landscape.jpg"><a>Landscape</a></li>
|
||||
<li data-value="/website/static/src/img/parallax/parallax_photo1.jpg"><a>Photo Woman</a></li>
|
||||
<li data-value="/website/static/src/img/banner/mountains.jpg"><a>Mountains</a></li>
|
||||
<li data-value="/website/static/src/img/parallax/parallax_bg.jpg"><a>Office</a></li>
|
||||
<li class="oe_custom_bg"><a><b>Chose your picture</b></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -428,10 +428,22 @@ User-agent: *
|
|||
Sitemap: <t t-esc="url_root"/>sitemap.xml
|
||||
</template>
|
||||
|
||||
<template id="sitemap">
|
||||
<template id="sitemap" name="Site Map" page="True">
|
||||
<t t-call="website.layout">
|
||||
<ul>
|
||||
<li t-foreach="pages" t-as="page">
|
||||
<a t-att-href="page['url']"><t t-esc="page['name']"/></a>
|
||||
</li>
|
||||
</ul>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="sitemap_xml">
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<t t-foreach="pages" t-as="page">
|
||||
<url t-esc="page['url']"/>
|
||||
<url>
|
||||
<loc><t t-esc="page['url']"/></loc>
|
||||
</url>
|
||||
</t>
|
||||
</urlset>
|
||||
</template>
|
||||
|
@ -487,31 +499,42 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
|
|||
|
||||
<template id="aboutus" name="About us" page="True">
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap">
|
||||
<div class="oe_structure"/>
|
||||
<div class="container mb32">
|
||||
<div class="row col-wrap" id="aboutus">
|
||||
<div class="col-sm-12 text-center">
|
||||
<h1>About us</h1>
|
||||
<h3 class="text-muted">A passion for great products</h3>
|
||||
</div>
|
||||
<div class="col-sm-8 mt16">
|
||||
<p>
|
||||
We are a team of passionated people whose goal is to improve everyone's
|
||||
life through disruptive products. We build great products to solve your
|
||||
business problems.
|
||||
</p>
|
||||
<p>
|
||||
Our products are designed for small to medium companies willing to optimize
|
||||
their performance.
|
||||
</p>
|
||||
</div><div class="col-sm-3 col-sm-offset-1">
|
||||
<img src="/website/static/src/img/library/business_conference.jpg" class="img img-responsive shadow" alt="Out Team"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
</div>
|
||||
<div id="wrap">
|
||||
<div data-snippet-id="parallax">
|
||||
<div style="background-image: url('/website/static/src/img/parallax/parallax_bg.jpg')" data-stellar-background-ratio="0.3" class="parallax oe_structure mt32 mb32 oe_small">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 mt32 mb32" data-snippet-id="colmd">
|
||||
<div class="text-center">
|
||||
<img src="/web/static/src/img/logo.png" class="img shadow logo-img"/>
|
||||
</div>
|
||||
<h3 class="text-center text-muted" t-field="res_company.rml_header1"></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
<div class="container mb32">
|
||||
<div class="row col-wrap" id="aboutus">
|
||||
<div class="col-sm-8 mt16">
|
||||
<p>
|
||||
We are a team of passionated people whose goal is to improve everyone's
|
||||
life through disruptive products. We build great products to solve your
|
||||
business problems.
|
||||
</p>
|
||||
<p>
|
||||
Our products are designed for small to medium companies willing to optimize
|
||||
their performance.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-3 col-sm-offset-1">
|
||||
<img src="/website/static/src/img/library/business_conference.jpg" class="img img-responsive shadow" alt="Out Team"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@import url(compass/css3.css);
|
||||
@charset "UTF-8";
|
||||
.css_website_mail .has-error {
|
||||
border-color: red;
|
||||
}
|
||||
|
@ -22,11 +22,14 @@ p.post-meta {
|
|||
}
|
||||
|
||||
.js_website_blog div#right_column section {
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
|
||||
opacity: 0.6;
|
||||
}
|
||||
.js_website_blog div#right_column section:hover {
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
-moz-transition: all 0.2s ease-out;
|
||||
-webkit-transition: all 0.2s ease-out;
|
||||
-moz-transition: all 0.2s ease-out;
|
||||
-o-transition: all 0.2s ease-out;
|
||||
transition: all 0.2s ease-out;
|
||||
}
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
@charset "utf-8"
|
||||
|
||||
@import "compass/css3"
|
||||
|
||||
.css_website_mail
|
||||
.has-error
|
||||
border-color: red
|
||||
.css_nav_month
|
||||
display: none
|
||||
&:first-of-type
|
||||
display: block
|
||||
.has-error
|
||||
border-color: red
|
||||
.css_nav_month
|
||||
display: none
|
||||
&:first-of-type
|
||||
display: block
|
||||
|
||||
.blog_content
|
||||
a.oe_mail_expand:after
|
||||
content: " →"
|
||||
a.oe_mail_expand
|
||||
font-weight: bold
|
||||
a.oe_mail_expand:after
|
||||
content: " →"
|
||||
a.oe_mail_expand
|
||||
font-weight: bold
|
||||
|
||||
p.post-meta
|
||||
position: relative
|
||||
top: -5px
|
||||
position: relative
|
||||
top: -5px
|
||||
|
||||
.js_website_blog
|
||||
div#right_column
|
||||
section
|
||||
opacity: 0.6
|
||||
section:hover
|
||||
opacity: 1
|
||||
-moz-transition: all 0.2s ease-out
|
||||
-webkit-transition: all 0.2s ease-out
|
||||
transition: all 0.2s ease-out
|
||||
|
||||
div#right_column
|
||||
section
|
||||
+opacity(0.6)
|
||||
section:hover
|
||||
+opacity(1)
|
||||
@include transition(all 0.2s ease-out)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_event_event_public,event.event.public,event.model_event_event,base.group_public,1,0,0,0
|
||||
access_event_type_public,event.type.public,event.model_event_type,base.group_public,1,0,0,0
|
||||
access_event_event_ticket_public,event.event.ticket.public,event_sale.model_event_event_ticket,base.group_public,1,0,0,0
|
||||
access_event_product_product_public,event.product.product.public,product.model_product_product,base.group_public,1,0,0,0
|
||||
access_event_product_product_public,event.product.product.public,product.model_product_product,base.group_public,1,0,0,0
|
||||
|
|
|
|
@ -103,7 +103,7 @@
|
|||
<!-- Option: index: Left Google Map -->
|
||||
<template id="opt_index_google_map" name="Left World Map"
|
||||
inherit_option_id="website_membership.index" inherit_id="website_membership.index">
|
||||
<xpath expr="//div[@id='left_column']/ul[last()]" position="after">
|
||||
<xpath expr="//div[@id='left_column']/ul[1]" position="before">
|
||||
<ul class="nav nav-pills nav-stacked mt16">
|
||||
<li class="nav-header"><h3>World Map</h3></li>
|
||||
<ul class="nav">
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import random
|
||||
import uuid
|
||||
import urllib
|
||||
import simplejson
|
||||
|
||||
import werkzeug.exceptions
|
||||
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.osv import osv
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.addons.website.models import website
|
||||
import random
|
||||
import uuid
|
||||
import urllib
|
||||
import simplejson
|
||||
|
||||
def get_order(order_id=None):
|
||||
order_obj = request.registry.get('sale.order')
|
||||
|
@ -358,9 +360,16 @@ class Ecommerce(http.Controller):
|
|||
|
||||
@website.route(['/shop/add_product/', '/shop/category/<int:cat_id>/add_product/'], type='http', auth="public", multilang=True)
|
||||
def add_product(self, cat_id=0, **post):
|
||||
product_id = request.registry.get('product.product').create(request.cr, request.uid,
|
||||
{'name': 'New Product', 'public_categ_id': cat_id}, request.context)
|
||||
return request.redirect("/shop/product/%s/?enable_editor=1" % product_id)
|
||||
if request.httprequest.method != 'POST':
|
||||
return werkzeug.exceptions.MethodNotAllowed(valid_methods=['POST'])
|
||||
|
||||
Product = request.registry.get('product.product')
|
||||
product_id = Product.create(request.cr, request.uid, {
|
||||
'name': 'New Product', 'public_categ_id': cat_id
|
||||
}, context=request.context)
|
||||
product = Product.browse(request.cr, request.uid, product_id, context=request.context)
|
||||
|
||||
return request.redirect("/shop/product/%s/?enable_editor=1" % product.product_tmpl_id.id)
|
||||
|
||||
def get_pricelist(self):
|
||||
if not request.httprequest.session.get('ecommerce_pricelist'):
|
||||
|
|
|
@ -77,7 +77,10 @@
|
|||
<div class="container oe_website_sale">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 pagination" style="padding-left: 15px;">
|
||||
<a t-if="editable" t-href="/shop/add_product/" class="btn btn-primary btn-default" t-keep-query="category,search,facettes">New Product</a>
|
||||
<form t-if="editable" t-keep-query="category,search,facettes"
|
||||
method="POST" t-action="/shop/add_product">
|
||||
<button class="btn btn-primary">New Product</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<t t-call="website.pager">
|
||||
|
@ -249,7 +252,7 @@
|
|||
<form t-action="/shop/" method="get" class="pull-right" t-keep-query="category,facettes">
|
||||
<div class="input-group">
|
||||
<t t-if="search">
|
||||
<t foreach="search.items()" t-as="key">
|
||||
<t t-foreach="search.items()" t-as="key">
|
||||
<input t-att-name="key[0]" t-att-value="key[1]"/>
|
||||
</t>
|
||||
</t>
|
||||
|
|
Loading…
Reference in New Issue