Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #29 from nthomas-mozilla/location-box

Wider location box to make it easier for humans to edit (bug 639389)
  • Loading branch information...
commit 1fcb0bb868065e17a1064d322eb45d17ab8a53ba 2 parents e8dc226 + 16b7f0c
@brandonsavage brandonsavage authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 apps/mirror/models.py
View
12 apps/mirror/models.py
@@ -2,6 +2,7 @@
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.html import escape
+from django.forms import TextInput
from product_details import product_details
@@ -10,6 +11,15 @@
LANG_CHOICES = [(key, "%s: %s" % (key, value['English']))
for key, value in product_details.languages.items()]
+# This is to get a longer input box when entering locations
+class LongDisplayCharField(models.CharField):
+ def formfield(self, **kwargs):
+ kwargs.update(
+ {"widget": TextInput(attrs={'style': 'width: 60em;'})}
+ )
+ return super(LongDisplayCharField, self).formfield(**kwargs)
+
+
class Mirror(models.Model):
"""A single mirror."""
id = models.AutoField(primary_key=True)
@@ -100,7 +110,7 @@ class Location(models.Model):
id = models.AutoField(primary_key=True)
product = models.ForeignKey('Product')
os = models.ForeignKey('OS', verbose_name='OS')
- path = models.CharField(
+ path = LongDisplayCharField(
max_length=255, help_text=(
"Always use a leading slash.<br/>"
'The placeholder :lang will be replaced with the requested '
Please sign in to comment.
Something went wrong with that request. Please try again.