{% extends "coop_cms/article.html" %}
{% load i18n %}

{% block meta_title %}coop_cms{% endblock %}

{% block jquery_declaration %}
{{block.super}}
{% endblock %}

{% block extra_head %}
{{block.super}}
<style>
    a{
        color: #000;
    }
    
    ul.article-list {
        border: solid thin #ccc;
        padding: 5px 5px;
        list-style : none;
    }
    
    ul.article-list li.draft a, ul.article-list li.draft {
        font-style: italic;
        color: #aaa;
    }
    
    .links a {
        padding: 4px 8px;
        border: solid #aaa thin;
        border-radius: 5px 5px 5px 5px;
        background: #ddd;
    }
    .links a:hover {
        background: #ccc;
    }
    
</style>
{% endblock %}

{% block document %}
    <div class="article">
        
    {% blocktrans %}
    <h1>Welcome on coop_cms</h1>
    <p>
        coop_cms is a simple CMS for the Django web framework.<br/>
        The goal is to make article edition as simple as possible thanks to HTML5 content editable and Aloha editor.
    </p>
    {% endblocktrans %}
        
        <h3>{% trans "Articles" %}</h3>
        {% if articles %}
            <ul class="article-list">
            {% for art in articles %}
                <li{% if art.publication == 0 %} class="draft"{% endif %}><a href="{{ art.get_absolute_url }}">{{ art.title }}</a></li>
            {% endfor %}
            </ul>
            <div class="links">
                {% if articles_list_url %}<a href="{{ articles_list_url }}">{% trans "View all articles" %}</a>{% endif %}
                {% if add_article_url %}<a href="{{ add_article_url }}" class="colorbox-form">{% trans "Add article" %}</a>{% endif %}
            </div>
        {% else %}
            <div class="links">
                {% if add_article_url %}<a href="{{ add_article_url }}" class="colorbox-form">Let's start and create your first article</a>{% endif %}
            </div>
        {% endif %}
        
        <h3>{% trans "Newsletters" %}</h3>
        {% if newsletters %}
            <ul class="article-list">
            {% for n in newsletters %}
                <li><a href="{{ n.get_absolute_url }}">{{ n.subject }}</a></li>
            {% endfor %}
            </ul>
        {% endif %}
        
        <div class="links">
            {% if newsletters_list_url %}<a href="{{ newsletters_list_url }}">{% trans "View all newsletters" %}</a>{% endif %}
            {% if add_newsletter_url %}<a href="{{ add_newsletter_url }}">{% trans "Create a newsletter" %}</a>{% endif %}
        </div>
    </div>


    
{% endblock %}
