conditional texts

This commit is contained in:
Arvind Tiwari 2017-09-21 19:32:22 +05:30
parent a16dbb50d8
commit 1c0f0da96e
4 changed files with 67 additions and 32 deletions

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-14 12:27+0000\n"
"POT-Creation-Date: 2017-09-21 19:20+0530\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -321,10 +321,14 @@ msgstr "Als gelesen markieren"
msgid "All notifications"
msgstr "Alle Benachrichtigungen"
msgid "Date"
msgstr "Datum"
#, python-format
msgid "%(page_header_text)s"
msgstr ""
msgid "Status:"
msgid "Invoice Date"
msgstr "Rechnung Datum"
msgid "Status"
msgstr ""
msgid "Approved"
@ -333,10 +337,10 @@ msgstr "Akzeptiert"
msgid "Declined"
msgstr "Abgelehnt"
msgid "Billed To:"
msgid "Billed to"
msgstr "Rechnungsadresse"
msgid "Payment Method:"
msgid "Payment method"
msgstr "Bezahlmethode"
msgid "ending in"
@ -345,6 +349,9 @@ msgstr "endend in"
msgid "Order summary"
msgstr "Bestellungsübersicht"
msgid "Product"
msgstr ""
msgid "Cores"
msgstr "Prozessorkerne"
@ -357,20 +364,40 @@ msgstr "Festplattenkapazität"
msgid "Total"
msgstr "Gesamt"
msgid "Finish Configuration"
msgstr "Konfiguration beenden"
#, python-format
msgid ""
"By clicking \"Place order\" this plan will charge your credit card account "
"with the fee of %(vm_price)sCHF/month"
msgstr ""
"Wenn Du \"bestellen\" auswählst, wird Deine Kreditkarte mit %(vm_price)sCHF "
"pro Monat belastet"
msgid "Place order"
msgstr "Bestellen"
msgid "BACK TO LIST"
msgstr "ZURÜCK ZUR LISTE"
msgid "Processing..."
msgstr "Weiter..."
msgid "Hold tight, we are processing your request"
msgstr ""
msgid "Some problem encountered. Please try again later."
msgstr ""
msgid "Order Nr."
msgstr "Bestellung Nr."
msgid "Date"
msgstr "Datum"
msgid "Amount"
msgstr "Betrag"
msgid "Status"
msgstr ""
msgid "See Invoice"
msgstr "Rechnung"
msgstr "Siehe Rechnung"
msgid "Page"
msgstr ""
@ -555,9 +582,6 @@ msgstr "Wir sind hier, um Dir zu helfen!"
msgid "CONTACT"
msgstr "KONTACT"
msgid "BACK TO LIST"
msgstr "ZURÜCK ZUR LISTE"
msgid "Terminate your Virtual Machine"
msgstr "Deine Virtuelle Maschine beenden"
@ -618,13 +642,17 @@ msgstr ""
msgid "Invalid credit card"
msgstr "Ungültige Kreditkarte"
#, python-format
msgid "Your New VM %(vm_name)s at Data Center Light"
msgstr "Deine neue VM %(vm_name)s bei Data Center Light"
msgid "Confirm Order"
msgstr "Bestellung Bestätigen"
msgid "Thank you for the order."
msgstr "Danke für den Auftrag"
msgid ""
"Your VM will be up and running in a few moments. We will send you a "
"confirmation email as soon as it is ready."
msgstr ""
msgid "In order to create a VM, you need to create/upload your SSH KEY first."
msgstr ""
"Um eine VM zu erstellen musst du zuerst einen SSH-Key erstellen / hochladen."
@ -641,6 +669,12 @@ msgstr "VM Kündigung"
msgid "VM %(VM_ID)s terminated successfully"
msgstr "VM %(VM_ID)s erfolgreich beendet"
#~ msgid "Finish Configuration"
#~ msgstr "Konfiguration beenden"
#~ msgid "Your New VM %(vm_name)s at Data Center Light"
#~ msgstr "Deine neue VM %(vm_name)s bei Data Center Light"
#~ msgid "My Virtual Machines"
#~ msgstr "Meine virtuellen Maschinen"
@ -734,9 +768,6 @@ msgstr "VM %(VM_ID)s erfolgreich beendet"
#~ msgid "Payment Details"
#~ msgstr "Rechnungsdetails"
#~ msgid "Place Order"
#~ msgstr "Bestelle"
#~ msgid "CARD NUMBER"
#~ msgstr "Kreditkartennummer"

View file

@ -79,7 +79,7 @@
{{order.last4}}<br>
{{user.email}}
{% else %}
{{cc_brand}} {% trans "ending in" %} ****
{{cc_brand|default:'Card'}} {% trans "ending in" %} ****
{{cc_last4}}<br>
{% if request.user.is_authenticated %}
{{request.user.email}}
@ -105,7 +105,11 @@
{% endcomment %}
<p>
<span>{% trans "Cores" %}</span>
<span class="pull-right">{{vm.cores|floatformat}}</span>
{% if vm.cores %}
<span class="pull-right">{{vm.cores|floatformat}}</span>
{% else %}
<span class="pull-right">{{vm.cpu|floatformat}}</span>
{% endif %}
</p>
<p>
<span>{% trans "Memory" %}</span>

View file

@ -9,10 +9,9 @@ from .views import (
HostingPricingView, CreateVirtualMachinesView, HostingBillListView,
HostingBillDetailView, SSHKeyDeleteView, SSHKeyCreateView, SSHKeyListView,
SSHKeyChoiceView, DashboardView, SettingsView)
from django.views.generic import TemplateView
urlpatterns = [
url(r'test/?$', TemplateView.as_view(template_name='hosting/order_detail.html'), name='test'),
url(r'index/?$', IndexView.as_view(), name='index'),
url(r'django/?$', DjangoHostingView.as_view(), name='djangohosting'),
url(r'dashboard/?$', DashboardView.as_view(), name='dashboard'),

View file

@ -704,12 +704,13 @@ class OrdersHostingDetailView(LoginRequiredMixin,
return context
def get(self, request, *args, **kwargs):
if 'specs' not in self.request.session:
return HttpResponseRedirect(
reverse('hosting:create_virtual_machine')
)
if 'token' not in self.request.session:
return HttpResponseRedirect(reverse('hosting:payment'))
if not self.kwargs.get('pk'):
if 'specs' not in self.request.session:
return HttpResponseRedirect(
reverse('hosting:create_virtual_machine')
)
if 'token' not in self.request.session:
return HttpResponseRedirect(reverse('hosting:payment'))
self.object = self.get_object()
context = self.get_context_data(object=self.object)
if 'failed_payment' in context: