<commit_before>{% extends 'activities_base.html' %}{% load staticfiles %}{% load clubs_utils %}
{% block title %}{{ activity.name }}{% endblock %}
{% block content %}
{% if error_message %}
<div class="alert alert-danger"><strong>{{ error_message }}</strong></div>
{% endif %}
<style>
	.profile-env > header .profile-picture img {
		background-color: #FFFFFF;
	}

	@media (max-width: 1080px) {
		.profile-env > header {
			margin-bottom: 20px;
		}
	}
	
	.profile-env > header .profile-info-sections > li:first-child {
		padding-right: 0;
  		padding-left: 0;
	}
	
	.profile-env > header .profile-info-sections .profile-name {
		margin-top: 17px;
	}
</style>
<div class="profile-env">

	<header class="row">
		
		<div class="col-sm-2">
			
			<a href="{% url 'activities:show' activity.pk %}" class="profile-picture hidden-xs hidden-sm">
				<img src="{% static 'logo/enjaz_logo_shadow_no_text.png' %}"
				class="img-responsive img-circle">
			</a>
			
		</div>
		
		<div class="col-sm-7">
			
			<ul class="profile-info-sections">
				<li>
					<div class="profile-name">
						<strong>
							<a href="{% url 'activities:show' activity.pk %}">{{ activity.name }}</a>
							
							{# if the user can view unapproved activity, show the activity status #}
							{# is-online = approved, is-idle = pending, is-busy = rejected #}
							
							{% if perms.activities.view_activity %}
							<a href="#" class="user-status {% if activity.is_approved %}is-online{% elif activity.is_approved == None %}is-idle{% else %}is-busy{% endif %} tooltip-primary"
							data-toggle="tooltip" data-placement="top"
							data-original-title="{{ activity.get_approval_status_message }}"></a>
							<!-- User statuses available classes "is-online", "is-offline", "is-idle", "is-busy" -->	
							{% endif %}
						</strong>
						<span><a href="{% url 'clubs:show' activity.primary_club.pk %}">{{ activity.primary_club.name }}</a></span>
					</div>
				</li>
			</ul>
			
		</div>
		
		<div class="col-sm-3">
			
			<div class="profile-buttons">
				{% if activity.registration_is_open %}
				<a href="{% url 'activities:participate' activity.pk %}" class="btn btn-default">
					<i class="entypo-user-add"></i>
					شارك
				</a>
				{% endif %}

                {# if the user can edit the activity... #}
				{% if perms.activities.change_activity or request.user|has_coordination_to_activity:activity %}
				<a href="{% url 'activities:edit' activity.pk %}" class="btn btn-default">
					<i class="entypo-pencil"></i>
					عدّل
				</a>
				{% endif %}
				{% if perms.activities.change_activity or request.user|has_coordination_to_activity:activity and activity.is_editable %}
				<a href="{% url 'activities:delete' activity.pk %}" class="btn btn-default btn-red">
					<i class="entypo-trash"></i>
					احذف
				</a>
				{% endif %}
			</div>
		</div>
		
	</header>
	
	<section class="profile-info-tabs">
		
		<div class="row">
			
			<div class="col-sm-offset-2 col-sm-10">

				<ul class="user-details">{# if the user is privileged, show them the internal description #}
                    {% if request.user|has_coordination_to_activity:activity or perms.activities.add_deanship_review or perms.activities.add_presidency_review or perms.activities.view_deanship_review or perms.activities.view_presidency_review %}
					<li>
						<a href="#">
							<i class="entypo-info-circled"></i>
							{{ activity.description|linebreaksbr }}
						</a>
					</li>{% endif %}
					<li>
						<a href="#">
							<i class="entypo-info-circled"></i>
							{{ activity.public_description|linebreaksbr }}
						</a>
					</li>
					{% for episode in activity.episode_set.all %}
					<li>
						<div class="row">
                        {# if the user has privileges to add a follow-up report... #}
						{% if  request.user|is_employee_of_any_club or request.user|has_coordination_to_activity:activity or perms.media.add_followupreport %}
						{# group the activity info in a div to make #}
						{# space for the report button #}
						<div class="col-md-10">
						{% endif %}
						<a href="#">
							<div class="col-sm-4">
								<i class="entypo-calendar"></i>
								{{ episode.start_date }}
								-
								{{ episode.end_date }}
							</div>
							<div class="col-sm-4">
								<i class="entypo-clock"></i>
								{{ episode.start_time }}
								-
								{{ episode.end_time }}
							</div>
							<div class="col-sm-4">
								<i class="entypo-location"></i>
								{{ episode.location }}
							</div>
						</a>
                        {# if the user has privileges to add or view a follow-up report... #}
						{% if request.user|is_employee_of_any_club or request.user|has_coordination_to_activity:activity or perms.media.add_followupreport %}
						</div>
						<div class="followupreport_zone col-md-2">
                            {# The particular logic for the following is described here: https://github.com/osamak/student-portal/issues/81 #}
			    {% if episode.report_is_submitted %}
			            		<a href="{% url 'media:show_report' episode.pk %}"
			            		class="btn btn-block btn-green btn-xs">استعرض التقرير</a>
                            {# show a special note for employees, that the report hasn't been submitted yet. #}
                            {% elif not episode.report_is_submitted and request.user|is_employee_of_any_club %}
			            		<a class="btn btn-block btn-primary btn-xs disabled">لم يرفع التقرير بعد</a>
                            {# only show the link if the user is not an employee #}
                            {% elif episode.requires_report and not request.user|is_employee_of_any_club %}

                                {% if episode.report_is_due %}
                                    <a href="{% url 'media:submit_report' episode.pk %}"
                                    class="btn btn-block btn-gold btn-xs">ارفع التقرير</a>

                                {% elif episode.report_is_overdue %}
                                    <a href="{% url 'media:submit_report' episode.pk %}"
                                    class="btn btn-block btn-red btn-xs">ارفع التقرير</a>

                                {% else %}
                                    {% if episode.can_report_early %}
                                        <a href="{% url 'media:submit_report' episode.pk %}"
                                        class="btn btn-block btn-info btn-xs">ارفع التقرير</a>
                                    {% else %}
                                        <a class="btn btn-block btn-primary btn-xs disabled">بانتظار انتهاء النشاط</a>
                                    {% endif %}
                                {% endif %}
                            {% elif not request.user|is_employee_of_any_club %}
                                <a href="{% url 'media:submit_report' episode.pk %}"
                                class="btn btn-block btn-info btn-xs">ارفع التقرير (اختياري)</a>
			            	{% endif %}
						</div>
						{% endif %}
						</div>
					</li>
					{% endfor %}
				</ul>

				<!-- tabs for the profile links -->
				<ul class="nav nav-tabs">
			{% if request.user|has_coordination_to_activity:activity or request.user|can_review_activity:activity %}
				{% for reviewer in activity.primary_club.get_reviewing_parents %}
					<li{% if active_tab == reviewer.pk %} class="active"{% endif %}>
					<a href="{% url 'activities:review' activity.id reviewer.id %}">مراجعة {{ reviewer.name }}</a>
					</li>
				{% endfor %}
			{% endif %}
                    {% if request.user|has_coordination_to_activity:activity or perms.niqati.view_order %}
					<li{% if active_tab == 'niqati' %} class="active"{% endif %}>
						<a href="{% url 'activities:niqati_orders' activity.pk %}">نقاطي</a>
					</li>
					{% endif %}
                    {% comment %}
                    In order to avoid URL reversing issues, the forms button has to be (at least temporarily) restricted
                    to the `show` view and the very views of the forms app. The `show` view will pass a `can_view_forms`
                    attribute to the context. All django-pluggable-forms views pass a context variable `object_id` to
                    their templates. That's how we can know the request is coming from any of these 2.
                    {% endcomment %}
                    {% if can_view_forms or object_id %}
					<li{% if active_tab == 'forms' %} class="active"{% endif %}><commit_msg>Show reviews for superuser.<commit_after>{% extends 'activities_base.html' %}{% load staticfiles %}{% load clubs_utils %}
{% block title %}{{ activity.name }}{% endblock %}
{% block content %}
{% if error_message %}
<div class="alert alert-danger"><strong>{{ error_message }}</strong></div>
{% endif %}
<style>
	.profile-env > header .profile-picture img {
		background-color: #FFFFFF;
	}

	@media (max-width: 1080px) {
		.profile-env > header {
			margin-bottom: 20px;
		}
	}
	
	.profile-env > header .profile-info-sections > li:first-child {
		padding-right: 0;
  		padding-left: 0;
	}
	
	.profile-env > header .profile-info-sections .profile-name {
		margin-top: 17px;
	}
</style>
<div class="profile-env">

	<header class="row">
		
		<div class="col-sm-2">
			
			<a href="{% url 'activities:show' activity.pk %}" class="profile-picture hidden-xs hidden-sm">
				<img src="{% static 'logo/enjaz_logo_shadow_no_text.png' %}"
				class="img-responsive img-circle">
			</a>
			
		</div>
		
		<div class="col-sm-7">
			
			<ul class="profile-info-sections">
				<li>
					<div class="profile-name">
						<strong>
							<a href="{% url 'activities:show' activity.pk %}">{{ activity.name }}</a>
							
							{# if the user can view unapproved activity, show the activity status #}
							{# is-online = approved, is-idle = pending, is-busy = rejected #}
							
							{% if perms.activities.view_activity %}
							<a href="#" class="user-status {% if activity.is_approved %}is-online{% elif activity.is_approved == None %}is-idle{% else %}is-busy{% endif %} tooltip-primary"
							data-toggle="tooltip" data-placement="top"
							data-original-title="{{ activity.get_approval_status_message }}"></a>
							<!-- User statuses available classes "is-online", "is-offline", "is-idle", "is-busy" -->	
							{% endif %}
						</strong>
						<span><a href="{% url 'clubs:show' activity.primary_club.pk %}">{{ activity.primary_club.name }}</a></span>
					</div>
				</li>
			</ul>
			
		</div>
		
		<div class="col-sm-3">
			
			<div class="profile-buttons">
				{% if activity.registration_is_open %}
				<a href="{% url 'activities:participate' activity.pk %}" class="btn btn-default">
					<i class="entypo-user-add"></i>
					شارك
				</a>
				{% endif %}

                {# if the user can edit the activity... #}
				{% if perms.activities.change_activity or request.user|has_coordination_to_activity:activity %}
				<a href="{% url 'activities:edit' activity.pk %}" class="btn btn-default">
					<i class="entypo-pencil"></i>
					عدّل
				</a>
				{% endif %}
				{% if perms.activities.change_activity or request.user|has_coordination_to_activity:activity and activity.is_editable %}
				<a href="{% url 'activities:delete' activity.pk %}" class="btn btn-default btn-red">
					<i class="entypo-trash"></i>
					احذف
				</a>
				{% endif %}
			</div>
		</div>
		
	</header>
	
	<section class="profile-info-tabs">
		
		<div class="row">
			
			<div class="col-sm-offset-2 col-sm-10">

				<ul class="user-details">{# if the user is privileged, show them the internal description #}
                    {% if request.user|has_coordination_to_activity:activity or perms.activities.add_deanship_review or perms.activities.add_presidency_review or perms.activities.view_deanship_review or perms.activities.view_presidency_review %}
					<li>
						<a href="#">
							<i class="entypo-info-circled"></i>
							{{ activity.description|linebreaksbr }}
						</a>
					</li>{% endif %}
					<li>
						<a href="#">
							<i class="entypo-info-circled"></i>
							{{ activity.public_description|linebreaksbr }}
						</a>
					</li>
					{% for episode in activity.episode_set.all %}
					<li>
						<div class="row">
                        {# if the user has privileges to add a follow-up report... #}
						{% if  request.user|is_employee_of_any_club or request.user|has_coordination_to_activity:activity or perms.media.add_followupreport %}
						{# group the activity info in a div to make #}
						{# space for the report button #}
						<div class="col-md-10">
						{% endif %}
						<a href="#">
							<div class="col-sm-4">
								<i class="entypo-calendar"></i>
								{{ episode.start_date }}
								-
								{{ episode.end_date }}
							</div>
							<div class="col-sm-4">
								<i class="entypo-clock"></i>
								{{ episode.start_time }}
								-
								{{ episode.end_time }}
							</div>
							<div class="col-sm-4">
								<i class="entypo-location"></i>
								{{ episode.location }}
							</div>
						</a>
                        {# if the user has privileges to add or view a follow-up report... #}
						{% if request.user|is_employee_of_any_club or request.user|has_coordination_to_activity:activity or perms.media.add_followupreport %}
						</div>
						<div class="followupreport_zone col-md-2">
                            {# The particular logic for the following is described here: https://github.com/osamak/student-portal/issues/81 #}
			    {% if episode.report_is_submitted %}
			            		<a href="{% url 'media:show_report' episode.pk %}"
			            		class="btn btn-block btn-green btn-xs">استعرض التقرير</a>
                            {# show a special note for employees, that the report hasn't been submitted yet. #}
                            {% elif not episode.report_is_submitted and request.user|is_employee_of_any_club %}
			            		<a class="btn btn-block btn-primary btn-xs disabled">لم يرفع التقرير بعد</a>
                            {# only show the link if the user is not an employee #}
                            {% elif episode.requires_report and not request.user|is_employee_of_any_club %}

                                {% if episode.report_is_due %}
                                    <a href="{% url 'media:submit_report' episode.pk %}"
                                    class="btn btn-block btn-gold btn-xs">ارفع التقرير</a>

                                {% elif episode.report_is_overdue %}
                                    <a href="{% url 'media:submit_report' episode.pk %}"
                                    class="btn btn-block btn-red btn-xs">ارفع التقرير</a>

                                {% else %}
                                    {% if episode.can_report_early %}
                                        <a href="{% url 'media:submit_report' episode.pk %}"
                                        class="btn btn-block btn-info btn-xs">ارفع التقرير</a>
                                    {% else %}
                                        <a class="btn btn-block btn-primary btn-xs disabled">بانتظار انتهاء النشاط</a>
                                    {% endif %}
                                {% endif %}
                            {% elif not request.user|is_employee_of_any_club %}
                                <a href="{% url 'media:submit_report' episode.pk %}"
                                class="btn btn-block btn-info btn-xs">ارفع التقرير (اختياري)</a>
			            	{% endif %}
						</div>
						{% endif %}
						</div>
					</li>
					{% endfor %}
				</ul>

				<!-- tabs for the profile links -->
				<ul class="nav nav-tabs">
			{% if request.user|has_coordination_to_activity:activity or request.user|can_review_activity:activity or request.user.is_superuser %}
				{% for reviewer in activity.primary_club.get_reviewing_parents %}
					<li{% if active_tab == reviewer.pk %} class="active"{% endif %}>
					<a href="{% url 'activities:review' activity.id reviewer.id %}">مراجعة {{ reviewer.name }}</a>
					</li>
				{% endfor %}
			{% endif %}
                    {% if request.user|has_coordination_to_activity:activity or perms.niqati.view_order %}
					<li{% if active_tab == 'niqati' %} class="active"{% endif %}>
						<a href="{% url 'activities:niqati_orders' activity.pk %}">نقاطي</a>
					</li>
					{% endif %}
                    {% comment %}
                    In order to avoid URL reversing issues, the forms button has to be (at least temporarily) restricted
                    to the `show` view and the very views of the forms app. The `show` view will pass a `can_view_forms`
                    attribute to the context. All django-pluggable-forms views pass a context variable `object_id` to
                    their templates. That's how we can know the request is coming from any of these 2.
                    {% endcomment %}
                    {% if can_view_forms or object_id %}
					<li{% if active_tab == 'forms' %} class="active"{% endif %}>
{'fraction_non_alphanumeric': 0.1443837707709471, 'fraction_numerical': 0.0029358229111619985, 'mean_word_length': 2.047414564322777, 'pattern_counts': {'":': 0, '<': 229, '<?xml version=': 0, '>': 239, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1201735', 'n_tokens_mistral': 6690, 'n_tokens_neox': 5118, 'n_words': 1211}