<commit_before> {% extends "base.html" %} {% set nav_active = 'home' %} {% set authenticated = True %} {% block head %} {{ super() }} {% endblock %} {% block btitle %} Home {% endblock %} {% block bstyles %}
<style>
    .form {
        padding-top: 20px;
        padding-bottom: 30px;
    }
    
    .panel-body .img-responsive {
        margin: 0 auto;
    }
</style>
{% endblock %} {% block page_content %} {% if not search %}
<div class="panel panel-default">
    <div class="panel-heading">
        Post a Photo
    </div>

    <div class="panel-body">
        <form class="form-inline" action="/post" method="POST" enctype="multipart/form-data">
            <div class="form-group">
                <div class='input-group'>
                    <label class="input-group-btn">
						<span class="btn btn-primary">
							Browse&hellip;
							<input type="file" name="file" accept="image/*" style="display: none;">
						</span>
					</label>
                    <input type="text" class="form-control" readonly>
                </div>
                <div class="form-group">
                    <input class="form-control" type="text" name="name" placeholder="Caption" required/>
                </div>
                <div class="checkbox">
                    <label><input type="checkbox" name="public" value="public"/>Public</label>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary" />
                    <span class="glyphicon glyphicon-edit"></span> Post
                    </button>
                </div>
        </form>
        </div>
    </div>
</div>
{%endif%} {% with error = get_flashed_messages(with_categories=true) %} {% for c, e in error %}
<div class="alert alert-{{c}} alert-dismissable fade in">
    <a href='#' class="close" data-dismiss="alert" aria-label="close">&times;</a> {{e}}
</div>
{% endfor %} {% endwith %} {% if posts %} {% for line in posts %}
<div class="panel panel-default" id="{{line.id}}">
    <div class="panel-heading">
        <span class="text-primary">{{line.first_name}} {{line.last_name}}</span>
        <span class="text-muted">&#9658;</span> {{line.content_name}}
        {% if line.groups|length > 0 %}
        <small> shared with </small>
        {% for g in line.groups %}
            {{g.group_name}}{% if line.groups|length != loop.index %},{% endif %}
        {% endfor %}
        {% endif %}
        <div class="pull-right">
            {% if line.public == 1 %}
            <span class="glyphicon glyphicon-eye-open"></span> {% else %}
            <span class="glyphicon glyphicon-eye-close"></span> {% endif %}
            <small>{{line.timest|time_ago}}&nbsp;</small> {% if (username == line.username) %}
            <a href="/postdel?username={{line.username}}&id={{line.id}}" title="Delete post" class="close deletePost">&times;</a> {% endif %}
        </div>
    </div>
    <div class="panel-body">
        <a href="#col{{line.id}}" data-toggle="collapse">
            <img src="/content/{{line.file_path}}" alt="{{line.content_name}}" class="img-responsive img-rounded">
        </a>
        {% for t in line.tags %}
        <span style="padding: 4pt; display: inline-block; margin-top: 5pt;" class="label label-default">
			<span class="glyphicon glyphicon-tag"></span> {{t.first_name}} {{t.last_name}}
        </span>
        {% endfor %}
        <div id="col{{line.id}}" class="collapse">
            <hr>
            <form class="form-inline" style="padding-top:0pt;padding-bottom:0pt;" action="/tag" method="POST">
                <div class="form-group">
                    <div class="input-group">
                        <input type="text" class="form-control" name="taggee" placeholder="Tag a friend!" required>
                        <input type="hidden" class="form-control" name="id" value="{{line.id}}">
                        <label class="input-group-btn">
                            <button type="submit" class="btn btn-default">
                                Tag
                            </button>
                        </label>
                    </div>
                </div>
            </form>
            <hr>
            <form class="form-inline" style="padding-top:10px;padding-bottom:0pt;" action="/share" method="POST">
                <div class="form-group">
                    <select class="form-control" name="group_name">
                        <option value="" disabled selected hidden>Group</option>
                        {% for group in groups %}
                        <option>{{group.group_name}}</option>
                        {% endfor %}
                    </select>
                    <input type="hidden" class="form-control" name="id" value="{{line.id}}" />
                    <button type="submit" class="btn btn-default">
						Share
					</button>
                </div>
            </form>
            <hr> {% if line.id not in favorites %}
            <form class="form-inline" action="/favoriteAdd" method="POST">
                {% else %}
                <form class="form-inline" action="/favoriteDel" method="POST">
                    {%endif%}
                    <div class="form-group">
                        <input type="hidden" class="form-control" name="id" value="{{line.id}}" /> {% if line.id not in favorites %}
                        <button type="submit" class="btn btn-default btn-sm">
          <span class="glyphicon glyphicon-save"></span> Save
        </button> {% else %}
                        <button type="submit" class="btn btn-default btn-sm">
          <span class="glyphicon glyphicon-open"></span> Unsave
        </button> {%endif%}
                    </div>
                </form>
        </div>
    </div><commit_msg>only an owner can share an item<commit_after> {% extends "base.html" %} {% set nav_active = 'home' %} {% set authenticated = True %} {% block head %} {{ super() }} {% endblock %} {% block btitle %} Home {% endblock %} {% block bstyles %}
<style>
    .form {
        padding-top: 20px;
        padding-bottom: 30px;
    }
    
    .panel-body .img-responsive {
        margin: 0 auto;
    }
</style>
{% endblock %} {% block page_content %} {% if not search %}
<div class="panel panel-default">
    <div class="panel-heading">
        Post a Photo
    </div>

    <div class="panel-body">
        <form class="form-inline" action="/post" method="POST" enctype="multipart/form-data">
            <div class="form-group">
                <div class='input-group'>
                    <label class="input-group-btn">
						<span class="btn btn-primary">
							Browse&hellip;
							<input type="file" name="file" accept="image/*" style="display: none;">
						</span>
					</label>
                    <input type="text" class="form-control" readonly>
                </div>
                <div class="form-group">
                    <input class="form-control" type="text" name="name" placeholder="Caption" required/>
                </div>
                <div class="checkbox">
                    <label><input type="checkbox" name="public" value="public"/>Public</label>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary" />
                    <span class="glyphicon glyphicon-edit"></span> Post
                    </button>
                </div>
        </form>
        </div>
    </div>
</div>
{%endif%} {% with error = get_flashed_messages(with_categories=true) %} {% for c, e in error %}
<div class="alert alert-{{c}} alert-dismissable fade in">
    <a href='#' class="close" data-dismiss="alert" aria-label="close">&times;</a> {{e}}
</div>
{% endfor %} {% endwith %} {% if posts %} {% for line in posts %}
<div class="panel panel-default" id="{{line.id}}">
    <div class="panel-heading">
        <span class="text-primary">{{line.first_name}} {{line.last_name}}</span>
        <span class="text-muted">&#9658;</span> {{line.content_name}}
        {% if line.groups|length > 0 %}
        <small> shared with </small>
        {% for g in line.groups %}
            {{g.group_name}}{% if line.groups|length != loop.index %},{% endif %}
        {% endfor %}
        {% endif %}
        <div class="pull-right">
            {% if line.public == 1 %}
            <span class="glyphicon glyphicon-eye-open"></span> {% else %}
            <span class="glyphicon glyphicon-eye-close"></span> {% endif %}
            <small>{{line.timest|time_ago}}&nbsp;</small> {% if (username == line.username) %}
            <a href="/postdel?username={{line.username}}&id={{line.id}}" title="Delete post" class="close deletePost">&times;</a> {% endif %}
        </div>
    </div>
    <div class="panel-body">
        <a href="#col{{line.id}}" data-toggle="collapse">
            <img src="/content/{{line.file_path}}" alt="{{line.content_name}}" class="img-responsive img-rounded">
        </a>
        {% for t in line.tags %}
        <span style="padding: 4pt; display: inline-block; margin-top: 5pt;" class="label label-default">
			<span class="glyphicon glyphicon-tag"></span> {{t.first_name}} {{t.last_name}}
        </span>
        {% endfor %}
        <div id="col{{line.id}}" class="collapse">
            <hr>
            <form class="form-inline" style="padding-top:0pt;padding-bottom:0pt;" action="/tag" method="POST">
                <div class="form-group">
                    <div class="input-group">
                        <input type="text" class="form-control" name="taggee" placeholder="Tag a friend!" required>
                        <input type="hidden" class="form-control" name="id" value="{{line.id}}">
                        <label class="input-group-btn">
                            <button type="submit" class="btn btn-default">
                                Tag
                            </button>
                        </label>
                    </div>
                </div>
            </form>
            {% if username == line.username %}
            <hr>
            <form class="form-inline" style="padding-top:10px;padding-bottom:0pt;" action="/share" method="POST">
                <div class="form-group">
                    <select class="form-control" name="group_name">
                        <option value="" disabled selected hidden>Group</option>
                        {% for group in groups %}
                        <option>{{group.group_name}}</option>
                        {% endfor %}
                    </select>
                    <input type="hidden" class="form-control" name="id" value="{{line.id}}" />
                    <button type="submit" class="btn btn-default">
						Share
					</button>
                </div>
            </form>
            {% endif %}
            <hr> {% if line.id not in favorites %}
            <form class="form-inline" action="/favoriteAdd" method="POST">
                {% else %}
                <form class="form-inline" action="/favoriteDel" method="POST">
                    {%endif%}
                    <div class="form-group">
                        <input type="hidden" class="form-control" name="id" value="{{line.id}}" /> {% if line.id not in favorites %}
                        <button type="submit" class="btn btn-default btn-sm">
          <span class="glyphicon glyphicon-save"></span> Save
        </button> {% else %}
                        <button type="submit" class="btn btn-default btn-sm">
          <span class="glyphicon glyphicon-open"></span> Unsave
        </button> {%endif%}
                    </div>
                </form>
        </div>
    </div>
{'fraction_non_alphanumeric': 0.17461135446190845, 'fraction_numerical': 0.003091986601391394, 'mean_word_length': 1.8324008756993433, 'pattern_counts': {'":': 0, '<': 223, '<?xml version=': 0, '>': 225, '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': '6164662', 'n_tokens_mistral': 3542, 'n_tokens_neox': 3148, 'n_words': 715}