Beispiel #1
0
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect('homepage.views.teams')

    from shipping.views import teamsnippet as ship_snippet
    ship_div = mark_safe(ship_snippet(loc))

    from bugsy.views import teamsnippet as bug_snippet
    bug_div = mark_safe(bug_snippet(loc))

    name = loc.name or loc.code

    gliblocale = settings.VERBATIM_CONVERSIONS.get(
        loc.code,
        loc.code.replace('-', '_')
    )
    if gliblocale:
        verbatim_url = 'https://localize.mozilla.org/%s/' % gliblocale
    else:
        verbatim_url = None

    return render(request, 'homepage/locale-team.html', {
                    'locale': loc,
                    'locale_name': name,
                    'shipping': ship_div,
                    'bugs': bug_div,
                    'webdashboard_url': settings.WEBDASHBOARD_URL,
                    'verbatim_url': verbatim_url,
                  })
Beispiel #2
0
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect('homepage.views.teams')

    from l10nstats.views import teamsnippet as stats_snippet
    l10nstats_div = mark_safe(stats_snippet(request, loc))

    from shipping.views import teamsnippet as ship_snippet
    ship_div = mark_safe(ship_snippet(request, loc))

    from bugsy.views import teamsnippet as bug_snippet
    bug_div = mark_safe(bug_snippet(request, loc))

    name = loc.name or loc.code

    return render_to_response('homepage/locale-team.html', {
        'locale': loc,
        'name': name,
        'l10nstats': l10nstats_div,
        'shipping': ship_div,
        'bugs': bug_div,
    },
                              context_instance=RequestContext(request))
Beispiel #3
0
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect('teams')
    try:
        team_locale = TeamLocaleThrough.objects.current().get(locale=loc)
        return redirect('l10n-team', team_locale.team.code)
    except TeamLocaleThrough.DoesNotExist:
        pass

    team_locales = (TeamLocaleThrough.objects.current().filter(
        team=loc).values_list('locale', flat=True))
    from shipping.views import teamsnippet as ship_snippet
    shipping = ship_snippet(loc, team_locales)

    from bugsy.views import teamsnippet as bug_snippet
    bugs = bug_snippet(loc)

    name = loc.name or loc.code

    return render(request, 'homepage/locale-team.html', {
        'locale': loc,
        'locale_name': name,
        'shipping': shipping,
        'bugs': bugs,
    })
Beispiel #4
0
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect('teams')
    try:
        team_locale = TeamLocaleThrough.objects.current().get(locale=loc)
        return redirect('l10n-team', team_locale.team.code)
    except TeamLocaleThrough.DoesNotExist:
        pass

    team_locales = (
        TeamLocaleThrough.objects.current()
        .filter(team=loc).values_list('locale', flat=True)
    )
    from shipping.views import teamsnippet as ship_snippet
    shipping = ship_snippet(loc, team_locales)

    from bugsy.views import teamsnippet as bug_snippet
    bugs = bug_snippet(loc)

    name = loc.name or loc.code

    return render(request, 'homepage/locale-team.html', {
                    'locale': loc,
                    'locale_name': name,
                    'shipping': shipping,
                    'bugs': bugs,
                  })
Beispiel #5
0
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect('homepage.views.teams')

    from l10nstats.views import teamsnippet as stats_snippet
    l10nstats_div = mark_safe(stats_snippet(request, loc))

    from shipping.views import teamsnippet as ship_snippet
    ship_div = mark_safe(ship_snippet(request, loc))

    from bugsy.views import teamsnippet as bug_snippet
    bug_div = mark_safe(bug_snippet(request, loc))

    name = loc.name or loc.code

    return render_to_response(
        'homepage/locale-team.html', {
            'locale': loc,
            'name': name,
            'l10nstats': l10nstats_div,
            'shipping': ship_div,
            'bugs': bug_div,
        })
Beispiel #6
0
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect('homepage.views.teams')

    from shipping.views import teamsnippet as ship_snippet
    ship_div = mark_safe(ship_snippet(loc))

    from bugsy.views import teamsnippet as bug_snippet
    bug_div = mark_safe(bug_snippet(loc))

    name = loc.name or loc.code

    gliblocale = settings.VERBATIM_CONVERSIONS.get(
        loc.code,
        loc.code.replace('-', '_')
    )
    if gliblocale:
        verbatim_url = 'https://localize.mozilla.org/%s/' % gliblocale
    else:
        verbatim_url = None

    return render(request, 'homepage/locale-team.html', {
                    'locale': loc,
                    'locale_name': name,
                    'shipping': ship_div,
                    'bugs': bug_div,
                    'webdashboard_url': settings.WEBDASHBOARD_URL,
                    'verbatim_url': verbatim_url,
                  })
Beispiel #7
0
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect("homepage.views.teams")
    try:
        team_locale = TeamLocaleThrough.objects.current().get(locale=loc)
        return redirect("homepage.views.locale_team", team_locale.team.code)
    except TeamLocaleThrough.DoesNotExist:
        pass

    team_locales = TeamLocaleThrough.objects.current().filter(team=loc).values_list("locale", flat=True)
    from shipping.views import teamsnippet as ship_snippet

    ship_div = mark_safe(ship_snippet(loc, team_locales))

    from bugsy.views import teamsnippet as bug_snippet

    bug_div = mark_safe(bug_snippet(loc))

    name = loc.name or loc.code

    gliblocale = settings.VERBATIM_CONVERSIONS.get(loc.code, loc.code.replace("-", "_"))
    if gliblocale:
        verbatim_url = "https://localize.mozilla.org/%s/" % gliblocale
    else:
        verbatim_url = None
    try:
        cachebuster = "?%d" % Run.objects.order_by("-pk").values_list("id", flat=True)[0]
    except IndexError:
        cachebuster = ""

    return render(
        request,
        "homepage/locale-team.html",
        {
            "locale": loc,
            "locale_name": name,
            "shipping": ship_div,
            "bugs": bug_div,
            "webdashboard_url": settings.WEBDASHBOARD_URL,
            "verbatim_url": verbatim_url,
            "PROGRESS_IMG_SIZE": settings.PROGRESS_IMG_SIZE,
            "PROGRESS_IMG_NAME": settings.PROGRESS_IMG_NAME,
            "cachebuster": cachebuster,
        },
    )
Beispiel #8
0
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect('homepage.views.teams')

    from shipping.views import teamsnippet as ship_snippet
    ship_div = mark_safe(ship_snippet(loc))

    from bugsy.views import teamsnippet as bug_snippet
    bug_div = mark_safe(bug_snippet(loc))

    name = loc.name or loc.code

    return render(request, 'homepage/locale-team.html', {
                    'locale': loc,
                    'locale_name': name,
                    'shipping': ship_div,
                    'bugs': bug_div,
                    'webdashboard_url': settings.WEBDASHBOARD_URL,
                  })
Beispiel #9
0
Datei: views.py Projekt: g-k/elmo
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect('teams')
    try:
        team_locale = TeamLocaleThrough.objects.current().get(locale=loc)
        return redirect('l10n-team', team_locale.team.code)
    except TeamLocaleThrough.DoesNotExist:
        pass

    team_locales = (
        TeamLocaleThrough.objects.current()
        .filter(team=loc).values_list('locale', flat=True)
    )
    from shipping.views import teamsnippet as ship_snippet
    shipping = ship_snippet(loc, team_locales)

    from bugsy.views import teamsnippet as bug_snippet
    bugs = bug_snippet(loc)

    name = loc.name or loc.code

    try:
        cachebuster = (
            '?%d' % Run.objects.order_by('-pk').values_list('id', flat=True)[0]
            )
    except IndexError:
        cachebuster = ''

    return render(request, 'homepage/locale-team.html', {
                    'locale': loc,
                    'locale_name': name,
                    'shipping': shipping,
                    'bugs': bugs,
                    'webdashboard_url': settings.WEBDASHBOARD_URL,
                    'PROGRESS_IMG_SIZE': settings.PROGRESS_IMG_SIZE,
                    'PROGRESS_IMG_NAME': settings.PROGRESS_IMG_NAME,
                    'cachebuster': cachebuster,
                  })
Beispiel #10
0
def locale_team(request, code):
    try:
        loc = Locale.objects.get(code=code)
    except Locale.DoesNotExist:
        return redirect('homepage.views.teams')
    try:
        team_locale = TeamLocaleThrough.objects.current().get(locale=loc)
        return redirect('homepage.views.locale_team', team_locale.team.code)
    except TeamLocaleThrough.DoesNotExist:
        pass

    team_locales = (
        TeamLocaleThrough.objects.current()
        .filter(team=loc).values_list('locale', flat=True)
    )
    from shipping.views import teamsnippet as ship_snippet
    shipping = ship_snippet(loc, team_locales)

    from bugsy.views import teamsnippet as bug_snippet
    bugs = bug_snippet(loc)

    name = loc.name or loc.code

    try:
        cachebuster = (
            '?%d' % Run.objects.order_by('-pk').values_list('id', flat=True)[0]
            )
    except IndexError:
        cachebuster = ''

    return render(request, 'homepage/locale-team.html', {
                    'locale': loc,
                    'locale_name': name,
                    'shipping': shipping,
                    'bugs': bugs,
                    'webdashboard_url': settings.WEBDASHBOARD_URL,
                    'PROGRESS_IMG_SIZE': settings.PROGRESS_IMG_SIZE,
                    'PROGRESS_IMG_NAME': settings.PROGRESS_IMG_NAME,
                    'cachebuster': cachebuster,
                  })