Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,25 @@ def get_dict(self, constant):
"fields": {
"id": 2,
"name": "Kolibri Studio (Debug Mode)",
"domain": "127.0.0.1:8000",
"domain": "127.0.0.1:8080",
},
},
{
"model": Site,
"pk": "id",
"fields": {
"id": 3,
"name": "Kolibri Studio (Develop)",
"domain": "develop.contentworkshop.learningequality.org",
"name": "Kolibri Studio (Develop/Unstable)",
"domain": "unstable.studio.learningequality.org",
},
},
{
"model": Site,
"pk": "id",
"fields": {
"id": 4,
"name": "Kolibri Studio (Hotfixes)",
"domain": "hotfixes.studio.learningequality.org",
},
},
]
Expand Down
7 changes: 6 additions & 1 deletion contentcuration/contentcuration/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ def gettext(s):
# ('en-PT', gettext('English - Pirate')),
)

SITE_BY_ID = {
'master': 1,
'unstable': 3,
'hotfixes': 4,
}

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
Expand All @@ -310,7 +315,7 @@ def gettext(s):

ACCOUNT_ACTIVATION_DAYS = 7
REGISTRATION_OPEN = True
SITE_ID = 1
SITE_ID = SITE_BY_ID.get(os.getenv('BRANCH_ENVIRONMENT'), 1)

# Used for serializing datetime objects.
DATE_TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,32 +86,40 @@
<p class="message-channel-name">{% translate "Welcome to Kolibri Studio!" %}</p>
</div>
<div class="greeting">
<p>
{% blocktranslate %}
We're delighted to introduce you to <a href="{{ domain }}">Kolibri Studio</a>, our curricular tool to add,
organize, and manage your own resources or those from the Kolibri Content Library.
{% endblocktranslate %}
<a href="{{ domain }}/channels/#/public">
{% translate "View the Kolibri Content Library" %}
</a>
</p>
<br>
</div>
<div class="function-container">
<p>
{% blocktranslate %}
Using Kolibri Studio, you can explore pre-organized collections of open educational resources (OER), and bundle,
tag, differentiate, re-order, and distribute them into custom channels.
{% endblocktranslate %}
</p>
<br/>
<p>
{% blocktranslate %}
Using an admin account, you can then publish and import these custom channels--either your own or those shared
with you -- into Kolibri with a unique "token" generated for each channel.
{% endblocktranslate %}
</p>
<br>
</div>
<div>
<p>
{% blocktranslate %}
Browse through the list of resources below* to learn more about Kolibri Studio and to begin creating your own
custom channels:
{% endblocktranslate %}
</p>
<ul>
<li>
<a href="https://kolibri-studio.readthedocs.io/en/latest/index.html">
Expand Down Expand Up @@ -142,7 +150,7 @@
<li>
<b>{% translate "Slide gif format:" %}</b>
<a
href="https://docs.google.com/presentation/d/1diRou-RYk7-gYkpMCDB5zs9C7Ywo_qifH0l78nvwVCY/edit#slide=id.g8b5cff85a9_0_78"
href="https://docs.google.com/presentation/d/e/2PACX-1vRLHvRytsoLdOCv5EMlm5_KRKYHdtwpt_FUkC3sLeW5L12Tw9KZj5GA6klbq8dQB1nVtEBGn73GZsU9/pub?start=true&loop=true&delayms=30000&slide=id.g6b950d4fd1_0_360"
>
<b>{% translate "Step by step Studio tutorial" %}</b>
</a>
Expand Down
13 changes: 6 additions & 7 deletions contentcuration/contentcuration/views/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ def send_invitation_email(request):
'channel_id': channel_id,
'invitation_key': invitation.id,
'channel': channel.name,
'domain': request.META.get('HTTP_ORIGIN') or "https://{}".format(
request.get_host() or Site.objects.get_current().domain),
'domain': "https://{}".format(Site.objects.get_current().domain),
}
subject = render_to_string('permissions/permissions_email_subject.txt', ctx_dict)
message = render_to_string('permissions/permissions_email.txt', ctx_dict)
Expand Down Expand Up @@ -255,7 +254,10 @@ def activate(self, *args, **kwargs):
)
# Send email to welcome new user
subject = render_to_string("registration/welcome_new_user_email_subject.txt")
message = render_to_string("registration/welcome_new_user_email.html", {})
message = render_to_string(
"registration/welcome_new_user_email.html",
{"domain": "https://{}".format(Site.objects.get_current().domain)}
)
user.email_user(
subject,
message,
Expand All @@ -271,12 +273,9 @@ class UserPasswordResetView(PasswordResetView):
http_method_names = ["post"]

def post(self, request):
protocol = "https" if request.is_secure() else "http"
site = request.get_host() or Site.objects.get_current().domain
email_context = {
"site": get_current_site(request),
"domain": request.META.get("HTTP_ORIGIN")
or "{}://{}".format(protocol, site),
"domain": "https://{}".format(Site.objects.get_current().domain),
}
form = self.form_class(json.loads(request.body))
if form.is_valid():
Expand Down