<commit_before>{% extends "base.html" %}

{% block title %}Overview{% endblock %}

{% block head %}

{{ super() }}
<script type="text/javascript">
$(document).ready(function(){    
    $('#status-body').on('shown.bs.collapse', function () {
       $("#status-icon").removeClass("fa-chevron-down").addClass("fa-chevron-up");
    });

    $('#status-body').on('hidden.bs.collapse', function () {
       $("#status-icon").removeClass("fa-chevron-up").addClass("fa-chevron-down");
    });
});
function removeSelf() {
	var settings = {
			dataType: "text",
			headers: {
				'X-CSRFToken': '{{csrf_token()}}'
			},
			method: 'DELETE',
			success: function(data, status, jqxhr){
				var wlNames = [{% for wl in lists %}"{{wl.name|e}}"{% if not loop.last %},{% endif %}{% endfor %}];
				for(var i=0, len=wlNames.length; i < len; i++) {
					var wlName = wlNames[i];
					console.log("Checking WL "+wlName);
					var entryId = "entry-"+wlName+"-{{ current_user.get_eve_id() }}";
					var entry = document.getElementById(entryId);
					if (entry != null) { // there is a entry for him on that wl
						entry.parentNode.removeChild(entry); // remote it from the DOM
					}
				}
			},
			url: "{{url_for('fittings.self_remove_all')}}"
	};
	$.ajax(settings);
}

function removeOwnEntry(wlName, charId, entryId) {
	var settings = {
			dataType: "text",
			headers: {
				'X-CSRFToken': '{{csrf_token()}}'
			},
			method: 'DELETE',
			success: function(data, status, jqxhr){
				var htmlId = "entry-"+wlName+"-"+charId;
				var entry = document.getElementById(htmlId);
				if (entry != null) { // there is a entry for him on that wl
					entry.parentNode.removeChild(entry); // remote it from the DOM
				}
			},
			url: "/api/self/wlentry/remove/"+entryId
	};
	$.ajax(settings);
}

function removeOwnFit(fitId, wlName, charId) {
	var settings = {
			dataType: "text",
			headers: {
				'X-CSRFToken': '{{csrf_token()}}'
			},
			method: 'DELETE',
			success: function(data, status, jqxhr){
				var entryHtmlId = "entry-"+wlName+"-"+charId;
				var fitHtmlId = "fit-"+fitId;
				var fit = document.getElementById(fitHtmlId);
				var entry = document.getElementById(entryHtmlId);
				if (fit != null) { // there is a entry for him on that wl
					fit.parentNode.removeChild(fit); // remote it from the DOM
				}
				var count = Number(entry.getAttribute("data-count"));
				if (count <= 1) {
					// no fit left, remove entry
					if (entry != null) { // there is a entry for him on that wl
						entry.parentNode.removeChild(entry); // remote it from the DOM
					}
				} else {
					count--;
					entry.setAttribute("data-count", count);
				}
			},
			url: "/api/self/fittings/remove/"+fitId
	};
	$.ajax(settings);
}
</script>
{% if perm_man.can() %}
<script type="text/javascript">
function invitePlayer(userId) {
	$.post("{{url_for('fittings.api_invite_player')}}", {'playerId': userId, '_csrf_token': '{{ csrf_token() }}'}, function(){
		/*var wl_names = [{% for wl in lists %}"{{wl.name|e}}",{% endfor %}];
		for (idx in wl_names) {
			var wl_name = wl_names[idx]
			var entry_id = "entry-"+wl_name+"-"+userId
			var entry = document.getElementById(entry_id);
			if (entry != null) { // there is a entry for him on that wl
				entry.parentNode.removeChild(entry); // remote it from the DOM
			}
		}*/
		$('#row-waitlists').load("{{url_for('index')}} #waitlists");
	}, "text");
}

function removePlayer(userId) {
	$.post("{{url_for('fittings.api_wls_remove_player')}}", {'playerId': userId, '_csrf_token': '{{ csrf_token() }}'}, function(){
		/*var wl_names = [{% for wl in lists %}"{{wl.name|e}}",{% endfor %}];
		for (idx in wl_names) {
			var wl_name = wl_names[idx]
			var entry_id = "entry-"+wl_name+"-"+userId
			var entry = document.getElementById(entry_id);
			if (entry != null) { // there is a entry for him on that wl
				entry.parentNode.removeChild(entry); // remote it from the DOM
			}
		}
		*/
		//$('#row-waitlists').load("{{url_for('index')}} #waitlists");
		window.location.reload(true);
	}, "text");
}

function removeEntry(entryId, userId) {
	$.post("{{url_for('fittings.api_wl_remove_entry')}}", {'entryId': entryId, '_csrf_token': '{{ csrf_token() }}'}, function(){
		/*var entry_id = "entry-{{queue.name}}-"+userId
		var entry = document.getElementById(entry_id);
		if (entry != null) { // there is a entry for him on that wl
			entry.parentNode.removeChild(entry); // remote it from the DOM
		}
		*/
		//$('#row-waitlists').load("{{url_for('index')}} #waitlists");
		window.location.reload(true);
	}, "text");
}

function moveEntryToWaitlists(entryId, userId) {
	$.post("{{url_for('fittings.move_to_waitlists')}}", {'entryId': entryId, '_csrf_token': '{{ csrf_token() }}'}, function(){
		/**var entry_id = "entry-{{queue.name}}-"+userId
		var entry = document.getElementById(entry_id);
		if (entry != null) { // there is a entry for him on that wl
			entry.parentNode.removeChild(entry); // remote it from the DOM
		}
		**/
		//$('#row-waitlists').load("{{url_for('index')}} #waitlists");
		window.location.reload(true);
	}, "text")
}

$(document).ready(function() {
	$("#remove-diag").on('show.bs.modal', function(e){
		var source = $(e.relatedTarget);
		var fname = source.data("type")
		if (fname == "removePlayer") {
			var userid = Number(source.data("user"));
			$("#remove-diag-accept").off();
			$("#remove-diag-accept").on("click", function() {
				window[fname](userid);
			});
			
			$("#remove-diag-body").text("Do you really want to remove this player from the Waitlist?");
			$("#remove-diag-label").text("Remove Player");
			
		} else if (fname == "removeEntry") {
			var userid = Number(source.data("user"));
			var entry = Number(source.data("entry"));
			$("#remove-diag-accept").off();
			$("#remove-diag-accept").on("click", function() {
				window[fname](entry, userid);
			});
			$("#remove-diag-body").text("Do you really want to remove this player from the X-UPs?");
			$("#remove-diag-label").text("Remove Player");
		}
	});
});
</script>
{% endif %}
{% if perm_viewfits.can() %}
<script src="https://quiescens.duckdns.org/wl/wtm.js"></script>
{% endif %}
{% endblock %}

{% block container_data %}
<div class="row">
	<div class="col-sm-6">
	<div class="card">
		<div style="cursor: pointer;" class="card-header" id="status-heading" data-toggle="collapse" data-target="#status-body" id="status-toggle">
	      <h4 class="card-title">
	          Status: {{fleet.status}}<i class="fa fa-chevron-down pull-xs-right" id="status-icon"></i>
	      </h4>
	    </div>
	    <div class="">
	    <table class="table-sm">
	    <tbody>
	    <tr>
	    	<th scope="row">Fleet Manager</th>
	    	<td>{% if fleet.manager is not none %}<a href="javascript:CCPEVE.showInfo(1377, {{fleet.manager[1]}});">{{fleet.manager[0]}}</a>{% else %}Not Set{% endif %}</td>
	    </tr>
	    </tbody>
	    </table>
	    </div>
	    <div id="status-body" class="collapse">
		    <table class="table-sm">
		    <tbody>
		    <!--
		    <tr>
		    	<th scope="row">FC</th>
		    	<td>{% if fleet.fc is not none %}<a href="javascript:CCPEVE.showInfo(1377, {{fleet.fc[1]}});">{{fleet.fc[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
			
		    <tr>
		    	<th scope="row">Fleet Manager</th>
		    	<td>{% if fleet.manager is not none %}<a href="javascript:CCPEVE.showInfo(1377, {{fleet.manager[1]}});">{{fleet.manager[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
		    -->
		    <tr>
		    	<th scope="row">Constellation</th>
		    	<td>{% if fleet.constellation is not none %}<a href="javascript:CCPEVE.showInfo(4, {{fleet.constellation[1]}});">{{fleet.constellation[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
		    <tr>
		    	<th scope="row">Dockup</th>
		    	<td>{% if fleet.dock is not none %}<a href="javascript:CCPEVE.setDestination({{fleet.dock[1]}});">{{fleet.dock[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
		    <tr>
		    	<th scope="row">HQ System</th>
		    	<td>{% if fleet.systemhq is not none %}<a href="javascript:CCPEVE.showInfo(5, {{fleet.systemhq[1]}});">{{fleet.systemhq[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
		    </tbody>
		    </table>
    	</div>
    </div>
	</div>
	<div class="col-sm-6">
		<div class="alert alert-info" role="alert">
  			<p class="text-xs-center"><strong>Help us!</strong> We would like your <a href="{{url_for('feedback.index')}}">feedback</a>!</p>
		</div>
		{% if not xup_open %}
		<div class="alert alert-warning" role="alert">
  			<p class="text-xs-center">X-up is currently closed!</p>
		</div>
		{% endif %}
	</div>
</div>
<div class="row" id="row-waitlists">
<div id="waitlists">
<div class="col-sm-3" id="wl-{{ queue.name }}">
	<ol class="list-group">
		<li class="list-group-item text-capitalize">X-Ups</li>
		{% for entry in queue.entries %}
		<li class="list-group-item" id="entry-{{ queue.name }}-{{ entry.user }}">
			<div class="card">
				<div class="container">
					{% if user.get_eve_id() == entry.user or perm_man.can() %}
					<a href="javascript:CCPEVE.showInfo(1377, {{ entry.user }});">
					{% endif %}
					<div class="row">
						<div class="col-sm-2 hidden-sm-down">
							<img src="https://image.eveonline.com/Character/{{ entry.user }}_32.jpg" alt="{{ entry.user_data.eve_name|e }}">
						</div>
						<div class="col-sm-8">
						{{ entry.user_data.eve_name|e }}{% if (user.get_eve_id() == entry.user or perm_man.can()) and entry.user_data.is_new() %} <span class="label label-info">New</span>{% endif %}
						</div>
					</div>
					{% if user.get_eve_id() == entry.user or perm_man.can() %}
					</a>
					{% endif %}
					<div class="row">
						<div class="btn-group btn-group-mini" role="group" aria-label="Action Buttons">
							{% if perm_man.can() %}
							<!-- <button type="button" class="btn btn-primary" onclick="javascript:CCPEVE.showInfo(1377, {{ entry.user }})">Char</button> -->
							<button type="button" class="btn btn-danger"  data-toggle="modal" data-target="#remove-diag" data-type="removeEntry" data-entry="{{entry.id}}" data-user="{{entry.user}}">Remove</button>
							<button type="button" class="btn btn-secondary" onclick="javascript:CCPEVE.startConversation({{ entry.user }})">Convo</button>
							<button type="button" class="btn btn-success" onclick="javascript:moveEntryToWaitlists({{ entry.id }}, {{ entry.user }})">Approve</button>
							{% endif %}
							{% if user.get_eve_id() == entry.user %}
							<button type="button" class="btn btn-warning"
								onclick="javascript:removeOwnEntry('{{queue.name}}', {{entry.user}}, {{ entry.id }});">Remove Self</button>
							{% endif %}
							{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
							<button type="button" data-toggle="collapse" data-target="#fittings-{{entry.id}}" class="btn btn-primary">Show/Hide Fits</button>
							{% endif %}
						</div>
					</div>
					
				</div>
				{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
  				<ul class="list-group list-group-flush collapse" id="fittings-{{entry.id}}">
				{% for fit in entry.fittings %}
    				<li class="list-group-item fitting">
    					<div class="container fit-link" data-dna="{{ fit.ship_type }}:{{ fit.modules }}">
    					<div class="row">
    						<div class="col-sm-4 hidden-sm-down">
    						<img src="https://image.eveonline.com/Render/{{ fit.ship_type }}_32.png" alt="{{ entry.user_data.eve_name|e }}">
    						</div>
    						<div class="col-sm-8">
    							<div class="row">
    							{{ fit.ship.typeName|e }}
    							</div>
    							{% if fit.comment is not none %}
    							<div class="row">
    							<small>{{ fit.comment|safe }}</small>
    							</div>
    							{% endif %}
    						</div>
    					</div>
    					</div>
    				</li>
				{% endfor %}
  				</ul>
  				{% endif %}
			</div>
		</li>
		{% endfor %}
	</ol>
</div>
{% for wlist in lists %}
<div class="col-sm-3" id="wl-{{ wlist.name }}">
	<ol class="list-group">
		<li class="list-group-item text-capitalize">{{ wlist.name|e }} WL</li>
		{% for entry in wlist.entries %}
		<li class="list-group-item"
			id="entry-{{wlist.name}}-{{ entry.user }}" {% if user.get_eve_id() == entry.user %}data-count="{{entry.fittings|length}}"{% endif %}>
			<div class="card">
				<div class="container">
					{% if user.get_eve_id() == entry.user or perm_man.can() %}
					<a href="javascript:CCPEVE.showInfo(1377, {{ entry.user }});">
					{% endif %}
					<div class="row">
					
						<div class="col-sm-2 col-xs-4">
								<img
								src="https://image.eveonline.com/Character/{{ entry.user }}_32.jpg"
								alt="{{ entry.user_data.eve_name|e }}">
						</div>
						<div class="col-sm-10 ol-xs-8">
							{{ entry.user_data.eve_name|e }}{% if entry.user_data.is_new() %} <span class="label label-info">New</span>{% endif %}
						</div>

					</div>
					{% if current_user.get_eve_id() == entry.user or perm_man.can() %}
					</a>
					{% endif %}
					{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
					<div class="row">
						<div class="btn-group btn-group-mini" role="group" aria-label="Action Buttons">
							{% if current_user.get_eve_id() == entry.user %}
							<!--  <button type="button" class="btn btn-mini btn-warning"
								onclick="javascript:removeOwnEntry('{{wlist.name}}', {{entry.user}}, {{ entry.id }});">Remove Self</button> -->
							{% endif %}
							{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
							<button type="button" data-toggle="collapse" data-target="#fittings-{{entry.id}}" class="btn btn-mini btn-primary">Show/Hide Fits</button>
							{% endif %}
							{% if perm_man.can() %}
							<!-- <button type="button" class="btn btn-primary" onclick="javascript:CCPEVE.showInfo(1377, {{ entry.user }})">Char</button> -->
							<button type="button" class="btn btn-secondary" onclick="javascript:CCPEVE.startConversation({{ entry.user }})">Convo</button>
							<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#remove-diag" data-type="removePlayer" data-user="{{entry.user}}">Remove Player</button>
							<button type="button" class="btn btn-success" onclick="javascript:invitePlayer({{ entry.user }})">Was Invited</button>
							{% endif %}
						</div>
					</div>
					{% endif %}
				</div>
				{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
				<ul class="list-group list-group-flush collapse" id="fittings-{{entry.id}}">
					{% for fit in entry.fittings %}
					<li class="list-group-item fitting" id="fit-{{ fit.id }}">
						<div class="container">
							<div class="row fit-link" data-dna="{{ fit.ship_type }}:{{ fit.modules }}">
								<div class="col-sm-4">
									<img
										src="https://image.eveonline.com/Render/{{ fit.ship_type }}_32.png"
										alt="{{ entry.user_data.eve_name|e }}">
								</div>
								<div class="col-sm-8">
									<div class="row">{{ fit.ship.typeName|e }}</div>
									{% if fit.comment is not none %}
									<div class="row"><small>{{ fit.comment|safe }}</small></div>
									{% endif %}
								</div>
							</div>
							{% if user.get_eve_id() == entry.user %}
							<div class="row">
								<div class="btn-group btn-group-mini" role="group"
									aria-label="Action Buttons">
									<button type="button" class="btn btn-mini btn-warning"
										onclick="javascript:removeOwnFit({{ fit.id }}, '{{ wlist.name }}', {{ entry.user }});">Remove Fit</button>
								</div>
							</div>
							{% endif %}
						</div>
					</li>
					{% endfor %}
				</ul>
				{% endif %}
			</div>
		</li> {% endfor %}
	</ol>
</div>
{% endfor %}
</div>
</div>
{% if perm_man.can() %}
<div class="modal fade bd-example-modal-sm" id="remove-diag" tabindex="-1" role="dialog" aria-labelledby="remove-diag-label" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
      	<button type="button" class="close" data-dismiss="modal" aria-label="Close">
      		<span aria-hidden="true">&times;</span>
		</button>
        <h4 class="modal-title" id="remove-diag-label"></h4>
      </div>
      <div class="modal-body" id="remove-diag-body">
      </div>
      <div class="modal-footer">
          <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
          <button type="button" class="btn btn-danger" id="remove-diag-accept">Yes</button>
      </div>
    </div><commit_msg>made all the list toogleable with icons indicating the current toggle status<commit_after>{% extends "base.html" %}

{% block title %}Overview{% endblock %}

{% block head %}

{{ super() }}
<script type="text/javascript">
$(document).ready(function(){    
    $('.collapse').on('shown.bs.collapse', function (e) {
    	var togglerSelector = $(e.target).data("tog-icon");
       	$(togglerSelector).removeClass("fa-chevron-down").addClass("fa-chevron-up");
    });

    $('.collapse').on('hidden.bs.collapse', function (e) {
    	var togglerSelector = $(e.target).data("tog-icon");
		$(togglerSelector).removeClass("fa-chevron-up").addClass("fa-chevron-down");
    });
});
function removeSelf() {
	var settings = {
			dataType: "text",
			headers: {
				'X-CSRFToken': '{{csrf_token()}}'
			},
			method: 'DELETE',
			success: function(data, status, jqxhr){
				var wlNames = [{% for wl in lists %}"{{wl.name|e}}"{% if not loop.last %},{% endif %}{% endfor %}];
				for(var i=0, len=wlNames.length; i < len; i++) {
					var wlName = wlNames[i];
					console.log("Checking WL "+wlName);
					var entryId = "entry-"+wlName+"-{{ current_user.get_eve_id() }}";
					var entry = document.getElementById(entryId);
					if (entry != null) { // there is a entry for him on that wl
						entry.parentNode.removeChild(entry); // remote it from the DOM
					}
				}
			},
			url: "{{url_for('fittings.self_remove_all')}}"
	};
	$.ajax(settings);
}

function removeOwnEntry(wlName, charId, entryId) {
	var settings = {
			dataType: "text",
			headers: {
				'X-CSRFToken': '{{csrf_token()}}'
			},
			method: 'DELETE',
			success: function(data, status, jqxhr){
				var htmlId = "entry-"+wlName+"-"+charId;
				var entry = document.getElementById(htmlId);
				if (entry != null) { // there is a entry for him on that wl
					entry.parentNode.removeChild(entry); // remote it from the DOM
				}
			},
			url: "/api/self/wlentry/remove/"+entryId
	};
	$.ajax(settings);
}

function removeOwnFit(fitId, wlName, charId) {
	var settings = {
			dataType: "text",
			headers: {
				'X-CSRFToken': '{{csrf_token()}}'
			},
			method: 'DELETE',
			success: function(data, status, jqxhr){
				var entryHtmlId = "entry-"+wlName+"-"+charId;
				var fitHtmlId = "fit-"+fitId;
				var fit = document.getElementById(fitHtmlId);
				var entry = document.getElementById(entryHtmlId);
				if (fit != null) { // there is a entry for him on that wl
					fit.parentNode.removeChild(fit); // remote it from the DOM
				}
				var count = Number(entry.getAttribute("data-count"));
				if (count <= 1) {
					// no fit left, remove entry
					if (entry != null) { // there is a entry for him on that wl
						entry.parentNode.removeChild(entry); // remote it from the DOM
					}
				} else {
					count--;
					entry.setAttribute("data-count", count);
				}
			},
			url: "/api/self/fittings/remove/"+fitId
	};
	$.ajax(settings);
}
</script>
{% if perm_man.can() %}
<script type="text/javascript">
function invitePlayer(userId) {
	$.post("{{url_for('fittings.api_invite_player')}}", {'playerId': userId, '_csrf_token': '{{ csrf_token() }}'}, function(){
		/*var wl_names = [{% for wl in lists %}"{{wl.name|e}}",{% endfor %}];
		for (idx in wl_names) {
			var wl_name = wl_names[idx]
			var entry_id = "entry-"+wl_name+"-"+userId
			var entry = document.getElementById(entry_id);
			if (entry != null) { // there is a entry for him on that wl
				entry.parentNode.removeChild(entry); // remote it from the DOM
			}
		}*/
		$('#row-waitlists').load("{{url_for('index')}} #waitlists");
	}, "text");
}

function removePlayer(userId) {
	$.post("{{url_for('fittings.api_wls_remove_player')}}", {'playerId': userId, '_csrf_token': '{{ csrf_token() }}'}, function(){
		/*var wl_names = [{% for wl in lists %}"{{wl.name|e}}",{% endfor %}];
		for (idx in wl_names) {
			var wl_name = wl_names[idx]
			var entry_id = "entry-"+wl_name+"-"+userId
			var entry = document.getElementById(entry_id);
			if (entry != null) { // there is a entry for him on that wl
				entry.parentNode.removeChild(entry); // remote it from the DOM
			}
		}
		*/
		//$('#row-waitlists').load("{{url_for('index')}} #waitlists");
		window.location.reload(true);
	}, "text");
}

function removeEntry(entryId, userId) {
	$.post("{{url_for('fittings.api_wl_remove_entry')}}", {'entryId': entryId, '_csrf_token': '{{ csrf_token() }}'}, function(){
		/*var entry_id = "entry-{{queue.name}}-"+userId
		var entry = document.getElementById(entry_id);
		if (entry != null) { // there is a entry for him on that wl
			entry.parentNode.removeChild(entry); // remote it from the DOM
		}
		*/
		//$('#row-waitlists').load("{{url_for('index')}} #waitlists");
		window.location.reload(true);
	}, "text");
}

function moveEntryToWaitlists(entryId, userId) {
	$.post("{{url_for('fittings.move_to_waitlists')}}", {'entryId': entryId, '_csrf_token': '{{ csrf_token() }}'}, function(){
		/**var entry_id = "entry-{{queue.name}}-"+userId
		var entry = document.getElementById(entry_id);
		if (entry != null) { // there is a entry for him on that wl
			entry.parentNode.removeChild(entry); // remote it from the DOM
		}
		**/
		//$('#row-waitlists').load("{{url_for('index')}} #waitlists");
		window.location.reload(true);
	}, "text")
}

$(document).ready(function() {
	$("#remove-diag").on('show.bs.modal', function(e){
		var source = $(e.relatedTarget);
		var fname = source.data("type")
		if (fname == "removePlayer") {
			var userid = Number(source.data("user"));
			$("#remove-diag-accept").off();
			$("#remove-diag-accept").on("click", function() {
				window[fname](userid);
			});
			
			$("#remove-diag-body").text("Do you really want to remove this player from the Waitlist?");
			$("#remove-diag-label").text("Remove Player");
			
		} else if (fname == "removeEntry") {
			var userid = Number(source.data("user"));
			var entry = Number(source.data("entry"));
			$("#remove-diag-accept").off();
			$("#remove-diag-accept").on("click", function() {
				window[fname](entry, userid);
			});
			$("#remove-diag-body").text("Do you really want to remove this player from the X-UPs?");
			$("#remove-diag-label").text("Remove Player");
		}
	});
});
</script>
{% endif %}
{% if perm_viewfits.can() %}
<script src="https://quiescens.duckdns.org/wl/wtm.js"></script>
{% endif %}
{% endblock %}

{% block container_data %}
<div class="row">
	<div class="col-sm-6">
	<div class="card">
		<div style="cursor: pointer;" class="card-header" id="status-heading" data-toggle="collapse" data-target="#status-body" id="status-toggle">
	      <h4 class="card-title">
	          Status: {{fleet.status}}<i id="status-tog-icon" class="fa fa-chevron-down pull-xs-right" id="status-icon"></i>
	      </h4>
	    </div>
	    <div class="">
	    <table class="table-sm">
	    <tbody>
	    <tr>
	    	<th scope="row">Fleet Manager</th>
	    	<td>{% if fleet.manager is not none %}<a href="javascript:CCPEVE.showInfo(1377, {{fleet.manager[1]}});">{{fleet.manager[0]}}</a>{% else %}Not Set{% endif %}</td>
	    </tr>
	    </tbody>
	    </table>
	    </div>
	    <div id="status-body" class="collapse" data-tog-icon="#status-tog-icon">
		    <table class="table-sm">
		    <tbody>
		    <!--
		    <tr>
		    	<th scope="row">FC</th>
		    	<td>{% if fleet.fc is not none %}<a href="javascript:CCPEVE.showInfo(1377, {{fleet.fc[1]}});">{{fleet.fc[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
			
		    <tr>
		    	<th scope="row">Fleet Manager</th>
		    	<td>{% if fleet.manager is not none %}<a href="javascript:CCPEVE.showInfo(1377, {{fleet.manager[1]}});">{{fleet.manager[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
		    -->
		    <tr>
		    	<th scope="row">Constellation</th>
		    	<td>{% if fleet.constellation is not none %}<a href="javascript:CCPEVE.showInfo(4, {{fleet.constellation[1]}});">{{fleet.constellation[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
		    <tr>
		    	<th scope="row">Dockup</th>
		    	<td>{% if fleet.dock is not none %}<a href="javascript:CCPEVE.setDestination({{fleet.dock[1]}});">{{fleet.dock[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
		    <tr>
		    	<th scope="row">HQ System</th>
		    	<td>{% if fleet.systemhq is not none %}<a href="javascript:CCPEVE.showInfo(5, {{fleet.systemhq[1]}});">{{fleet.systemhq[0]}}</a>{% else %}Not Set{% endif %}</td>
		    </tr>
		    </tbody>
		    </table>
    	</div>
    </div>
	</div>
	<div class="col-sm-6">
		<div class="alert alert-info" role="alert">
  			<p class="text-xs-center"><strong>Help us!</strong> We would like your <a href="{{url_for('feedback.index')}}">feedback</a>!</p>
		</div>
		{% if not xup_open %}
		<div class="alert alert-warning" role="alert">
  			<p class="text-xs-center">X-up is currently closed!</p>
		</div>
		{% endif %}
	</div>
</div>
<div class="row" id="row-waitlists">
<div id="waitlists">
<div class="col-sm-3" id="wl-{{ queue.name }}">
	<div class="panel panel-default">
		<div class="panel-heading" role="tab" id="wl-{{ queue.id }}-heading" data-toggle="collapse" data-parent="#wl-{{ queue.id }}-tog" data-target="#wl-{{ queue.id }}-fits" aria-expanded="true" aria-controls="wl-{{ queue.id }}-fits">
      		<h4 class="panel-title">
        	<a class="list-group-item text-capitalize">
				X-Ups<i class="fa fa-chevron-up pull-xs-right" id="wl-{{ queue.id }}-tog-icon"></i>
        	</a>
      		</h4>
    	</div>
		<ol data-tog-icon="#wl-{{ queue.id }}-tog-icon" class="list-group collapse in" id="wl-{{ queue.id }}-fits" role="tabpanel" aria-labelledby="wl-{{ queue.id }}-heading">
			{% for entry in queue.entries %}
			<li class="list-group-item" id="entry-{{ queue.name }}-{{ entry.user }}">
				<div class="card">
					<div class="container">
						{% if user.get_eve_id() == entry.user or perm_man.can() %}
						<a href="javascript:CCPEVE.showInfo(1377, {{ entry.user }});">
						{% endif %}
						<div class="row">
							<div class="col-sm-2 hidden-sm-down">
								<img src="https://image.eveonline.com/Character/{{ entry.user }}_32.jpg" alt="{{ entry.user_data.eve_name|e }}">
							</div>
							<div class="col-sm-8">
							{{ entry.user_data.eve_name|e }}{% if (user.get_eve_id() == entry.user or perm_man.can()) and entry.user_data.is_new() %} <span class="label label-info">New</span>{% endif %}
							</div>
						</div>
						{% if user.get_eve_id() == entry.user or perm_man.can() %}
						</a>
						{% endif %}
						<div class="row">
							<div class="btn-group btn-group-mini" role="group" aria-label="Action Buttons">
								{% if perm_man.can() %}
								<!-- <button type="button" class="btn btn-primary" onclick="javascript:CCPEVE.showInfo(1377, {{ entry.user }})">Char</button> -->
								<button type="button" class="btn btn-danger"  data-toggle="modal" data-target="#remove-diag" data-type="removeEntry" data-entry="{{entry.id}}" data-user="{{entry.user}}">Remove</button>
								<button type="button" class="btn btn-secondary" onclick="javascript:CCPEVE.startConversation({{ entry.user }})">Convo</button>
								<button type="button" class="btn btn-success" onclick="javascript:moveEntryToWaitlists({{ entry.id }}, {{ entry.user }})">Approve</button>
								{% endif %}
								{% if user.get_eve_id() == entry.user %}
								<button type="button" class="btn btn-warning"
									onclick="javascript:removeOwnEntry('{{queue.name}}', {{entry.user}}, {{ entry.id }});">Remove Self</button>
								{% endif %}
								{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
								<button type="button" data-toggle="collapse" data-target="#fittings-{{entry.id}}" class="btn btn-primary">Show/Hide Fits</button>
								{% endif %}
							</div>
						</div>
						
					</div>
					{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
	  				<ul class="list-group list-group-flush collapse" id="fittings-{{entry.id}}">
					{% for fit in entry.fittings %}
	    				<li class="list-group-item fitting">
	    					<div class="container fit-link" data-dna="{{ fit.ship_type }}:{{ fit.modules }}">
	    					<div class="row">
	    						<div class="col-sm-4 hidden-sm-down">
	    						<img src="https://image.eveonline.com/Render/{{ fit.ship_type }}_32.png" alt="{{ entry.user_data.eve_name|e }}">
	    						</div>
	    						<div class="col-sm-8">
	    							<div class="row">
	    							{{ fit.ship.typeName|e }}
	    							</div>
	    							{% if fit.comment is not none %}
	    							<div class="row">
	    							<small>{{ fit.comment|safe }}</small>
	    							</div>
	    							{% endif %}
	    						</div>
	    					</div>
	    					</div>
	    				</li>
					{% endfor %}
	  				</ul>
	  				{% endif %}
				</div>
			</li>
			{% endfor %}
		</ol>
	</div>
</div>
{% for wlist in lists %}
<div class="col-sm-3" id="wl-{{ wlist.name }}">
	<div class="panel panel-default">
		<div class="panel-heading" role="tab" id="wl-{{ wlist.id }}-heading">
      		<h4 class="panel-title">
        	<a  class="list-group-item text-capitalize" data-toggle="collapse" data-parent="#wl-{{ wlist.id }}-tog" data-target="#wl-{{ wlist.id }}-fits" aria-expanded="true" aria-controls="wl-{{ wlist.id }}-fits">
				{{ wlist.name|e }} WL<i class="fa fa-chevron-up pull-xs-right" id="wl-{{ wlist.id }}-tog-icon"></i>
        	</a>
      		</h4>
    	</div>
		<ol data-tog-icon="#wl-{{ wlist.id }}-tog-icon" class="list-group collapse in" id="wl-{{ wlist.id }}-fits" role="tabpanel" aria-labelledby="wl-{{ wlist.id }}-heading">
			{% for entry in wlist.entries %}
			<li class="list-group-item"
				id="entry-{{wlist.name}}-{{ entry.user }}" {% if user.get_eve_id() == entry.user %}data-count="{{entry.fittings|length}}"{% endif %}>
				<div class="card">
					<div class="container">
						{% if user.get_eve_id() == entry.user or perm_man.can() %}
						<a href="javascript:CCPEVE.showInfo(1377, {{ entry.user }});">
						{% endif %}
						<div class="row">
						
							<div class="col-sm-2 col-xs-4">
									<img
									src="https://image.eveonline.com/Character/{{ entry.user }}_32.jpg"
									alt="{{ entry.user_data.eve_name|e }}">
							</div>
							<div class="col-sm-10 ol-xs-8">
								{{ entry.user_data.eve_name|e }}{% if entry.user_data.is_new() %} <span class="label label-info">New</span>{% endif %}
							</div>
	
						</div>
						{% if current_user.get_eve_id() == entry.user or perm_man.can() %}
						</a>
						{% endif %}
						{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
						<div class="row">
							<div class="btn-group btn-group-mini" role="group" aria-label="Action Buttons">
								{% if current_user.get_eve_id() == entry.user %}
								<!--  <button type="button" class="btn btn-mini btn-warning"
									onclick="javascript:removeOwnEntry('{{wlist.name}}', {{entry.user}}, {{ entry.id }});">Remove Self</button> -->
								{% endif %}
								{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
								<button type="button" data-toggle="collapse" data-target="#fittings-{{entry.id}}" class="btn btn-mini btn-primary">Show/Hide Fits</button>
								{% endif %}
								{% if perm_man.can() %}
								<!-- <button type="button" class="btn btn-primary" onclick="javascript:CCPEVE.showInfo(1377, {{ entry.user }})">Char</button> -->
								<button type="button" class="btn btn-secondary" onclick="javascript:CCPEVE.startConversation({{ entry.user }})">Convo</button>
								<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#remove-diag" data-type="removePlayer" data-user="{{entry.user}}">Remove Player</button>
								<button type="button" class="btn btn-success" onclick="javascript:invitePlayer({{ entry.user }})">Was Invited</button>
								{% endif %}
							</div>
						</div>
						{% endif %}
					</div>
					{% if user.get_eve_id() == entry.user or perm_viewfits.can() %}
					<ul class="list-group list-group-flush collapse" id="fittings-{{entry.id}}">
						{% for fit in entry.fittings %}
						<li class="list-group-item fitting" id="fit-{{ fit.id }}">
							<div class="container">
								<div class="row fit-link" data-dna="{{ fit.ship_type }}:{{ fit.modules }}">
									<div class="col-sm-4">
										<img
											src="https://image.eveonline.com/Render/{{ fit.ship_type }}_32.png"
											alt="{{ entry.user_data.eve_name|e }}">
									</div>
									<div class="col-sm-8">
										<div class="row">{{ fit.ship.typeName|e }}</div>
										{% if fit.comment is not none %}
										<div class="row"><small>{{ fit.comment|safe }}</small></div>
										{% endif %}
									</div>
								</div>
								{% if user.get_eve_id() == entry.user %}
								<div class="row">
									<div class="btn-group btn-group-mini" role="group"
										aria-label="Action Buttons">
										<button type="button" class="btn btn-mini btn-warning"
											onclick="javascript:removeOwnFit({{ fit.id }}, '{{ wlist.name }}', {{ entry.user }});">Remove Fit</button>
									</div>
								</div>
								{% endif %}
							</div>
						</li>
						{% endfor %}
					</ul>
					{% endif %}
				</div>
			</li> {% endfor %}
		</ol>
	</div>
</div>
{% endfor %}
</div>
</div>
{% if perm_man.can() %}
<div class="modal fade bd-example-modal-sm" id="remove-diag" tabindex="-1" role="dialog" aria-labelledby="remove-diag-label" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
      	<button type="button" class="close" data-dismiss="modal" aria-label="Close">
      		<span aria-hidden="true">&times;</span>
		</button>
        <h4 class="modal-title" id="remove-diag-label"></h4>
      </div>
      <div class="modal-body" id="remove-diag-body">
      </div>
      <div class="modal-footer">
          <button type="button" class="btn btn-success" data-dismiss="modal">No</button>
          <button type="button" class="btn btn-danger" id="remove-diag-accept">Yes</button>
      </div>
    </div>
{'fraction_non_alphanumeric': 0.2152980286947393, 'fraction_numerical': 0.004315875422839146, 'mean_word_length': 3.1411665257819106, 'pattern_counts': {'":': 0, '<': 507, '<?xml version=': 0, '>': 503, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '313014', 'n_tokens_mistral': 14596, 'n_tokens_neox': 11939, 'n_words': 2401}