# Generated by Django 3.2.19 on 2023-05-24 12:57

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models


class Migration(migrations.Migration):
    dependencies = [
        ("press", "0031_press_journal_footer_text"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("repository", "0036_repository_support_copy_paste"),
    ]

    operations = [
        migrations.CreateModel(
            name="HistoricalRepository",
            fields=[
                (
                    "id",
                    models.IntegerField(
                        auto_created=True, blank=True, db_index=True, verbose_name="ID"
                    ),
                ),
                (
                    "domain",
                    models.CharField(
                        blank=True, db_index=True, max_length=255, null=True
                    ),
                ),
                (
                    "is_secure",
                    models.BooleanField(
                        default=False,
                        help_text="If the site should redirect to HTTPS, mark this.",
                    ),
                ),
                (
                    "support_copy_paste",
                    models.BooleanField(
                        default=True,
                        help_text="Turn this on if copy-pasting content from a word processor, or using the toolbar to format text. It tells Janeway to clear out formatting that does not play nice. Turn it off and leave it off if anyone has added custom HTML or CSS using the code view, since it might remove custom code.",
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                (
                    "short_name",
                    models.CharField(
                        help_text="Shortened version of the name eg. olh. Max 15 chars.",
                        max_length=15,
                    ),
                ),
                (
                    "object_name",
                    models.CharField(
                        help_text="eg. preprint or article", max_length=255
                    ),
                ),
                (
                    "object_name_plural",
                    models.CharField(
                        help_text="eg. preprints or articles", max_length=255
                    ),
                ),
                ("logo", models.TextField(blank=True, max_length=100, null=True)),
                ("favicon", models.TextField(blank=True, max_length=100, null=True)),
                (
                    "hero_background",
                    models.TextField(blank=True, max_length=100, null=True),
                ),
                (
                    "publisher",
                    models.CharField(
                        help_text="Used for outputs including DC and Citation metadata",
                        max_length=255,
                    ),
                ),
                (
                    "custom_js_code",
                    models.TextField(
                        blank=True,
                        help_text="The contents of this field are output into the JS areaat the foot of every Repository page.",
                        null=True,
                    ),
                ),
                (
                    "live",
                    models.BooleanField(
                        default=False, verbose_name="Repository is Live?"
                    ),
                ),
                (
                    "limit_upload_to_pdf",
                    models.BooleanField(
                        default=False,
                        help_text="If set to True, this will require all file uploads fromauthors to be PDF files.",
                    ),
                ),
                ("about", models.TextField(blank=True, null=True)),
                (
                    "start",
                    models.TextField(
                        blank=True, null=True, verbose_name="Submission Start Text"
                    ),
                ),
                (
                    "file_upload_help",
                    models.TextField(
                        blank=True,
                        help_text="Add any information that the author may need to know as part of the file upload process.",
                        null=True,
                        verbose_name="File Upload Help",
                    ),
                ),
                (
                    "require_pdf_help",
                    models.TextField(
                        blank=True,
                        default="requires that all author uploads be PDF files.",
                        help_text="When a repository requires that all manuscripts be PDF this text is combined with the repository name and displayed with the default text it would diplay: RepositoryName requires that all author uploads be PDF files.",
                        null=True,
                        verbose_name="Limit Upload to PDF Help",
                    ),
                ),
                ("submission", models.TextField(blank=True, null=True)),
                ("publication", models.TextField(blank=True, null=True)),
                ("decline", models.TextField(blank=True, null=True)),
                ("accept_version", models.TextField(blank=True, null=True)),
                ("decline_version", models.TextField(blank=True, null=True)),
                ("new_comment", models.TextField(blank=True, null=True)),
                ("review_invitation", models.TextField(blank=True, null=True)),
                ("review_helper", models.TextField(blank=True, null=True)),
                (
                    "manager_review_status_change",
                    models.TextField(blank=True, null=True),
                ),
                (
                    "reviewer_review_status_change",
                    models.TextField(blank=True, null=True),
                ),
                (
                    "footer",
                    models.TextField(
                        blank=True, default="<p>Powered by Janeway</p>", null=True
                    ),
                ),
                (
                    "login_text",
                    models.TextField(
                        blank=True,
                        help_text="If text is added it will display on the login and register pages.",
                        null=True,
                        verbose_name="Account Page Text",
                    ),
                ),
                (
                    "submission_agreement",
                    models.TextField(
                        default="<p>Authors grant us the right to publish, on this website, their uploaded manuscript, supplementary materials and any supplied metadata.</p>",
                        help_text="Add any information that the author may need to know as part of their submission, eg. Copyright transfer etc.'",
                        null=True,
                    ),
                ),
                ("random_homepage_preprints", models.BooleanField(default=False)),
                (
                    "limit_access_to_submission",
                    models.BooleanField(
                        default=False,
                        help_text="If enabled, users need to request access to submit preprints.",
                    ),
                ),
                (
                    "submission_access_request_text",
                    models.TextField(
                        blank=True,
                        help_text="Describe any supporting information you want users to supply when requestingaccess permissions for this repository. Linked to Limit Access to Submissions.",
                        null=True,
                    ),
                ),
                (
                    "submission_access_contact",
                    models.EmailField(
                        blank=True,
                        help_text="Will be notified of new submission access requests.",
                        max_length=254,
                        null=True,
                    ),
                ),
                ("history_id", models.AutoField(primary_key=True, serialize=False)),
                ("history_date", models.DateTimeField(db_index=True)),
                ("history_change_reason", models.CharField(max_length=100, null=True)),
                (
                    "history_type",
                    models.CharField(
                        choices=[("+", "Created"), ("~", "Changed"), ("-", "Deleted")],
                        max_length=1,
                    ),
                ),
                (
                    "history_user",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "press",
                    models.ForeignKey(
                        blank=True,
                        db_constraint=False,
                        null=True,
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="+",
                        to="press.press",
                    ),
                ),
            ],
            options={
                "verbose_name": "historical repository",
                "verbose_name_plural": "historical repositories",
                "ordering": ("-history_date", "-history_id"),
                "get_latest_by": ("history_date", "history_id"),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
