<%! from django.utils.translation import ugettext as _ %>
<%! from xmodule.split_test_module import ValidationMessageType %>

<%
split_test = context.get('split_test')
(message, message_type) = split_test.descriptor.validation_message()
message_type_display_name = ValidationMessageType.display_name(message_type) if message_type else None
is_configured = split_test.user_partition_id >= 0
%>

% if message or not is_configured:
    % if is_root and not is_configured:
        <div class="no-container-content">
    % else:
        <div class="wrapper-xblock-message">
        <div class="xblock-message ${message_type}">
    % endif

    % if not is_configured:
        <p><i class="icon-warning-sign"></i> ${_("You must select a group configuration for this content experiment.")}
            <a href="#" class="button edit-button action-button">
                <i class="icon-pencil"></i> <span class="action-button-text">${_("Select a Group Configuration")}</span>
            </a>
        </p>
    % else:
        <p>
            % if message_type == 'warning':
                <i class='icon-warning-sign'></i>
            % elif message_type == 'error':
                <i class='icon-exclamation-sign'></i>
            % endif
        <span class='message-text'>
            % if message_type_display_name:
                <span class='sr'>${message_type_display_name}:</span>
            % endif
            ${message}
        </span>
        </p>
    % endif

    % if is_root and not is_configured:
        </div>
    % else:
        </div>
        </div>
    % endif
% endif
