MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / story_view_user

Function story_view_user

Scripts/ButSystem.py:18862–18904  ·  view source on GitHub ↗
(username: str)

Source from the content-addressed store, hash-verified

18860{% extends "base.html" %}
18861{% block content %}
18862<div class="d-flex align-items-center justify-content-between gap-2 flex-wrap mb-3"><h3 class="mb-0">{{ _('Reports') }}</h3></div>
18863<div class="row g-3">
18864 <div class="col-12 col-lg-5">
18865 <div class="card-soft p-3">
18866 <div class="fw-semibold mb-2">{{ _('Create report') }}</div>
18867 <form method="post" action="{{ url_for('report_create') }}" enctype="multipart/form-data">
18868 <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
18869 <input class="form-control mb-2" name="title" placeholder="{{ _('Title') }}" required>
18870 <input class="form-control mb-2" name="subject" placeholder="{{ _('Subject') }}" required>
18871 <textarea class="form-control mb-2" name="text" rows="5" placeholder="{{ _('Text') }}" required></textarea>
18872 <input class="form-control mb-2" type="file" name="files" multiple>
18873 <button class="btn btn-accent" type="submit">{{ _('Create report') }}</button>
18874 </form>
18875 </div>
18876 </div>
18877 <div class="col-12 col-lg-7">
18878 <div class="card-soft p-3">
18879 <form method="get" class="d-flex gap-2 mb-3">
18880 <input class="form-control" name="q" value="{{ q }}" placeholder="{{ _('Search reports...') }}">
18881 <button class="btn btn-ghost" type="submit">{{ _('Search') }}</button>
18882 </form>
18883 {% for r in items %}
18884 <div class="card-soft p-3 mb-3">
18885 <div class="fw-bold">{{ r.title }}</div>
18886 <div class="small-muted">{{ _('Subject') }}: {{ r.subject }}</div>
18887 <div class="small-muted">{{ _('By') }} @{{ r.owner }} • {{ r.updated_at_local if r.updated_at_local is defined else r.updated_at }}</div>
18888 <div class="mt-2" style="white-space:pre-wrap">{{ r.text }}</div>
18889 <div class="mt-2">
18890 {% for aid in r.attachments %}<a class="btn btn-sm btn-ghost me-2 mb-2" href="{{ url_for('report_att_download', aid=aid) }}">{{ _('Attachment') }} #{{ aid }}</a>{% endfor %}
18891 </div>
18892 {% if r.owner == me or is_admin %}
18893 <details class="mt-2"><summary>{{ _('Edit report') }}</summary>
18894 <form method="post" action="{{ url_for('report_edit', rid=r.id) }}" enctype="multipart/form-data" class="mt-2">
18895 <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
18896 <input class="form-control mb-2" name="title" value="{{ r.title }}" required>
18897 <input class="form-control mb-2" name="subject" value="{{ r.subject }}" required>
18898 <textarea class="form-control mb-2" name="text" rows="4" required>{{ r.text }}</textarea>
18899 <input class="form-control mb-2" type="file" name="files" multiple>
18900 <button class="btn btn-ghost btn-sm" type="submit">{{ _('Save edit') }}</button>
18901 </form>
18902 </details>
18903 {% endif %}
18904 {% if is_admin %}
18905 <form method="post" action="{{ url_for('report_delete', rid=r.id) }}" class="mt-2" onsubmit="return confirm('{{ _('Delete report?') }}')">
18906 <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
18907 <button class="btn btn-danger btn-sm" type="submit">{{ _('Delete report') }}</button>

Callers

nothing calls this directly

Calls 5

_stories_tables_initFunction · 0.70
current_userFunction · 0.70
_stories_for_userFunction · 0.70
ensure_profile_rowFunction · 0.70
db_connectFunction · 0.70

Tested by

no test coverage detected