def get_context_data(self, **kwargs): context = super(AppDashboardView, self).get_context_data(**kwargs) context.update({ 'site_available_at_url': build_absolute_uri(self.request, site=get_current_site().db_object) }) return context
def get_context_data(self, **kwargs): context = super(ThemePackageView, self).get_context_data(**kwargs) context.update({'notifications': self.get_notifications()}) self.update_context_urls( context, {'send_test_email': reverse('api_notification_base')}) context.update({ 'site_available_at_url': build_absolute_uri(self.request, site=get_current_site().db_object) }) return context
def djaoapp_urls(request, account=None, base=None): if account is None: account = get_current_app().account urls = { 'pricing': build_absolute_uri(request, location='/pricing/', site=settings.APP_NAME), 'cart': build_absolute_uri(request, location='/billing/%s/cart/' % account, site=settings.APP_NAME) } if base: urls.update({ 'app': build_absolute_uri(request, location='/app/%s/' % base, site="%s-master" % settings.DB_NAME) }) # XXX Hack for correct domain return urls
def provider_absolute_url(request, location='/', provider=None, with_scheme=True): site = _provider_as_site(provider) if site: try: # If `site == get_current_site()`, we have a full-proof way # to generate the absolute URL with either a domain name or # a path prefix depending on the request. return site.as_absolute_uri(path=location) except AttributeError: # OK, we'll use the default build_absolute_uri from multitier. pass return build_absolute_uri(request, site=site, location=location, with_scheme=with_scheme)
def processor_redirect(request, site=None): """ Full URL redirect after the processor connected the organization account with our system. """ site_model = get_site_model() if site is None: site = get_current_site() elif not isinstance(site, site_model): try: site = site_model.objects.get(slug=site) except site_model.DoesNotExist: #pylint:disable=protected-access raise Http404("No %s with slug '%s' can be found." % (site_model._meta.object_name, site)) return build_absolute_uri(request, location=reverse( 'saas_update_bank', kwargs={'organization': site.account}), site=site)
def get_context_data(self, **kwargs): context = super(ThemePackageView, self).get_context_data(**kwargs) broker = get_broker() context.update({ 'notifications': { 'card_updated': { 'title': _("Card updated"), 'descr': _("This notification is sent when a credit card"\ " on file is updated.") }, 'charge_receipt': { 'title': _("Charge receipt"), 'descr': _("This notification is sent when a charge is"\ " created on a credit card. It is also sent when the charge is refunded.") }, 'claim_code_generated': { 'title': _("Claim code"), 'descr': _("This notification is sent to the user invited"\ " through a groupBuy.") }, 'expires_soon': { 'title': _("Expires soon"), 'descr': _("This notification is sent when a subscription"\ " is about to expire.") }, 'order_executed': { 'title': _("Order confirmation"), 'descr': _("This notification is sent when an order has"\ " been confirmed but a charge has been successfuly processed yet.") }, 'organization_updated': { 'title': _("Profile updated"), 'descr': _("This notification is sent when a profile"\ " is updated.") }, 'password_reset': { 'title': _("Password reset"), 'descr': _("This notification is sent to a user that has"\ " requested to reset their password through a \"forgot password?\" link.") }, 'user_activated': { 'title': _("User activated"), 'descr': _("This notification is sent to profile managers"\ " of a domain when a user has activated his/her account.") }, 'user_contact': { 'title': _("User contact"), 'descr': _("This notification is sent to profile managers"\ " of a domain when a user submits an inquiry on the contact-us page.") }, 'user_registered': { 'title': _("User registered"), 'descr': _("This notification is sent to profile managers"\ " of a domain when a user has registered.") }, 'role_request_created': { 'title': _("Role requested"), 'descr': _("This notification is sent to profile managers"\ " of an organization when a user has requested a role on that organization.") }, 'verification': { 'title': _("Verification"), 'descr': _("This notification is sent to verify an e-mail"\ " address of a user.") }, 'sales_report': { 'title': _("Weekly sales report"), 'descr': _("This notification is sent to profile managers."\ " It contains the weekly sales results.") }, }, 'role_descriptions': broker.get_role_descriptions() }) self.update_context_urls( context, {'send_test_email': reverse('api_notification_base')}) context.update({ 'site_available_at_url': build_absolute_uri(self.request, site=get_current_site().db_object) }) return context