{% extends "bee_django_crm/base.html" %}
{% load bee_django_crm_filter %}
{% block content %}
    {% include 'bee_django_crm/logo.html' %}
    {% include 'bee_django_crm/nav.html' %}
    <h4>渠道详情</h4>

{#    <a href="{% url 'bee_django_crm:source_update'  source.id %}">修改信息</a>#}
    <table class="table">
        <tr>
            <td class="col-xs-3">名称</td>
            <td>{{ source.name }}</td>
        </tr>
        <tr>
            <td>注册页显示名称</td>
            <td>{{ source.reg_name|default:"" }}</td>
        </tr>
        <tr>
            <td>是否为海报类型</td>
            <td>{{ source.get_is_poster }}</td>
        </tr>
        {% if not source.is_poster %}
            {% for landing_url in landing_url_arg_list %}
                <tr>
                    <td>落地页链接{{ forloop.counter }}</td>
                    <td><a href="{{ landing_url }}{{ args }}">
                        {{ landing_url }}{{ args }}</a></td>
                </tr>
                <tr>
                    <td>落地页二维码{{ forloop.counter }}</td>
                    <td><img src="{% url 'bee_django_crm:source_qrcode'  'landing' source.id forloop.counter0 %}"
                             alt="落地页二维码"></td>
                </tr>
            {% endfor %}
            <tr>
                <td>注册页链接</td>
                <td><a href="{{ reg_url }}">
                    {{ reg_url }}</a></td>
            </tr>
            <tr>
                <td>注册页二维码</td>
                <td><img src="{% url 'bee_django_crm:source_qrcode' 'reg' source.id 0 %}" alt="注册页二维码"></td>
                {% else %}
            <tr>
                <td>海报图片</td>
                <td>
                    <a href="{% url 'bee_django_crm:poster_create' source.id %}">上传新图片</a>

                    {% for poster in source.poster_set.all %}
                        {#                        <img src="/{{ poster.get_temp_image }}" alt="" style="width: 90%"> 删除#}

                        <div>{% if poster.is_show %}<span style="color: red">(显示)</span> {% endif %}
                            图片{{ forloop.counter }}：
                            <a href="{% url 'bee_django_crm:poster_detail' poster.id %}">详情</a>
                            {#                            <a href="{% url 'bee_django_crm:poster_detail' poster.id %}">修改</a>#}
                            <a href="{% url 'bee_django_crm:poster_update' poster.id %}">图片设置</a>
                        </div>
                    {% endfor %}
                </td>
            </tr>

        {% endif %}
    </table>
{% endblock %}