Added check on userID > 0 + links are more stylish
Cette révision appartient à :
Parent
a38f79eaf5
révision
6aa6e9d95f
3 fichiers modifiés avec 29 ajouts et 9 suppressions
|
@ -26,12 +26,14 @@ func Filter(tag string, tagType string, torrentID uint) bool {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.CheckErrorWithMessage(err, "USER_NOT_FOUND: Couldn't update pantsu points!")
|
log.CheckErrorWithMessage(err, "USER_NOT_FOUND: Couldn't update pantsu points!")
|
||||||
}
|
}
|
||||||
if toDelete.Tag == tag {
|
if user.ID > 0 {
|
||||||
user.IncreasePantsu()
|
if toDelete.Tag == tag {
|
||||||
} else {
|
user.IncreasePantsu()
|
||||||
user.DecreasePantsu()
|
} else {
|
||||||
|
user.DecreasePantsu()
|
||||||
|
}
|
||||||
|
user.Update()
|
||||||
}
|
}
|
||||||
user.Update()
|
|
||||||
toDelete.Delete()
|
toDelete.Delete()
|
||||||
}
|
}
|
||||||
/* err := DeleteAllType(tagType, torrentID) // We can also delete them in batch
|
/* err := DeleteAllType(tagType, torrentID) // We can also delete them in batch
|
||||||
|
|
|
@ -1588,8 +1588,12 @@ details[open] summary:after {
|
||||||
margin-bottom:1rem;
|
margin-bottom:1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.tag-text {
|
||||||
|
margin: 2px 0.5rem;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
span.tag {
|
span.tag {
|
||||||
padding: 2px 0.5rem;
|
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
box-shadow: 0px 0px 1px 0px black;
|
box-shadow: 0px 0px 1px 0px black;
|
||||||
}
|
}
|
||||||
|
@ -1600,15 +1604,27 @@ span.tag {
|
||||||
|
|
||||||
.tag.pending {
|
.tag.pending {
|
||||||
background: #1d6d90;
|
background: #1d6d90;
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag a.tag-form.plus {
|
.tag.pending .tag-text {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag a.tag-form.plus:after {
|
||||||
content: '+';
|
content: '+';
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag a.tag-form.minus {
|
.tag a.tag-form.minus:after {
|
||||||
content: '-';
|
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 */
|
/* Language specific CSS */
|
||||||
|
|
||||||
|
|
|
@ -68,8 +68,10 @@
|
||||||
<td class="torrent-info-td torrent-info-label">{{ T("torrent_tags")}}:</td>
|
<td class="torrent-info-td torrent-info-label">{{ T("torrent_tags")}}:</td>
|
||||||
<td class="tr-flag torrent-view-td torrent-info-data">
|
<td class="tr-flag torrent-view-td torrent-info-data">
|
||||||
{{ range Torrent.Tags}}
|
{{ 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 }}
|
{{ T("tagtype_" + .Type) }}: {{ .Tag }}
|
||||||
|
</span>
|
||||||
{{ if .Accepted == false }}
|
{{ 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>
|
<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 }}
|
{{ end }}
|
||||||
|
|
Référencer dans un nouveau ticket