learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
456 stars 306 forks source link

Display custom welcome message for admins. #5529

Closed mrpau-eugene closed 6 years ago

mrpau-eugene commented 6 years ago

Summary

Displays a custom welcome message to the admin after their first login, given that they modify the ~/.kalite/settings.py first..

image

TODO

If not all TODOs are marked, this PR is considered WIP (work in progress)

Issues addressed

5522

codecov[bot] commented 6 years ago

Codecov Report

Merging #5529 into 0.17.x will increase coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           0.17.x    #5529      +/-   ##
==========================================
+ Coverage   62.77%   62.79%   +0.01%     
==========================================
  Files         117      117              
  Lines        6555     6558       +3     
==========================================
+ Hits         4115     4118       +3     
  Misses       2440     2440
Impacted Files Coverage Δ
kalite/distributed/custom_context_processors.py 100% <ø> (ø) :arrow_up:
kalite/facility/api_resources.py 95.31% <100%> (+0.11%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f862026...b2e7a0a. Read the comment docs.

benjaoming commented 6 years ago

Great work!

We need to write a custom welcome message that isn't about RACHEL, I'll get a hold of the imps team and request that they write it, since they might be opinionated about it.

First draft:

Need help?

KA Lite is community-driven and relies on help and experience which you can both share and receive in our community.

  • Offline help: Use the "Docs" button in the top menu to get help

Online help:

Notice that the URLs of the links appear in the text -- this is on purpose.

jamalex commented 6 years ago

Are we going to show this message unconditionally, whether or not they have internet? Given the fact that most RACHEL usage is totally offline (and doesn't need to go online for setup, as the videos are preloaded), would it be better to frame the message differently if no internet is available and the links won't work?

For the default (non-RACHEL) admin login, there's a greater chance the first install will be online (to load videos), but still not necessarily the case.

laurenlichtman commented 6 years ago

I'm not sure if we need a RACHEL-specific version. One of the reasons we did this was to also learn about how people are using KA Lite and/or add it to the map. I've added LE so it makes sense "why LE" is in the links. @jamalex I made a small edit to address your concern. Open to thoughts.

Suggested edit cc: @jeepurs:

You are running an instance of KA Lite, developed by the edtech nonprofit organization, Learning Equality. KA Lite is community-driven and relies on help and experience from our online community.

benjaoming commented 6 years ago

@laurenlichtman

I'm not sure if we need a RACHEL-specific version.

It's configurable, so anyone can setup their own welcome message... RACHEL was the specific case for this because of a concern that we get a lot of RACHEL-specific support questions, so we'll ask them to customize this message in their devices.

benjaoming commented 6 years ago

@jamalex

would it be better to frame the message differently if no internet is available and the links won't work

That's why the URLs are displayed - regardless, we are only showing the message on the first login. Deployments with preseeded databases might have already set the flag so the message doesn't get displayed.

benjaoming commented 6 years ago

Made some amendments to above suggestion...

@jamalex changed the text so it's addressing both on and offline scenarios

@laurenlichtman I've added the map as the first item, it should totally be there, thanks

jeepurs commented 6 years ago

@benjaoming does that mean the default is non-RACHEL and that the RACHEL users will have to configure it?

It's configurable, so anyone can setup their own welcome message

benjaoming commented 6 years ago

@jeepurs

@benjaoming does that mean the default is non-RACHEL and that the RACHEL users will have to configure it?

Yes -- just not the RACHEL users per say, but the pre-configuration that RACHEL ships with should contain a different welcome message that they decide and design for their wishes.

mrpau-eugene commented 6 years ago

@benjaoming is this supposed to be the default message for non-RACHEL users?

Need help?

KA Lite is community-driven and relies on help and experience which you can both share and receive in our community.

  • Offline help: Use the "Docs" button in the top menu to get help

Online help:

benjaoming commented 6 years ago

@benjaoming is this supposed to be the default message for non-RACHEL users?

Yes, but I think you should make Offline help a sub-heading, too, so it aligns with Online help

benjaoming commented 6 years ago

Seems like something weird happened with the version history, making it a bit hard to review.

@mrpau-eugene could you:

  1. Create a new PR with a fresh branch off from current 0.17.x ?
  2. Introduce your changes from your old feature branch as a single commit? See: https://makandracards.com/makandra/527-squash-several-git-commits-into-a-single-commit
  3. Move the default KALITE_WELCOME_MESSAGE to kalite.project.base ?
laurenlichtman commented 6 years ago

@benjaoming any action needed from me on this? Would like to flag to the WP team when it's ready. Thanks!

benjaoming commented 6 years ago

@laurenlichtman - good call, yes the action item would be to advice about using the new configuration in RACHEL. It's not out yet because of another bug. Will get back once released!