edit_base.html 5.64 KB
 {% extends "base.html" %}

 {% load url_view_to_edit %}
  
 {% block title %}
 	Routine Manager
 {% endblock %}

 {% block content %}

	<div class="row text-center" style="margin-top: 20px;">
	
		<ul class="nav nav-tabs col-lg-4" style="margin-bottom: 15px;">
		
			{% if depth_level > 0 %}
				<li {% if depth_level == 1 %}class="active"{% endif %}><a href="{% url "action_request" req_id action%}" >Request Info</a></li>		
			{% endif %}

			{% if depth_level > 1 %}
				<li {% if depth_level == 2 %}class="active"{% endif %}><a href="{% url "action_sequence" seq_id action%}" >Sequence Info</a></li>		
			{% endif %}

			{% if depth_level > 2 %}
				<li {% if depth_level == 3 %}class="active"{% endif %}><a href="{% url "action_album" alb_id action%}" >Album Info</a></li>		
			{% endif %}

			{% if depth_level > 3 %}
				<li {% if depth_level == 4 %}class="active"{% endif %}><a href="{% url "action_plan" plan_id action%}" >Plan Info</a></li>		
			{% endif %}
	    </ul>
	

		<div class="nav-tabs col-lg-6 text-left" style="margin-top:1px">
			<div class="row col-lg-4">
				{% if req.submitted == False %}
					{% if req.complete == True %}
						<a href="{% url "submit_request" req.id "action_request" %}" class="btn btn-info" onclick="return confirm('The request will be validated, and the sequences scheduled')"
						title="The request will be validated, and the sequences scheduled">Submit request for scheduling</a>
					{% else %}
						<a class="btn btn-info" onclick="return confirm('The request must be complete to be submitted')"
						title="The request must be complete to be submitted">Submit request for scheduling</a>
					{% endif %}
				{% else %}
					<a href="{% url "unsubmit_request" req.id %}" class="btn btn-warning" onclick="return confirm('The request will be unvalidated, and the unexecuted sequences, unscheduled')"
					title="The request will be unvalidated, and the unexecuted sequences, unscheduled">Unsubmit request</a>
				{% endif %}			
			</div>

			<div class="row col-lg-4">
				<a href="{% url "export_request" req.id %}" class="btn btn-info">Export request as XML file</a>
			</div>

			<div class="row col-lg-4">
				TODO : ajouter checkbox pour choisir en dynamique JD / GD
			</div>
		</div>

	</div>
	<div class="row">                                                                                                                                                                                                                            
	                                                                                                                                                                                                                                             
	        <div class="col-lg-6">                                                                                                                                                                                                              
	                <h3>
	                	{% block section_title %}

	                	{% endblock %}
	                </h3>                                                                                                                                                                       

				{% block fields %}

				{% endblock %}
				
				{% if action == "view" %}
					<a href="{{request.path|url_view_to_edit }}" class="btn btn-primary">Move to edition mode</a>
					
				{% endif %}
	        </div>                                                                                                                                                                                                                               
	                                                                                                                                                                                                                                             
		<div class="col-lg-6">
			<div class="row col-lg-12">
				<div class="panel-heading"><h3>Summary</h3></div>
				<div class="well" style="overflow:scroll; height:350px;">
					<div>
						<a class="btn btn-sm {% if req.complete %}btn-success{% else %}btn-danger{% endif %}" href="{% url "action_request" req_id action%}" >Request: {{ req.name }}</a>
						{% if depth_level == 1 %}<span class="label label-info">{{action}}ing ...</span>{% endif %}
					</div>
					{% for seq in req.sequences.all %}
					
						<div>
							<a class="btn btn-sm {% if seq.status != "INCPL" %}btn-success{% else %}btn-danger{% endif %}" href="{% url "action_sequence" seq.id action%}" style="margin-left: 60px" >Sequence: {{ seq.name }}</a>
							{% if depth_level == 2 and seq_id == seq.id %}<span class="label label-info">{{action}}ing ...</span>{% endif %}
						</div>
						{% for album in seq.albums.all %}
					
							<div>
								<a class="btn btn-sm {% if album.complete %}btn-success{% else %}btn-danger{% endif %}" href="{% url "action_album" album.id action%}" style="margin-left: 120px" >Album: {{ album.name }}</a>
								{% if depth_level == 3 and alb_id == album.id %}<span class="label label-info">{{action}}ing ...</span>{% endif %}
							</div>
							{% for plan in album.plans.all %}
					
								<div>
									<a class="btn btn-sm {% if plan.complete %}btn-success{% else %}btn-danger{% endif %}" href="{% url "action_plan" plan.id action%}" style="margin-left: 180px" >Plan: {{ plan.name }}</a>
									{% if depth_level == 4 and plan_id == plan.id %}<span class="label label-info">{{action}}ing ...</span>{% endif %}
								</div>							
								
							{% endfor %}
					
						{% endfor %}
					
					{% endfor %}			
				</div>
			</div>
			
			{% block children %}

			{% endblock %}		
		</div>


	</div>


 {% endblock %}