]> gitweb.fperrin.net Git - djsite.git/commitdiff
Rename code from 'quotations' to 'quotes'
authorFrédéric Perrin <fred@fperrin.net>
Wed, 28 Sep 2016 20:49:00 +0000 (21:49 +0100)
committerFrédéric Perrin <fred@fperrin.net>
Wed, 28 Sep 2016 20:56:33 +0000 (21:56 +0100)
djsite/urls.py
quotes/static/quotes/style.css [moved from quotes/static/quotations/style.css with 100% similarity]
quotes/templates/quotations/many.html [deleted file]
quotes/templates/quotations/onequote.html [deleted file]
quotes/templates/quotes/author.html [moved from quotes/templates/quotations/author.html with 62% similarity]
quotes/templates/quotes/base.html [moved from quotes/templates/quotations/base.html with 88% similarity]
quotes/templates/quotes/display.html [moved from quotes/templates/quotations/display.html with 65% similarity]
quotes/templates/quotes/many.html [new file with mode: 0644]
quotes/templates/quotes/onequote.html [new file with mode: 0644]
quotes/templates/quotes/tag.html [moved from quotes/templates/quotations/tag.html with 62% similarity]
quotes/views.py

index b325b2a96bfddb267e22da2a8a58c16894cf6b63..761ea477a5e7367c142bc7b69a96ff0801302b31 100644 (file)
@@ -18,5 +18,5 @@ from django.contrib import admin
 
 urlpatterns = [
     url(r'^admin/', include(admin.site.urls)),
-    url(r'^quotes/', include('quotes.urls')),
+    url(r'^quotes/', include('quotes.urls', namespace='quotes')),
 ]
diff --git a/quotes/templates/quotations/many.html b/quotes/templates/quotations/many.html
deleted file mode 100644 (file)
index 63d4f03..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends 'quotations/base.html' %}
-
-{% block body %}
-
-{% for quote in quotes %}
-  {% include "quotations/display.html" with quote=quote %}
-{% endfor %}
-
-{% endblock %}
diff --git a/quotes/templates/quotations/onequote.html b/quotes/templates/quotations/onequote.html
deleted file mode 100644 (file)
index 0102dcc..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{% extends 'quotations/base.html' %}
-
-{% block body %}
-
-{% include "quotations/display.html" with quote=quote %}
-
-{% endblock %}
similarity index 62%
rename from quotes/templates/quotations/author.html
rename to quotes/templates/quotes/author.html
index 38b36c70af3c5449df5c8d67a5ae85de56292c16..1fa09c8731519c99ac39f18a9322940354f7de85 100644 (file)
@@ -1,4 +1,4 @@
-{% extends 'quotations/base.html' %}
+{% extends 'quotes/base.html' %}
 
 {% block body %}
 
@@ -8,7 +8,7 @@
 <p>All the quotes for {{ author.name }}:<p>
 
 {% for quote in author.quote_set.all %}
-  {% include "quotations/display.html" with quote=quote %}
+  {% include "quotes/display.html" with quote=quote %}
 {% endfor %}
 
 
similarity index 88%
rename from quotes/templates/quotations/base.html
rename to quotes/templates/quotes/base.html
index b11766b8ef0a70281a04309cec1cbb258532aca8..fe72a4385b252e9de0698f123c6c0ac204ac71ca 100644 (file)
@@ -1,7 +1,7 @@
 <html>
   <head>
     {% load staticfiles %}
-    <link rel="stylesheet" type="text/css" href="{% static 'quotations/style.css' %}" />
+    <link rel="stylesheet" type="text/css" href="{% static 'quotes/style.css' %}" />
   </head>
   <body>
     {% block body %}
similarity index 65%
rename from quotes/templates/quotations/display.html
rename to quotes/templates/quotes/display.html
index 62d36d9bcfd9e2e967d6ae9af3702e36a070f018..108dc92ba6a3662d01f02c57530d97be5898e971 100644 (file)
@@ -4,7 +4,7 @@
   </p>
 
   <p class="author">
-    — <span class="name"><a href="{% url 'author' quote.author.id %}">
+    — <span class="name"><a href="{% url 'quotes:author' quote.author.id %}">
        {{ quote.author.name }}
     </a></span>
   </p>
@@ -13,7 +13,7 @@
     <p class="tags">
       Tags: 
       {% for tag in quote.tags.all %}
-        <a href="{% url 'tags' tag.id %}">{{ tag.tag }}</a>
+        <a href="{% url 'quotes:tags' tag.id %}">{{ tag.tag }}</a>
       {% endfor %}
     </p>
   {% endif %}
diff --git a/quotes/templates/quotes/many.html b/quotes/templates/quotes/many.html
new file mode 100644 (file)
index 0000000..328863b
--- /dev/null
@@ -0,0 +1,9 @@
+{% extends 'quotes/base.html' %}
+
+{% block body %}
+
+{% for quote in quotes %}
+  {% include "quotes/display.html" with quote=quote %}
+{% endfor %}
+
+{% endblock %}
diff --git a/quotes/templates/quotes/onequote.html b/quotes/templates/quotes/onequote.html
new file mode 100644 (file)
index 0000000..4d01894
--- /dev/null
@@ -0,0 +1,7 @@
+{% extends 'quotes/base.html' %}
+
+{% block body %}
+
+{% include "quotes/display.html" with quote=quote %}
+
+{% endblock %}
similarity index 62%
rename from quotes/templates/quotations/tag.html
rename to quotes/templates/quotes/tag.html
index bf06aff10549747d6ebca01876cf28a55ae8cbab..266cd168e45c35f75b69a1fca0523c93121b7d7d 100644 (file)
@@ -1,4 +1,4 @@
-{% extends 'quotations/base.html' %}
+{% extends 'quotes/base.html' %}
 
 {% block body %}
 
@@ -8,7 +8,7 @@
 <p>All the quotes tagged with {{ tag.tag }}:<p>
 
 {% for quote in tag.quote_set.all %}
-  {% include "quotations/display.html" with quote=quote %}
+  {% include "quotes/display.html" with quote=quote %}
 {% endfor %}
 
 
index 615719209327f58096622d8b3d5e8b51d3928c98..981af054515b7817efb40daae2138b7d34de0b1a 100644 (file)
@@ -10,7 +10,7 @@ from .models import Author, Quote, Tag
 def onequote(request, quote_id):
     q = Quote.objects.get(id=quote_id)
     context = { 'quote' : q }
-    return render(request, 'quotations/onequote.html', context)
+    return render(request, 'quotes/onequote.html', context)
 
 def random(request):
     count = Quote.objects.count()
@@ -19,14 +19,14 @@ def random(request):
 def tags(request, tag_id):
     tag = Tag.objects.get(id=tag_id)
     context = { 'tag' : tag }
-    return render(request, 'quotations/tag.html', context)
+    return render(request, 'quotes/tag.html', context)
 
 def author(request, author_id):
     author = Author.objects.get(id=author_id)
     context = { 'author' : author }
-    return render(request, 'quotations/author.html', context)
+    return render(request, 'quotes/author.html', context)
 
 def all(request):
     quotes = Quote.objects.all()
     context = { 'quotes' : quotes }
-    return render(request, 'quotations/all.html', context)
+    return render(request, 'quotes/all.html', context)