{% extends "tcms_base.html" %}
{% load static %}

{% block subtitle %}Environment properties{% endblock %}

{% block custom_stylesheet %}

{% endblock %}

{% block custom_javascript %}
<script type="text/javascript" src="{% static "js/management_actions.js" %}"></script>
<script type="text/javascript">
	Nitrate.Management.Environment.Property.URLs = {
      add_property: '{% url "management-add-env-property" %}',
      edit_property: '/environment/properties/$id/edit/',
      del_property: '{% url "management-env-properties" %}',
	  set_property_status: '{% url "management-set-env-property-status" %}',
      set_property_values_status: '{% url "management-set-env-property-values-status" %}',
      list_property_values: '/environment/properties/$id/values/',
      add_property_value: '/environment/properties/$id/values/add/',
	  edit_property_value: '/environment/properties/values/$id/edit/',
	};
	Nitrate.Utils.after_page_load(Nitrate.Management.Environment.Property.on_load);
</script>
{% endblock %}

{% block contents %}
<div id="content">
	<div class="sprites crumble">
		<a href="{% url "nitrate-index" %}">Home</a>
		>> <a href="{% url "management-env-groups" %}">Environment groups</a>
		>> Environment Properties
	</div>
	<h2>Environment Properties</h2>
	<div id="message" class="successlink ">{{ message }}</div>
	<div class="Detailform border-1" style="float:left;margin-left:1%">
	<fielset>
		<form id="id_property_form">
			<div class="env-list-side manage ">
				<div class="mixbar">
				<span class="tit">Properties</span>
				<span class="right-action">
					{% if perms.management.add_tcmsenvproperty %}
					<a id="js-add-prop" class="addlink" href="javascript:void(0)">Add</a>
					{% endif %}
					{% if perms.management.change_tcmsenvproperty %}
					<a id="js-disable-prop" class="disablelink" href="javascript:void(0)">Disable</a>
					<a id="js-enable-prop" class="enablelink" href="javascript:void(0)">Enable</a>
					{% endif %}
				</span>
				</div>
				<ul class="groupul" id="id_properties_container">
					{% for property in properties %}
					<li id="id_property_{{ property.pk }}" data-param="{{ property.pk }}" class="{% cycle 'even' 'odd' %} js-one-prop">
						<span class="lab" style="float:left; width:50%;">
							<input type="checkbox" name="id" value="{{ property.pk }}">
							<a id="id_property_name_{{ property.pk }}" class="{% if property.is_active %}{% else %}line-through{% endif %} js-prop-name">{{ property.name }}</a>
						</span>
						{% if perms.management.change_tcmsenvproperty %}
						<div class="right-action">
							<a class="editlink js-edit-prop" href="javascript:void(0)">Rename</a>
						</div>
						{% endif %}
					</li>
					{% endfor %}
				</ul>
			</div>
		</form>
	</fielset>
	<fielset>
		<div class="env-list-side" id="id_values_container">
		</div>
	</fielset>
	</div>
</div>
{% endblock %}
