Make scripts/objects lists use EvMore. Change EvMore to not justify by default.

This commit is contained in:
Griatch 2020-01-11 15:49:12 +01:00
parent b5aee2c41e
commit 69d85bd184
221 changed files with 2190 additions and 6810 deletions

View file

@ -20,9 +20,7 @@ class HelpEntryForm(forms.ModelForm):
fields = "__all__"
db_help_category = forms.CharField(
label="Help category",
initial="General",
help_text="organizes help entries in lists",
label="Help category", initial="General", help_text="organizes help entries in lists"
)
db_lock_storage = forms.CharField(
label="Locks",
@ -48,11 +46,7 @@ class HelpEntryAdmin(admin.ModelAdmin):
(
None,
{
"fields": (
("db_key", "db_help_category"),
"db_entrytext",
"db_lock_storage",
),
"fields": (("db_key", "db_help_category"), "db_entrytext", "db_lock_storage"),
"description": "Sets a Help entry. Set lock to <i>view:all()</I> unless you want to restrict it.",
},
),

View file

@ -145,8 +145,6 @@ class HelpEntryManager(TypedObjectManager):
"""
ostring = ostring.strip().lower()
if help_category:
return self.filter(
db_key__iexact=ostring, db_help_category__iexact=help_category
)
return self.filter(db_key__iexact=ostring, db_help_category__iexact=help_category)
else:
return self.filter(db_key__iexact=ostring)

View file

@ -15,10 +15,7 @@ class Migration(migrations.Migration):
(
"id",
models.AutoField(
verbose_name="ID",
serialize=False,
auto_created=True,
primary_key=True,
verbose_name="ID", serialize=False, auto_created=True, primary_key=True
),
),
(
@ -50,9 +47,7 @@ class Migration(migrations.Migration):
(
"db_lock_storage",
models.TextField(
help_text="normally view:all().",
verbose_name="locks",
blank=True,
help_text="normally view:all().", verbose_name="locks", blank=True
),
),
("db_staff_only", models.BooleanField(default=False)),
@ -65,10 +60,7 @@ class Migration(migrations.Migration):
),
),
],
options={
"verbose_name": "Help Entry",
"verbose_name_plural": "Help Entries",
},
options={"verbose_name": "Help Entry", "verbose_name_plural": "Help Entries"},
bases=(models.Model,),
)
]

View file

@ -12,9 +12,7 @@ class Migration(migrations.Migration):
model_name="helpentry",
name="db_entrytext",
field=models.TextField(
blank=True,
help_text="the main body of help text",
verbose_name="help entry",
blank=True, help_text="the main body of help text", verbose_name="help entry"
),
),
migrations.AlterField(
@ -31,10 +29,7 @@ class Migration(migrations.Migration):
model_name="helpentry",
name="db_key",
field=models.CharField(
help_text="key to search for",
max_length=255,
unique=True,
verbose_name="help key",
help_text="key to search for", max_length=255, unique=True, verbose_name="help key"
),
),
migrations.AlterField(

View file

@ -68,9 +68,7 @@ class HelpEntry(SharedMemoryModel):
"help entry", blank=True, help_text="the main body of help text"
)
# lock string storage
db_lock_storage = models.TextField(
"locks", blank=True, help_text="normally view:all()."
)
db_lock_storage = models.TextField("locks", blank=True, help_text="normally view:all().")
# tags are primarily used for permissions
db_tags = models.ManyToManyField(
Tag,
@ -141,8 +139,7 @@ class HelpEntry(SharedMemoryModel):
"""
content_type = ContentType.objects.get_for_model(self.__class__)
return reverse(
"admin:%s_%s_change" % (content_type.app_label, content_type.model),
args=(self.id,),
"admin:%s_%s_change" % (content_type.app_label, content_type.model), args=(self.id,)
)
@classmethod
@ -205,10 +202,7 @@ class HelpEntry(SharedMemoryModel):
try:
return reverse(
"%s-detail" % slugify(self._meta.verbose_name),
kwargs={
"category": slugify(self.db_help_category),
"topic": slugify(self.db_key),
},
kwargs={"category": slugify(self.db_help_category), "topic": slugify(self.db_key)},
)
except Exception as e:
print(e)
@ -243,10 +237,7 @@ class HelpEntry(SharedMemoryModel):
try:
return reverse(
"%s-update" % slugify(self._meta.verbose_name),
kwargs={
"category": slugify(self.db_help_category),
"topic": slugify(self.db_key),
},
kwargs={"category": slugify(self.db_help_category), "topic": slugify(self.db_key)},
)
except:
return "#"
@ -279,10 +270,7 @@ class HelpEntry(SharedMemoryModel):
try:
return reverse(
"%s-delete" % slugify(self._meta.verbose_name),
kwargs={
"category": slugify(self.db_help_category),
"topic": slugify(self.db_key),
},
kwargs={"category": slugify(self.db_help_category), "topic": slugify(self.db_key)},
)
except:
return "#"