Beispiel #1
0
def blueprints(request, template=BLUEPRINTS_TEMPLATE):
    blueprint_names = utils.get_blueprints()
    blueprints = []
    for name in blueprint_names:
        blueprints.append(utils.get_blueprint(name))

    return direct_to_template(
        request, template, {"menu_current": "design_blueprints", "h1": "Scrap Blueprints", "blueprints": blueprints}
    )
Beispiel #2
0
from django import forms
from django.utils.translation import ugettext_lazy as _

from bp.core.scraps.utils import get_blueprints

BLUEPRINT_CHOICES = get_blueprints(two_tuple=True, families=True)

class CreateScrapForm(forms.Form):
    blueprint_name = forms.ChoiceField(
        choices=BLUEPRINT_CHOICES,
        label='',
        help_text="Select a blueprint and click the <strong>Create Scrap</strong> button.",
    )

class CreatePileForm(forms.Form):
    name = forms.CharField(
        label='',
        help_text="Enter a name and click the <strong>Create Pile</strong> button.",
        max_length=30,
    )

class RenamePileForm(forms.Form):
    name = forms.CharField(
        max_length=30,
    )