merged
This commit is contained in:
@@ -6,17 +6,12 @@ from django.utils import timezone
|
||||
from django.utils.text import slugify
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from taggit.managers import TaggableManager
|
||||
import logging
|
||||
request_logger = logging.getLogger('django.request')
|
||||
# import documents
|
||||
from documents import ep
|
||||
|
||||
from .managers import (
|
||||
PostManager, ArticleManager, NewsManager, AllEventManager, EventManager, FetMeetingManager
|
||||
)
|
||||
|
||||
# from ckeditor_uploader import RichTextUploadingField
|
||||
# import uuid
|
||||
import re
|
||||
from rest_framework import serializers
|
||||
|
||||
@@ -24,6 +19,7 @@ from datetime import timedelta
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger('posts')
|
||||
request_logger = logging.getLogger('django.request')
|
||||
|
||||
|
||||
class Category(models.Model):
|
||||
@@ -101,8 +97,10 @@ class Post(models.Model):
|
||||
def get_tags(self):
|
||||
"""Returns assigned tags as a comma seperated list."""
|
||||
return ",".join(self.tags.names())
|
||||
|
||||
@property
|
||||
def agenda_html(self):
|
||||
<<<<<<< HEAD
|
||||
if not self.agenda_key:
|
||||
return None
|
||||
h=ep.getPadHTML(self.agenda_key)
|
||||
@@ -116,6 +114,13 @@ class Post(models.Model):
|
||||
request_logger.info("set etherpad!")
|
||||
return value
|
||||
|
||||
=======
|
||||
return "<h1>Agenda</h1>"
|
||||
|
||||
# @agenda_html.setter
|
||||
# def agenda_html_set(self, value):
|
||||
# return value
|
||||
>>>>>>> 72b4b7d982139cd76d2d5389e7b906097d75a0c0
|
||||
@property
|
||||
def get_tagnames(self):
|
||||
return ["#%s" % t for t in self.tags.names()]
|
||||
@@ -198,7 +203,7 @@ class PostSerializer(serializers.HyperlinkedModelSerializer):
|
||||
'event_end',
|
||||
'is_hidden',
|
||||
'agenda_html'
|
||||
# 'author'#,
|
||||
# 'author',
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -48,8 +48,16 @@ def tags(request, tag=""):
|
||||
(job_names[idx], active_members[idx], tag + "#" + slug_list[idx])
|
||||
)
|
||||
|
||||
author_image = None
|
||||
if featured_post:
|
||||
post_author = Member.all_members.filter(nickname=featured_post.author).first()
|
||||
|
||||
if post_author:
|
||||
author_image = post_author.image['avatar'].url
|
||||
|
||||
context = {
|
||||
"posts": posts,
|
||||
"author_image": author_image,
|
||||
"featured_post": featured_post,
|
||||
"members": members,
|
||||
"tags_list": None,
|
||||
|
||||
@@ -6,62 +6,60 @@
|
||||
|
||||
<div class="grid-x">
|
||||
|
||||
<div class="medium-8 small cell" style="background: grey">
|
||||
{% with post=featured_post %}
|
||||
<a href="{{post.url}}">
|
||||
<div class="news-hero-large"style="background-image: url('{{post.imageurl}}');)">
|
||||
<div class="news-hero-text" >
|
||||
<hr>
|
||||
<div class="article-date">
|
||||
<p>{{post.public_date}}</p>
|
||||
</div>
|
||||
<div class="article-title">
|
||||
<h1>{{post.title| safe}}</h1>
|
||||
<p>{{post.subtitle | safe}}</p>
|
||||
</div>
|
||||
<div class="medium-8 small cell" style="background: grey">
|
||||
{% with post=featured_post %}
|
||||
<a href="{{post.url}}">
|
||||
<div class="news-hero-large"style="background-image: url('{{post.imageurl}}');)">
|
||||
<div class="news-hero-text" >
|
||||
<hr>
|
||||
<div class="article-date">
|
||||
<p>{{post.public_date}}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{% endwith %}
|
||||
</div>
|
||||
<div class="article-title">
|
||||
<h1>{{post.title| safe}}</h1>
|
||||
<p>{{post.subtitle | safe}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
||||
<div class="medium-4 responsive-side-box cell">
|
||||
<div class="medium-4 responsive-side-box cell">
|
||||
|
||||
<a href="{% url 'posts.index' %}"><h1>Neuigkeiten</h1>
|
||||
</a>
|
||||
<div class="article-row-section">
|
||||
{% with post=featured_post %}
|
||||
{% include 'posts/partials/_article_row.html' %}
|
||||
{% endwith %}
|
||||
{% for post in featured_meeting %}
|
||||
{% include 'posts/partials/_meeting_row.html' %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<a href="{% url 'posts.index' %}"><h1>Neuigkeiten</h1></a>
|
||||
<div class="article-row-section">
|
||||
{% with post=featured_post %}
|
||||
{% include 'posts/partials/_article_row.html' %}
|
||||
{% endwith %}
|
||||
{% for post in featured_meeting %}
|
||||
{% include 'posts/partials/_meeting_row.html' %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid-container">
|
||||
<div class="grid-x grid-padding-x padding-top-1">
|
||||
{{ tags_list|tags_to_url }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="grid-x grid-x-padding">
|
||||
<div class="medium-8 small-12 small-order-2 medium-order-1"">
|
||||
{% for post in posts %}
|
||||
{% include 'posts/partials/_posts_hero.html' %}
|
||||
{% endfor %}
|
||||
<div class="grid-x grid-padding-x padding-top-1">
|
||||
{{ tags_list|tags_to_url }}
|
||||
</div>
|
||||
<div class="medium-4 small-12 small-order-1 medium-order-2 padding-1">
|
||||
{% for post in events %}
|
||||
{% include 'posts/partials/_date_box.html' %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<div class="grid-x grid-x-padding">
|
||||
<div class="medium-8 small-12 small-order-2 medium-order-1"">
|
||||
{% for post in posts %}
|
||||
{% include 'posts/partials/_posts_hero.html' %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="medium-4 small-12 small-order-1 medium-order-2 padding-1">
|
||||
{% for post in events %}
|
||||
{% include 'posts/partials/_date_box.html' %}
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,11 +1,11 @@
|
||||
<div class="grid-x">
|
||||
{% for mem in job_memberships %}
|
||||
{% with member=mem.member %}
|
||||
{% with member=mem.member %}
|
||||
<div class="medium-3 large-2 small-6 cell">
|
||||
<h2>{{mem.member.surname}}</h2>
|
||||
{% include 'members/partials/_member.html' %}
|
||||
<h2>{{mem.get_job_role_display}} ({{mem.job_start|date}} - {{mem.job_end|date}})</h2>
|
||||
<h2>{{mem.member.surname}}</h2>
|
||||
{% include 'members/partials/_member.html' %}
|
||||
<h2>{{mem.get_job_role_display}} ({{mem.job_start|date}} - {{mem.job_end|date}})</h2>
|
||||
</div>
|
||||
{%endwith %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -1,5 +0,0 @@
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block content %}
|
||||
Memeber
|
||||
{% endblock %}
|
||||
@@ -3,16 +3,12 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
|
||||
|
||||
<div class="grid-x">
|
||||
<div class="medium-8 cell">
|
||||
{% for post in posts %}
|
||||
{% include 'posts/partials/_posts_hero.html' %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
<div class="grid-x">
|
||||
<div class="medium-8 cell">
|
||||
{% for post in posts %}
|
||||
{% include 'posts/partials/_posts_hero.html' %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -91,4 +91,4 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}fffsdfag
|
||||
{% endblock %}
|
||||
@@ -1,6 +1,5 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% load post_helpers %}
|
||||
{% load thumbnail %}
|
||||
{% block content %}
|
||||
{% if featured_post != None %}
|
||||
{% with post=featured_post %}
|
||||
@@ -17,7 +16,7 @@
|
||||
{{post.subtitle | tags_to_url }}
|
||||
{% if post.author_member != None %}
|
||||
<div class="article-author"><a href="{% url 'member' post.author_member.nickname %}">
|
||||
<img src="{{post.author_member.image | thumbnail_url:'avatar'}}" alt="" />
|
||||
<img src="{{author_image}}" alt="" />
|
||||
{{post.author}}</a>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user