Cherry pick from master:

* Forbid form closing on the backdrop click
* Forbit closing on the backdrop. Part2

Change-Id: Iaf0029efb375c92da93a4c092426ece400f31d6d
This commit is contained in:
Ekaterina Fedorova 2013-09-24 12:18:15 +04:00
parent 80b7dd2b74
commit f9d6e954de
5 changed files with 32 additions and 8 deletions

View File

@ -166,8 +166,6 @@ def environments_list(request):
def environment_create(request, parameters):
#name is required param
name = parameters['name']
log.debug('Environment::Create <Name: {0}>'.format(name))
env = muranoclient(request).environments.create(name)
log.debug('Environment::Create {0}'.format(env))
return env

View File

@ -23,7 +23,7 @@ from horizon import workflows
from muranodashboard.panel import api
LOG = logging.getLogger(__name__)
log = logging.getLogger(__name__)
class SelectProjectUserAction(workflows.Action):
@ -87,7 +87,9 @@ class CreateEnvironment(workflows.Workflow):
try:
api.environment_create(request, context)
return True
except:
except Exception:
name = self.context.get('name', 'noname')
log.error("Unable to create environment {0}".format(name))
exceptions.handle(request)
return False
@ -100,9 +102,11 @@ class UpdateEnvironmentInfoAction(workflows.Action):
api.environment_update(request,
data['environment_id'],
data['name'])
except:
except Exception:
exceptions.handle(request, ignore=True)
log.error("Unable to update environment name with ud={0}".format(
data['environment_id'],
))
return False
return True

View File

@ -0,0 +1,22 @@
<div id="{% block modal_id %}{% endblock %}" data-backdrop="static" class="{% block modal_class %}{% if hide %}modal hide{% else %}static_page{% endif %}{% endblock %}">
<div class="modal-header">
{% if hide %}<a href="#" class="close" data-dismiss="modal">&times;</a>{% endif %}
<h3>{% block modal-header %}{% endblock %}</h3>
</div>
{% if table %}
<div class="modal-body">
{{ table.render }}
</div>
<hr />
{% endif %}
<form id="{% block form_id %}{% endblock %}" autocomplete="{% block autocomplete %}{% endblock %}" class="{% block form_class %}{% endblock %}" action="{% block form_action %}{% endblock %}" method="{% block form-method %}POST{% endblock %}" {% if add_to_field %}data-add-to-field="{{ add_to_field }}"{% endif %} {% block form_attrs %}{% endblock %}>{% csrf_token %}
<div class="modal-body clearfix">
{% block modal-body %}
<fieldset>
{% include "common/_form_fields.html" %}
</fieldset>
{% endblock %}
</div>
<div class="modal-footer">{% block modal-footer %}{% endblock %}</div>
</form>
</div>

View File

@ -1,4 +1,4 @@
{% extends "horizon/common/_modal_form.html" %}
{% extends "common/_modal_form.html" %}
{% load i18n humanize %}
{% block form_action %}{% url horizon:project:murano:create %}{% endblock %}
@ -16,7 +16,7 @@
{% endfor %}
{% else %}
<fieldset>
{% include "services/_horizon_form_fields.html" %}
{% include "common/_form_fields.html" %}
</fieldset>
{% endif %}
</div>