{% extends "api/base.html" %}
{% load static %}

{% block headmain %}EKB{% endblock %}

{% block style%}
<!-- <link rel="stylesheet" href="{% static 'loginedtest/style.css' %}"> -->
<link rel="stylesheet" href="{% static 'first/style.css' %}" />
{% endblock %}





{% block moblie_menuu %}
    {% if is_valid == "yes"%}
        {% if testthing %}
        
            {% for object in testthing %}
                {% if object.0 == 'header' %}
                        <li><a href="/{{papka}}?type={{papka}}&title={{title}}#hh{{ forloop.counter }}">{{object.1}}</a></li>
                {% endif %}
            {% endfor %} 
            
        {% endif %}
    {% elif is_valid == "no" %}

        {% if testthing %}
                
            {% for object in testthing %}
                <li><a href="?type={{object.papka}}&title={{object.title}}">{{object.title}}</a></li>
            {% endfor %}

        {% endif %}

    {% endif %}
{% endblock %}






{% block history_dropdown %}
    {% if random_history %}
        {% for ran in random_history %}
            <a href="/{{ran.papka}}/?type={{ran.papka}}&title={{ran.title}}">{{ran.title}}</a>
        {% endfor %}
    {% else %}
        <a href="">ошибка....</a>
    {% endif %}
{% endblock %}


{% block places_dropdown %}
    {% if random_places %}
        {% for ran in random_places %}
            <a href="/{{ran.papka}}/?type={{ran.papka}}&title={{ran.title}}">{{ran.title}}</a>
        {% endfor %}
    {% else %}
        <a href="">ошибка....</a>
    {% endif %}
{% endblock %}


{% block celebrity_dropdown %}
    {% if random_celebrity %}
        {% for ran in random_celebrity %}
            <a href="/{{ran.papka}}/?type={{ran.papka}}&title={{ran.title}}">{{ran.title}}</a>
        {% endfor %}
    {% else %}
        <a href="">ошибка....</a>
    {% endif %}
{% endblock %}


{% block theaters_and_music_dropdown %}
    {% if random_theaters_and_music %}
        {% for ran in random_theaters_and_music %}
            <a href="/{{ran.papka}}/?type={{ran.papka}}&title={{ran.title}}" style="font-size: 15px;">{{ran.title}}</a>
        {% endfor %}
    {% else %}
        <a href="">ошибка....</a>
    {% endif %}
{% endblock %}





{% block maincontent %}
{% if is_valid == "yes"%}
<div class="n_bar">
    {% if testthing %}
        
        {% for object in testthing %}
            {% if object.0 == 'header' %}
                {% if forloop.counter == 1 %}
                    <a href="#hh{{ forloop.counter }}" style="word-wrap: break-word; overflow-wrap: break-word; padding-top: 10px;" class="button2">{{object.1}}</a>
                {% else %}
                    <a href="#hh{{ forloop.counter }}" style="word-wrap: break-word; overflow-wrap: break-word;" class="button2">{{object.1}}</a>
                {% endif %}
            {% endif %}
        {% endfor %}
    
    {% endif %}

</div>

<div class="in_content">
    <br>
    <label style="font-size: 40px; width: 40px; margin-top: 20px; word-wrap: break-word;">{% if title %}{{title}}{% else %}Нету названия!{% endif %}
        <hr style="max-width: auto; margin-left: 0px;"></label>
    

    {% if testthing %}
        {% for object in testthing %}
            
            {% if object.0 == 'header' %}
                <div id="hh{{ forloop.counter }}"></div>
                {% if forloop.counter == 1 %}
                <div>
                {% else %}
                <br>
                <br>
                <br>
                {% endif %}
                
                <label style="font-size: 40px; width: 40px; overflow-wrap: break-word;">{{object.1}}<hr style="max-width: auto; margin-left:0;"></label>
            {% endif %}
            


            {% if object.0 == 'text' %}
            
            
            
            <br>
            <br>
        
            <pre style="max-width: 650px;  word-wrap: break-word; text-align: left;font-size: 20px; white-space: pre-wrap;">{{object.1}}</pre>
            {% endif %}


            {% if object.0 == 'img' %}
                {% for picture in object.1 %}
                    {% if picture %}
                    <img src="{% static picture %}" class="img_content" alt="imgg">
                    {% endif %}
                {% endfor %}
            {% endif %}




        {% endfor %}
    {% endif %}
    




    {% if authtor %}
    <br>
    <label>{{authtor}}</label>
    {% endif %}
    <br>
    {{date}}




    <br>
    <br>
    <button onclick="topFunction()" id="myBtn" title="Go to top">Наверх</button>
    
{% elif is_valid == "no" %}
<div class="n_bar">
    {% if testthing %}
        
        {% for object in testthing %}
                {% if forloop.counter == 1 %}
                    <a href="#hh{{ forloop.counter }}" style="word-wrap: break-word; overflow-wrap: break-word; padding-top: 20px;" class="button2">{{object.title}}</a>
                {% else %}
                    <a href="#hh{{ forloop.counter }}" style="word-wrap: break-word; overflow-wrap: break-word;" class="button2">{{object.title}}</a>
                {% endif %}
        {% endfor %}

    {% endif %}

</div>

<div class="in_content" style="padding-top: 25px;">
    <label style="font-size: 40px; width: 40px;">{{namee}}<hr style="max-width: 400px; margin-left:0;"></label>



{% for object in testthing %}
    {% if forloop.counter == 1 %}
        <label style="font-size: 30px; margin-top: 20px;" onclick="window.location.href='?type={{object.papka}}&title={{object.title}}'">{{object.title}}<hr style="margin-left:0;"></label>
  
    <label style="font-size: 20px; ">{{object.desc}}</label>
    <br>
    
    {% if object.img_preview %}
        <img src="{% static object.img_preview %}" class="img_content">
    {% endif %}
    <button class="more_butt" onclick="window.location.href='?type={{object.papka}}&title={{object.title}}'">Подробнее</button>
    {% else %}
        <div id="hh{{ forloop.counter }}"></div>
        <br>
        <br>
        <br>
        <label style="font-size: 30px; margin-top: 20px;" onclick="window.location.href='?type={{object.papka}}&title={{object.title}}'">{{object.title}}<hr style=" margin-left:0;"></label>
        
        <label style="font-size: 20px; ">{{object.desc}}</label>
        <br>
        
        {% if object.img_preview %}
            <img src="{% static object.img_preview %}" class="img_content">
            <br>
        {% endif %}
        
        <button class="more_butt" onclick="window.location.href='?type={{object.papka}}&title={{object.title}}'">Подробнее</button>
    {% endif %}
{% endfor %}


    


</div>
{% else %}
<div class="in_content" style="padding-top: 25px;">
    <label style="font-size: 40px; width: 40px;">{{namee}}<hr style="max-width: 400px; margin-left:0;"></label>
</div>
{% endif %}
{% endblock %}


{% block js %}<script src="{% static 'first/script.js' %}"></script>{% endblock %}