瀏覽代碼

Moved all templates into app folders

master
David Winterbottom 14 年之前
父節點
當前提交
da8b0902a6
共有 29 個檔案被更改,包括 96 行新增20 行删除
  1. 1
    0
      examples/vanilla/settings.py
  2. 19
    0
      examples/vanilla/templates/base.html
  3. 56
    0
      examples/vanilla/templates/layout.html
  4. 0
    0
      oscar/apps/checkout/templates/checkout/checkout.html
  5. 0
    0
      oscar/apps/checkout/templates/checkout/gateway.html
  6. 1
    1
      oscar/apps/checkout/templates/checkout/preview.html
  7. 1
    1
      oscar/apps/checkout/templates/checkout/shipping_address.html
  8. 1
    1
      oscar/apps/checkout/templates/checkout/shipping_methods.html
  9. 0
    0
      oscar/apps/checkout/templates/checkout/thank_you.html
  10. 1
    1
      oscar/apps/checkout/templates/checkout/user_address_form.html
  11. 8
    8
      oscar/apps/checkout/views.py
  12. 0
    0
      oscar/apps/image/__init__.py
  13. 0
    0
      oscar/apps/order_management/templates/order_management/browse.html
  14. 0
    0
      oscar/apps/order_management/templates/order_management/order.html
  15. 2
    2
      oscar/apps/order_management/views.py
  16. 1
    1
      oscar/apps/promotions/abstract_models.py
  17. 0
    0
      oscar/apps/promotions/templates/promotions/block_countdown.html
  18. 0
    0
      oscar/apps/promotions/templates/promotions/block_default.html
  19. 0
    0
      oscar/apps/promotions/templates/promotions/block_singleproduct.html
  20. 0
    0
      oscar/apps/promotions/templates/promotions/block_tabbedblock.html
  21. 0
    0
      oscar/apps/promotions/templates/promotions/home.html
  22. 1
    1
      oscar/apps/promotions/templatetags/promotions.py
  23. 1
    1
      oscar/apps/promotions/views.py
  24. 0
    0
      oscar/apps/reports/templates/reports/dashboard.html
  25. 1
    1
      oscar/apps/reports/views.py
  26. 1
    1
      oscar/apps/search/abstract_indexes.py
  27. 0
    0
      oscar/apps/search/templates/search/indexes/product/item_text.txt
  28. 0
    0
      oscar/apps/search/templates/search/results.html
  29. 1
    1
      oscar/apps/search/views.py

+ 1
- 0
examples/vanilla/settings.py 查看文件

@@ -108,6 +108,7 @@ TEMPLATE_DIRS = (
108 108
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
109 109
     # Always use forward slashes, even on Windows.
110 110
     # Don't forget to use absolute paths, not relative paths.
111
+    location('templates')
111 112
 )
112 113
 
113 114
 # A sample logging configuration. The only tangible logging

+ 19
- 0
examples/vanilla/templates/base.html 查看文件

@@ -0,0 +1,19 @@
1
+<!DOCTYPE html> 
2
+<html lang="{% block language %}en-gb{% endblock %}">
3
+    <head>
4
+        <title>{% block title %}Oscar :: Flexible ecommerce for Django{% endblock %}</title>
5
+        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
6
+        <meta name="created" content='{% now "jS M Y h:i" %}' />
7
+        <meta name="description" content="{% block description %}{% endblock %}" />
8
+        <meta name="keywords" content="{% block keywords %}{% endblock %}" />
9
+        {% block extra_head %}{% endblock %}
10
+    </head>
11
+    <body id="{% block body_id %}default{% endblock %}" class="{% block body_class %}default{% endblock %}">
12
+        {% block layout %}{% endblock %}
13
+        {% block tracking %}
14
+            {% if not debug and not request.user.is_staff %}
15
+                <!-- Tracking to go here. -->
16
+            {% endif %}
17
+        {% endblock %}
18
+    </body>
19
+</html>

+ 56
- 0
examples/vanilla/templates/layout.html 查看文件

@@ -0,0 +1,56 @@
1
+{% extends "base.html" %}
2
+
3
+{% load currency_filters %}
4
+{% load promotions %}
5
+
6
+{% block layout %}
7
+    <div id="container">
8
+        <div id="header">
9
+            <p><a href="{% url home %}">Oscar // Flexible e-commerce for Django</a></p>
10
+            
11
+            <form method="get" action="{% url oscar-search %}">
12
+                {{ search_form.as_p }}
13
+                <input type="submit" value="Go!" /> 
14
+            </form>
15
+            
16
+            {% if user.is_authenticated %}
17
+                <a href="{% url customer:summary %}">Profile</a>
18
+                <a href="{% url customer:logout %}">Logout</a>
19
+            {% else %}
20
+                <a href="{% url customer:login %}">Login</a>
21
+            {% endif %}
22
+            
23
+            {% for banner in banners %}
24
+                {{ banner.get_banner_html|safe }}
25
+            {% endfor %}
26
+
27
+            Add a:
28
+            <a href="/admin/promotions/pagepromotion/add/?page_url={{ url_path }}" >promotion</a> /
29
+            <a href="/admin/promotions/pagemerchandisingblock/add/?page_url={{ url_path }}" >merchandising block</a>
30
+            to this page.
31
+            
32
+            Basket total: {{ basket.total_incl_tax|currency }}
33
+            <a href="{% url basket:summary %}">View basket</a>
34
+            
35
+            {% block header %}
36
+            {% endblock %}
37
+        </div>
38
+        <div id="content">
39
+        
40
+            {% if messages %}
41
+            <ul class="messages">
42
+                {% for message in messages %}
43
+                <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
44
+                {% endfor %}
45
+            </ul>
46
+            {% endif %}
47
+            
48
+            {% for linked_block in merchandising_blocks %}
49
+                {% render_merchandising_block linked_block %}
50
+            {% endfor %}
51
+            
52
+            {% block content %}{% endblock %}
53
+        </div>
54
+        <div id="footer">{% block footer %}{% endblock %}</div>
55
+    </div>
56
+{% endblock %}

oscar/templates/oscar/checkout/checkout.html → oscar/apps/checkout/templates/checkout/checkout.html 查看文件


oscar/templates/oscar/checkout/gateway.html → oscar/apps/checkout/templates/checkout/gateway.html 查看文件


oscar/templates/oscar/checkout/preview.html → oscar/apps/checkout/templates/checkout/preview.html 查看文件

@@ -1,4 +1,4 @@
1
-{% extends "oscar/checkout/checkout.html" %}
1
+{% extends "checkout/checkout.html" %}
2 2
 
3 3
 {% block place_order %}
4 4
 <hr/>

oscar/templates/oscar/checkout/shipping_address.html → oscar/apps/checkout/templates/checkout/shipping_address.html 查看文件

@@ -1,4 +1,4 @@
1
-{% extends "oscar/checkout/checkout.html" %}
1
+{% extends "checkout/checkout.html" %}
2 2
 
3 3
 {% block shipping_address %}
4 4
 

oscar/templates/oscar/checkout/shipping_methods.html → oscar/apps/checkout/templates/checkout/shipping_methods.html 查看文件

@@ -1,4 +1,4 @@
1
-{% extends "oscar/checkout/checkout.html" %}
1
+{% extends "checkout/checkout.html" %}
2 2
 
3 3
 {% load currency_filters %}
4 4
 

oscar/templates/oscar/checkout/thank_you.html → oscar/apps/checkout/templates/checkout/thank_you.html 查看文件


oscar/templates/oscar/checkout/user_address_form.html → oscar/apps/checkout/templates/checkout/user_address_form.html 查看文件

@@ -1,4 +1,4 @@
1
-{% extends "oscar/checkout/checkout.html" %}
1
+{% extends "checkout/checkout.html" %}
2 2
 
3 3
 
4 4
 {% block shipping_address %}

+ 8
- 8
oscar/apps/checkout/views.py 查看文件

@@ -42,7 +42,7 @@ class IndexView(AccountAuthView):
42 42
     straight onto the next step.  Otherwise, we provide options to login, register and
43 43
     (if the option is enabled) proceed anonymously.
44 44
     """
45
-    template_name = 'oscar/checkout/gateway.html'
45
+    template_name = 'checkout/gateway.html'
46 46
     
47 47
     def get_logged_in_redirect(self):
48 48
         return reverse('oscar-checkout-shipping-address')
@@ -136,7 +136,7 @@ class ShippingAddressView(CheckoutSessionMixin, FormView):
136 136
     saved in the session and saved as a model when the order is sucessfully submitted.
137 137
     """
138 138
     
139
-    template_name = 'oscar/checkout/shipping_address.html'
139
+    template_name = 'checkout/shipping_address.html'
140 140
     form_class = ShippingAddressForm
141 141
     
142 142
     def get_initial(self):
@@ -155,7 +155,7 @@ class ShippingAddressView(CheckoutSessionMixin, FormView):
155 155
             if 'action' in self.request.POST and self.request.POST['action'] == 'ship_to':
156 156
                 # User has selected a previous address to ship to
157 157
                 self.checkout_session.ship_to_user_address(address)
158
-                return HttpResponseRedirect(self.get_success_response())
158
+                return HttpResponseRedirect(self.get_success_url())
159 159
             elif 'action' in self.request.POST and self.request.POST['action'] == 'delete':
160 160
                 address.delete()
161 161
                 messages.info(self.request, "Address deleted from your address book")
@@ -180,7 +180,7 @@ class UserAddressCreateView(CreateView):
180 180
     This is not the same as creating a SHIPPING Address, although if used for the order,
181 181
     it will be converted into a shipping address at submission-time.
182 182
     """
183
-    template_name = 'oscar/checkout/user_address_form.html'
183
+    template_name = 'checkout/user_address_form.html'
184 184
     form_class = UserAddressForm
185 185
 
186 186
     def get_context_data(self, **kwargs):
@@ -204,7 +204,7 @@ class UserAddressUpdateView(UpdateView):
204 204
     """
205 205
     Update a user address
206 206
     """
207
-    template_name = 'oscar/checkout/user_address_form.html'
207
+    template_name = 'checkout/user_address_form.html'
208 208
     form_class = UserAddressForm
209 209
     
210 210
     def get_queryset(self):
@@ -243,7 +243,7 @@ class ShippingMethodView(CheckoutSessionMixin, TemplateView):
243 243
     Shipping methods are domain-specific and so need implementing in a 
244 244
     subclass of this class.
245 245
     """
246
-    template_name = 'oscar/checkout/shipping_methods.html';
246
+    template_name = 'checkout/shipping_methods.html';
247 247
     
248 248
     def get(self, request, *args, **kwargs):
249 249
         # Save shipping methods as instance var as we need them both here
@@ -297,7 +297,7 @@ class OrderPreviewView(CheckoutSessionMixin, TemplateView):
297 297
     """
298 298
     View a preview of the order before submitting.
299 299
     """
300
-    template_name = 'oscar/checkout/preview.html'
300
+    template_name = 'checkout/preview.html'
301 301
 
302 302
 
303 303
 class PaymentDetailsView(CheckoutSessionMixin, TemplateView):
@@ -548,7 +548,7 @@ class ThankYouView(DetailView):
548 548
     """
549 549
     Displays the 'thank you' page which summarises the order just submitted.
550 550
     """
551
-    template_name = 'oscar/checkout/thank_you.html'
551
+    template_name = 'checkout/thank_you.html'
552 552
     context_object_name = 'order'
553 553
     
554 554
     def get_object(self):

+ 0
- 0
oscar/apps/image/__init__.py 查看文件


oscar/templates/oscar/order_management/browse.html → oscar/apps/order_management/templates/order_management/browse.html 查看文件


oscar/templates/oscar/order_management/order.html → oscar/apps/order_management/templates/order_management/order.html 查看文件


+ 2
- 2
oscar/apps/order_management/views.py 查看文件

@@ -25,7 +25,7 @@ import_module('order_management.forms', ['SimpleSearch'], locals())
25 25
 class OrderListView(ListView):
26 26
     u"""A list of orders"""
27 27
     context_object_name = "orders"
28
-    template_name = 'oscar/order_management/browse.html'
28
+    template_name = 'order_management/browse.html'
29 29
     paginate_by = 20
30 30
 
31 31
     def get_queryset(self):
@@ -62,7 +62,7 @@ class OrderListView(ListView):
62 62
         
63 63
 class OrderView(DetailView, PostActionMixin):
64 64
     u"""A detail view of an order"""
65
-    template_name = "oscar/order_management/order.html"
65
+    template_name = "order_management/order.html"
66 66
     context_object_name = 'order'
67 67
     
68 68
     def get_object(self):

+ 1
- 1
oscar/apps/promotions/abstract_models.py 查看文件

@@ -183,7 +183,7 @@ class AbstractMerchandisingBlock(models.Model):
183 183
     
184 184
     @property
185 185
     def template_file(self):
186
-        return 'oscar/promotions/block_%s.html' % self.type.lower()
186
+        return 'promotions/block_%s.html' % self.type.lower()
187 187
     
188 188
     
189 189
 class MerchandisingBlockProduct(models.Model):

oscar/templates/oscar/promotions/block_countdown.html → oscar/apps/promotions/templates/promotions/block_countdown.html 查看文件


oscar/templates/oscar/promotions/block_default.html → oscar/apps/promotions/templates/promotions/block_default.html 查看文件


oscar/templates/oscar/promotions/block_singleproduct.html → oscar/apps/promotions/templates/promotions/block_singleproduct.html 查看文件


oscar/templates/oscar/promotions/block_tabbedblock.html → oscar/apps/promotions/templates/promotions/block_tabbedblock.html 查看文件


oscar/templates/oscar/home.html → oscar/apps/promotions/templates/promotions/home.html 查看文件


+ 1
- 1
oscar/apps/promotions/templatetags/promotions.py 查看文件

@@ -9,7 +9,7 @@ class MerchandisingBlockNode(Node):
9 9
     
10 10
     def render(self, context):
11 11
         linked_block = self.linked_block.resolve(context)
12
-        template = select_template([linked_block.block.template_file, 'oscar/promotions/block_default.html'])
12
+        template = select_template([linked_block.block.template_file, 'promotions/block_default.html'])
13 13
         args = dict(block=linked_block.block, **linked_block.block.template_context(request=context['request']))
14 14
         context = Context(args)
15 15
         return template.render(context)

+ 1
- 1
oscar/apps/promotions/views.py 查看文件

@@ -8,7 +8,7 @@ promotions_models = import_module('promotions.models', ['PagePromotion', 'Keywor
8 8
 
9 9
 
10 10
 class HomeView(TemplateView):
11
-    template_name = 'oscar/home.html'
11
+    template_name = 'promotions/home.html'
12 12
 
13 13
 
14 14
 def page_promotion_click(request, page_promotion_id):

oscar/templates/oscar/reports/dashboard.html → oscar/apps/reports/templates/reports/dashboard.html 查看文件


+ 1
- 1
oscar/apps/reports/views.py 查看文件

@@ -19,7 +19,7 @@ def dashboard(request):
19 19
             return response
20 20
     else:
21 21
         form = report_forms.ReportForm()
22
-    return TemplateResponse(request, 'oscar/reports/dashboard.html', {'form': form})
22
+    return TemplateResponse(request, 'reports/dashboard.html', {'form': form})
23 23
 
24 24
 
25 25
 def _get_generator(form):

+ 1
- 1
oscar/apps/search/abstract_indexes.py 查看文件

@@ -9,7 +9,7 @@ class AbstractProductIndex(SearchIndex):
9 9
     Base class for products solr index definition.  Overide by creating your
10 10
     own copy of oscar.search_indexes.py
11 11
     """
12
-    text = EdgeNgramField(document=True, use_template=True, template_name='oscar/search/indexes/product/item_text.txt')
12
+    text = EdgeNgramField(document=True, use_template=True, template_name='search/indexes/product/item_text.txt')
13 13
     title = EdgeNgramField(model_attr='title')
14 14
     upc = CharField(model_attr="upc")
15 15
     score = FloatField(model_attr="score")

oscar/templates/oscar/search/indexes/product/item_text.txt → oscar/apps/search/templates/search/indexes/product/item_text.txt 查看文件


oscar/templates/oscar/search/results.html → oscar/apps/search/templates/search/results.html 查看文件


+ 1
- 1
oscar/apps/search/views.py 查看文件

@@ -58,7 +58,7 @@ class MultiFacetedSearchView(FacetedSearchView):
58 58
     u"""
59 59
     Search view for multifaceted searches
60 60
     """
61
-    template = 'oscar/search/results.html'
61
+    template = 'search/results.html'
62 62
 
63 63
     def __call__(self, request, *args, **kwargs):
64 64
         """

Loading…
取消
儲存