123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- {% extends "layout/backend.j2" %}
- {% block content %}
- <h1>Backend</h1>
- <div class="row">
- <div class="col-sm">
- <div class="card">
- <div class="card-header">
- Pages
- <div class="float-right">
- <a href="{{ url_for('backend_page.create') }}" class="btn btn-secondary btn-sm">Create</a>
- </div>
- </div>
- <div class="card-body">
- <table class="table table-striped table-sm">
- <thead>
- <tr>
- <th>Action</th>
- <th>Title</th>
- <th>Private</th>
- <th>Author</th>
- </tr>
- </thead>
- <tbody>
- {%- for page in pages recursive -%}
- <tr>
- <td>
- <div class="btn-group">
- <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Action
- </button>
- <div class="dropdown-menu">
- <a class="dropdown-item" href="{{ url_for('backend_page.view', page_id=page.id) }}">View</a>
- <a class="dropdown-item" href="{{ url_for('backend_page.edit', page_id=page.id) }}">Edit</a>
- <a class="dropdown-item" href="{{ url_for('backend_page.remove', page_id=page.id) }}">Remove</a>
- </div>
- </div>
- </td>
- <td>
- {{ '> ' * (loop.depth - 1) }}<a href="{{ url_for('backend_page.view', page_id=page.id) }}">
- {{ page.title if page.title else 'page %s' % page.id }}
- </a>
- </td>
- <td>{{ page.private }}</td>
- <td>{{ page.user.name }}</td>
- </tr>
- {{ loop(page.children) }}
- {%- endfor -%}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-sm">
- <div class="card">
- <div class="card-header">
- Files
- <div class="float-right">
- <a href="{{ url_for('backend_file.create') }}" class="btn btn-secondary btn-sm">Upload</a>
- </div>
- </div>
- <div class="card-body">
- <table class="table table-striped table-sm">
- <thead>
- <tr>
- <th>Action</th>
- <th>Title</th>
- <th>Extension</th>
- <th>Author</th>
- </tr>
- </thead>
- <tbody>
- {% for file in files %}
- <tr>
- <td>
- <div class="btn-group">
- <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Action
- </button>
- <div class="dropdown-menu">
- <a class="dropdown-item" href="{{ url_for('backend_file.view', file_id=file.id) }}">View</a>
- <a class="dropdown-item" href="{{ url_for('backend_file.edit', file_id=file.id) }}">Edit</a>
- <a class="dropdown-item" href="{{ url_for('backend_file.remove', file_id=file.id) }}">Remove</a>
- </div>
- </div>
- </td>
- <td>
- <a href="{{ url_for('backend_file.view', file_id=file.id) }}">
- {{ file.title if file.title else 'file %s' % file.id }}
- </a>
- </td>
- <td>{{ file.extension() }}</td>
- <td>{{ file.user.name }}</td>
- </tr>
- {%- endfor -%}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-sm">
- <div class="card">
- <div class="card-header">
- Users
- </div>
- <div class="card-body">
- <table class="table table-striped table-sm">
- <thead>
- <tr>
- <th>Action</th>
- <th>Name</th>
- <th>Approved</th>
- <th>Registration</th>
- </tr>
- </thead>
- <tbody>
- {% for user in users %}
- <tr>
- <td>
- <div class="btn-group">
- <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Action
- </button>
- <div class="dropdown-menu">
- <a class="dropdown-item" href="{{ url_for('backend_user.view', user_id=user.id) }}">View</a>
- {% if not user.approved %}
- <a class="dropdown-item" href="{{ url_for('backend_user.approve', user_id=user.id) }}">Approve</a>
- {% endif %}
- </div>
- </div>
- </td>
- <td>
- <a href="{{ url_for('backend_user.view', user_id=user.id) }}">
- {{ user.name }}
- </a>
- </td>
- <td>{{ user.approved }}</td>
- <td>{{ user.registration_at }}</td>
- </tr>
- {%- endfor -%}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- {% endblock %}
|