This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push:
new f39f0e5 discourse integration
f39f0e5 is described below
commit f39f0e50f1f1a475003a12e5019a201785e3b758
Author: Miroslav Suchý <msuchy(a)redhat.com>
AuthorDate: Fri Aug 10 13:58:59 2018 +0200
discourse integration
Signed-off-by: Miroslav Suchý <msuchy(a)redhat.com>
---
docker/frontend/files/etc/copr/copr.conf | 4 ++++
frontend/coprs_frontend/config/copr.conf | 4 ++++
frontend/coprs_frontend/config/copr_devel.conf | 4 ++++
frontend/coprs_frontend/coprs/config.py | 2 ++
.../coprs/templates/coprs/detail/overview.html | 19 +++++++++++++++++++
5 files changed, 33 insertions(+)
diff --git a/docker/frontend/files/etc/copr/copr.conf
b/docker/frontend/files/etc/copr/copr.conf
index 6bc1eaf..fb75001 100644
--- a/docker/frontend/files/etc/copr/copr.conf
+++ b/docker/frontend/files/etc/copr/copr.conf
@@ -128,3 +128,7 @@ OPENID_PROVIDER_URL = "https://id.fedoraproject.org"
# When the data in EOL chroots should be deleted (in days)
DELETE_EOL_CHROOTS_AFTER = 180
+
+# enable Discourse integration
+ENABLE_DISCUSSION = False
+# DISCOURSE_URL = "https://discussion.fedoraproject.org/"
diff --git a/frontend/coprs_frontend/config/copr.conf
b/frontend/coprs_frontend/config/copr.conf
index 4496b7d..dd2ed09 100644
--- a/frontend/coprs_frontend/config/copr.conf
+++ b/frontend/coprs_frontend/config/copr.conf
@@ -118,3 +118,7 @@ REDIS_PORT = 6379
# # Description sometimes put into template to make clear what we point to
# 'user_desc': 'FAS account'
# }
+
+# enable Discourse integration
+ENABLE_DISCUSSION = False
+# DISCOURSE_URL = "https://discussion.fedoraproject.org/"
diff --git a/frontend/coprs_frontend/config/copr_devel.conf
b/frontend/coprs_frontend/config/copr_devel.conf
index e52916b..087f093 100644
--- a/frontend/coprs_frontend/config/copr_devel.conf
+++ b/frontend/coprs_frontend/config/copr_devel.conf
@@ -63,3 +63,7 @@ BLACKLISTED_GROUPS = ['fedorabugs', 'packager',
'provenpackager']
# Hide page parts not relevant to this Copr instance:
# LAYOUT_OVERVIEW_HIDE_QUICK_ENABLE = False
+
+# enable Discourse integration
+ENABLE_DISCUSSION = False
+# DISCOURSE_URL = "https://discussion.fedoraproject.org/"
diff --git a/frontend/coprs_frontend/coprs/config.py
b/frontend/coprs_frontend/coprs/config.py
index 8f77484..3e56df4 100644
--- a/frontend/coprs_frontend/coprs/config.py
+++ b/frontend/coprs_frontend/coprs/config.py
@@ -90,6 +90,8 @@ class Config(object):
# How many pinned projects a user or group can have
PINNED_PROJECTS_LIMIT = 4
+ ENABLE_DISCUSSION = False
+ DISCOURSE_URL = ''
class ProductionConfig(Config):
DEBUG = False
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
index de9688f..378bf3a 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -81,6 +81,24 @@
{% endfor %}
</ul>
{% endif %}
+
+ {% if config.ENABLE_DISCUSSION %}
+ {% if config.DISCOURSE_URL %}
+ <div id='discourse-comments'></div>
+
+ <script type="text/javascript">
+ DiscourseEmbed = { discourseUrl: '{{ config.DISCUSSION_URL }}',
+ discourseEmbedUrl: '{{
copr_url('coprs_ns.copr_detail', copr, _external=True) }}' };
+
+ (function() {
+ var d = document.createElement('script'); d.type =
'text/javascript'; d.async = true;
+ d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
+ (document.getElementsByTagName('head')[0] ||
document.getElementsByTagName('body')[0]).appendChild(d);
+ })();
+ </script>
+ {% endif %}
+ {% endif %}
+
</div>
<div class="col-sm-4 col-md-3">
<br>
@@ -208,4 +226,5 @@
</script>
{% endfor %}
+
{% endblock %}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date