config update

master
Laurent 6 years ago
parent a374bd2171
commit 1ecc99ea52
  1. 4
      news/models.py
  2. BIN
      news/static/image/favicon.png
  3. BIN
      news/static/image/icon128_transparent.png
  4. BIN
      news/static/image/icon128_transparent_black.png
  5. BIN
      news/static/image/icon128_transparent_white.png
  6. BIN
      news/static/image/icon_square.png
  7. 11
      news/static/news/css/app.css
  8. 6
      news/templates/base.html
  9. 24
      news/templates/news/index.html
  10. 9
      pokercc/settings.py

@ -31,6 +31,10 @@ class Post(models.Model):
# flat.append(comment) # flat.append(comment)
flat.extend(comment.flat_children(0, user)) flat.extend(comment.flat_children(0, user))
return flat 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.annotate(ratings_num=count('voters')).order_by('-ratings_num')[:5]
# return self.comment_set.order_by('voters_num').all()[:5] # return self.comment_set.order_by('voters_num').all()[:5]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

@ -9,7 +9,11 @@
:root { :root {
--main-bg-color: #FFD540; --main-bg-color: #FFD540;
--header-bg-color: #EAC33B; --header-bg-color: #FFD540;
}
iframe {
border: 0;
} }
a { a {
@ -142,6 +146,11 @@ a h1 {
.lat_padding { .lat_padding {
padding: 0px 8px; padding: 0px 8px;
} }
@media print, screen and (min-width: 40em) {
.lat_padding {
padding: 0px;
}
}
.inside_image_top { .inside_image_top {
position: absolute; position: absolute;

@ -6,6 +6,7 @@
<head> <head>
<link rel="stylesheet" type="text/css" href="{% static 'news/css/app.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'news/css/app.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'news/css/foundation.min.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'news/css/foundation.min.css' %}">
<link rel="shortcut icon" type="image/png" href="{% static 'image/favicon.png' %}"/>
<title>{% block title %}My amazing site{% endblock %}</title> <title>{% block title %}My amazing site{% endblock %}</title>
</head> </head>
@ -26,7 +27,10 @@
<!-- Header --> <!-- Header -->
<header> <header>
<div class="title"> <div class="title">
<h1><a href="{% url 'news:index' %}">poker rumble</a></h1> <h1>
<!-- <img src="{% static 'image/icon_square.png' %}" alt="Poker Rumble icon" width="64" height="56"/> -->
<a href="{% url 'news:index' %}">poker rumble</a>
</h1>
</div> </div>
<!-- <h2>HOME OF NEWS GRINDERS</h2> --> <!-- <h2>HOME OF NEWS GRINDERS</h2> -->

@ -20,18 +20,27 @@
<!-- A post --> <!-- A post -->
{% if post.style == 0 %} {% if post.style == 0 %}
{% if post.is_youtube_video %}
<a href="{{ post.url }}">
<h1>{{ post.title }}</h1>
</a>
<iframe src="{{ post.url }}" width="600" height="400"></iframe>
{% else %}
<div class="imgcontainer"> <div class="imgcontainer">
<img src="{% static 'media/' %}{{ post.image_url }}"/> <img src="{% static 'media/' %}{{ post.image_url }}"/>
<div class="inside_image_top"> <div class="inside_image_top">
{% if post.url %}<a href="{{ post.url }}">{% endif %} {% if post.url %}<a href="{{ post.url }}">{% endif %}
<h1>{{ post.title }}</h1> <h1>{{ post.title }}</h1>
{% if post.url %}</a>{% endif %} {% if post.url %}</a>{% endif %}
{% if post.body %}
<p> <p>
{{ post.body }} {{ post.body }}
</p> </p>
{% endif %}
</div> </div>
</div>
<div class="inside_image_bottom"> {% endif %}
<div class="details"> <div class="details">
<a href="{% url 'news:post' post.id %}">{% if post.comment_set.count > 0 %}{{ post.comment_set.count }} comment{% if post.comment_set.count > 1 %}s{% endif %}{% else %}write comment{% endif %}</a> <a href="{% url 'news:post' post.id %}">{% if post.comment_set.count > 0 %}{{ post.comment_set.count }} comment{% if post.comment_set.count > 1 %}s{% endif %}{% else %}write comment{% endif %}</a>
@ -42,10 +51,6 @@
<span>{{ comment.body }} - {{ comment.author.username }}</span><br/> <span>{{ comment.body }} - {{ comment.author.username }}</span><br/>
{% endfor %} {% endfor %}
</div> </div>
</div>
</div>
<!-- Quote --> <!-- Quote -->
{% elif post.style == 1 %} {% elif post.style == 1 %}
@ -69,12 +74,16 @@
</div> </div>
</div> </div>
<!-- Picture no title no link --> <!-- Media no title no link -->
{% elif post.style == 2 %} {% elif post.style == 2 %}
{% if post.is_youtube_video %}
<iframe src="{{ post.url }}" width="600" height="400"></iframe>
{% else %}
<div class="imgcontainer"> <div class="imgcontainer">
<img class="crop" src="{% static 'media/' %}{{ post.image_url }}"/> <img class="crop" src="{% static 'media/' %}{{ post.image_url }}"/>
</div> </div>
{% endif %}
<div class="post_padding"> <div class="post_padding">
<div class="details info"> <div class="details info">
@ -88,7 +97,6 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
</article> </article>

@ -79,12 +79,15 @@ WSGI_APPLICATION = 'pokercc.wsgi.application'
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.postgresql' #'django.db.backends.sqlite3', # 'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'stax_rumble' #os.path.join(BASE_DIR, 'db.sqlite3'), # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'stax_rumble',
'USER': 'stax', 'USER': 'stax',
'PASSWORD': 'staxkikoo', 'PASSWORD': 'staxkikoo',
'HOST': 'postgresql-stax.alwaysdata.net', 'HOST': 'postgresql-stax.alwaysdata.net',
# 'PORT': '5432', 'PORT': '5432',
} }
} }

Loading…
Cancel
Save