Skip to content

Commit

Permalink
s/dong/song/
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoff committed Jun 9, 2011
1 parent 71a9b68 commit ed008ec
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 39 deletions.
10 changes: 5 additions & 5 deletions playlist/models.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class UserProfile(models.Model):
tokens = models.IntegerField(default=0) tokens = models.IntegerField(default=0)


This comment has been minimized.

Copy link
@btipling

btipling Jun 10, 2011

80 columns! Pull request rejected!

#settings #settings
s_playlistHistory = models.IntegerField(default=10, help_text="Number of previously played dongs shown") s_playlistHistory = models.IntegerField(default=10, help_text="Number of previously played songs shown")


def __unicode__(self): return self.name def __unicode__(self): return self.name


Expand All @@ -121,18 +121,18 @@ def uploadSong(self, upload):
Song.objects.get(sha_hash=upload.info['sha_hash']) Song.objects.get(sha_hash=upload.info['sha_hash'])
except Song.DoesNotExist: pass except Song.DoesNotExist: pass
else: else:
self.user.message_set.create(message="The dong '%s' is already in the database" % upload.info['title']) self.user.message_set.create(message="The song '%s' is already in the database" % upload.info['title'])
raise DuplicateError, "song already in database" raise DuplicateError, "song already in database"


if os.path.getsize(upload.file) > settings.MAX_UPLOAD_SIZE: if os.path.getsize(upload.file) > settings.MAX_UPLOAD_SIZE:
self.user.message_set.create(message="The dong %s too big" % upload.info['title']) self.user.message_set.create(message="The song %s too big" % upload.info['title'])
raise FileTooBigError raise FileTooBigError


upload.info['uploader'] = self.user upload.info['uploader'] = self.user
s = upload.store() s = upload.store()


if s.length > settings.MAX_SONG_LENGTH: #11 mins if s.length > settings.MAX_SONG_LENGTH: #11 mins
s.ban("Autobahned because the dong is too long. Ask a mod to unban it if you want to play it.") s.ban("Autobahned because the song is too long. Ask a mod to unban it if you want to play it.")
s.save() s.save()


self.user.get_profile().uploads += 1 self.user.get_profile().uploads += 1
Expand Down Expand Up @@ -348,7 +348,7 @@ def approve(self, actioner):
return #song has gone! return #song has gone!


if self.not_music: if self.not_music:
self.song.ban("This dong is not music.") self.song.ban("This song is not music.")


def deny(self, actioner): def deny(self, actioner):
"""Deny the report""" """Deny the report"""
Expand Down
2 changes: 1 addition & 1 deletion playlist/templates/artists.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div> </div>
<ul> <ul>
{% for artist in artists.object_list %} {% for artist in artists.object_list %}
<li><a href="{% url artist artist.id %}"> {{ artist.name }}</a> ({{artist.song_count}} dong{{artist.song_count|pluralize}})</li> <li><a href="{% url artist artist.id %}"> {{ artist.name }}</a> ({{artist.song_count}} song{{artist.song_count|pluralize}})</li>
{% endfor %} {% endfor %}
</ul> </ul>


Expand Down
2 changes: 1 addition & 1 deletion playlist/templates/jsplaylist.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<tbody id='playlist'> <tbody id='playlist'>
{% if user.get_profile.tokens %} {% if user.get_profile.tokens %}
<tr><th colspan="7" class="plinfo"> <tr><th colspan="7" class="plinfo">
You have {{user.get_profile.tokens}} token{{user.get_profile.tokens|pluralize}}, so you can add extra dongs to the playlist! You have {{user.get_profile.tokens}} token{{user.get_profile.tokens|pluralize}}, so you can add extra songs to the playlist!
</th></tr> </th></tr>
{% endif %} {% endif %}
<tr><th colspan="7" id="length">{% include "pl_length.html" %}</th></tr> <tr><th colspan="7" id="length">{% include "pl_length.html" %}</th></tr>
Expand Down
2 changes: 1 addition & 1 deletion playlist/templates/pl_length.html
Original file line number Original file line Diff line number Diff line change
@@ -1,2 +1,2 @@
{% load filters %} {% load filters %}
Playlist is {{length.seconds|stom}} long with {{length.song_count}} dong{{length.song_count|pluralize}} Playlist is {{length.seconds|stom}} long with {{length.song_count}} song{{length.song_count|pluralize}}
6 changes: 3 additions & 3 deletions playlist/templates/playlist_table.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
<td class="actions"> <td class="actions">
{% if entry.favourite %} {% if entry.favourite %}
<a href='{% url playlist.views.unfavourite entry.object.song.id %}'> <a href='{% url playlist.views.unfavourite entry.object.song.id %}'>
<img src="images/heart_delete.png" title="Remove this dong from your favourites" alt="unfavourite" /> <img src="images/heart_delete.png" title="Remove this song from your favourites" alt="unfavourite" />
</a> </a>
{% else %} {% else %}
<a href='{% url playlist.views.favourite entry.object.song.id %}'> <a href='{% url playlist.views.favourite entry.object.song.id %}'>
{% if request.user.username != "Beelzebozo" %} {% if request.user.username != "Beelzebozo" %}
<img src="images/heart_add.png" title="Add this dong to your favourites" alt="favourite" /> <img src="images/heart_add.png" title="Add this song to your favourites" alt="favourite" />
{% else %} {% else %}
<img src="images/heart_add_beelz.png" title="Add this dong to your favourites" alt="favourite" /> <img src="images/heart_add_beelz.png" title="Add this song to your favourites" alt="favourite" />
{% endif %} {% endif %}
</a> </a>
{% endif %} {% endif %}
Expand Down
4 changes: 2 additions & 2 deletions playlist/templates/reports.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
{% endif %} {% endif %}
</ul> </ul>


<p> Approving this will <em>{% if report.duplicate %}merge{% else %}{% if report.corrupt %}delete{% else %}{% if report.not_music %}ban{% else %}do nothing to{% endif %}{% endif %}{% endif %}</em> this dong.</p> <p> Approving this will <em>{% if report.duplicate %}merge{% else %}{% if report.corrupt %}delete{% else %}{% if report.not_music %}ban{% else %}do nothing to{% endif %}{% endif %}{% endif %}</em> this song.</p>
<p><a href="{% url playlist.views.reports approve=report.id %}">(approve)</a> <a href="{% url playlist.views.reports deny=report.id %}">(deny)</a></p> <p><a href="{% url playlist.views.reports approve=report.id %}">(approve)</a> <a href="{% url playlist.views.reports deny=report.id %}">(deny)</a></p>




</div> </div>
{% empty %} {% empty %}
No reports at the moment. Our dongs are being very obedient. No reports at the moment. Our songs are being very obedient.
{% endfor %} {% endfor %}


</div> </div>
Expand Down
6 changes: 3 additions & 3 deletions playlist/templates/scuttle.html
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends "master.html" %} {% extends "master.html" %}


{% block title %}Dong Orphanage{% endblock %} {% block title %}Song Orphanage{% endblock %}


{% load filters %} {% load filters %}


Expand Down Expand Up @@ -39,11 +39,11 @@
{% if songs.has_previous %} {% if songs.has_previous %}
<a href="{% url playlist.views.orphans songs.previous_page_number %}">previous</a> <a href="{% url playlist.views.orphans songs.previous_page_number %}">previous</a>
{% endif %} {% endif %}
Orphaned dongs: page {{ songs.number }} of {{ songs.paginator.num_pages }} Orphaned songs: page {{ songs.number }} of {{ songs.paginator.num_pages }}
{% if songs.has_next %} {% if songs.has_next %}
<a href="{% url orphans songs.next_page_number %}">next</a> <a href="{% url orphans songs.next_page_number %}">next</a>
{% endif %} {% endif %}
<p>Click on a dong to become the uploader of it. Please only click on dongs you did actually upload for now.</p> <p>Click on a song to become the uploader of it. Please only click on songs you did actually upload for now.</p>
</div> </div>
<ul> <ul>
{% for song in songs.object_list %} {% for song in songs.object_list %}
Expand Down
2 changes: 1 addition & 1 deletion playlist/templates/search.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{% endif %} {% endif %}
{% else %} {% else %}
{% if query %} {% if query %}
<p>No exact dong/artist matches for search "{{query}}", sorry.</p> <p>No exact song/artist matches for search "{{query}}", sorry.</p>
{% endif %} {% endif %}
{% endif %} {% endif %}
</div> </div>
Expand Down
14 changes: 7 additions & 7 deletions playlist/templates/song.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@
<div style="float: right; font-size: 24px; font-weight: bold; color: grey;">{{song.id}}</div> <div style="float: right; font-size: 24px; font-weight: bold; color: grey;">{{song.id}}</div>
<table> <table>
<tr> <tr>
<th class="song" colspan="2">Dong <th class="song" colspan="2">Song
</th> </th>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<a href='{% url playlist.views.song song.id,"/edit" %}'> <a href='{% url playlist.views.song song.id,"/edit" %}'>
<img src="/images/page_edit.png" title="Edit dong info" alt="edit" /> <img src="/images/page_edit.png" title="Edit song info" alt="edit" />
</a> </a>


{% if can_delete %} {% if can_delete %}
<a href='{% url playlist.views.deletesong song.id %}'> <a href='{% url playlist.views.deletesong song.id %}'>
<img src="/images/cross.png" title="Delete dong" alt="delete" /> <img src="/images/cross.png" title="Delete song" alt="delete" />
</a> </a>
{% endif %} {% endif %}
{% if favourite %} {% if favourite %}
<a href='{% url playlist.views.unfavourite song.id %}'> <a href='{% url playlist.views.unfavourite song.id %}'>
<img src="/images/heart_delete.png" title="Unfavourite this dong" alt="unfavourite" /> <img src="/images/heart_delete.png" title="Unfavourite this song" alt="unfavourite" />
</a> </a>
{% else %} {% else %}
<a href='{% url playlist.views.favourite song.id %}'> <a href='{% url playlist.views.favourite song.id %}'>
{% if request.user.username != "Beelzebozo" %} {% if request.user.username != "Beelzebozo" %}
<img src="images/heart_add.png" title="Add this dong to your favourites" alt="favourite" /> <img src="images/heart_add.png" title="Add this song to your favourites" alt="favourite" />
{% else %} {% else %}
<img src="images/heart_add_beelz.png" title="Add this dong to your favourites" alt="favourite" /> <img src="images/heart_add_beelz.png" title="Add this song to your favourites" alt="favourite" />
{% endif %} {% endif %}
</a> </a>
{% endif %} {% endif %}
<a href='{% url playlist.views.song_report song.id %}'> <a href='{% url playlist.views.song_report song.id %}'>
<img src="images/exclamation.png" title="Report this dong" alt="report" /> <img src="images/exclamation.png" title="Report this song" alt="report" />
</a> </a>
</td> </td>
{% if edit %} {% if edit %}
Expand Down
8 changes: 4 additions & 4 deletions playlist/templates/song_report.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
<h1>Reporting {{song.artist.name}} - {{song.title}}</h1> <h1>Reporting {{song.artist.name}} - {{song.title}}</h1>
<form action="{% url playlist.views.song_report songid=song.id %}" method="post"> <form action="{% url playlist.views.song_report songid=song.id %}" method="post">
{% csrf_token %} {% csrf_token %}
<p>{{form.corrupt}} <span style="font-weight: bold;">Corrupt:</span> use if this dong cuts off or has other major problems. If you can, please upload or find a better version and report this as a duplicate instead so we don't lose any juicy statistics.</p> <p>{{form.corrupt}} <span style="font-weight: bold;">Corrupt:</span> use if this song cuts off or has other major problems. If you can, please upload or find a better version and report this as a duplicate instead so we don't lose any juicy statistics.</p>
{{form.corrupt.errors}} {{form.corrupt.errors}}
<p><span style="font-weight: bold;">Duplicate:</span> use if this dong is a duplicate of another dong (different versions of the same dong don't count). Ideally, you should report the lower-quality dong and leave the better one alone. Enter the duplicate dong's id here: {{form.duplicate}} </p> <p><span style="font-weight: bold;">Duplicate:</span> use if this song is a duplicate of another song (different versions of the same song don't count). Ideally, you should report the lower-quality song and leave the better one alone. Enter the duplicate song's id here: {{form.duplicate}} </p>
{{form.duplicate.errors}} {{form.duplicate.errors}}
<p>{{form.not_music}} <span style="font-weight: bold;">Not music:</span> use if this dong is obviously not music - essentially the only thing that qualifies for this is spoken word unless you enjoy big annoying arguments that don't achieve anything.</p> <p>{{form.not_music}} <span style="font-weight: bold;">Not music:</span> use if this song is obviously not music - essentially the only thing that qualifies for this is spoken word unless you enjoy big annoying arguments that don't achieve anything.</p>
{{form.not_music.errors}} {{form.not_music.errors}}
<p>{{form.other}} <span style="font-weight: bold;">Other:</span> use for any other reasonable issue with this dong.</p> <p>{{form.other}} <span style="font-weight: bold;">Other:</span> use for any other reasonable issue with this song.</p>
<p>Any further comments or explanation? {{form.user_note}}</p> <p>Any further comments or explanation? {{form.user_note}}</p>
{{form.user_note.errors}} {{form.user_note.errors}}
<input type="submit" value="Submit" /> <input type="submit" value="Submit" />
Expand Down
10 changes: 5 additions & 5 deletions playlist/templates/stats.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
{% block main %} {% block main %}
<div class="playlist"> <div class="playlist">


<p><span class="bold">Dongs in database:</span> {{totaldongs}} </p> <p><span class="bold">Songs in database:</span> {{totaldongs}} </p>
<p><span class="bold">Additions to the playlist:</span> {{totaladds}} </p> <p><span class="bold">Additions to the playlist:</span> {{totaladds}} </p>
<p><span class="bold">Unplayed dongs:</span> {{unplayeddongs}} </p> <p><span class="bold">Unplayed songs:</span> {{unplayeddongs}} </p>
<p><span class="bold">Registered users:</span> {{totalusers}} </p> <p><span class="bold">Registered users:</span> {{totalusers}} </p>




{% if populardongs %} {% if populardongs %}
<p>Most added dongs:</p> <p>Most added songs:</p>
<ul> <ul>
{% for dong in populardongs %} {% for dong in populardongs %}
<li>{{dong}} - {{dong.totaladds}}</li> <li>{{dong}} - {{dong.totaladds}}</li>
Expand All @@ -22,7 +22,7 @@
{% endif %} {% endif %}


{% if votedhidongs %} {% if votedhidongs %}
<p>Highest-rated dongs:</p> <p>Highest-rated songs:</p>
<ul> <ul>
{% for dong in votedhidongs %} {% for dong in votedhidongs %}
<li>{{dong}} - {{dong.avgscore}}</li> <li>{{dong}} - {{dong.avgscore}}</li>
Expand All @@ -32,7 +32,7 @@
{% endif %} {% endif %}


{% if votedlodongs %} {% if votedlodongs %}
<p>Lowest-rated dongs:</p> <p>Lowest-rated songs:</p>
<ul> <ul>
{% for dong in votedlodongs %} {% for dong in votedlodongs %}
<li>{{dong}} - {{dong.avgscore}}</li> <li>{{dong}} - {{dong.avgscore}}</li>
Expand Down
4 changes: 2 additions & 2 deletions playlist/templates/user.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<p><span class="bold">User status:</span> {{owner.groups.all.0.name}}</p> <p><span class="bold">User status:</span> {{owner.groups.all.0.name}}</p>
<p><span class="bold">Comments written:</span> {{numcomments}}</p> <p><span class="bold">Comments written:</span> {{numcomments}}</p>
<p><span class="bold">Number of uploads:</span> {{owner.uploads.count}}</p> <p><span class="bold">Number of uploads:</span> {{owner.uploads.count}}</p>
<p><span class="bold">Number of dongs added to the playlist:</span> {{useradds}}</p> <p><span class="bold">Number of songs added to the playlist:</span> {{useradds}}</p>
{% if owner.id == viewer %} {% if owner.id == viewer %}
<p><span class="bold">Number of times your uploads have been added by others:</span> {{otheradds}}</p> <p><span class="bold">Number of times your uploads have been added by others:</span> {{otheradds}}</p>
{% else %} {% else %}
<p><span class="bold">Number of times user's uploads have been added by others:</span> {{otheradds}}</p> <p><span class="bold">Number of times user's uploads have been added by others:</span> {{otheradds}}</p>
{% endif %} {% endif %}
<p><span class="bold">Number of tokens:</span> {{owner.get_profile.tokens}}</p> <p><span class="bold">Number of tokens:</span> {{owner.get_profile.tokens}}</p>
<p><span class="bold">Average score for uploaded dongs:</span> {{uploadavg}}</p> <p><span class="bold">Average score for uploaded songs:</span> {{uploadavg}}</p>


<p> <p>
<a id="menuitem" href="{% url playlist.views.search %}?query=favourites%3D{{owner.username}}"> <a id="menuitem" href="{% url playlist.views.search %}?query=favourites%3D{{owner.username}}">
Expand Down
8 changes: 4 additions & 4 deletions playlist/views.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ def song_report(request, songid):
report.song = song report.song = song
report.reporter = request.user report.reporter = request.user
report.save() report.save()
request.user.message_set.create(message="Dong successfully reported.") request.user.message_set.create(message="Song successfully reported.")
return HttpResponseRedirect(reverse('song', kwargs={'songid': songid})) return HttpResponseRedirect(reverse('song', kwargs={'songid': songid}))
else: else:
for field in report_form: for field in report_form:
Expand Down Expand Up @@ -1079,9 +1079,9 @@ def add(request, songid=0):


if oldtokens != profile.tokens: if oldtokens != profile.tokens:
if profile.tokens: if profile.tokens:
msg = "You already had a dong on the playlist, so you've used up a token to add this one. You have %d left" % (profile.tokens) msg = "You already had a song on the playlist, so you've used up a token to add this one. You have %d left" % (profile.tokens)
else: else:
msg = "You already had a dong on the playlist, so you've used up a token to add this one. That was your last one!" msg = "You already had a song on the playlist, so you've used up a token to add this one. That was your last one!"
if not isajax: if not isajax:
request.user.message_set.create(message=msg) request.user.message_set.create(message=msg)
else: else:
Expand All @@ -1092,7 +1092,7 @@ def add(request, songid=0):
if song.isOrphan(): if song.isOrphan():
song.uploader = request.user song.uploader = request.user
song.save() song.save()
msg = "This dong was an orphan, so you have automatically adopted it. Take good care of it!" msg = "This song was an orphan, so you have automatically adopted it. Take good care of it!"
if isajax: if isajax:
toret.append(msg) toret.append(msg)
else: else:
Expand Down

0 comments on commit ed008ec

Please sign in to comment.