Repository: oppia/oppia

Issue:
Remove remaining GLOBALS from HTML
## Explanation
The aim of this project is to deprecate and remove all GLOBALS used in various html files across oppia codebase. This will help in static serving of the pages so that they can load faster.
For further explanation, please refer #5002.

If you'd like to help with this issue, please select a GLOBAL variable from the list below, put your name in parentheses next to it, and submit a PR after getting rid of the variable from GLOBALS in that file. Or select a GLOBAL from the list below, and comment on the issue that you'd be taking it up, and submit a PR. Once the PR is submitted, you can tick the checkboxes.

## Remaining GLOBALS

- maintenance.html
  - [x] ADDITIONAL_ANGULAR_MODULES @Jamesjay4199 
  - [x] DEV_MODE
- admin.html
  - [x] csrf_token @Jamesjay4199 
  - [x] USER_EMAIL @Jamesjay4199 
  - [x] LOGOUT_URL @abhaygupta97 
  - [x] DEMO_EXPLORATIONS @Jamesjay4199 
  - [x] DEMO_EXPLORATION_IDS @Jamesjay4199 
  - [x] DEMO_COLLECTIONS @Jamesjay4199 
  - [x] HUMAN_READABLE_CURRENT_TIME @Jamesjay4199 
  - [x] CONTINUOUS_COMPUTATIONS_DATA @Jamesjay4199 
  - [x] ONE_OFF_JOB_SPECS @Jamesjay4199 
  - [x] UNFINISHED_JOB_DATA @Jamesjay4199 
  - [x] RECENT_JOB_DATA @Jamesjay4199 
  - [x] UPDATABLE_ROLES @Jamesjay4199 
  - [x] VIEWABLE_ROLES @Jamesjay4199 
  - [x] TOPIC_SUMMARIES @Jamesjay4199 
  - [x] ROLE_GRAPH_DATA @Jamesjay4199 
  - [x] userIsLoggedIn
- creator_dashboard.html
  - [x] DEFAULT_TWITTER_SHARE_MESSAGE_DASHBOARD @Jamesjay4199 
  - [x] INTERACTION_SPECS
  - [x] ALLOWED_INTERACTION_CATEGORIES @sophiewu6
  - [x] DEFAULT_OBJECT_VALUES @Jamesjay4199 
- exploration_player.html
  - [x] collectionId @Jamesjay4199 
  - [x] collectionTitle @Jamesjay4199 
  - [x] DEFAULT_TWITTER_SHARE_MESSAGE_PLAYER @Jamesjay4199 
  - [x] explorationVersion @Jamesjay4199 
  - [x] INTERACTION_SPECS
  - [x] canEdit @Jamesjay4199 
- collection_editor.html
  - [x] collectionId @Jamesjay4199 
  - [x] TAG_REGEX @Jamesjay4199 
- library.html @abhaygupta97 
  - [x] LANGUAGE_CODES_AND_NAMES
  - [x] SEARCH_DROPDOWN_CATEGORIES
  - [x] PAGE_MODE
- form_builder_test_page.html
  - [x] ADDITIONAL_ANGULAR_MODULES
- exploration_editor.html
  - [x] ALLOWED_INTERACTION_CATEGORIES @sophiewu6 
  - [x] can_edit
  - [x] can_publish
  - [x] can_translate
  - [x] DEFAULT_OBJECT_VALUES @Jamesjay4199 
  - [x] DEFAULT_TWITTER_SHARE_MESSAGE_EDITOR @Jamesjay4199 
  - [x] INTERACTION_SPECS @Jamesjay4199 
  - [x] INVALID_PARAMETER_NAMES @Jamesjay4199 
  - [x] SHOW_TRAINABLE_UNRESOLVED_ANSWERS @Jamesjay4199 
  - [x] TAG_REGEX @Jamesjay4199 
  - [x] canDelete
  - [x] canModifyRoles
  - [x] canReleaseOwnership
  - [x] canUnpublish
- profile.html
  - [x] PROFILE_USERNAME @Jamesjay4199 
- skill_editor.html
  - [x] INTERACTION_SPECS @Jamesjay4199 
  - [x] ALLOWED_INTERACTION_CATEGORIES @sophiewu6 
  - [x] DEFAULT_OBJECT_VALUES
- signup.html @ShubhamBansal1997 
  - [x] CAN_SEND_EMAILS
- collection_player.html
  - [x] collectionId @Jamesjay4199 
  - [x] isLoggedIn @Jamesjay4199 
  - [x] canEdit @Jamesjay4199 
- topic_editor.html
  - [x] INTERACTION_SPECS
  - [x] ALLOWED_INTERACTION_CATEGORIES @sophiewu6 
  - [x] DEFAULT_OBJECT_VALUES
- preferences.html @abhaygupta97 
  - [x] LANGUAGE_CODES_AND_NAMES



Discussion:
@abhaygupta97 can I take this issue?
@prasadgujar you need to choose a global variable from above list, then I will assign it to you.
Hi @prasadgujar, welcome! Please follow the instructions [here](https://github.com/oppia/oppia/wiki/Contributing-code-to-Oppia#setting-things-up) first to get started.
Hi @abhaygupta97 would like to work on this issue ```signup.html```
Hi @ShubhamBansal1997 assigned it to you. Go ahead! Thanks.
hi @abhaygupta97 may i work on this issue
creator_dashboard.html and skill_editor.html
Hi @Saumitra-Shukla you can choose any one GLOBAL variable from list given above and I will assign it to you.
@abhaygupta97 skill_editor.html
@Saumitra-Shukla choose any one GLOBAL among  `INTERACTION_SPECS`, `ALLOWED_INTERACTION_CATEGORIES` and `DEFAULT_OBJECT_VALUES` in skill_editor.html on which you want to work. I will assign it to you.
interaction_specs @abhaygupta97
@Saumitra-Shukla assigned it to you. Go ahead! Thanks.
@Saumitra-Shukla -- please make sure to follow the instructions [here](https://github.com/oppia/oppia/wiki/Contributing-code-to-Oppia#setting-things-up) first. Thanks!
Hi @ShubhamBansal1997, @Saumitra-Shukla 
How's this going on? Any updates regarding the same ? 
Hello everyone,
Sorry for the late reply(was hospitalized).
I will looking forward to work again on the issue.

On Thu, 14 Mar, 2019, 9:33 PM Nitish Bansal, <notifications@github.com>
wrote:

> Hi @ShubhamBansal1997 <https://github.com/ShubhamBansal1997>,
> @Saumitra-Shukla <https://github.com/Saumitra-Shukla>
> How's this going on? Any updates regarding the same ?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/oppia/oppia/issues/6387#issuecomment-472935976>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AMQuWXTMTkRNBG0WXkiikgKlqZEn_8Udks5vWnK1gaJpZM4bc6TP>
> .
>

@bansalnitish I have my mid sems till 16th march so will push by 17th March.
Sounds good, thanks for the update. All the Best for your MTE :).
Hi, can I take ALLOWED_INTERACTION_CATEGORIES? Thanks!
@bansalnitish I have raised the PR https://github.com/oppia/oppia/pull/6467
@sophiewu6 Assigned `ALLOWED_INTERACTION_CATEGORIES` to you. Go ahead! Thanks.

Resolving patch:
diff --git a/core/controllers/profile.py b/core/controllers/profile.py
--- a/core/controllers/profile.py
+++ b/core/controllers/profile.py
@@ -276,6 +276,7 @@ def get(self):
         """Handles GET requests."""
         user_settings = user_services.get_user_settings(self.user_id)
         self.render_json({
+            'can_send_emails': feconf.CAN_SEND_EMAILS,
             'has_agreed_to_latest_terms': (
                 user_settings.last_agreed_to_terms and
                 user_settings.last_agreed_to_terms >=


Test patch: