Truncate long names

This commit prevents page layout failure in the following cases:

1) In page headers at environment and  component details page
   and deployment page also

2) Current environment and category name at applications page

Also, environment name translation was removed since it is user input.
(and truncate doesn't work with blocktrance)

This is a cherry-pick from 0c98c671c8
Closes-Bug: #1467489

Change-Id: Ie40113ece55456a7a72048939f8c1f57afde3212
This commit is contained in:
Ekaterina Chernova 2015-07-23 13:42:16 +03:00
parent e93c5706e8
commit 3ea399c427
5 changed files with 10 additions and 10 deletions

View File

@ -6,7 +6,7 @@
<div id="environment_switcher" class="header dropdown">
{% with num_of_envs=available_environments|length %}
{% if environment %}
<a href="#environment_switcher" class="btn btn-default btn-sm dropdown-toggle">{{ environment.name }} {% if num_of_envs > 1 %} <b class="caret"></b>{% endif %}</a>
<a href="#environment_switcher" class="btn btn-default btn-sm dropdown-toggle">{{ environment.name|truncatechars:30}} {% if num_of_envs > 1 %} <b class="caret"></b>{% endif %}</a>
{% else %}
<a href="{% url 'horizon:murano:environments:create_environment' %}?next={% url 'horizon:murano:catalog:index' %}" title="{% trans 'Click to create an environment' %}" class="btn btn-default ajax-modal">{% trans "Create Environment" %}</a>
{% endif %}

View File

@ -37,7 +37,7 @@
<div class="header dropdown">
<a href="#"
class="btn btn-sm btn-default dropdown-toggle">
{{ current_category }} <b
{{ current_category|truncatechars:30 }} <b
class="caret"></b></a>
<ul class="dropdown-menu row_actions clearfix">
{% for category in categories %}

View File

@ -7,9 +7,9 @@
{% blocktrans %}Environments{% endblocktrans %}
</a> >
<a href=" {% url 'horizon:murano:environments:services' environment_id %}?tab=environment_details__deployments">
{% blocktrans %} Environment {{ environment_name }}{% endblocktrans %}
{% blocktrans%}Environment{% endblocktrans %} {{ environment_name|truncatechars:60 }}
</a> >
Deployment at {{ deployment_start_time }}
{% blocktrans%}Deployment at{% endblocktrans %} {{ deployment_start_time }}
</h2>
</div>
{% endblock %}

View File

@ -7,9 +7,8 @@
{% blocktrans %}Environments{% endblocktrans %}
</a> >
<a href=" {% url 'horizon:murano:environments:services' service.environment_id %}">
{% blocktrans %}Environment {{ environment_name }}{% endblocktrans %}
</a>
{% blocktrans %} > Component: {{ service_name }}{% endblocktrans %}
{% blocktrans %}Environment{% endblocktrans %} {{ environment_name|truncatechars_html:30 }}
</a> > {% blocktrans%}Component{% endblocktrans %} {{ service_name|truncatechars:30 }}
</h2>
</div>

View File

@ -3,10 +3,11 @@
{% load static %}
{% block page_header %}
<div class='page-header'>
<h2>
<h2>
<a href=" {% url 'horizon:murano:environments:index' %}">
{% blocktrans %}Environments{% endblocktrans %}
</a> > Environment {{ environment_name }}
</h2>
</a> > {% blocktrans %}Environment{% endblocktrans %}
{{ environment_name|truncatechars:60 }}
</h2>
</div>
{% endblock %}