Skip to content

Commit 2cc701f

Browse files
Reorder and cleanup project settings page (#11470)
* Reorder and cleanup project settings page Fixes #9530 * Add comment * Add migration * Make URL scheme more clear * Make versioning scheme a bit more obvious... --------- Co-authored-by: Manuel Kaufmann <[email protected]>
1 parent f70b738 commit 2cc701f

File tree

6 files changed

+115
-20
lines changed

6 files changed

+115
-20
lines changed

docs/user/guides/setup/versioning-schemes.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
How to change the versioning scheme of your project
2-
===================================================
1+
How to change the URL versioning scheme of your project
2+
========================================================
33

44
In this guide, we show you how to change the versioning scheme of your project on Read the Docs.
55

@@ -20,5 +20,5 @@ Changing the versioning scheme
2020

2121
#. Go the :guilabel:`Admin` tab of your project.
2222
#. Click on :guilabel:`Settings`.
23-
#. Select the new versioning scheme in the :guilabel:`Versioning scheme` dropdown.
23+
#. Select the new versioning scheme in the :guilabel:`URL versioning scheme` dropdown.
2424
#. Click on :guilabel:`Save`.

docs/user/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ Learn more about our hosting features:
200200
Host your documentation in multiple languages.
201201

202202
:doc:`/versioning-schemes`
203-
Learn about different versioning schemes.
203+
Learn about different URL versioning schemes.
204204

205205
:doc:`/custom-domains`
206206
Host your documentation on your own domain.

docs/user/versioning-schemes.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
URL versioning schemes
22
======================
33

4-
The versioning scheme of your project defines the URL of your documentation,
4+
The URL versioning scheme of your project defines the URL of your documentation,
55
and if your project supports multiple versions or translations.
66

77
Read the Docs supports three different versioning schemes:

readthedocs/projects/forms.py

+16-10
Original file line numberDiff line numberDiff line change
@@ -407,30 +407,31 @@ class Meta:
407407
# Basics and repo settings
408408
"name",
409409
"repo",
410-
"repo_type",
411-
"default_branch",
412410
"language",
413-
"description",
414-
# Project related settings
415411
"default_version",
416412
"privacy_level",
417413
"versioning_scheme",
418-
"external_builds_enabled",
419-
"external_builds_privacy_level",
414+
"default_branch",
420415
"readthedocs_yaml_path",
421-
"analytics_code",
422-
"analytics_disabled",
423-
"show_version_warning",
424416
# Meta data
425417
"programming_language",
426418
"project_url",
419+
"description",
427420
"tags",
421+
# Booleans
422+
"external_builds_privacy_level",
423+
"external_builds_enabled",
424+
# Deprecated
425+
"analytics_code",
426+
"analytics_disabled",
427+
"show_version_warning",
428428
)
429429

430+
# Make description smaller, only a CharField
430431
description = forms.CharField(
431432
required=False,
432433
max_length=150,
433-
widget=forms.Textarea,
434+
help_text=_("Short description of this project"),
434435
)
435436

436437
def __init__(self, *args, **kwargs):
@@ -466,6 +467,11 @@ def __init__(self, *args, **kwargs):
466467
for field in ["privacy_level", "external_builds_privacy_level"]:
467468
self.fields.pop(field)
468469

470+
# Remove analytics from new dashboard
471+
if settings.RTD_EXT_THEME_ENABLED:
472+
for field in ["analytics_code", "analytics_disabled"]:
473+
self.fields.pop(field)
474+
469475
default_choice = (None, "-" * 9)
470476
versions_choices = (
471477
self.instance.versions(manager=INTERNAL)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Generated by Django 4.2.13 on 2024-07-15 22:05
2+
3+
from django.db import migrations, models
4+
from django_safemigrate import Safe
5+
6+
import readthedocs.projects.validators
7+
8+
9+
class Migration(migrations.Migration):
10+
safe = Safe.before_deploy
11+
dependencies = [
12+
("projects", "0124_remove_zh_locale"),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name="historicalproject",
18+
name="repo",
19+
field=models.CharField(
20+
db_index=True,
21+
help_text="Git repository URL",
22+
max_length=255,
23+
validators=[readthedocs.projects.validators.RepositoryURLValidator()],
24+
verbose_name="Repository URL",
25+
),
26+
),
27+
migrations.AlterField(
28+
model_name="historicalproject",
29+
name="versioning_scheme",
30+
field=models.CharField(
31+
choices=[
32+
(
33+
"multiple_versions_with_translations",
34+
"Multiple versions with translations (/<language>/<version>/<filename>)",
35+
),
36+
(
37+
"multiple_versions_without_translations",
38+
"Multiple versions without translations (/<version>/<filename>)",
39+
),
40+
(
41+
"single_version_without_translations",
42+
"Single version without translations (/<filename>)",
43+
),
44+
],
45+
default="multiple_versions_with_translations",
46+
help_text="This affects URL your documentation is served from, and if it supports translations or versions. Changing the versioning scheme will break your current URLs, so you might need to create a redirect.",
47+
max_length=120,
48+
null=True,
49+
verbose_name="URL versioning scheme",
50+
),
51+
),
52+
migrations.AlterField(
53+
model_name="project",
54+
name="repo",
55+
field=models.CharField(
56+
db_index=True,
57+
help_text="Git repository URL",
58+
max_length=255,
59+
validators=[readthedocs.projects.validators.RepositoryURLValidator()],
60+
verbose_name="Repository URL",
61+
),
62+
),
63+
migrations.AlterField(
64+
model_name="project",
65+
name="versioning_scheme",
66+
field=models.CharField(
67+
choices=[
68+
(
69+
"multiple_versions_with_translations",
70+
"Multiple versions with translations (/<language>/<version>/<filename>)",
71+
),
72+
(
73+
"multiple_versions_without_translations",
74+
"Multiple versions without translations (/<version>/<filename>)",
75+
),
76+
(
77+
"single_version_without_translations",
78+
"Single version without translations (/<filename>)",
79+
),
80+
],
81+
default="multiple_versions_with_translations",
82+
help_text="This affects URL your documentation is served from, and if it supports translations or versions. Changing the versioning scheme will break your current URLs, so you might need to create a redirect.",
83+
max_length=120,
84+
null=True,
85+
verbose_name="URL versioning scheme",
86+
),
87+
),
88+
]

readthedocs/projects/models.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class Project(models.Model):
257257
_("Repository URL"),
258258
max_length=255,
259259
validators=[validate_repository_url],
260-
help_text=_("Hosted documentation repository URL"),
260+
help_text=_("Git repository URL"),
261261
db_index=True,
262262
)
263263

@@ -280,16 +280,17 @@ class Project(models.Model):
280280
help_text=_("URL that documentation is expected to serve from"),
281281
)
282282
versioning_scheme = models.CharField(
283-
_("Versioning scheme"),
283+
_("URL versioning scheme"),
284284
max_length=120,
285285
default=constants.MULTIPLE_VERSIONS_WITH_TRANSLATIONS,
286286
choices=constants.VERSIONING_SCHEME_CHOICES,
287287
# TODO: remove after migration
288288
null=True,
289289
help_text=_(
290-
"This affects how the URL of your documentation looks like, "
291-
"and if it supports translations or multiple versions. "
292-
"Changing the versioning scheme will break your current URLs."
290+
"This affects URL your documentation is served from, "
291+
"and if it supports translations or versions. "
292+
"Changing the versioning scheme will break your current URLs, "
293+
"so you might need to create a redirect."
293294
),
294295
)
295296
# TODO: this field is deprecated, use `versioning_scheme` instead.

0 commit comments

Comments
 (0)