<commit_before>{% extends '::page-2cols.html.twig' %}

{% block title %}{{ membership.organization.name }}{% endblock %}

{% block titleIcon %}
	<img src="{{ asset('src/img/titles/orga.png') }}" alt="{{ 'base.logo.alt'|trans }}" title="{{ 'base.logo.title'|trans }}" class="page-title-icon" />
{% endblock %}

{% block stylesheets %}
	<link rel="stylesheet" href="{{ asset('redactor/redactor/redactor.css') }}" type="text/css" />
{% endblock %}

{% block javascripts %}
	<script type="text/javascript" src="{{ asset('redactor/redactor/redactor.min.js') }}"></script>

	<script type="text/javascript">
		// HTML redactor
        $('.redactor-html').redactor({
			fixed: true,
			lang: 'fr',
			buttons: [
				'bold', 'italic', 'deleted', 'underline', 'fontcolor', '|',
				'alignleft', 'aligncenter', 'alignright', '|',
				'unorderedlist', '|', 'image', 'link'
			]
		});

		var updateImgSizeAttr = function(){
			$(this).find('img').each(function() {

				// Force to keep ratio for image that are loaded
				if(parseInt($(this).css('width')) >= 25 && parseInt($(this).css('width')) >= 25)
				{
					if(!$(this).data('ratio')) {
						$(this).data('ratio', parseInt($(this).css('width'))/parseInt($(this).css('height')));
					}
					else {
						$(this).css('height', parseInt($(this).css('width'))/$(this).data('ratio'));
					}
				}

				// Set width and height for php parsing
				$(this).attr('data-width', parseInt($(this).css('width')));
				$(this).attr('data-height', parseInt($(this).css('height')));

			});
			return true;
		};

		$('.redactor_redactor-html').bind("DOMSubtreeModified", updateImgSizeAttr);
		$('#daymailform').submit(updateImgSizeAttr);

	</script>

	{% if wantPreview %}
	<script type="text/javascript">
		$(function() {
			var url = '{{ path('memberships_orga_daymail_preview', {'login': orga.login, 'day': currentDay|date('d-m-Y')}) }}';

			$.facebox(
				'<p style="text-align:center;"><br /><img src="{{ asset('src/img/loader-big.gif') }}" /><br /><br /></p>'
			);

			$.get(url, function(data) {
				$.facebox(data);
			});
		});
	</script>
	{% endif %}
{% endblock %}

{% block content %}
	<div class="padding20-all">
		<div class="row-fluid"><commit_msg>Fix js script compatibility with IE and chrome<commit_after>{% extends '::page-2cols.html.twig' %}

{% block title %}{{ membership.organization.name }}{% endblock %}

{% block titleIcon %}
	<img src="{{ asset('src/img/titles/orga.png') }}" alt="{{ 'base.logo.alt'|trans }}" title="{{ 'base.logo.title'|trans }}" class="page-title-icon" />
{% endblock %}

{% block stylesheets %}
	<link rel="stylesheet" href="{{ asset('redactor/redactor/redactor.css') }}" type="text/css" />
{% endblock %}

{% block javascripts %}
	<script type="text/javascript" src="{{ asset('redactor/redactor/redactor.min.js') }}"></script>

	<script type="text/javascript">
		// HTML redactor
        $('.redactor-html').redactor({
			fixed: true,
			lang: 'fr',
			buttons: [
				'bold', 'italic', 'deleted', 'underline', 'fontcolor', '|',
				'alignleft', 'aligncenter', 'alignright', '|',
				'unorderedlist', '|', 'image', 'link'
			]
		});

		var updateImgSizeAttr = function(){
			$('.redactor_redactor-html').find('img').each(function() {

				if($(this).width() >= 25 && $(this).height() >= 25)
				{
					// Force to keep ratio
					if(!$(this).data('ratio')) {
						$(this).data('ratio', $(this).width() / $(this).height());

						// Center image when inserted
						$(this).css('display', 'block');
						$(this).css('margin-left', 'auto');
						$(this).css('margin-right', 'auto');
					}
					else {
						$(this).height($(this).width() / $(this).data('ratio'));
					}

					// Limit image size
					if($(this).width() > 600) {
						$(this).height(600 / $(this).data('ratio'));
						(this).width(600);
					}
					if($(this).height() > 500) {
						$(this).height(500);
						$(this).width(500 * $(this).data('ratio'));
					}
				}

				// Set width and height for php parsing
				$(this).attr('data-width', $(this).width());
				$(this).attr('data-height', $(this).height());

			});

			imgTimeout = setTimeout(updateImgSizeAttr, 250);
			return true;
		};
		// ugly without an event, but there is no *html change event* compatible everywhere
		var imgTimeout = setTimeout(updateImgSizeAttr, 250);

		$('#daymailform').submit(updateImgSizeAttr);

	</script>

	{% if wantPreview %}
	<script type="text/javascript">
		$(function() {
			var url = '{{ path('memberships_orga_daymail_preview', {'login': orga.login, 'day': currentDay|date('d-m-Y')}) }}';

			$.facebox(
				'<p style="text-align:center;"><br /><img src="{{ asset('src/img/loader-big.gif') }}" /><br /><br /></p>'
			);

			$.get(url, function(data) {
				$.facebox(data);
			});
		});
	</script>
	{% endif %}
{% endblock %}

{% block content %}
	<div class="padding20-all">
		<div class="row-fluid">
{'fraction_non_alphanumeric': 0.2451041022469594, 'fraction_numerical': 0.007833436404864976, 'mean_word_length': 3.7152575315840624, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 41, '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': '3753073', 'n_tokens_mistral': 1994, 'n_tokens_neox': 1627, 'n_words': 297}