コード例 #1
0
from django.conf.urls.defaults import *
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404

from apps.canvas_auth.models import User, AnonymousUser
from canvas import util
from canvas.url_util import re_slug
import canvas.models

urlpatterns = patterns(
    'apps.invite_remixer.views',
    url(re_slug('invite_id') + '/?$', 'invite', name='invite_url'),
)

DELIMITER = '-'


def invite_id(user, comment_id=None):
    keys = [user.id]
    if comment_id is not None:
        keys.append(comment_id)

    return DELIMITER.join([util.base36encode(e) for e in keys])


def invite_get_arg(*args, **kwargs):
    return 'invite=' + invite_id(*args, **kwargs)


def absolute_invite_url(*args, **kwargs):
    return 'http://example.com' + invite_url(*args, **kwargs)
コード例 #2
0
ファイル: urls.py プロジェクト: StetHD/canvas-2
admin_urls = patterns('',
    (r'^$', redirect_to, {'url': '/admin/x/everything'}),
    (r'^', include(canvas_urls.root_urls)),
    (r'^staff/comment_freeze$', include('drawquest.apps.comment_freeze.urls')),
    (r'^staff/whitelisting', include('drawquest.apps.whitelisting.urls')),
    url(r'^staff$', direct_to_template, kwargs={'template': 'staff/staff.html'}),
    (r'^staff/', include(canvas_urls.staff_urls)),
    (r'^api_console$', 'drawquest.apps.api_console.views.staff_api_console'),

    (r'^quests/', include('drawquest.apps.quests.urls')),

    (r'^x/', include(canvas_urls.tag_browse_urls)),
    (r'^t/', include(canvas_urls.tag_browse_urls)),

    url(r'^p/' + re_slug('short_id')
               + maybe('/'+re_int('page'))
               + maybe('/reply/'+re_int('gotoreply'))
               + maybe('/(?P<sort_by_top>top)')
               + '/?$', 'apps.threads.views.thread'),
)

urlpatterns = patterns('canvas.views',
    url(r'^js_testing$', 'direct_to_django_template', kwargs={'template': 'drawquest_js_testing.django.html'}),

    url(r'^login$', 'drawquest_login', kwargs={'default_next': '/', 'staff_protocol': 'http'}),
    url(r'^logout$', 'logout'),
)

urlpatterns += patterns('',
    (r'^download$', redirect_to, {'url': 'https://itunes.apple.com/us/app/drawquest-free-daily-drawing/id576917425?ls=1&mt=8'}),
コード例 #3
0
ファイル: urls.py プロジェクト: eiritana/canvas
    (r'^$', redirect_to, {
        'url': '/admin/x/everything'
    }),
    (r'^', include(canvas_urls.root_urls)),
    (r'^staff/comment_freeze$', include('drawquest.apps.comment_freeze.urls')),
    (r'^staff/whitelisting', include('drawquest.apps.whitelisting.urls')),
    url(r'^staff$',
        direct_to_template,
        kwargs={'template': 'staff/staff.html'}),
    (r'^staff/', include(canvas_urls.staff_urls)),
    (r'^api_console$', 'drawquest.apps.api_console.views.staff_api_console'),
    (r'^quests/', include('drawquest.apps.quests.urls')),
    (r'^x/', include(canvas_urls.tag_browse_urls)),
    (r'^t/', include(canvas_urls.tag_browse_urls)),
    url(
        r'^p/' + re_slug('short_id') + maybe('/' + re_int('page')) +
        maybe('/reply/' + re_int('gotoreply')) +
        maybe('/(?P<sort_by_top>top)') + '/?$', 'apps.threads.views.thread'),
)

urlpatterns = patterns(
    'canvas.views',
    url(r'^js_testing$',
        'direct_to_django_template',
        kwargs={'template': 'drawquest_js_testing.django.html'}),
    url(r'^login$',
        'drawquest_login',
        kwargs={
            'default_next': '/',
            'staff_protocol': 'http'
        }),
コード例 #4
0
from django.conf.urls import *

from canvas.url_util import re_slug, maybe

urlpatterns = patterns('apps.monster.views',
    url('^/$', 'landing'),
    url('^/create$', 'create'),
    url('^/random$', 'random'),
    url('^/api/browse$', 'api_browse_monsters'),
    url('^/api/details/' + re_slug('short_id') + '$', 'api_monster_details'),
    url('^/' + re_slug('short_id') + maybe('/' + re_slug('option')) + '$', 'view'),
)

コード例 #5
0
from django.conf.urls.defaults import *

from canvas.url_util import re_slug, re_int, re_group_slug, re_year, re_month, re_day, maybe

urlpatterns = patterns(
    'apps.public_api.views',
    url('^$', 'root'),
    url('^posts/' + maybe(re_slug('short_id')) + '$', 'posts'),
    url('^users/' + maybe(re_slug('username')) + '$', 'users'),
    url('^groups/' + maybe(re_group_slug('group_name')) + '$', 'groups'),
)
コード例 #6
0
from django.conf.urls import *
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404

from apps.canvas_auth.models import User, AnonymousUser
from canvas import util
from canvas.url_util import re_slug
import canvas.models

urlpatterns = patterns('apps.invite_remixer.views',
    url(re_slug('invite_id') + '/?$', 'invite', name='invite_url'),
)

DELIMITER = '-'

def invite_id(user, comment_id=None):
    keys = [user.id]
    if comment_id is not None:
        keys.append(comment_id)

    return DELIMITER.join([util.base36encode(e) for e in keys])

def invite_get_arg(*args, **kwargs):
    return 'invite=' + invite_id(*args, **kwargs)

def absolute_invite_url(*args, **kwargs):
    return 'http://example.com' + invite_url(*args, **kwargs)

def invite_url(*args, **kwargs):
    """
    Returns an invite URL to use for thread pages or /. Unique to user, thread, and channel.
コード例 #7
0
ファイル: urls.py プロジェクト: StetHD/canvas-2
from django.conf.urls.defaults import *

from canvas.url_util import re_slug

urlpatterns = patterns('apps.share_tracking.views',
    url(re_slug('share_id') + '/?$', 'shared_url'),
)

コード例 #8
0
from django.conf.urls import *

from canvas.url_util import re_slug

urlpatterns = patterns(
    'apps.share_tracking.views',
    url(re_slug('share_id') + '/?$', 'shared_url'),
)
コード例 #9
0
from django.conf.urls import *

from canvas.shortcuts import direct_to_template
from canvas.url_util import re_slug, re_int, re_group_slug, re_year, re_month, re_day, maybe


urlpatterns = patterns('drawquest.apps.staff.views',
    url(r'^$', direct_to_template, kwargs={'template': 'staff/portal.html'}),
    url(r'^/staff_stars$', 'staff_stars'),
    url(r'^/top_starred$', 'top_starred'),
    url(r'^/deep_links$', 'deep_links'),
    url(r'^/max_strokes/(?P<stroke_count>[0-9])$' , 'max_strokes'),
    url(r'^/user/' + re_slug('username') + '/ip_history$', 'user_ip_history'),
    url(r'^/user/' + re_slug('username') + '/activity_stream$', 'user_activity_stream'),
    url(r'^/user/' + re_slug('username') + '/iap$', 'user_iap_receipts'),
    url(r'^/ip/' + re_slug('ip') + '/user_history$', 'ip_user_history'),
    url(r'^/user/' + r'(?P<username_or_email>[a-zA-Z0-9_.,-\@]+)$', 'user'),
)
urlpatterns += patterns('',
    url(r'^/top_quests$', 'drawquest.apps.quests.views.staff_top_quests'),
    url(r'^/new_ugq$', 'drawquest.apps.quests.views.staff_new_ugq'),
)

コード例 #10
0
         "breakout_url": "/welcome?next=signup"
     }),
 url(r'^signup_link_exit_iframe$',
     'direct_to_django_template',
     kwargs={
         'template': 'exit_iframe.django.html',
         "breakout_url": "/signup"
     }),
 url(r'^share_prompt$', 'signup_share_prompt'),
 url(r'^stamps_used/(?P<content>[a-z0-9]+)$', 'stamps_used'),
 url(r'^top$', 'frontpage', kwargs={'sort': 'top'}),
 url(r'^top/' + re_day + '$', 'frontpage', kwargs={'sort': 'top'}),
 url(r'^top/' + re_month + '$', 'frontpage', kwargs={'sort': 'top'}),
 url(r'^top/' + re_year + '$', 'frontpage', kwargs={'sort': 'top'}),
 url(r'^unsubscribe$', 'unsubscribe'),
 url(r'^user/' + re_slug('username') + '/?$',
     'user_view',
     kwargs={'userpage_type': 'top'},
     name="user_link"),
 url(r'^user/' + re_slug('username') + '/edit/?$', 'user_edit'),
 url(r'^user/' + re_slug('username') + '/new/?$',
     'user_view',
     kwargs={'userpage_type': 'new'}),
 url(r'^user/' + re_slug('username') + '/anonymous/?$',
     'user_view',
     kwargs={'userpage_type': 'top_anonymous'}),
 url(r'^user/' + re_slug('username') + '/anonymous/new/?$',
     'user_view',
     kwargs={'userpage_type': 'new_anonymous'}),
 url(r'^user/' + re_slug('username') + '/stickered/?$',
     'user_view',
コード例 #11
0
    (r'^staff', include('drawquest.apps.staff.urls')),
    (r'^staff/moderation', include('drawquest.apps.whitelisting.urls')),
    (r'^staff/colors', include('drawquest.apps.palettes.urls')),
    (r'^staff/vanity_metrics', 'drawquest.views.vanity_metrics'),
    (r'^staff/explore', include('drawquest.apps.explore.urls')),
    (r'^staff/', include(canvas_urls.staff_urls)),
    (r'^api_console$', 'drawquest.apps.api_console.views.staff_api_console'),
    (r'^api_endpoints$', 'drawquest.apps.api_console.views.staff_api_endpoints'),

    (r'^quests/schedule', 'drawquest.apps.quest_scheduler.views.schedule'),
    (r'^quests/', include('drawquest.apps.quests.urls')),

    (r'^x/', include(canvas_urls.tag_browse_urls)),
    (r'^t/', include(canvas_urls.tag_browse_urls)),

    url(r'^p/' + re_slug('short_id')
               + maybe('/'+re_int('page'))
               + maybe('/reply/'+re_int('gotoreply'))
               + maybe('/(?P<sort_by_top>top)')
               + '/?$', 'apps.threads.views.thread'),
)

urlpatterns = patterns('canvas.views',
    url(r'^js_testing$', 'direct_to_django_template', kwargs={'template': 'drawquest_js_testing.django.html'}),

    url(r'^login$', 'drawquest_login', kwargs={'default_next': '/admin/staff', 'staff_protocol': 'http'}),
    url(r'^logout$', 'logout'),
)

urlpatterns += patterns('',
    (r'^download$', RedirectView.as_view(url='https://itunes.apple.com/us/app/drawquest-free-daily-drawing/id576917425?ls=1&mt=8')),
コード例 #12
0
ファイル: urls.py プロジェクト: eiritana/canvas
from django.conf.urls.defaults import *

from canvas.url_util import re_slug, maybe

urlpatterns = patterns(
    'apps.monster.views',
    url('^/$', 'landing'),
    url('^/create$', 'create'),
    url('^/random$', 'random'),
    url('^/api/browse$', 'api_browse_monsters'),
    url('^/api/details/' + re_slug('short_id') + '$', 'api_monster_details'),
    url('^/' + re_slug('short_id') + maybe('/' + re_slug('option')) + '$',
        'view'),
)
コード例 #13
0
 url(r'^$', 'frontpage', kwargs={'sort': 'hot', 'homepage': True}),
 url(r'^best$', 'frontpage', kwargs={'sort': 'best'}),
 url(r'^csrf_token', 'csrf_token'),
 (r'^feed', include('apps.feed.urls')),
 url(r'^invite$', 'invite'),
 url(r'^join$', 'join'),
 url(r'^login$', 'canvas_login'),
 url(r'^login_exit_iframe$', 'direct_to_django_template', kwargs={'template': 'exit_iframe.django.html', "breakout_url": "/login"}),
 url(r'^logout$', 'logout'),
 url(r'^all_stamps$', 'all_stamps'),
 (r'^monster', include('apps.monster.urls')),
 url(r'^new$', 'frontpage', kwargs={'sort':'new'}),
 # Note that ping is handled by special middleware.
 url(r'^onboarding', include('apps.onboarding.urls')),
 (r'^post_thread', include('apps.post_thread.urls')),
 url(r'^script/' + re_slug('short_id') + '$', 'script_view'),
 url(r'^signup_exit_iframe$', 'signup_exit_iframe'),
 url(r'^signup_help_exit_iframe$', 'direct_to_django_template', kwargs={'template': 'exit_iframe.django.html', "breakout_url": "/welcome?next=signup"}),
 url(r'^signup_link_exit_iframe$', 'direct_to_django_template', kwargs={'template': 'exit_iframe.django.html', "breakout_url": "/signup"}),
 url(r'^share_prompt$', 'signup_share_prompt'),
 url(r'^stamps_used/(?P<content>[a-z0-9]+)$', 'stamps_used'),
 url(r'^top$', 'frontpage', kwargs={'sort': 'top'}),
 url(r'^top/' + re_day + '$', 'frontpage', kwargs={'sort': 'top'}),
 url(r'^top/' + re_month + '$', 'frontpage', kwargs={'sort': 'top'}),
 url(r'^top/' + re_year + '$', 'frontpage', kwargs={'sort': 'top'}),
 url(r'^unsubscribe$', 'unsubscribe'),
 url(r'^user/' + re_slug('username') + '/?$', 'user_view', kwargs={'userpage_type':'top'}, name="user_link"),
 url(r'^user/' + re_slug('username') + '/edit/?$', 'user_edit'),
 url(r'^user/' + re_slug('username') + '/new/?$', 'user_view', kwargs={'userpage_type':'new'}),
 url(r'^user/' + re_slug('username') + '/anonymous/?$', 'user_view', kwargs={'userpage_type':'top_anonymous'}),
 url(r'^user/' + re_slug('username') + '/anonymous/new/?$', 'user_view', kwargs={'userpage_type':'new_anonymous'}),
コード例 #14
0
    (r'^', include(canvas_urls.root_urls)),
    (r'^staff', include('drawquest.apps.staff.urls')),
    (r'^staff/moderation', include('drawquest.apps.whitelisting.urls')),
    (r'^staff/colors', include('drawquest.apps.palettes.urls')),
    (r'^staff/vanity_metrics', 'drawquest.views.vanity_metrics'),
    (r'^staff/explore', include('drawquest.apps.explore.urls')),
    (r'^staff/', include(canvas_urls.staff_urls)),
    (r'^api_console$', 'drawquest.apps.api_console.views.staff_api_console'),
    (r'^api_endpoints$',
     'drawquest.apps.api_console.views.staff_api_endpoints'),
    (r'^quests/schedule', 'drawquest.apps.quest_scheduler.views.schedule'),
    (r'^quests/', include('drawquest.apps.quests.urls')),
    (r'^x/', include(canvas_urls.tag_browse_urls)),
    (r'^t/', include(canvas_urls.tag_browse_urls)),
    url(
        r'^p/' + re_slug('short_id') + maybe('/' + re_int('page')) +
        maybe('/reply/' + re_int('gotoreply')) +
        maybe('/(?P<sort_by_top>top)') + '/?$', 'apps.threads.views.thread'),
)

urlpatterns = patterns(
    'canvas.views',
    url(r'^js_testing$',
        'direct_to_django_template',
        kwargs={'template': 'drawquest_js_testing.django.html'}),
    url(r'^login$',
        'drawquest_login',
        kwargs={
            'default_next': '/admin/staff',
            'staff_protocol': 'http'
        }),
コード例 #15
0
ファイル: urls.py プロジェクト: StetHD/canvas-2
from django.conf.urls.defaults import *

from canvas.url_util import re_slug, re_int, re_group_slug, re_year, re_month, re_day, maybe

urlpatterns = patterns('apps.public_api.views',
    url('^$', 'root'),
    url('^posts/' + maybe(re_slug('short_id')) + '$', 'posts'),
    url('^users/' + maybe(re_slug('username')) + '$', 'users'),
    url('^groups/' + maybe(re_group_slug('group_name')) + '$', 'groups'),
)