Added custom permissions to mix (homepage & downloads)

This commit is contained in:
Fergal Moran
2014-01-09 21:21:51 +00:00
parent 4cd6471356
commit 8102f9d9d9
3 changed files with 8 additions and 3 deletions

View File

@@ -45,6 +45,11 @@ class Mix(_BaseModel):
class Meta:
app_label = 'spa'
permissions = (
("mix_add_homepage", "Can add a mix to the homepage"),
("mix_allow_download", "Can allow downloads on a mix"),
)
objects = MixManager()
title = models.CharField(max_length=150)

View File

@@ -145,7 +145,7 @@
<div class="profile-info-row">
<div class="profile-info-name"> About Me</div>
<div class="profile-info-value">
<div class="usereditable" id="about" style="display: inline; white-space:pre-wrap;"><%= description.replace(/\n/g, '<br />') %></div>
<div class="usereditable" id="about" style="display: inline; white-space:pre-wrap;"><%= description %></div>
</div>
</div>
</div>

View File

@@ -40,7 +40,7 @@
<% print(download_allowed ? 'checked="checked"' : '') %>>
<span class="lbl" for="download_allowed"></span>
</label>
{% if user.is_staff %}
{% if perms.spa.mix_add_homepage %}
<label class="inline">
<small class="muted">Homepage:</small>
<input class="ace ace-switch ace-switch-7"
@@ -53,4 +53,4 @@
{% endif %}
</div>
</div>
</form>
</form>