diff --git a/news/models.py b/news/models.py index c652a2c..cbc0a4d 100644 --- a/news/models.py +++ b/news/models.py @@ -31,6 +31,10 @@ class Post(models.Model): # flat.append(comment) flat.extend(comment.flat_children(0, user)) return flat + + def is_youtube_video(self): + return "youtube.com" in self.url + # return self.comment_set.annotate(ratings_num=count('voters')).order_by('-ratings_num')[:5] # return self.comment_set.order_by('voters_num').all()[:5] diff --git a/news/static/image/favicon.png b/news/static/image/favicon.png new file mode 100644 index 0000000..e00a48a Binary files /dev/null and b/news/static/image/favicon.png differ diff --git a/news/static/image/icon128_transparent.png b/news/static/image/icon128_transparent.png new file mode 100644 index 0000000..b30104f Binary files /dev/null and b/news/static/image/icon128_transparent.png differ diff --git a/news/static/image/icon128_transparent_black.png b/news/static/image/icon128_transparent_black.png new file mode 100644 index 0000000..7e961fa Binary files /dev/null and b/news/static/image/icon128_transparent_black.png differ diff --git a/news/static/image/icon128_transparent_white.png b/news/static/image/icon128_transparent_white.png new file mode 100644 index 0000000..508be27 Binary files /dev/null and b/news/static/image/icon128_transparent_white.png differ diff --git a/news/static/image/icon_square.png b/news/static/image/icon_square.png new file mode 100644 index 0000000..54f5ef5 Binary files /dev/null and b/news/static/image/icon_square.png differ diff --git a/news/static/news/css/app.css b/news/static/news/css/app.css index 928ba73..e68f179 100644 --- a/news/static/news/css/app.css +++ b/news/static/news/css/app.css @@ -9,7 +9,11 @@ :root { --main-bg-color: #FFD540; - --header-bg-color: #EAC33B; + --header-bg-color: #FFD540; +} + +iframe { + border: 0; } a { @@ -142,6 +146,11 @@ a h1 { .lat_padding { padding: 0px 8px; } +@media print, screen and (min-width: 40em) { + .lat_padding { + padding: 0px; + } +} .inside_image_top { position: absolute; diff --git a/news/templates/base.html b/news/templates/base.html index 9f65d5d..a761eb5 100644 --- a/news/templates/base.html +++ b/news/templates/base.html @@ -6,6 +6,7 @@ + {% block title %}My amazing site{% endblock %} @@ -26,7 +27,10 @@
-

poker rumble

+

+ + poker rumble +

diff --git a/news/templates/news/index.html b/news/templates/news/index.html index 99ea6fc..747f42f 100644 --- a/news/templates/news/index.html +++ b/news/templates/news/index.html @@ -20,32 +20,37 @@ {% if post.style == 0 %} -
- -
- {% if post.url %}{% endif %} -

{{ post.title }}

- {% if post.url %}
{% endif %} -

- {{ post.body }} -

-
- -
- - - -
- {% for comment in post.top_comments %} - {{ comment.body }} - {{ comment.author.username }}
- {% endfor %} + {% if post.is_youtube_video %} + +

{{ post.title }}

+
+ + {% else %} +
+ +
+ {% if post.url %}{% endif %} +

{{ post.title }}

+ {% if post.url %}
{% endif %} + + {% if post.body %} +

+ {{ post.body }} +

+ {% endif %}
+ {% endif %} + + +
+ {% for comment in post.top_comments %} + {{ comment.body }} - {{ comment.author.username }}
+ {% endfor %}
- {% elif post.style == 1 %} @@ -69,25 +74,28 @@
- + {% elif post.style == 2 %} -
- -
+ {% if post.is_youtube_video %} + + {% else %} +
+ +
+ {% endif %} -
- - -
- {% for comment in post.top_comments %} - {{ comment.body }} - {{ comment.author.username }}
- {% endfor %} -
+
+ - + +
+ {% for comment in post.top_comments %} + {{ comment.body }} - {{ comment.author.username }}
+ {% endfor %} +
+
{% endif %} diff --git a/pokercc/settings.py b/pokercc/settings.py index 3790a1d..265e6d8 100644 --- a/pokercc/settings.py +++ b/pokercc/settings.py @@ -79,12 +79,15 @@ WSGI_APPLICATION = 'pokercc.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.postgresql' #'django.db.backends.sqlite3', - 'NAME': 'stax_rumble' #os.path.join(BASE_DIR, 'db.sqlite3'), + # 'ENGINE': 'django.db.backends.sqlite3', + # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': 'stax_rumble', 'USER': 'stax', 'PASSWORD': 'staxkikoo', 'HOST': 'postgresql-stax.alwaysdata.net', - # 'PORT': '5432', + 'PORT': '5432', } }