Repository: oppia/oppia

Issue:
After publishing, creators should be encouraged to share their explorations.
When someone creates and publishes an exploration, their final step is to click a "Publish Exploration" button. After they do this, not much happens.

Instead, we'd like to open a congratulatory modal dialog, which congratulates them, and suggests that they share their newly-created exploration on G+ etc. (we'll put the various 'sharing' links there in order to make it easy for them). Note to developers: there are already sharing links in the [information card modal](https://github.com/oppia/oppia/blob/f4064e683f169842556acfd2739b5a6754c31adf/core/templates/dev/head/player/information_card_modal.html#L76) in the learner view, and it is probably worth abstracting this out into a reusable directive located in components/ for use in multiple places.

Milestones:
- [ ] figure out what the exact messages in the dialog should be
- [ ] figure out what the default G+/Facebook/Twitter share messages should be
- [ ] implement the functionality

@whygee will be taking the first two of these on, and then, after that, this should be treated as a regular starter code project.



Discussion:
@seanlip I'd like to take on this on.
How about we also add a couple of buttons to the modal - one which takes the creator to the learner view for the exploration, and another to take him back to the gallery ?

Great, I've assigned you (sorry for the delay!) I don't think the learner view button is necessary, and I'm not sure why the creator would want to visit the gallery. If anything, maybe a button to their creator dashboard would be sensible?

Also, I suggest going ahead and doing implementation with some text that looks sensible, so that your code can be looked at while @whygee works on the text. Thanks!


Resolving patch:
diff --git a/core/controllers/base.py b/core/controllers/base.py
--- a/core/controllers/base.py
+++ b/core/controllers/base.py
@@ -103,6 +103,33 @@
     'site_feedback_form_url', {'type': 'unicode'},
     'Site feedback form URL (leave blank if there is no such form)', '')
 
+SHARING_OPTIONS = config_domain.ConfigProperty(
+    'sharing_options', {
+        'type': 'dict',
+        'properties': [{
+            'name': 'gplus',
+            'schema': {
+                'type': 'bool',
+            }
+        }, {
+            'name': 'facebook',
+            'schema': {
+                'type': 'bool',
+            }
+        }, {
+            'name': 'twitter',
+            'schema': {
+                'type': 'bool',
+            }
+        }]
+    },
+    'Sharing options to display in the editor view',
+    default_value={
+        'gplus': False,
+        'facebook': False,
+        'twitter': False,
+    })
+
 SOCIAL_MEDIA_BUTTONS = config_domain.ConfigProperty(
     'social_media_buttons', {
         'type': 'list',
diff --git a/core/controllers/editor.py b/core/controllers/editor.py
--- a/core/controllers/editor.py
+++ b/core/controllers/editor.py
@@ -67,6 +67,14 @@
     'in the gallery',
     default_value=MODERATOR_REQUEST_FORUM_URL_DEFAULT_VALUE)
 
+SHARING_OPTIONS_TWITTER_TEXT = config_domain.ConfigProperty(
+    'sharing_options_twitter_text_editor', {
+        'type': 'unicode',
+    },
+    'Default text for the Twitter share message for the editor',
+    default_value=(
+        'Check out this interactive lesson from Oppia - a free, open-source '
+        'learning platform!'))
 
 def get_value_generators_js():
     """Return a string that concatenates the JS for all value generators."""
@@ -205,6 +213,8 @@ def get(self, exploration_id):
             'INTERACTION_SPECS': interaction_registry.Registry.get_all_specs(),
             'PANEL_SPECS': feconf.PANELS_PROPERTIES,
             'DEFAULT_OBJECT_VALUES': rule_domain.get_default_object_values(),
+            'SHARING_OPTIONS': base.SHARING_OPTIONS.value,
+            'SHARING_OPTIONS_TWITTER_TEXT': SHARING_OPTIONS_TWITTER_TEXT.value,
             'additional_angular_modules': additional_angular_modules,
             'can_delete': rights_manager.Actor(
                 self.user_id).can_delete(
diff --git a/core/controllers/reader.py b/core/controllers/reader.py
--- a/core/controllers/reader.py
+++ b/core/controllers/reader.py
@@ -44,43 +44,15 @@
 
 MAX_SYSTEM_RECOMMENDATIONS = 4
 
-SHARING_OPTIONS = config_domain.ConfigProperty(
-    'sharing_options', {
-        'type': 'dict',
-        'properties': [{
-            'name': 'gplus',
-            'schema': {
-                'type': 'bool',
-            }
-        }, {
-            'name': 'facebook',
-            'schema': {
-                'type': 'bool',
-            }
-        }, {
-            'name': 'twitter',
-            'schema': {
-                'type': 'bool',
-            }
-        }]
-    },
-    'Sharing options to display in the learner view',
-    default_value={
-        'gplus': False,
-        'facebook': False,
-        'twitter': False,
-    })
-
 SHARING_OPTIONS_TWITTER_TEXT = config_domain.ConfigProperty(
-    'sharing_options_twitter_text', {
+    'sharing_options_twitter_text_reader', {
         'type': 'unicode',
     },
-    'Default text for the Twitter share message',
+    'Default text for the Twitter share message for the reader',
     default_value=(
         'Check out this interactive lesson from Oppia - a free, open-source '
         'learning platform!'))
 
-
 def require_playable(handler):
     """Decorator that checks if the user can play the given exploration."""
     def test_can_play(self, exploration_id, **kwargs):
@@ -338,7 +310,7 @@ def get(self, exploration_id):
         self.values.update({
             'GADGET_SPECS': gadget_registry.Registry.get_all_specs(),
             'INTERACTION_SPECS': interaction_registry.Registry.get_all_specs(),
-            'SHARING_OPTIONS': SHARING_OPTIONS.value,
+            'SHARING_OPTIONS': base.SHARING_OPTIONS.value,
             'SHARING_OPTIONS_TWITTER_TEXT': SHARING_OPTIONS_TWITTER_TEXT.value,
             'additional_angular_modules': additional_angular_modules,
             'can_edit': (


Test patch: