uonline/uonline

View on GitHub
views/new_character.jade

Summary

Maintainability
Test Coverage
extends layout
block title
    | Создание персонажа
block content
    .page-header
        h1 Создание персонажа
    if error === true
        .alert.alert-danger
            a.close(href='#', data-dismiss='alert') ×
            if nameIsBusy === true
                b Извините! Это имя уже занято.
                | #{' '}Придумайте какое-нибудь другое.
            else
                b Ой! Вы что-то не так ввели.
                | #{' '}Исправьте ошибки и попробуйте ещё раз.
    form.pjax.form-horizontal(method='post', action='/action/newCharacter')
        #character-name-form-group.form-group.has-feedback(class=(error?'has-error':''))
            label.col-sm-2.control-label(for='character_name') Имя
            .col-sm-3
                input.form-control#character-name(type='text', name='character_name', maxlength='32', required, autofocus)
                span#character-name-feedback.glyphicon.glyphicon-ok.form-control-feedback(style='display: none')
            span.col-sm-7.help-block
                small От 2 до 32 символов, [a-zA-Zа-яА-Я -].
        .form-group
            label.col-sm-2.control-label(for='character_race') Раса
            .col-sm-3
                div.radio
                    label
                        input(type='radio', name='character_race', value='orc', checked='checked')
                        | #{' '}
                        | Орк
                div.radio
                    label
                        input(type='radio', name='character_race', value='human')
                        | #{' '}
                        | Человек
                div.radio
                    label
                        input(type='radio', name='character_race', value='elf')
                        | #{' '}
                        | Эльф
        .form-group
            label.col-sm-2.control-label(for='character_gender') Пол
            .col-sm-3
                div.radio
                    label
                        input(type='radio', name='character_gender', value='male', checked='checked')
                        | #{' '}
                        | Мужчина
                div.radio
                    label
                        input(type='radio', name='character_gender', value='female')
                        | #{' '}
                        | Женщина
        .form-group
            .col-sm-2
            .col-sm-3
                button.btn.btn-primary(type='submit') Создать