diff --git a/docs/index.rst b/docs/index.rst index 9cd46b86cbf..10140ba7601 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -142,7 +142,7 @@ out of your documentation and Read the Docs. * **Advanced project configuration**: :doc:`subprojects` | - :doc:`Single version docs ` | + :doc:`Single version docs ` * **Multi-language documentation**: :doc:`Translations and localization ` @@ -170,7 +170,6 @@ out of your documentation and Read the Docs. subprojects single_version - privacy localization diff --git a/docs/privacy.rst b/docs/privacy.rst deleted file mode 100644 index b1321558668..00000000000 --- a/docs/privacy.rst +++ /dev/null @@ -1,36 +0,0 @@ -Privacy Levels -============== - -.. note:: - For private documentation or docs from private repositories, - use :doc:`Read the Docs for Business `. - -Read the Docs supports 3 different privacy levels on 2 different objects; -Public, Private on Projects and Versions. - -Understanding the Privacy Levels --------------------------------- - -+------------+------------+-----------+-----------+-------------+ -| Level | Detail | Listing | Search | Viewing | -+============+============+===========+===========+=============+ -| Private | No | No | No | Yes | -+------------+------------+-----------+-----------+-------------+ -| Public | Yes | Yes | Yes | Yes | -+------------+------------+-----------+-----------+-------------+ - -.. note:: With a URL to view the actual documentation, even private docs are viewable. - This is because our architecture doesn't do any logic on documentation display, - to increase availability. - -Public -~~~~~~ - -This is the easiest and most obvious. It is also the default. -It means that everything is available to be seen by everyone. - -Private -~~~~~~~ - -Private objects are available only to people who have permissions to see them. -They will not display on any list view, and will 404 when you link them to others. diff --git a/docs/versions.rst b/docs/versions.rst index e5a18ae989e..1a8fa707783 100644 --- a/docs/versions.rst +++ b/docs/versions.rst @@ -85,13 +85,32 @@ any user with a link to its docs would be able to see it. This is useful when: - You no longer support a version, but you don't want to remove its docs. -- You have a work in progress version and don't want to publish its docs just yet. +- You have a work in progress version and don't want to publish its docs just yet. .. note:: Active versions that are hidden will be listed as ``Disallow: /path/to/version/`` in the default `robots.txt file `__ created by Read the Docs. +Privacy levels +-------------- + +.. note:: + + Privacy levels are only supported on :doc:`/commercial/index`. + +Public +~~~~~~ + +It means that everything is available to be seen by everyone. + +Private +~~~~~~~ + +Private versions are available only to people who have permissions to see them. +They will not display on any list view, and will 404 when you link them to others. +If you want to share your docs temporarily, see :doc:`/commercial/sharing`. + Tags and branches ----------------- @@ -112,7 +131,6 @@ Version Control Support Matrix | Default | master | default | | trunk | +------------+------------+-----------+------------+-----------+ - Version warning --------------- @@ -130,4 +148,4 @@ When a user hits the root URL for your documentation, for example ``http://pip.readthedocs.io/``, they will be redirected to the **Default version**. This defaults to **latest**, -but could also point to your latest released version. \ No newline at end of file +but could also point to your latest released version. diff --git a/readthedocs/api/v3/tests/test_projects.py b/readthedocs/api/v3/tests/test_projects.py index d9998d32041..381f36a9d1c 100644 --- a/readthedocs/api/v3/tests/test_projects.py +++ b/readthedocs/api/v3/tests/test_projects.py @@ -131,7 +131,6 @@ def test_import_project(self): self.assertEqual(project.repo, 'https://github.com/rtfd/template') self.assertEqual(project.language, 'en') self.assertEqual(project.programming_language, 'py') - self.assertEqual(project.privacy_level, 'public') self.assertEqual(project.project_url, 'http://template.readthedocs.io/') self.assertIn(self.me, project.users.all()) self.assertEqual(project.builds.count(), 1) @@ -201,7 +200,6 @@ def test_update_project(self): 'homepage': 'https://updated-homepage.org', 'default_version': 'stable', 'default_branch': 'updated-default-branch', - 'privacy_level': 'private', 'analytics_code': 'UA-XXXXXX', 'show_version_warning': False, 'single_version': True, @@ -229,7 +227,6 @@ def test_update_project(self): self.assertEqual(self.project.project_url, 'https://updated-homepage.org') self.assertEqual(self.project.default_version, 'stable') self.assertEqual(self.project.default_branch, 'updated-default-branch') - self.assertEqual(self.project.privacy_level, 'public') self.assertEqual(self.project.analytics_code, 'UA-XXXXXX') self.assertEqual(self.project.show_version_warning, False) self.assertEqual(self.project.single_version, True) diff --git a/readthedocs/core/mixins.py b/readthedocs/core/mixins.py index 2780e168527..6adc330bf41 100644 --- a/readthedocs/core/mixins.py +++ b/readthedocs/core/mixins.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """Common mixin classes for views.""" from django.contrib.auth.mixins import LoginRequiredMixin diff --git a/readthedocs/projects/forms.py b/readthedocs/projects/forms.py index fcc271ce8f4..fcfc470d12d 100644 --- a/readthedocs/projects/forms.py +++ b/readthedocs/projects/forms.py @@ -14,7 +14,6 @@ from textclassifier.validators import ClassifierValidator from readthedocs.builds.constants import INTERNAL -from readthedocs.core.mixins import HideProtectedLevelMixin from readthedocs.core.utils import slugify, trigger_build from readthedocs.core.utils.extend import SettingsOverrideObject from readthedocs.integrations.models import Integration @@ -190,7 +189,7 @@ def clean_tags(self): return tags -class ProjectAdvancedForm(HideProtectedLevelMixin, ProjectTriggerBuildMixin, ProjectForm): +class ProjectAdvancedForm(ProjectTriggerBuildMixin, ProjectForm): """Advanced project option form.""" @@ -199,7 +198,6 @@ class Meta: per_project_settings = ( 'default_version', 'default_branch', - 'privacy_level', 'analytics_code', 'show_version_warning', 'single_version', diff --git a/readthedocs/rtd_tests/tests/test_project_forms.py b/readthedocs/rtd_tests/tests/test_project_forms.py index 04d1b02b846..eb0ba4ef799 100644 --- a/readthedocs/rtd_tests/tests/test_project_forms.py +++ b/readthedocs/rtd_tests/tests/test_project_forms.py @@ -1,4 +1,5 @@ from unittest import mock + from django.contrib.auth.models import User from django.test import TestCase from django.test.utils import override_settings @@ -6,11 +7,10 @@ from django_dynamic_fixture import get from textclassifier.validators import ClassifierValidator -from readthedocs.builds.constants import LATEST, STABLE, EXTERNAL +from readthedocs.builds.constants import EXTERNAL, LATEST, STABLE from readthedocs.builds.models import Version from readthedocs.projects.constants import ( PRIVATE, - PRIVACY_CHOICES, PROTECTED, PUBLIC, REPO_TYPE_GIT, @@ -274,28 +274,6 @@ def test_default_version_field_if_no_active_version(self): self.assertTrue(form.fields['default_version'].widget.attrs['readonly']) self.assertEqual(form.fields['default_version'].initial, 'latest') - def test_hide_protected_privacy_level_new_objects(self): - """ - Test PROTECTED is only allowed in old objects. - - New projects are not allowed to set the privacy level as protected. - """ - # New default object - project = get(Project) - form = ProjectAdvancedForm(instance=project) - - privacy_choices = list(PRIVACY_CHOICES) - privacy_choices.remove((PROTECTED, _('Protected'))) - self.assertEqual(form.fields['privacy_level'].choices, privacy_choices) - - # "Old" object with privacy_level previously set as protected - project = get( - Project, - privacy_level=PROTECTED, - ) - form = ProjectAdvancedForm(instance=project) - self.assertEqual(form.fields['privacy_level'].choices, list(PRIVACY_CHOICES)) - class TestProjectAdvancedFormDefaultBranch(TestCase): diff --git a/readthedocs/templates/core/project_detail_right.html b/readthedocs/templates/core/project_detail_right.html index 5b9395df09b..b47ad0c8e8d 100644 --- a/readthedocs/templates/core/project_detail_right.html +++ b/readthedocs/templates/core/project_detail_right.html @@ -97,15 +97,6 @@

{% trans "Tags" %}

{% endblock %} -{% block privacy-level %} -

{% trans "Project Privacy Level" %}

-
-

- {{ project.get_privacy_level_display }} -

-
-{% endblock %} - {% block short-urls %}

{% trans "Short URLs" %}