<commit_before>{% extends "lfc/manage/filebrowser_base.html" %}
{% load i18n %}

{% block content %}
    <h1>{% trans "Global images" %}</h1>
    <table class="lfs-manage-table" width="100%">
        <tr>
            <th width="70px">
                {% trans "Image" %}
            </th>
            <th>
                {% trans "Sizes" %}
            </th>
        </tr>

        {% for image in portal_images %}
            <tr>
                <td valign="top">
                    <img src="{{ image.image.url_60x60 }}" />
                </td>
                <td valign="top">
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        {% trans "Original" %}
                    </a> /
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_60x60 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        60 x 60
                    </a> /
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_200x200 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        200 x 200
                    </a> /
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_400x400 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        400 x 400
                    </a> /
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_600x600 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        600 x 600
                    </a>
                </td>
            </tr>
        {% empty %}
            <tr>
                <td colspan="2">
                    {% trans "There are no global images." %}
                </td>
            </tr>
        {% endfor %}
    </table>

    <h1 class="middle">{% trans "Local images" %}</h1>
    <table class="lfs-manage-table" width="100%">
        <tr>
            <th width="70px">
                {% trans "Image" %}
            </th>
            <th>
                {% trans "Sizes" %}
            </th>
        </tr>

        {% for image in images %}
            <tr>
                <td valign="top">
                    <img src="{{ image.image.url_60x60 }}" />
                </td>
                <td valign="top">
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        {% trans "Original" %}
                    </a> /                    
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_60x60 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        60 x 60
                    </a> / 
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_200x200 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        200 x 200
                    </a> / 
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_400x400 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        400 x 400
                    </a> / 
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_600x600 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        600 x 600
                    </a>
                </td>
            </tr>
        {% empty %}
            <tr>
                <td colspan="2">
                    {% trans "There are no local images yet" %}
                </td>
            </tr>

        {% endfor %}
    </table>

    <h1 class="middle">{% trans "Upload local images" %}</h1>
    <form action="{% url lfc_fb_upload_image %}"
          method="post"
          enctype="multipart/form-data">
        <input type="hidden" name="obj_id" value="{{ obj_id }}">
        <input type="file" name="image" />
        <input type="submit" />
    </form>
{% endblock %}
<commit_msg>fix for issue 18 - do not allow to upload images if content is not yet created<commit_after>{% extends "lfc/manage/filebrowser_base.html" %}
{% load i18n %}

{% block content %}
    <h1>{% trans "Global images" %}</h1>
    <table class="lfs-manage-table" width="100%">
        <tr>
            <th width="70px">
                {% trans "Image" %}
            </th>
            <th>
                {% trans "Sizes" %}
            </th>
        </tr>

        {% for image in portal_images %}
            <tr>
                <td valign="top">
                    <img src="{{ image.image.url_60x60 }}" />
                </td>
                <td valign="top">
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        {% trans "Original" %}
                    </a> /
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_60x60 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        60 x 60
                    </a> /
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_200x200 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        200 x 200
                    </a> /
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_400x400 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        400 x 400
                    </a> /
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_600x600 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        600 x 600
                    </a>
                </td>
            </tr>
        {% empty %}
            <tr>
                <td colspan="2">
                    {% trans "There are no global images." %}
                </td>
            </tr>
        {% endfor %}
    </table>

    <h1 class="middle">{% trans "Local images" %}</h1>
    <table class="lfs-manage-table" width="100%">
        <tr>
            <th width="70px">
                {% trans "Image" %}
            </th>
            <th>
                {% trans "Sizes" %}
            </th>
        </tr>

        {% for image in images %}
            <tr>
                <td valign="top">
                    <img src="{{ image.image.url_60x60 }}" />
                </td>
                <td valign="top">
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        {% trans "Original" %}
                    </a> /                    
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_60x60 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        60 x 60
                    </a> / 
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_200x200 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        200 x 200
                    </a> / 
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_400x400 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        400 x 400
                    </a> / 
                    <a href="javascript:FileBrowserDialogue.fileSubmit('{{ image.image.url_600x600 }}');" class="fb_selectlink" title="{% trans 'Select File' %}">
                        600 x 600
                    </a>
                </td>
            </tr>
        {% empty %}
            <tr>
                <td colspan="2">
                    {% trans "There are no local images yet" %}
                </td>
            </tr>

        {% endfor %}
    </table>

    <h1 class="middle">{% trans "Upload local images" %}</h1>
    {% if not obj_id %}
        {% trans "You have to save content object before you can upload images for it." %}
    {% else %}
    <form action="{% url lfc_fb_upload_image %}"
          method="post"
          enctype="multipart/form-data">
        <input type="hidden" name="obj_id" value="{{ obj_id }}">
        <input type="file" name="image" />
        <input type="submit" />
    </form>
    {% endif %}
{% endblock %}

{'fraction_non_alphanumeric': 0.16067062521830247, 'fraction_numerical': 0.027244149493538247, 'mean_word_length': 1.3900946021146354, 'pattern_counts': {'":': 0, '<': 141, '<?xml version=': 0, '>': 141, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1782793', 'n_tokens_mistral': 2705, 'n_tokens_neox': 2293, 'n_words': 530}