Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Added check on userID > 0 + links are more stylish

Cette révision appartient à :
akuma06 2017-07-31 18:29:43 +02:00
Parent a38f79eaf5
révision 6aa6e9d95f
3 fichiers modifiés avec 29 ajouts et 9 suppressions

Voir le fichier

@ -26,12 +26,14 @@ func Filter(tag string, tagType string, torrentID uint) bool {
if err != nil {
log.CheckErrorWithMessage(err, "USER_NOT_FOUND: Couldn't update pantsu points!")
}
if toDelete.Tag == tag {
user.IncreasePantsu()
} else {
user.DecreasePantsu()
if user.ID > 0 {
if toDelete.Tag == tag {
user.IncreasePantsu()
} else {
user.DecreasePantsu()
}
user.Update()
}
user.Update()
toDelete.Delete()
}
/* err := DeleteAllType(tagType, torrentID) // We can also delete them in batch

Voir le fichier

@ -1588,8 +1588,12 @@ details[open] summary:after {
margin-bottom:1rem;
}
span.tag-text {
margin: 2px 0.5rem;
display: inline-block;
}
span.tag {
padding: 2px 0.5rem;
border-radius: 1rem;
box-shadow: 0px 0px 1px 0px black;
}
@ -1600,15 +1604,27 @@ span.tag {
.tag.pending {
background: #1d6d90;
color: white;
}
.tag a.tag-form.plus {
.tag.pending .tag-text {
margin-right: 0;
}
.tag a.tag-form.plus:after {
content: '+';
}
.tag a.tag-form.minus {
.tag a.tag-form.minus:after {
content: '-';
}
.tag.pending a.tag-form {
border-top-right-radius: 1rem;
border-bottom-right-radius: 1rem;
padding: 2px 0.5rem;
display: inline-block;
background: white;
}
/* Language specific CSS */

Voir le fichier

@ -68,8 +68,10 @@
<td class="torrent-info-td torrent-info-label">{{ T("torrent_tags")}}:</td>
<td class="tr-flag torrent-view-td torrent-info-data">
{{ range Torrent.Tags}}
<span class="tag{{ if len(Torrent.Tags) > 5 }} big{{ end }}{{ if !.Accepted }} pending{{else}} accepted{{end}}" title="Tag: {{ .Type }}">
<span class="tag{{ if len(Torrent.Tags) > 5 }} big{{ end }}{{ if !.Accepted }} pending{{else}} accepted{{end}}" title="Tag: {{ .Type }} {{ if !.Accepted }}Weight: {{ .Total }}{{else}}({{ T("accepted") }}){{end}}">
<span class="tag-text">
{{ T("tagtype_" + .Type) }}: {{ .Tag }}
</span>
{{ if .Accepted == false }}
<a href="/torrent/tag/{{ if User.Tags.Contains(.) }}remove{{else}}add{{end}}?id={{Torrent.ID}}&tag={{ .Tag }}&type={{ .Type }}" class="tag-form {{ if User.Tags.Contains(.) }}minus{{else}}plus{{end}}"></a>
{{ end }}