Update buttons and css.

This commit is contained in:
snowfag 2017-05-23 01:17:18 -04:00
parent f32d1a0c64
commit ad8a5c0d1c
3 changed files with 67 additions and 42 deletions

14
nyaa/static/css/main.css Normal file → Executable file
View File

@ -256,3 +256,17 @@ a.text-purple:hover, a.text-purple:active, a.text-purple:focus { color: #a760e0;
.avatar { .avatar {
max-width: 120px; max-width: 120px;
} }
.btn-grey {
color: #000000;
background-color: #cccfd2;
border-color: #ccc;
}
.btn-grey:hover, .btn-grey:focus, .btn-grey:active, .btn-grey.active, .open > .dropdown-toggle.btn-grey {
background-color: #aaaaaa;
}
.btn span.glyphicon {
opacity: 0;
}
.btn.active span.glyphicon {
opacity: 1;

77
nyaa/templates/edit.html Normal file → Executable file
View File

@ -29,41 +29,48 @@
{{ render_field(form.information, class_='form-control', placeholder='Your website or IRC channel') }} {{ render_field(form.information, class_='form-control', placeholder='Your website or IRC channel') }}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="control-label">Torrent flags</label> <label class="control-label">Torrent flags</label><br>
<div> <div class="btn-group" data-toggle="buttons">
{% if g.user.is_moderator %} {# Only allow changing anonymous status when an uploader exists #}
<label class="btn btn-primary"> {% if torrent.uploader_id %}
{{ form.is_deleted }} <label class="btn btn-default {% if torrent.anonymous %}active{% endif %}" title="Upload torrent anonymously (don't display your username)">
Deleted {{ form.is_anonymous }}
</label> <span class="glyphicon glyphicon-ok"></span>
{% endif %} Anonymous
</label>
<label class="btn btn-default" style="background-color: darkgray; border-color: #ccc;" title="Hide torrent from listing"> {% endif %}
{{ form.is_hidden }} <label class="btn btn-grey {% if torrent.hidden %}active{% endif %}" title="Hide torrent from listing">
Hidden {{ form.is_hidden }}
</label> <span class="glyphicon glyphicon-ok"></span>
<label class="btn btn-danger" title="This torrent is derived from another release"> Hidden
{{ form.is_remake }} </label>
Remake <label class="btn btn-danger {% if torrent.remake %}active{% endif %}" title="This torrent is derived from another release">
</label> {{ form.is_remake }}
<label class="btn btn-primary" title="This torrent is a complete batch (eg. season)"> <span class="glyphicon glyphicon-ok"></span>
{{ form.is_complete }} Remake
Complete </label>
</label> <label class="btn btn-warning {% if torrent.complete %}active{% endif %}" title="This torrent is a complete batch (eg. season)">
{{ form.is_complete }}
{# Only allow changing anonymous status when an uploader exists #} <span class="glyphicon glyphicon-ok"></span>
{% if torrent.uploader_id %} Complete
<label class="btn btn-primary" title="Upload torrent anonymously (don't display your username)"> </label>
{{ form.is_anonymous }} {% if g.user.is_trusted %}
Anonymous <label class="btn btn-success {% if torrent.trusted %}active{% endif %}" title="Mark torrent trusted">
</label> {{ form.is_trusted }}
{% endif %} <span class="glyphicon glyphicon-ok"></span>
{% if g.user.is_trusted %} Trusted
<label class="btn btn-success" title="Mark torrent trusted"> </label>
{{ form.is_trusted }} {% endif %}
Trusted </div>
</label> <br><br>
{% endif %} <div class="btn-group" data-toggle="buttons">
{% if g.user.is_moderator %}
<label class="btn btn-primary {% if torrent.deleted %}active{% endif %}">
{{ form.is_deleted }}
<span class="glyphicon glyphicon-ok"></span>
Deleted
</label>
{% endif %}
</div> </div>
</div> </div>
</div> </div>

18
nyaa/templates/upload.html Normal file → Executable file
View File

@ -38,31 +38,35 @@
{{ render_field(upload_form.information, class_='form-control', placeholder='Your website or IRC channel') }} {{ render_field(upload_form.information, class_='form-control', placeholder='Your website or IRC channel') }}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label class="control-label">Torrent flags</label> <label class="control-label">Torrent flags</label><br>
<div> <div class="btn-group" data-toggle="buttons">
<label class="btn btn-primary" title="Upload torrent anonymously (don't display your username)"> <label class="btn btn-default" title="Upload torrent anonymously (don't display your username)">
{{ upload_form.is_anonymous(disabled=(False if g.user else ""), checked=(False if g.user else "")) }} {{ upload_form.is_anonymous(disabled=(False if g.user else ""), checked=(False if g.user else "")) }}
<span class="glyphicon glyphicon-ok"></span>
Anonymous Anonymous
</label> </label>
<label class="btn btn-default" style="background-color: darkgray; border-color: #ccc;" title="Hide torrent from listing"> <label class="btn btn-grey" title="Hide torrent from listing">
{{ upload_form.is_hidden }} {{ upload_form.is_hidden }}
<span class="glyphicon glyphicon-ok"></span>
Hidden Hidden
</label> </label>
<label class="btn btn-danger" title="This torrent is derived from another release"> <label class="btn btn-danger" title="This torrent is derived from another release">
{{ upload_form.is_remake }} {{ upload_form.is_remake }}
<span class="glyphicon glyphicon-ok"></span>
Remake Remake
</label> </label>
<label class="btn btn-primary" title="This torrent is a complete batch (eg. season)"> <label class="btn btn-warning" title="This torrent is a complete batch (eg. season)">
{{ upload_form.is_complete }} {{ upload_form.is_complete }}
<span class="glyphicon glyphicon-ok"></span>
Complete Complete
</label> </label>
{% if g.user.is_trusted %} {% if g.user.is_trusted %}
<label class="btn btn-success" title="Mark torrent trusted"> <label class="btn btn-success active" title="Mark torrent trusted">
{{ upload_form.is_trusted(checked="") }} {{ upload_form.is_trusted(checked="") }}
<span class="glyphicon glyphicon-ok"></span>
Trusted Trusted
</label> </label>
{% endif %} {% endif %}
</div>
</div> </div>
</div> </div>