<commit_before>{% extends "base.html" %}
{% load staticfiles %}
{% block content %}


{% if status == 'failed' %}
<div class="alert alert-error">
	<button type="button" class="close" data-dismiss="alert">&times;</button>
	<strong>Error</strong> {{ message }}
</div>
{% endif %}

{% if status == 'success' %}
<div class="alert alert-success">
	<button type="button" class="close" data-dismiss="alert">&times;</button>
	<strong>Success!</strong> {{ message }}
</div>
{% endif %}


{% if status == 'auth_error' %}
<div class="alert alert-error">
	<button type="button" class="close" data-dismiss="alert">&times;</button>
	<strong>Error</strong> You clicked No, cannot proceed :(
</div>
{% endif %}

<script>
if(window.location.hash) {
	var hash = window.location.hash.substring(1).split('&');
	for (var h in hash) {
		key = hash[h].split('=')[0]
		value = hash[h].split('=')[1]
		if (key == 'error' && value == 'access_denied')
		{
			displayAuthError();
			break;
		}
	}
} 

function displayAuthError()	{
	error_status = '<div class="alert alert-error"> <button type="button" class="close" data-dismiss="alert">&times;</button> <strong>Error</strong> You clicked No, cannot proceed :( </div>'
	document.write(error_status)

}


</script>

<div class="page-header">
	      <h1>Mine Projekter</h1>
		  <p class="lead">{{ text.projects_header | safe }}</p>
</div>

<div class="row">

<style>
	table { border:none }
</style>



{% if not services %}
	{% if user.cas.student_id %}
	<div>
		<div class="well span11">
				<img src="{% static "img/dtu-logo.png" %}" style="display: block; margin: 0 auto;" />
				<p><h3>Hey, {{ user.cas.givenName }} ({{ user.cas.student_id }})! You seem to have a DTU account, but are not on our list of students who can join SensibleDTU.</h3></p>
				<p><h3>Is this a mistake? <a href="mailto:<EMAIL>">Let us know!</a></h3></p>


		</div>
	</div>
	{% else %}
	<div>
		<div class="well span11">
			<div style="text-align:center">
			<p><h3>For at deltage i SensibleDTU skal du være DTU studerende.</h3></p>
			</div>
			</br>
				<img src="{% static "img/dtu-logo.png" %}" style="display: block; margin: 0 auto;" />
			<table style="width: 100%;">
				<tr>
					<td style="text-align: center; vertical-align: middle;">
						<h4 style="color:#c51137">
							DTU student?
							<div class="form-actions">
								<p><a class="btn btn-large btn-danger" href="{% url "id_cas" %}">Link to Your account</a></p>
							</div>
						</h4>

					</td>
				</tr>
			</table>
			<div>

			</div>

		</div>
	</div>



	{% endif %}
{% endif %}


{% for service,status in services.items %}
	{% if 'error' in status %}

		{% if status.error == 'connection error' %}
			<div class="well span11">
				<form method="get" action="{{ status.authorize_url }}">
				<h1>{{ service }}</h1>
				<p>{{ status.discovery.service_desc_full | safe }} </p>
					</br>
					<h4><div class="span" style="margin:-13px 0px 0px; background-color:#c43c35; text-align:center; padding: 4px 20px 4px; font-weight: bold; white-space: pre-wrap; -webkit-border-radius: 3px; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; color: #ffffff;"> The Study seems to be offline at the moment. <a href="mailto:<EMAIL>">Ping us.</a> Thanks!</div></h4>
			</form>
			</div>
		{% else %}
			<div class="well span11">
				<form method="get" action="{{ status.authorize_url }}">
				<h1>{{ service }}</h1>
				<h4> {{ status.discovery.service_desc_full | safe }} </h4>
					
							<div class="form-actions">
				   <p><button type="submit" name="submit" value="" class="btn btn-primary btn-large">Tilmeld <i class="icon-chevron-right icon-white"></i></button></p>
				   </div>
			</form>
			</div>
			{% endif %}
	{% else%}
		<div class="well span11">
			<h1>{{ service }}</h1>

			<h4> {{ status.description.service_desc_short | safe }} </h4>

				<div class="row">
				<div class="form-actions span" style="border: 1px solid #DDDDDD; background-color: #FFFFFF; border-radius: 4px 4px 4px 4px; margin-bottom:-10px; padding:2px 15px">
					<h2>Applikationer</h2>
					<h4>Nedenfor ser du en oversigt over dine applikationer. Applikationer indsamler data til SensibleDTU og du skal af sikkerhedsmæssige grunde godkende hver enkelt før de aktiveres.</h4>
				</div>
				</div>



			{% for application, params in status.applications.items %}
				<div class="form-actions" style="border: 1px solid #DDDDDD; background-color: #FFFFFF; border-radius: 4px 4px 4px 4px;margin-bottom:-10px">
						
					<h2>
					{% if params.uri != '' %}
						<a href="{{ params.uri }}">{{ application }}
						<button value="" class="btn btn-primary btn-small" style="margin-bottom: 2px"><i class="icon-chevron-right icon-white"></i><i class="icon-chevron-right icon-white"></i></button></a>
					{% else %}
						{{ application }}

					{% endif %}
					</h2>
					<p><h5>{{ params.description | safe}}</h5></p>
					<p></hr></p>
					<table class="table table-condensed table-striped">
						<tbody >
					{% for auth_uri, scopes in params.scopes.items %}
							<tr>
								<form method="get" action="{{ auth_uri }}">
								<td class="span8" style="border-top: none; vertical-align:middle;">
						{% for scope, scope_params in scopes.items %}
							{% if scope != 'message' and scope != 'status' %}
								{% if scope_params.authorized == 1 %}
								<div class="span6" style="border-color: #46a546; padding: 2px 3px 0px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px 3px 3px 3px; border-width:1px; border-style:solid; border-top-style:solid; margin: 20px 10px 20px">
								<h4><div class="" style="margin:-13px 0px 0px; background-color:#46a546; text-align:center; padding: 4px 20px 4px; font-weight: bold; white-space: pre-wrap; -webkit-border-radius: 3px; -moz-border-radius: 3px 3px 3px 3px; border-radius: 0px 0px 3px 3px; color: #ffffff;"> can {{ scope_params.description | safe }}</div></h4>
								<strong>{{ scope_params.description_extra | safe }}</strong>
								{% else %}
								<div class="span6" style="border-color: #c43c35; padding: 2px 3px 0px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px 3px 3px 3px; border-width:1px; border-style:solid; border-top-style:solid; margin: 20px 10px 20px"><input type="checkbox" name="scope_{{ scope }}" checked id="cb_{{ service }}_{{ application }}_{{ auth_uri }}_{{ scope }}" value="checked" hidden />
								<h4><div class="" style="margin:-13px 0px 0px; background-color:#c43c35; text-align:center; padding: 4px 20px 4px; font-weight: bold; white-space: pre-wrap; -webkit-border-radius: 3px; -moz-border-radius: 3px 3px 3px 3px; border-radius: 0px 0px 3px 3px; color: #ffffff;"> not allowed to {{ scope_params.description | safe }} </div></h4>
								<strong>{{ scope_params.description_extra | safe }}</strong>
								</div>


								{% endif %}
							{% endif %}
						{% endfor %}

								</td>
<commit_msg>missing div when displaying granted authorizations<commit_after>{% extends "base.html" %}
{% load staticfiles %}
{% block content %}


{% if status == 'failed' %}
<div class="alert alert-error">
	<button type="button" class="close" data-dismiss="alert">&times;</button>
	<strong>Error</strong> {{ message }}
</div>
{% endif %}

{% if status == 'success' %}
<div class="alert alert-success">
	<button type="button" class="close" data-dismiss="alert">&times;</button>
	<strong>Success!</strong> {{ message }}
</div>
{% endif %}


{% if status == 'auth_error' %}
<div class="alert alert-error">
	<button type="button" class="close" data-dismiss="alert">&times;</button>
	<strong>Error</strong> You clicked No, cannot proceed :(
</div>
{% endif %}

<script>
if(window.location.hash) {
	var hash = window.location.hash.substring(1).split('&');
	for (var h in hash) {
		key = hash[h].split('=')[0]
		value = hash[h].split('=')[1]
		if (key == 'error' && value == 'access_denied')
		{
			displayAuthError();
			break;
		}
	}
} 

function displayAuthError()	{
	error_status = '<div class="alert alert-error"> <button type="button" class="close" data-dismiss="alert">&times;</button> <strong>Error</strong> You clicked No, cannot proceed :( </div>'
	document.write(error_status)

}


</script>

<div class="page-header">
	      <h1>Mine Projekter</h1>
		  <p class="lead">{{ text.projects_header | safe }}</p>
</div>

<div class="row">

<style>
	table { border:none }
</style>



{% if not services %}
	{% if user.cas.student_id %}
	<div>
		<div class="well span11">
				<img src="{% static "img/dtu-logo.png" %}" style="display: block; margin: 0 auto;" />
				<p><h3>Hey, {{ user.cas.givenName }} ({{ user.cas.student_id }})! You seem to have a DTU account, but are not on our list of students who can join SensibleDTU.</h3></p>
				<p><h3>Is this a mistake? <a href="mailto:<EMAIL>">Let us know!</a></h3></p>


		</div>
	</div>
	{% else %}
	<div>
		<div class="well span11">
			<div style="text-align:center">
			<p><h3>For at deltage i SensibleDTU skal du være DTU studerende.</h3></p>
			</div>
			</br>
				<img src="{% static "img/dtu-logo.png" %}" style="display: block; margin: 0 auto;" />
			<table style="width: 100%;">
				<tr>
					<td style="text-align: center; vertical-align: middle;">
						<h4 style="color:#c51137">
							DTU student?
							<div class="form-actions">
								<p><a class="btn btn-large btn-danger" href="{% url "id_cas" %}">Link to Your account</a></p>
							</div>
						</h4>

					</td>
				</tr>
			</table>
			<div>

			</div>

		</div>
	</div>



	{% endif %}
{% endif %}


{% for service,status in services.items %}
	{% if 'error' in status %}

		{% if status.error == 'connection error' %}
			<div class="well span11">
				<form method="get" action="{{ status.authorize_url }}">
				<h1>{{ service }}</h1>
				<p>{{ status.discovery.service_desc_full | safe }} </p>
					</br>
					<h4><div class="span" style="margin:-13px 0px 0px; background-color:#c43c35; text-align:center; padding: 4px 20px 4px; font-weight: bold; white-space: pre-wrap; -webkit-border-radius: 3px; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; color: #ffffff;"> The Study seems to be offline at the moment. <a href="mailto:<EMAIL>">Ping us.</a> Thanks!</div></h4>
			</form>
			</div>
		{% else %}
			<div class="well span11">
				<form method="get" action="{{ status.authorize_url }}">
				<h1>{{ service }}</h1>
				<h4> {{ status.discovery.service_desc_full | safe }} </h4>
					
							<div class="form-actions">
				   <p><button type="submit" name="submit" value="" class="btn btn-primary btn-large">Tilmeld <i class="icon-chevron-right icon-white"></i></button></p>
				   </div>
			</form>
			</div>
			{% endif %}
	{% else%}
		<div class="well span11">
			<h1>{{ service }}</h1>

			<h4> {{ status.description.service_desc_short | safe }} </h4>

				<div class="row">
				<div class="form-actions span" style="border: 1px solid #DDDDDD; background-color: #FFFFFF; border-radius: 4px 4px 4px 4px; margin-bottom:-10px; padding:2px 15px">
					<h2>Applikationer</h2>
					<h4>Nedenfor ser du en oversigt over dine applikationer. Applikationer indsamler data til SensibleDTU og du skal af sikkerhedsmæssige grunde godkende hver enkelt før de aktiveres.</h4>
				</div>
				</div>



			{% for application, params in status.applications.items %}
				<div class="form-actions" style="border: 1px solid #DDDDDD; background-color: #FFFFFF; border-radius: 4px 4px 4px 4px;margin-bottom:-10px">
						
					<h2>
					{% if params.uri != '' %}
						<a href="{{ params.uri }}">{{ application }}
						<button value="" class="btn btn-primary btn-small" style="margin-bottom: 2px"><i class="icon-chevron-right icon-white"></i><i class="icon-chevron-right icon-white"></i></button></a>
					{% else %}
						{{ application }}

					{% endif %}
					</h2>
					<p><h5>{{ params.description | safe}}</h5></p>
					<p></hr></p>
					<table class="table table-condensed table-striped">
						<tbody >
					{% for auth_uri, scopes in params.scopes.items %}
							<tr>
								<form method="get" action="{{ auth_uri }}">
								<td class="span8" style="border-top: none; vertical-align:middle;">
						{% for scope, scope_params in scopes.items %}
							{% if scope != 'message' and scope != 'status' %}
								{% if scope_params.authorized == 1 %}
								<div class="span6" style="border-color: #46a546; padding: 2px 3px 0px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px 3px 3px 3px; border-width:1px; border-style:solid; border-top-style:solid; margin: 20px 10px 20px">
								<h4><div class="" style="margin:-13px 0px 0px; background-color:#46a546; text-align:center; padding: 4px 20px 4px; font-weight: bold; white-space: pre-wrap; -webkit-border-radius: 3px; -moz-border-radius: 3px 3px 3px 3px; border-radius: 0px 0px 3px 3px; color: #ffffff;"> can {{ scope_params.description | safe }}</div></h4>
								<strong>{{ scope_params.description_extra | safe }}</strong>
								</div>
								{% else %}
								<div class="span6" style="border-color: #c43c35; padding: 2px 3px 0px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px 3px 3px 3px; border-width:1px; border-style:solid; border-top-style:solid; margin: 20px 10px 20px"><input type="checkbox" name="scope_{{ scope }}" checked id="cb_{{ service }}_{{ application }}_{{ auth_uri }}_{{ scope }}" value="checked" hidden />
								<h4><div class="" style="margin:-13px 0px 0px; background-color:#c43c35; text-align:center; padding: 4px 20px 4px; font-weight: bold; white-space: pre-wrap; -webkit-border-radius: 3px; -moz-border-radius: 3px 3px 3px 3px; border-radius: 0px 0px 3px 3px; color: #ffffff;"> not allowed to {{ scope_params.description | safe }} </div></h4>
								<strong>{{ scope_params.description_extra | safe }}</strong>
								</div>


								{% endif %}
							{% endif %}
						{% endfor %}

								</td>

{'fraction_non_alphanumeric': 0.19332756881395013, 'fraction_numerical': 0.026516789162703558, 'mean_word_length': 3.5805280528052807, 'pattern_counts': {'":': 0, '<': 332, '<?xml version=': 0, '>': 332, 'https://': 0, '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': '5445127', 'n_tokens_mistral': 6060, 'n_tokens_neox': 4793, 'n_words': 1216}