Example #1
0
    def get(self):
        current_session = Session().get_current_session(self)
        account = current_session.get_account_entity()
        email = current_session.get_email()
        """ Get widgets values """
        trophy_case_values = widgets_dao.get_trophy_case_properties_to_render(
            account)
        rank_values = widgets_dao.get_rank_properties_to_render(account)
        points_values = widgets_dao.get_points_properties_to_render(account)
        leaderboard_values = widgets_dao.get_leaderboard_properties_to_render(
            account)
        notifier_values = widgets_dao.get_notifier_properties_to_render(
            account)
        milestones_values = widgets_dao.get_milestones_properties_to_render(
            account)
        """ Preview urls """
        trophy_case_preview_url = ""
        rank_preview_url = ""
        points_preview_url = ""
        """ Notifier """
        if environment.is_dev():
            widget_path = constants.CONSOLE_GET_WIDGET_DEV
        else:
            widget_path = constants.CONSOLE_GET_WIDGET_PROD
        widget_type = "notifier"
        userhash = hashlib.sha1(email + '---' +
                                constants.ANONYMOUS_USER).hexdigest()
        notifier_str = "<div style='z-index:9999; overflow: hidden; position: fixed; bottom: 0px; right: 10px;'><iframe style='border:none;' allowtransparency='true' height='" + str(
            constants.NOTIFIER_SIZE_DEFAULT
        ) + "px' width='" + str(
            constants.NOTIFIER_SIZE_DEFAULT
        ) + "px' scrolling='no' src='" + widget_path + "?widget=" + widget_type + "&u=" + userhash + "&height=" + str(
            constants.NOTIFIER_SIZE_DEFAULT) + "&width=" + str(
                constants.NOTIFIER_SIZE_DEFAULT
            ) + "'>Sorry your browser does not support iframes!</iframe></div>"

        template_values = {
            'features_main': True,
            'account_name': current_session.get_email(),
            'trophy_case_values': trophy_case_values,
            'rank_values': rank_values,
            'points_values': points_values,
            'notifier_values': notifier_values,
            'milestones_values': milestones_values,
            'leaderboard_values': leaderboard_values,
            'trophy_case_preview_url': trophy_case_preview_url,
            'rank_preview_url': rank_preview_url,
            'points_preview_url': points_preview_url,
            'notifier': notifier_str
        }
        self.response.out.write(
            template.render(constants.TEMPLATE_PATHS.CONSOLE_DASHBOARD,
                            template_values))
Example #2
0
def get_full_link(relative_path):
    """ 
  Returns the full link for a given badge (dev vs production)
  """

    if relative_path.startswith("http"):
        # already full
        return relative_path

    if environment.is_dev():
        return constants.LOCAL_URL + relative_path
    else:
        return constants.PRODUCTION_URL + relative_path
Example #3
0
def get_full_link(relative_path):
    """ 
  Returns the full link for a given badge (dev vs production)
  """

    if relative_path.startswith("http"):
        # already full
        return relative_path

    if environment.is_dev():
        return constants.LOCAL_URL + relative_path
    else:
        return constants.PRODUCTION_URL + relative_path
Example #4
0
 def get(self):
   current_session = Session().get_current_session(self)
   account_entity = current_session.get_account_entity()
   email = account_entity.email
   
   """ Notifier """
   if environment.is_dev():
     widget_path = constants.CONSOLE_GET_WIDGET_DEV
   else:
     widget_path = constants.CONSOLE_GET_WIDGET_PROD 
   widget_type = "notifier"
   userhash = hashlib.sha1(email + '---' + constants.ANONYMOUS_USER).hexdigest()
   notifier_str = "<div style='z-index:9999; overflow: hidden; position: fixed; bottom: 0px; right: 10px;'><iframe style='border:none;' allowtransparency='true' height='"+str(constants.NOTIFIER_SIZE_DEFAULT)+"px' width='"+str(constants.NOTIFIER_SIZE_DEFAULT)+"px' scrolling='no' src='" + widget_path + "?widget=" + widget_type + "&u=" + userhash + "&height=" +str(Falseconstants.NOTIFIER_SIZE_DEFAULT) + "&width="+str(constants.NOTIFIER_SIZE_DEFAULT)+"'>Sorry your browser does not support iframes!</iframe></div>"
   self.response.out.write(notifier_str)
Example #5
0
 def get(self):
   current_session = Session().get_current_session(self)
   account = current_session.get_account_entity()
   email = current_session.get_email()
   
   """ Get widgets values """
   trophy_case_values = widgets_dao.get_trophy_case_properties_to_render(account)
   rank_values = widgets_dao.get_rank_properties_to_render(account)
   points_values = widgets_dao.get_points_properties_to_render(account)
   leaderboard_values = widgets_dao.get_leaderboard_properties_to_render(account)
   notifier_values = widgets_dao.get_notifier_properties_to_render(account)
   milestones_values = widgets_dao.get_milestones_properties_to_render(account)
   
   """ Preview urls """
   trophy_case_preview_url = ""
   rank_preview_url = ""
   points_preview_url = ""
   
   """ Notifier """
   if environment.is_dev():
     widget_path = constants.CONSOLE_GET_WIDGET_DEV
   else:
     widget_path = constants.CONSOLE_GET_WIDGET_PROD 
   widget_type = "notifier"
   userhash = hashlib.sha1(email + '---' + constants.ANONYMOUS_USER).hexdigest()
   notifier_str = "<div style='z-index:9999; overflow: hidden; position: fixed; bottom: 0px; right: 10px;'><iframe style='border:none;' allowtransparency='true' height='"+str(constants.NOTIFIER_SIZE_DEFAULT)+"px' width='"+str(constants.NOTIFIER_SIZE_DEFAULT)+"px' scrolling='no' src='" + widget_path + "?widget=" + widget_type + "&u=" + userhash + "&height=" +str(constants.NOTIFIER_SIZE_DEFAULT) + "&width="+str(constants.NOTIFIER_SIZE_DEFAULT)+"'>Sorry your browser does not support iframes!</iframe></div>"
   
   template_values = {'features_main' : True,
                      'account_name' : current_session.get_email(),
                      'trophy_case_values' : trophy_case_values,
                      'rank_values':rank_values,
                      'points_values':points_values,
                      'notifier_values': notifier_values,
                      'milestones_values': milestones_values,
                      'leaderboard_values':leaderboard_values,
                      'trophy_case_preview_url':trophy_case_preview_url,
                      'rank_preview_url':rank_preview_url,
                      'points_preview_url':points_preview_url,
                      'notifier': notifier_str}
   self.response.out.write(template.render(constants.TEMPLATE_PATHS.CONSOLE_DASHBOARD, template_values))  
Example #6
0
def full_path(relative_url):
  if environment.is_dev():
    return constants.DEV_URL + constants.LOGGING.PATH
  else:
    return constants.PRODUCTION_URL + constants.LOGGING.PATH
Example #7
0
def full_path(relative_url):
    if environment.is_dev():
        return constants.DEV_URL + constants.UPDATE.PATH
    else:
        return constants.PRODUCTION_URL + constants.UPDATE.PATH