Skip to content

Commit

Permalink
A project can be ad-free by having 'gold_owners'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfischer committed Jul 5, 2018
1 parent 8c3f75a commit dda848a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion readthedocs/doc_builder/backends/mkdocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ def generate_rtd_data(self, docs_dir, mkdocs_config):
'docroot': docs_dir,
'source_suffix': ".md",
'api_host': getattr(settings, 'PUBLIC_API_URL', 'https://readthedocs.org'),
'ad_free': self.project.ad_free or self.project.gold_owners.exists(),
'commit': self.version.project.vcs_repo(self.version.slug).commit,
'global_analytics_code': getattr(settings, 'GLOBAL_ANALYTICS_CODE', 'UA-17997319-1'),
'user_analytics_code': analytics_code,
'ad_free': self.version.project.ad_free,
}
data_json = json.dumps(readthedocs_data, indent=4)
data_ctx = {
Expand Down
9 changes: 2 additions & 7 deletions readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,10 @@ context = {
'using_theme': (html_theme == "default"),
'new_theme': (html_theme == "sphinx_rtd_theme"),
'source_suffix': SUFFIX,
'ad_free': {% if project.ad_free %}True{% else %}False{% endif %},
'ad_free': {% if project.gold_owners.exists or project.ad_free %}True{% else %}False{% endif %},
'user_analytics_code': '{{ project.analytics_code|default_if_none:'' }}',
'global_analytics_code': '{{ settings.GLOBAL_ANALYTICS_CODE }}',
{% if project.repo_type == 'git' %}
'commit': '{{ commit|slice:"8" }}',
{% else %}
'commit': '{{ commit }}',
{% endif %}

'commit': {% if project.repo_type == 'git' %}'{{ commit|slice:"8" }}'{% else %}'{{ commit }}'{% endif %},
}

{# Provide block for extending context data from child template #}
Expand Down

0 comments on commit dda848a

Please sign in to comment.