<commit_before>{% trans_default_domain "wellcommerce" %}
{% import "WellCommerceAppBundle:Front/Form:macros_horizontal.html.twig" as macros %}
<div class="description-block">
	<h2>{% trans %}review.heading.index{% endtrans %}</h2>

	<div id="add-opinion-alert" class="alert alert-success">
		<button class="btn btn-success btn-lg pull-right">{% trans %}review.button.add_opinion{% endtrans %}</button>
		<strong>{% trans %}review.tip.help1{% endtrans %}</strong><br />
        {% trans %}review.tip.help2{% endtrans %}
	</div>

	<!-- OPINION ADDED ALERT
    <div class="alert alert-info">
        <strong>Your review has been sent and is awaiting moderation.</strong>
    </div>
    -->

	<div class="well product-opinions collapse">
		{{ macros.form_begin(form, 'form-horizontal') }}
			<div class="form-group">
				<label for="nick" class="col-sm-3 control-label">{% trans %}review.label.rating{% endtrans %}</label>
				<div class="col-md-6 col-sm-10">
					<div class="stars"></div>
				</div>
			</div>
			{{ macros.element(form.children.get('rating')) }}
			{{ macros.element(form.children.get('nick')) }}
			{{ macros.element(form.children.get('review')) }}
			<div class="form-group">
				<div class="col-sm-offset-3 col-md-6 col-sm-10">
					<button type="submit" class="btn btn-primary">{% trans %}review.button.add_opinion{% endtrans %}</button>
				</div>
			</div>
		{{ macros.form_end(form) }}
	</div>

	{% for review in reviews %}
	<div class="media product-opinion">
		<div class="media-left">
			<span class="glyphicon glyphicon-comment" aria-hidden="true"></span>
		</div>
		<div class="media-body">
			<h4 class="media-heading">
				{{ review.nick }}
				<small>{{ review.createdAt|date }}</small>
			</h4>

			<div>
				{% for i in range(1, review.rating) %}
					<span class="glyphicon glyphicon-star" aria-hidden="true"></span>
				{% endfor %}
			</div>
			{% autoescape true %}
			{{ review.review }}
			{% endautoescape %}
		</div>
	</div>
	{% endfor %}
</div>
<script type="text/javascript">
	$(document).ready(function(){
		$('.product-opinions div.stars').raty({
			target:     '#rating',
			targetType: 'score',
			targetKeep : true,
			score: 5,
			starOff : '{{ asset('themes/wellcommerce-default-theme/assets/img/star-off.png') }}',
			starOn  : '{{ asset('themes/wellcommerce-default-theme/assets/img/star-on.png') }}'
		});
	});
</script><commit_msg>Added ability to enable/disable reviews on per-product basis<commit_after>{% trans_default_domain "wellcommerce" %}
{% import "WellCommerceAppBundle:Front/Form:macros_horizontal.html.twig" as macros %}
{% if product.enableReviews %}
<div class="description-block">
	<h2>{% trans %}review.heading.index{% endtrans %}</h2>

	<div id="add-opinion-alert" class="alert alert-success">
		<button class="btn btn-success btn-lg pull-right">{% trans %}review.button.add_opinion{% endtrans %}</button>
		<strong>{% trans %}review.tip.help1{% endtrans %}</strong><br />
        {% trans %}review.tip.help2{% endtrans %}
	</div>

	<!-- OPINION ADDED ALERT
    <div class="alert alert-info">
        <strong>Your review has been sent and is awaiting moderation.</strong>
    </div>
    -->

	<div class="well product-opinions collapse">
		{{ macros.form_begin(form, 'form-horizontal') }}
			<div class="form-group">
				<label for="nick" class="col-sm-3 control-label">{% trans %}review.label.rating{% endtrans %}</label>
				<div class="col-md-6 col-sm-10">
					<div class="stars"></div>
				</div>
			</div>
			{{ macros.element(form.children.get('rating')) }}
			{{ macros.element(form.children.get('nick')) }}
			{{ macros.element(form.children.get('review')) }}
			<div class="form-group">
				<div class="col-sm-offset-3 col-md-6 col-sm-10">
					<button type="submit" class="btn btn-primary">{% trans %}review.button.add_opinion{% endtrans %}</button>
				</div>
			</div>
		{{ macros.form_end(form) }}
	</div>

	{% for review in reviews %}
	<div class="media product-opinion">
		<div class="media-left">
			<span class="glyphicon glyphicon-comment" aria-hidden="true"></span>
		</div>
		<div class="media-body">
			<h4 class="media-heading">
				{{ review.nick }}
				<small>{{ review.createdAt|date }}</small>
			</h4>

			<div>
				{% for i in range(1, review.rating) %}
					<span class="glyphicon glyphicon-star" aria-hidden="true"></span>
				{% endfor %}
			</div>
			{% autoescape true %}
			{{ review.review }}
			{% endautoescape %}
		</div>
	</div>
	{% endfor %}
</div>
<script type="text/javascript">
	$(document).ready(function(){
		$('.product-opinions div.stars').raty({
			target:     '#rating',
			targetType: 'score',
			targetKeep : true,
			score: 5,
			starOff : '{{ asset('themes/wellcommerce-default-theme/assets/img/star-off.png') }}',
			starOn  : '{{ asset('themes/wellcommerce-default-theme/assets/img/star-on.png') }}'
		});
	});
</script>
{% endif %}
{'fraction_non_alphanumeric': 0.20646356525319062, 'fraction_numerical': 0.006587072869493619, 'mean_word_length': 3.7730844793713163, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 103, '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': '3522342', 'n_tokens_mistral': 1947, 'n_tokens_neox': 1627, 'n_words': 323}