Merge branch 'develop' of github.com:ungleich/dynamicweb into develop

This commit is contained in:
Levi 2016-05-20 16:43:17 -04:30
commit 419f08aff8
4 changed files with 113 additions and 77 deletions

View File

@ -84,18 +84,18 @@ INSTALLED_APPS = (
'djangocms_file', 'djangocms_file',
'djangocms_picture', 'djangocms_picture',
'djangocms_video', 'djangocms_video',
'djangocms_flash', # 'djangocms_flash',
'djangocms_googlemap', # 'djangocms_googlemap',
'djangocms_inherit', # 'djangocms_inherit',
'djangocms_link', # 'djangocms_link',
'djangocms_teaser', # 'djangocms_teaser',
'djangocms_page_meta', 'djangocms_page_meta',
'djangocms_text_ckeditor', 'djangocms_text_ckeditor',
'djangocms_admin_style', 'djangocms_admin_style',
'cmsplugin_filer_file', 'cmsplugin_filer_file',
'cmsplugin_filer_folder', 'cmsplugin_filer_folder',
'cmsplugin_filer_link', 'cmsplugin_filer_link',
'cmsplugin_filer_teaser', # 'cmsplugin_filer_teaser',
'cmsplugin_filer_video', 'cmsplugin_filer_video',
# #
# blog # blog
@ -103,10 +103,9 @@ INSTALLED_APPS = (
'reversion', 'reversion',
# ungleich # ungleich
'ungleich', 'ungleich',
# 'ungleich_page', 'ungleich_page',
'hosting', 'hosting',
'digitalglarus', 'digitalglarus',
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (
@ -176,7 +175,7 @@ CMS_TEMPLATES = (
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', 'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'app_new', 'NAME': 'app',
} }
} }
@ -280,12 +279,12 @@ CACHES = {
} }
} }
#if LOGIN_URL is None: if LOGIN_URL is None:
# LOGIN_URL = APP_ROOT_ENDPOINT + 'login/' LOGIN_URL = APP_ROOT_ENDPOINT + 'login/'
#if LOGOUT_URL is None: if LOGOUT_URL is None:
# LOGOUT_URL = APP_ROOT_ENDPOINT + 'logout/' LOGOUT_URL = APP_ROOT_ENDPOINT + 'logout/'
#if LOGIN_REDIRECT_URL is None: if LOGIN_REDIRECT_URL is None:
# LOGIN_REDIRECT_URL = APP_ROOT_ENDPOINT LOGIN_REDIRECT_URL = APP_ROOT_ENDPOINT
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/ # https://docs.djangoproject.com/en/1.7/howto/static-files/
@ -302,7 +301,7 @@ META_SITE_PROTOCOL = 'http'
META_USE_SITES = True META_USE_SITES = True
MIGRATION_MODULES = { MIGRATION_MODULES = {
'cms': 'cms.migrations', 'cms': 'cms.migrations',
#'filer': 'filer.migrations_django', # 'filer': 'filer.migrations_django',
# 'menus': 'menus.migrations_django', # 'menus': 'menus.migrations_django',
'djangocms_flash': 'djangocms_flash.migrations_django', 'djangocms_flash': 'djangocms_flash.migrations_django',
'djangocms_googlemap': 'djangocms_googlemap.migrations_django', 'djangocms_googlemap': 'djangocms_googlemap.migrations_django',
@ -337,7 +336,6 @@ STATICFILES_FINDERS = (
THUMBNAIL_PROCESSORS = ( THUMBNAIL_PROCESSORS = (
'easy_thumbnails.processors.colorspace', 'easy_thumbnails.processors.colorspace',
'easy_thumbnails.processors.autocrop', 'easy_thumbnails.processors.autocrop',
#'easy_thumbnails.processors.scale_and_crop',
'filer.thumbnail_processors.scale_and_crop_with_subject_location', 'filer.thumbnail_processors.scale_and_crop_with_subject_location',
'easy_thumbnails.processors.filters', 'easy_thumbnails.processors.filters',
) )
@ -443,12 +441,6 @@ PARLER_LANGUAGES = {1: ({'code': 'en-us'}, {'code': 'de'},)}
AUTH_USER_MODEL = 'membership.CustomUser' AUTH_USER_MODEL = 'membership.CustomUser'
ALLOWED_HOSTS = [
"*"
]
# PAYMENT # PAYMENT
STRIPE_DESCRIPTION_ON_PAYMENT = "Payment for ungleich GmbH services" STRIPE_DESCRIPTION_ON_PAYMENT = "Payment for ungleich GmbH services"

View File

@ -1,64 +1,102 @@
{% extends "hosting/base_short.html" %} {% extends "hosting/base_short.html" %}
{% load staticfiles bootstrap3 %} {% load staticfiles bootstrap3 %}
{% block content %} {% block content %}
<div> <div>
<div class="container orders-container"> <div class="container orders-container">
<div class="row"> <div class="row">
<div class="col-md-8 col-md-offset-2"> <div class="col-md-8 col-md-offset-2">
<table class="table borderless table-hover"> <table class="table borderless table-hover">
<h3><i class="fa fa-credit-card"></i> My Orders</h3> <h3><i class="fa fa-credit-card"></i> My Orders</h3>
<br/> <br/>
<thead> <thead>
<tr> <tr>
<th>#</th> <th>#</th>
<th>Date</th> <th>Date</th>
<th>Amount</th> <th>Amount</th>
<th>Status</th> <th>Status</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for order in orders %} {% for order in orders %}
<tr> <tr>
<td scope="row">{{order.id}}</td> <td scope="row">{{ order.id }}</td>
<td>{{order.created_at}}</td> <td>{{ order.created_at }}</td>
<td>{{order.vm_plan.price}} CHF</td> <td>{{ order.vm_plan.price }} CHF</td>
<td>{% if order.approved %} <td>{% if order.approved %}
<span class="text-success strong">Approved</span> <span class="text-success strong">Approved</span>
{% else%} {% else %}
<span class="text-danger strong">Declined</span> <span class="text-danger strong">Declined</span>
{% endif%} {% endif %}
</td> </td>
<td> <td>
<button type="button" class="btn btn-default"><a href="{% url 'hosting:orders' order.id %}">View Detail</a></button> <button type="button" class="btn btn-default"><a
</td> href="{% url 'hosting:orders' order.id %}">View Detail</a>
</tr> </button>
{% endfor %} <button type="button" class="btn btn-default" data-toggle="modal"
</tbody> data-target="#Modal{{ order.id }}"><a
</table> href="#">Cancel order</a>
</button>
</td>
</tr>
<div class="modal fade" id="Modal{{ order.id }}" tabindex="-1" role="dialog"
aria-labelledby="exampleModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-label="Confirm"><span
aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<h4 class="modal-title" id="ModalLabel">Do You want do delete
Your
order?</h4>
{% if is_paginated %} <form method="post"
<div class="pagination"> action="{% url 'hosting:delete_order' order.id %}">
{% csrf_token %}
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">
Close
</button>
<button type="submit" class="btn btn-primary">Delete
</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% endfor %}
</tbody>
</table>
{% if is_paginated %}
<div class="pagination">
<span class="page-links"> <span class="page-links">
{% if page_obj.has_previous %} {% if page_obj.has_previous %}
<a href="{{request.path}}?page={{ page_obj.previous_page_number }}">previous</a> <a href="{{ request.path }}?page={{ page_obj.previous_page_number }}">previous</a>
{% endif %} {% endif %}
<span class="page-current"> <span class="page-current">
Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}. Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
</span> </span>
{% if page_obj.has_next %} {% if page_obj.has_next %}
<a href="{{request.path}}?page={{ page_obj.next_page_number }}">next</a> <a href="{{ request.path }}?page={{ page_obj.next_page_number }}">next</a>
{% endif %} {% endif %}
</span> </span>
</div> </div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{%endblock%} {% endblock %}

View File

@ -3,7 +3,7 @@ from django.conf.urls import url
from .views import DjangoHostingView, RailsHostingView, PaymentVMView, \ from .views import DjangoHostingView, RailsHostingView, PaymentVMView, \
NodeJSHostingView, LoginView, SignupView, IndexView, \ NodeJSHostingView, LoginView, SignupView, IndexView, \
OrdersHostingListView, OrdersHostingDetailView, VirtualMachinesPlanListView,\ OrdersHostingListView, OrdersHostingDetailView, VirtualMachinesPlanListView,\
VirtualMachineDetailView, GenerateVMSSHKeysView VirtualMachineDetailView, GenerateVMSSHKeysView, OrdersHostingDeleteView
urlpatterns = [ urlpatterns = [
# url(r'pricing/?$', VMPricingView.as_view(), name='pricing'), # url(r'pricing/?$', VMPricingView.as_view(), name='pricing'),
@ -14,6 +14,7 @@ urlpatterns = [
url(r'payment/?$', PaymentVMView.as_view(), name='payment'), url(r'payment/?$', PaymentVMView.as_view(), name='payment'),
url(r'orders/?$', OrdersHostingListView.as_view(), name='orders'), url(r'orders/?$', OrdersHostingListView.as_view(), name='orders'),
url(r'orders/(?P<pk>\d+)/?$', OrdersHostingDetailView.as_view(), name='orders'), url(r'orders/(?P<pk>\d+)/?$', OrdersHostingDetailView.as_view(), name='orders'),
url(r'cancel_order/(?P<pk>\d+)/?$', OrdersHostingDeleteView.as_view(), name='delete_order'),
url(r'my-virtual-machines/?$', VirtualMachinesPlanListView.as_view(), name='virtual_machines'), url(r'my-virtual-machines/?$', VirtualMachinesPlanListView.as_view(), name='virtual_machines'),
url(r'my-virtual-machines/(?P<pk>\d+)/?$', VirtualMachineDetailView.as_view(), url(r'my-virtual-machines/(?P<pk>\d+)/?$', VirtualMachineDetailView.as_view(),
name='virtual_machines'), name='virtual_machines'),

View File

@ -3,7 +3,7 @@ from django.shortcuts import get_object_or_404, render
from django.core.urlresolvers import reverse_lazy, reverse from django.core.urlresolvers import reverse_lazy, reverse
from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import View, CreateView, FormView, ListView, DetailView, UpdateView from django.views.generic import View, CreateView, FormView, ListView, DetailView, UpdateView, DeleteView
from django.http import HttpResponseRedirect, HttpResponse from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import authenticate, login from django.contrib.auth import authenticate, login
from django.conf import settings from django.conf import settings
@ -126,7 +126,7 @@ class LoginView(FormView):
class SignupView(CreateView): class SignupView(CreateView):
template_name = 'hosting/signup.html' template_name = 'hosting/signup.html'
form_class = HostingUserSignupForm form_class = HostingUserSignupForm
moodel = CustomUser model = CustomUser
def get_success_url(self): def get_success_url(self):
next_url = self.request.session.get('next', reverse_lazy('hosting:signup')) next_url = self.request.session.get('next', reverse_lazy('hosting:signup'))
@ -169,6 +169,7 @@ class GenerateVMSSHKeysView(LoginRequiredMixin, UpdateView):
# return response # return response
# return HttpResponseRedirect(reverse('')) # return HttpResponseRedirect(reverse(''))
class PaymentVMView(LoginRequiredMixin, FormView): class PaymentVMView(LoginRequiredMixin, FormView):
template_name = 'hosting/payment.html' template_name = 'hosting/payment.html'
login_url = reverse_lazy('hosting:login') login_url = reverse_lazy('hosting:login')
@ -264,6 +265,10 @@ class OrdersHostingListView(LoginRequiredMixin, ListView):
self.queryset = HostingOrder.objects.filter(customer__user=user) self.queryset = HostingOrder.objects.filter(customer__user=user)
return super(OrdersHostingListView, self).get_queryset() return super(OrdersHostingListView, self).get_queryset()
class OrdersHostingDeleteView(LoginRequiredMixin,DeleteView):
login_url=reverse_lazy('hosting:login')
success_url = reverse_lazy('hosting:orders')
model = HostingOrder
class VirtualMachinesPlanListView(LoginRequiredMixin, ListView): class VirtualMachinesPlanListView(LoginRequiredMixin, ListView):
template_name = "hosting/virtual_machines.html" template_name = "hosting/virtual_machines.html"