twidi avatar twidi committed 382da4f Merge

merge from upstream

Comments (0)

Files changed (12)

Add a comment to this file

satchmo/apps/payment/locale/fr/LC_MESSAGES/django.mo

Binary file modified.

satchmo/apps/payment/locale/fr/LC_MESSAGES/django.po

 
 #: modules/paypal/views.py:142
 msgid "Paid through PayPal."
-msgstr "Payé via de Paypal."
+msgstr "Payé via Paypal."
 
 #: modules/paypal/views.py:152
 msgid "---Comment via Paypal IPN---"
 
 #: templates/payment/_order_payment_summary.html:15
 msgid "Pay remaining balance"
-msgstr "Solde restant dû"
+msgstr "Payer le solde restant dû"
 
 #: templates/payment/admin/charge_remaining_confirm.html:4
 msgid "Custom Charge"
 
 #: templates/shop/checkout/balance_remaining.html:12
 msgid "Order Balance"
-msgstr "Montant total"
+msgstr "Solde de commande"
 
 #: templates/shop/checkout/balance_remaining.html:17
 #, python-format
 #: templates/shop/checkout/sermepa/confirm.html:17
 #: templates/shop/checkout/sermepa/confirm.html:42
 msgid "Purchase Items"
-msgstr "Valider la commande"
+msgstr "Procéder au paiement"
 
 #: templates/shop/checkout/base_pay_ship.html:18
 #: templates/shop/checkout/form.html:28
 msgid "Please Select"
 msgstr "Merci de choisir"
 
+msgid "Remaining Balance for order #%(order_id)s"
+msgstr "Solde restant pour la commande N°%(order_id)s"
+
+msgid "Shipping for free items"
+msgstr "Frais de livraison pour produits gratuits"
+
 #~ msgid ""
 #~ "Select the payment modules you want to use with your shop.  \n"
 #~ "    If you are adding a new one, you should save and come back to this "

satchmo/apps/payment/templates/shop/checkout/paypal/confirm.html

 <input type="hidden" name="return" value="{{ return_address }}" />
 {% if subscription %}
 <input type="hidden" name="cmd" value="_xclick-subscriptions">
-<input type="hidden" name="item_name" value="{{ subscription.product.name }}">
+<input type="hidden" name="item_name" value="{{ subscription.product.name|force_escape }}">
 <input type="hidden" name="item_number" value="{{ invoice }}">
 <input type="hidden" name="invoice" value="{{ invoice }}" />
 <input type="hidden" name="no_shipping" value="1">
 <input type="hidden" name="no_shipping" value="1" />
 <input type="hidden" name="invoice" value="{{ invoice }}" />
 {% if order.partially_paid %}
-<input type="hidden" name="item_name_1" value="Remaining Balance for order {{ order.id }}" />
+<input type="hidden" name="item_name_1" value="{% blocktrans with order.id as order_id %}Remaining Balance for order {{ order_id }}{% endblocktrans %}" />
 <input type="hidden" name="amount_1" value="{{order.balance|truncate_decimal:2}}" />
 <input type="hidden" name="quantity_1" value="1" />
 {% else %}
 {% for item in order.orderitem_set.all %}{% spaceless %}
 {% if item.discount %}
   {% if item.line_total > item.discount %}
-    <input type="hidden" name="item_name_{{forloop.counter}}" value="{{item}}" />
+    <input type="hidden" name="item_name_{{forloop.counter}}" value="{{item.description|force_escape}}" />
     <input type="hidden" name="amount_{{forloop.counter}}" value="{{item.unit_price|truncate_decimal:2}}" />
     <input type="hidden" name="discount_amount_{{forloop.counter}}" value="{{item.discount|truncate_decimal:2}}" />
   {% else %}
     {# BUT, if this is the only thing in the cart, then we still need to put *something* #}
     {# in the cart, so lets do handling as a line item #}
     {% if order.discounted_sub_total <= 0 %}
-      <input type="hidden" name="item_name_{{forloop.counter}}" value="Shipping for free items" />
+      <input type="hidden" name="item_name_{{forloop.counter}}" value="{% trans "Shipping for free items" %}" />
       <input type="hidden" name="amount_{{forloop.counter}}" value="{{order.shipping_with_tax|truncate_decimal:2}}" />
     {% endif %}
   {% endif %}
 {% else %}
   {# no discount #}
-  <input type="hidden" name="item_name_{{forloop.counter}}" value="{{item}}" />
+  <input type="hidden" name="item_name_{{forloop.counter}}" value="{{item.description|force_escape}}" />
   <input type="hidden" name="amount_{{forloop.counter}}" value="{{item.unit_price|truncate_decimal:2}}" />
 {% endif %}
 {% endspaceless %}

satchmo/apps/payment/templates/shop/checkout/sermepa/confirm.html

 <input type="hidden" name="Ds_Merchant_ConsumerLanguage" value="2" />	{# English #}
 
 {% if order.partially_paid %}
-	<input type="hidden" name="Ds_Merchant_ProductDescription" value="Remaining Balance for order {{order.id}}" />
+	<input type="hidden" name="Ds_Merchant_ProductDescription" value="{% blocktrans with order.id as order_id %}Remaining Balance for order #{{ order_id }}{% blocktrans %}" />
 {% else %}
-	<input type="hidden" name="Ds_Merchant_ProductDescription" value="Order {{order.id}}" />
+	<input type="hidden" name="Ds_Merchant_ProductDescription" value="{% blocktrans with order.id as order_id %}Order #{{ order_id }}{% blocktrans %}" />
 {% endif %}
 
 <input type="hidden" name="Ds_Merchant_Amount" value="{{amount}}" />

satchmo/apps/payment/utils.py

 from decimal import Decimal
 from livesettings import config_get_group
-from satchmo_store.shop.models import Order, OrderItem, OrderItemDetail
+from satchmo_store.shop.models import Order, OrderItem, OrderItemDetail, OrderCart
 from satchmo_store.shop.signals import satchmo_post_copy_item_to_order
 from shipping.utils import update_shipping
 import logging
     """Update the order with all cart items, first removing all items if this
     is an update.
     """
-    if update:
-        new_order.remove_all_items()
-    else:
-        # have to save first, or else we can't add orderitems
-        new_order.site = cart.site
-        new_order.save()
+    if not isinstance(cart, OrderCart):
+        if update:
+            new_order.remove_all_items()
+        else:
+            # have to save first, or else we can't add orderitems
+            new_order.site = cart.site
+            new_order.save()
 
-    # Add all the items in the cart to the order
-    for item in cart.cartitem_set.all():
-        new_order_item = OrderItem(order=new_order,
-            product=item.product,
-            quantity=item.quantity,
-            unit_price=item.unit_price,
-            line_item_price=item.line_total)
+        # Add all the items in the cart to the order
+        for item in cart.cartitem_set.all():
+            new_order_item = OrderItem(order=new_order,
+                product=item.product,
+                quantity=item.quantity,
+                unit_price=item.unit_price,
+                line_item_price=item.line_total)
 
-        update_orderitem_for_subscription(new_order_item, item)
-        update_orderitem_details(new_order_item, item)
+            update_orderitem_for_subscription(new_order_item, item)
+            update_orderitem_details(new_order_item, item)
 
-        # Send a signal after copying items
-        # External applications can copy their related objects using this
-        satchmo_post_copy_item_to_order.send(
-                cart,
-                cartitem=item,
-                order=new_order, orderitem=new_order_item
-                )
+            # Send a signal after copying items
+            # External applications can copy their related objects using this
+            satchmo_post_copy_item_to_order.send(
+                    cart,
+                    cartitem=item,
+                    order=new_order, orderitem=new_order_item
+                    )
 
     new_order.recalculate_total()
Add a comment to this file

satchmo/apps/satchmo_store/accounts/locale/fr/LC_MESSAGES/django.mo

Binary file modified.

satchmo/apps/satchmo_store/accounts/locale/fr/LC_MESSAGES/django.po

 
 #: forms.py:69
 msgid "The two passwords do not match."
-msgstr "Les 2 mots de passe diffèrent"
+msgstr "Les 2 mots de passe diffèrent."
 
 #: forms.py:80
 msgid "That email address is already in use."
-msgstr "Cette adresse email est déjà utilisée"
+msgstr "Cette adresse email est déjà utilisée."
 
 #: mail.py:24
 #, python-format
Add a comment to this file

satchmo/apps/satchmo_store/shop/locale/fr/LC_MESSAGES/django.mo

Binary file modified.

satchmo/apps/satchmo_store/shop/locale/fr/LC_MESSAGES/django.po

 
 #: templates/shop/admin/_customorder_management.html:10
 msgid "Charge remaining amount"
-msgstr "Solde restant dû"
+msgstr "Facturer le solde restant dû"
 
 #: templates/shop/admin/_customorder_management.html:13
 msgid "Product Details"

satchmo/apps/satchmo_store/shop/models.py

     def __len__(self):
         return 0
 
+    def save(self):
+        pass
+
 class OrderCart(NullCart):
     """Allows us to fake a cart if we are reloading an order."""
 
     def __len__(self):
         return self.numItems
 
+    def __iter__(self):
+        return iter(self.cartitem_set.all())
+
 class CartManager(models.Manager):
 
     def from_request(self, request, create=False, return_nullcart=True):
         """Given the addressee name, try to return a first name"""
         return ' '.join(self.ship_addressee.split()[0:-1]) or ''
     ship_first_name = property(_ship_first_name)
-        
+
     def _ship_last_name(self):
         """Given the addressee name, try to return a last name"""
         return ' '.join(self.ship_addressee.split()[-1:]) or ''

satchmo/apps/satchmo_store/shop/templates/shop/order_history.html

 {% extends "shop/base.html" %}
 {% load i18n %}
 {% load satchmo_currency %}
+{% load satchmo_checkout %}
 {% load satchmo_order normalize_decimal %}
 
 {% block navbar %}
                     <a href="{% url satchmo_order_tracking order.id %}">{{ order.id }}</a>
                 </td>
                 <td class="orderstatus">
-                    {{ order.status }}
+                    {{ order.status|status_label }}
                 </td>
                 <td class="orderdate">
                     {{ order.time_stamp|date:"F jS Y H:i" }}
                 <td class="orderitems">
                     {% for item in order.orderitem_set.all %}
                     {% if not forloop.first %}<br/>{% endif %}
-                    <span class="orderitemqty">{{ item.quantity|normalize_decimal }}</span> <span class="orderitem">{{ item }}<span> 
+                    <span class="orderitemqty">{{ item.quantity|normalize_decimal }}</span> <span class="orderitem">{{ item }}</span>
                     {% endfor %}
                 </td>
                 <td class="ordertototal">

satchmo/apps/satchmo_store/shop/templatetags/satchmo_google.py

-from django.template import Library
+from django.template import Library, RequestContext
 from django.conf import settings
 from satchmo_store.contact.models import Contact
 from livesettings import config_value
 
 register = Library()
 
-def show_tracker(secure=False):
+def show_tracker(context, secure=False):
     """
     Output the google tracker code.
     """
-    return({"GOOGLE_CODE": config_value('GOOGLE', 'ANALYTICS_CODE'),
-            "secure" : secure})
+    return RequestContext(context['request'],
+        {"GOOGLE_CODE": config_value('GOOGLE', 'ANALYTICS_CODE'), "secure" : secure})
 
-register.inclusion_tag("shop/google-analytics/tracker.html")(show_tracker)
+register.inclusion_tag("shop/google-analytics/tracker.html", takes_context=True)(show_tracker)
 
 def show_receipt(context):
     """
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.