Skip to content

Instantly share code, notes, and snippets.

@NickToye
Created April 6, 2012 19:54
Show Gist options
  • Save NickToye/2322497 to your computer and use it in GitHub Desktop.
Save NickToye/2322497 to your computer and use it in GitHub Desktop.
<div id="write_review" class="clearfix">
<? if (isset($review_posted)): ?>
<p class="flash success">Your taste review has been successfully posted.</p>
<? else: ?>
<h3 id="review_link" class="clearfix"><a href="#" onclick="$('#review_form').removeClass('hidden'); $('#review_link').addClass('hidden'); return false;">Write Your Taste Review</a></h3>
<div id="review_form" class="hidden bottom_offset">
<ul class="form">
<li class="field">
<label><span class="label">Rating</span>
<div class="rating_selector" id="rating_selector">
<span class="rating_stars">&nbsp;</span>
<input type="hidden" name="rating" value=""/>
<select class="rating_stars" name="rating">
<option value="0"></option>
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
<option value="4"></option>
<option value="5"></option>
</select>
<script>
jQuery(function($) {
$('.rating_selector').stars({
inputType: "select",
cancelValue: 0,
cancelShow: false
});
});
</script>
</div>
</label>
</li>
<li class="field text">
<label for="review_title"><span class="label">Title</span>
<input autocomplete="off" id="review_title" name="review_title" type="text" class="text"/>
</label>
</li>
<? if (!$this->customer): ?>
<li class="field text left">
<label for="review_author_name"><span class="label">Your Name</span>
<input autocomplete="off" id="review_author_name" name="review_author_name" type="text" class="text"/>
</label>
</li>
<li class="field text right">
<label for="review_author_email"><span class="label">Email</span>
<input autocomplete="off" id="review_author_email" type="text" class="text" name="review_author_email"/>
</label>
</li>
<? endif ?>
<li class="field text">
<label for="review_text"><span class="label">Review</span>
<textarea autocomplete="off" rows="5" id="review_text" name="review_text"></textarea>
</label>
</li>
</ul>
<input type="submit" class="btn" value="Submit" onclick="return $(this).getForm().sendRequest('shop:on_addProductReview', {extraFields: {no_flash: true}, update:{'shop:product_page': 'shop:product_partial'}})"/>
</div>
<? endif ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment