Adds HTML to content styles

master
Laurent 6 years ago
parent 2fc4cc48e2
commit f3c7e67e79
  1. 3
      news/choices.py
  2. 15
      news/templates/news/index.html
  3. 19
      pokercc/settings.py

@ -2,5 +2,6 @@ STYLE_CHOICES = (
(0, "Standard [Title + URL + Image]"),
(1, "Quote [Title]"),
(2, "Image Only [Image]"),
(3, "Youtube [Put video id in URL]")
(3, "Youtube [Put video id in URL]"),
(4, "HTML [Title + Body(HTML)]")
)

@ -92,6 +92,21 @@
<iframe class="youtube" src="https://www.youtube.com/embed/{{ post.url }}"></iframe>
<div class="post_padding">
<div class="details info">
<a href="{% url 'news:post' post.id post.slug %}">{% if post.comment_set.count > 0 %}{{ post.comment_set.count }} comment{% if post.comment_set.count > 1 %}s{% endif %}{% else %}write comment{% endif %}</a>
</div>
<!-- Some comments -->
<div class="comments">
{% for comment in post.top_comments %}
<span>{{ comment.body }} - {{ comment.author.username }}</span><br/>
{% endfor %}
</div>
</div>
{% elif post.style == 4 %}
{{ post.body |safe }}
<div class="post_padding">
<div class="details info">
<a href="{% url 'news:post' post.id post.slug %}">{% if post.comment_set.count > 0 %}{{ post.comment_set.count }} comment{% if post.comment_set.count > 1 %}s{% endif %}{% else %}write comment{% endif %}</a>

@ -27,7 +27,7 @@ SECRET_KEY = 'erk4wh93pi(m(odwg74lsy60tb$rz4=ndyiv3#2lcx^!$^kq@4'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['ssh-stax.alwaysdata.net', 'www.pokerrumble.net']
ALLOWED_HOSTS = ['127.0.0.1', 'ssh-stax.alwaysdata.net', 'www.pokerrumble.net']
#EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
@ -86,15 +86,14 @@ WSGI_APPLICATION = 'pokercc.wsgi.application'
DATABASES = {
'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'stax_rumble_dev',
'USER': 'stax',
'PASSWORD': 'staxkikoo',
'HOST': 'postgresql-stax.alwaysdata.net',
# 'PORT': '5432',
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': 'stax_rumble_dev',
# 'USER': 'stax',
# 'PASSWORD': 'staxkikoo',
# 'HOST': 'postgresql-stax.alwaysdata.net',
}
}

Loading…
Cancel
Save