Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Sukebei colors for classic theme, subscribe link on torrent pages (#1696)

* Add files via upload

* change url of files

* Delete topbar.png

* Delete dl-link.png

* Add files via upload

* sukebei colors for classic theme

* stylisation for follow link on torrents

* Update main.css

* Update tomorrow.css

* Update follow.go

* Update profile.jet.html

* Update user.go

* Update view.jet.html

* Update view.go

* Update view.jet.html

* Update view.jet.html

* Update tomorrow.css
Cette révision appartient à :
kilo 2017-10-28 21:50:32 +02:00 révisé par GitHub
Parent 33964e017d
révision 530fd0555a
Signature inconnue de Forgejo
ID de la clé GPG: 4AEE18F83AFDEB23
11 fichiers modifiés avec 107 ajouts et 11 suppressions

Voir le fichier

@ -65,6 +65,14 @@ func ViewHandler(c *gin.Context) {
if user.NeedsCaptcha() {
captchaID = captcha.GetID()
}
if c.Request.URL.Query()["followed"] != nil {
messages.AddInfoTf("infos", "user_followed_msg", b.UploaderName)
}
if c.Request.URL.Query()["unfollowed"] != nil {
messages.AddInfoTf("infos", "user_unfollowed_msg", b.UploaderName)
}
// Display finally the view
templates.Torrent(c, b, folder, captchaID)
}

Voir le fichier

@ -16,7 +16,7 @@ func UserFollowHandler(c *gin.Context) {
currentUser := router.GetUser(c)
user, _, errorUser := users.FindForAdmin(uint(id))
if errorUser == nil && user.ID > 0 {
if !currentUser.IsFollower(user) {
if !currentUser.IsFollower(uint(id)) {
followAction = "followed"
currentUser.SetFollow(user)
} else {
@ -25,5 +25,8 @@ func UserFollowHandler(c *gin.Context) {
}
}
url := "/user/" + strconv.Itoa(int(user.ID)) + "/" + user.Username + "?" + followAction
if c.Query("id") != "" {
url = "/view/" + c.Query("id") + "?" + followAction
}
c.Redirect(http.StatusSeeOther, url)
}

Voir le fichier

@ -210,12 +210,13 @@ func (u *User) GetRole() string {
}
// IsFollower : Check if a user is following another
func (follower *User) IsFollower(u *User) bool {
func (follower *User) IsFollower(userid uint) bool {
var likingUserCount int
ORM.Model(&UserFollows{}).Where("user_id = ? and following = ?", follower.ID, u.ID).Count(&likingUserCount)
ORM.Model(&UserFollows{}).Where("user_id = ? and following = ?", follower.ID, userid).Count(&likingUserCount)
return likingUserCount != 0
}
// ToJSON : Conversion of a user model to json
func (u *User) ToJSON() UserJSON {
json := UserJSON{

Voir le fichier

@ -1129,7 +1129,24 @@ html, body {
overflow: hidden;
text-overflow: ellipsis;
}
.torrent-info-data #subscribe-link::before, .torrent-info-data #subscribe-link::after {
font-weight: normal;
color: black;
}
.torrent-info-data #subscribe-link::before {
content: '[';
}
.torrent-info-data #subscribe-link::after {
content: ']';
}
.torrent-info-data #subscribe-link {
font-weight: bold;
font-size: 13px;
}
.torrent-info-data #subscribe-link:hover {
text-decoration: underline;
}
.torrent-info-box {
border: 1px solid #ccc;
border-radius: 4px;
@ -1775,7 +1792,7 @@ input.nav-btn {
max-width: 100%;
}
.rules-drop>summary {
details>summary {
cursor: pointer;
}
@ -1799,11 +1816,12 @@ summary::-webkit-details-marker { display: none }
summary:after {
vertical-align: middle;
float: left;
margin: -1px 5px 0 0;
margin: -3px 5px 0 0;
content: "+";
width: 12px;
font-size: 1.5em;
font-weight: bold;
outline: none;
}
details[open] summary:after {
@ -2041,9 +2059,42 @@ p.upload-rules a {
margin-bottom: 2px;
z-index: 1;
}
.upload-form-table details {
margin-bottom: 4px;
}
#anidex-upload-info > div {
height: auto;
padding: 10px 6px;
border-top: none;
}
#anidex-upload-info p {
margin-bottom: 4px;
}
#anidex-upload-info p:first-child {
margin-top: 0;
}
#anidex-upload-info > div > div {
margin-left: 9px;
}
#anidex-upload-info > div input[type="text"], #anidex-upload-info > div select {
margin-bottom: 4px;
}
#anidex-upload-info > div select {
width: calc(100% - 8px);
}
#anidex-upload-info > div select[name="anidex_form_category"] option{
color: #000;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
font-size: 14px;
font-weight: bold;
}
.upload-form-table .checkbox-container+input {
width: 90%;
width: calc(100% - 21px);
width: calc(100% - 29px);
}
.upload-form-table .checkbox-container {
display: inline-block;
@ -2058,6 +2109,7 @@ p.upload-rules a {
background: #dadada;
}
#tag-h3 {
margin: 0 0 7px;
}

Voir le fichier

@ -60,6 +60,9 @@ body, .header {
a {
color: #106655;
}
.sukebei a {
color: #660000;
}
a:hover {
text-decoration: underline;
}
@ -132,7 +135,10 @@ th.tr-name a {
content: '';
}
.icon-floppy {
background: url("/img/dl-link.png") no-repeat center;
background: url("classic/dl-link.png") no-repeat center;
}
.sukebei .icon-floppy {
background: url("classic/sukebei-dl-link.png") no-repeat center;
}
.upload-tag-table .input-label {
font-size: 12px;
@ -141,7 +147,7 @@ th.tr-name a {
height: 40px;
}
.header {
background: url("/img/topbar.png") repeat-x black;
background: url("classic/topbar.png") repeat-x black;
background: linear-gradient(to bottom, #6d6d6d 0%, #000000 72%);
border-color: black;
height: 40px;
@ -237,6 +243,9 @@ select.form-input {
border: 1px solid #333333;
color: #FBFBFB;
}
.sukebei .pagination span:hover {
background-color: #993333;
}
.website-nav .pagination p {
display: none;
}
@ -441,6 +450,9 @@ span.comment-index+p a:hover {
margin-right: 6px;
float: left;
}
.sukebei .torrent-buttons a, .sukebei .torrent-buttons button {
background: linear-gradient(to bottom, #CA3346 5%, #482120 80%);
}
.torrent-buttons a.hidden {
opacity: 0.6!important;
filter: grayscale(0.7);
@ -486,6 +498,9 @@ td {
td a {
color: #106655;
}
.sukebei td a {
color: #660000;
}
td.tr-se, .success-text {
color: green;
}
@ -692,3 +707,9 @@ span.tag {
width: 128px!important;
height: 20px;
}
.sukebei .torrent-info-data #subscribe-link {
color: #660000;
}
.torrent-info-data #subscribe-link::before, .torrent-info-data #subscribe-link:: after {
color: #111111;
}

Voir le fichier

Avant

Largeur:  |  Hauteur:  |  Taille: 393 B

Après

Largeur:  |  Hauteur:  |  Taille: 393 B

Fichier binaire non affiché.

Après

Largeur:  |  Hauteur:  |  Taille: 322 B

Voir le fichier

Avant

Largeur:  |  Hauteur:  |  Taille: 228 B

Après

Largeur:  |  Hauteur:  |  Taille: 228 B

Voir le fichier

@ -346,3 +346,7 @@ span.tag {
.sukebei .admin-content tr:hover a {
color: #ea8c8c;
}
#subscribe-link::before, #subscribe-link::after {
color: #c5c8c6;
}

Voir le fichier

@ -20,7 +20,7 @@
<div class="profile-usermenu">
{{if User.ID > 0 }}
{{if !User.CurrentUserIdentical(UserProfile.ID) }}
{{if !User.IsFollower(UserProfile)}}
{{if !User.IsFollower(UserProfile.ID)}}
<a class="form-input" href="/user/{{UserProfile.ID}}/{{UserProfile.Username}}/follow" class="form-input btn-green">{{ T("follow")}}</a>
{{else}}
<a class="form-input" href="/user/{{UserProfile.ID}}/{{UserProfile.Username}}/follow" class="form-input btn-orange">{{ T("unfollow")}}</a>

Voir le fichier

@ -23,7 +23,14 @@
</tr>
<tr class="torrent-info-row">
<td class="torrent-info-td torrent-info-label">{{ T("uploaded_by") }}:</td>
<td class="torrent-view-td torrent-info-data {{if Torrent.UploaderID == 0}}uploader-anon{{else}}uploader-link{{end}}">{{ genUploaderLink(Torrent.UploaderID, Torrent.UploaderName, Torrent.Hidden)|raw }}</td>
{{if Torrent.UploaderID == 0}}
<td class="torrent-view-td torrent-info-data uploader-anon">{{ genUploaderLink(Torrent.UploaderID, Torrent.UploaderName, Torrent.Hidden)|raw }}
{{else}}
<td class="torrent-view-td torrent-info-data uploader-link">
{{ genUploaderLink(Torrent.UploaderID, Torrent.UploaderName, Torrent.Hidden)|raw }}
{{if !Torrent.Hidden && Torrent.UploaderID != User.ID && User.ID > 0}}<a href="/user/{{Torrent.UploaderID}}/{{Torrent.UploaderName}}/follow?id={{Torrent.ID}}" id="subscribe-link">{{if User.IsFollower(Torrent.UploaderID)}}{{T("unfollow")}}{{else}}{{T("follow")}}{{end}}</a>{{end}}
</td>
{{end}}
</tr>
<tr class="torrent-info-row">