People forget about mods tools (#664)
Cette révision appartient à :
Parent
66667e9f1a
révision
0613b149d9
5 fichiers modifiés avec 31 ajouts et 24 suppressions
|
@ -242,6 +242,7 @@ func TorrentEditModPanel(w http.ResponseWriter, r *http.Request) {
|
|||
uploadForm.Name = torrentJson.Name
|
||||
uploadForm.Category = torrentJson.Category + "_" + torrentJson.SubCategory
|
||||
uploadForm.Status = torrentJson.Status
|
||||
uploadForm.WebsiteLink = string(torrentJson.WebsiteLink)
|
||||
uploadForm.Description = string(torrentJson.Description)
|
||||
htv := PanelTorrentEdVbs{uploadForm, NewPanelSearchForm(), T, currentUser, form.NewErrors(), form.NewInfos(), r.URL}
|
||||
err := panelTorrentEd.ExecuteTemplate(w, "admin_index.html", htv)
|
||||
|
@ -266,6 +267,7 @@ func TorrentPostEditModPanel(w http.ResponseWriter, r *http.Request) {
|
|||
torrent.Category = uploadForm.CategoryID
|
||||
torrent.SubCategory = uploadForm.SubCategoryID
|
||||
torrent.Status = uploadForm.Status
|
||||
torrent.WebsiteLink = uploadForm.WebsiteLink
|
||||
torrent.Description = uploadForm.Description
|
||||
torrent.Uploader = nil // GORM will create a new user otherwise (wtf?!)
|
||||
db.ORM.Save(&torrent)
|
||||
|
|
|
@ -241,6 +241,7 @@ func (f *UploadForm) ExtractInfo(r *http.Request) error {
|
|||
func (f *UploadForm) ExtractEditInfo(r *http.Request) error {
|
||||
f.Name = r.FormValue(UploadFormName)
|
||||
f.Category = r.FormValue(UploadFormCategory)
|
||||
f.WebsiteLink = r.FormValue(UploadFormWebsiteLink)
|
||||
f.Description = r.FormValue(UploadFormDescription)
|
||||
f.Status, _ = strconv.Atoi(r.FormValue(UploadFormStatus))
|
||||
|
||||
|
|
|
@ -3,26 +3,26 @@
|
|||
<ul class="nav navbar-nav navbar-right badgemenu">
|
||||
<li class="dropdown">
|
||||
{{if gt .ID 0}}
|
||||
<a href="{{ genRoute "user_profile" "id" (print .ID) "username" .Username }}" class="dropdown-toggle profile-image" data-toggle="dropdown">
|
||||
<img src="https://www.gravatar.com/avatar/{{ .MD5 }}?s=50" class="img-circle special-img"> {{ .Username }} <span class="badge">{{ .GetUnreadNotifications }}</span><b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ genRoute "user_profile" "id" (print .ID) "username" .Username }}"><i class="fa fa-cog"></i> {{call $.T "profile"}}</a></li>
|
||||
<li><a href="{{ genRoute "user_notifications" }}"><i class="fa fa-cog"></i> {{ call $.T "my_notifications"}} <span class="badge">{{ .GetUnreadNotifications }}</span></a></li>
|
||||
<li><a href="{{ genRoute "user_profile_edit" "id" (print .ID) "username" .Username }}"><i class="fa fa-cog"></i> {{call $.T "settings"}}</a></li>
|
||||
<li class="divider"></li>
|
||||
{{if HasAdmin . }}<li><a href="{{ genRoute "mod_index" }}"><i class="fa fa-cog"></i> {{call $.T "moderation"}}</a></li><li class="divider"></li>{{end}}
|
||||
<li><a href="{{ genRoute "user_logout" }}"><i class="fa fa-sign-out"></i> {{ call $.T "sign_out"}}</a></li>
|
||||
</ul>
|
||||
{{ else }}
|
||||
<a href="#" class="dropdown-toggle profile-image" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="hidden-md hidden-sm">{{ call $.T "member" }}</span>
|
||||
<span class="glyphicon glyphicon-user visible-md-inline"></span>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ genRoute "user_login" }}"><i class="fa fa-sign-out"></i> {{ call $.T "sign_in"}}</a></li>
|
||||
<li><a href="{{ genRoute "user_register" }}"><i class="fa fa-cog"></i> {{ call $.T "sign_up"}}</a></li>
|
||||
</ul>
|
||||
<a href="{{ genRoute "user_profile" "id" (print .ID) "username" .Username }}" class="dropdown-toggle profile-image" data-toggle="dropdown">
|
||||
<img src="https://www.gravatar.com/avatar/{{ .MD5 }}?s=50" class="img-circle special-img"> {{ .Username }} <span class="badge">{{ .GetUnreadNotifications }}</span><b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ genRoute "user_profile" "id" (print .ID) "username" .Username }}"><i class="fa fa-cog"></i> {{call $.T "profile"}}</a></li>
|
||||
<li><a href="{{ genRoute "user_notifications" }}"><i class="fa fa-cog"></i> {{ call $.T "my_notifications"}} <span class="badge">{{ .GetUnreadNotifications }}</span></a></li>
|
||||
<li><a href="{{ genRoute "user_profile_edit" "id" (print .ID) "username" .Username }}"><i class="fa fa-cog"></i> {{call $.T "settings"}}</a></li>
|
||||
<li class="divider"></li>
|
||||
{{if HasAdmin . }}<li><a href="{{ genRoute "mod_index" }}"><i class="fa fa-cog"></i> {{call $.T "moderation"}}</a></li><li class="divider"></li>{{end}}
|
||||
<li><a href="{{ genRoute "user_logout" }}"><i class="fa fa-sign-out"></i> {{ call $.T "sign_out"}}</a></li>
|
||||
</ul>
|
||||
{{ else }}
|
||||
<a href="#" class="dropdown-toggle profile-image" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="hidden-md hidden-sm">{{ call $.T "member" }}</span>
|
||||
<span class="glyphicon glyphicon-user visible-md-inline"></span>
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ genRoute "user_login" }}"><i class="fa fa-sign-out"></i> {{ call $.T "sign_in"}}</a></li>
|
||||
<li><a href="{{ genRoute "user_register" }}"><i class="fa fa-cog"></i> {{ call $.T "sign_up"}}</a></li>
|
||||
</ul>
|
||||
{{end}}
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -64,6 +64,10 @@
|
|||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="website_link">{{call $.T "website_link"}}</label>
|
||||
<input name="website_link" id="website_link" class="form-control" type="text" value="{{.WebsiteLink}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="desc">{{call $.T "torrent_description"}}</label>
|
||||
<p class="help-block">{{call $.T "description_markdown_notice"}}</p>
|
||||
|
|
|
@ -68,15 +68,15 @@
|
|||
<label for="remake">{{call $.T "mark_as_remake"}}</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="website_link">{{call $.T "website_link"}}</label>
|
||||
<input name="website_link" id="website_link" class="form-control" type="text" value="{{.WebsiteLink}}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="desc">{{call $.T "torrent_description"}}</label>
|
||||
<p class="help-block">{{call $.T "description_markdown_notice"}}</p>
|
||||
<textarea name="desc" id="desc" class="form-control torrent-desc" rows="15">{{.Description}}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="website_link">{{call $.T "website_link"}}</label>
|
||||
<input name="website_link" id="website_link" class="form-control" type="text" value="{{.WebsiteLink}}">
|
||||
</div>
|
||||
|
||||
{{block "captcha" (makeCaptchaData .CaptchaID $.T)}}{{end}}
|
||||
|
||||
|
|
Référencer dans un nouveau ticket