This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#input").autocomplete({ | |
minLength: 1, | |
source: function(req, add){ | |
var search=$("#input").val(); | |
$.ajax({ | |
url: '/your-url/', | |
async: true, | |
dataType: 'json', | |
type: 'GET', | |
data: {'start': search,}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#action-button").click(function() { | |
// supondo que voce tenha um <input id="pesquisar-nome"/> | |
var inputValue = $("#pesquisar-nome").val(); | |
$.ajax({ | |
url: "/search_view/?pesquisar-nome=" + encodeURIComponent(inputValue), | |
type: "get", | |
success: function(data) { | |
$('#results').html(data); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListaProdutos(ListView): | |
template_name = 'produtos.html' | |
model = Produto | |
context_object_name = 'produtos' | |
def get_queryset(self): | |
pista = self.request.GET.get('pesquisar_por') | |
status = self.request.GET.get('status') | |
if status == 'ativo' : status = 'A' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ListaProdutos(ListView): | |
template_name = 'produtos.html' | |
model = Produto | |
context_object_name = 'produtos' | |
def get_queryset(self): | |
pista = self.request.GET.get('pesquisar_por') | |
status = self.request.GET.get('status') | |
if status == 'ativo': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if acessos.paginator.num_pages > 1 %} | |
<nav> | |
<ul class="pager"> | |
{% if acessos.has_previous %} | |
<li class="previous"><a href="?page=1"><span aria-hidden="true">←</span> Primeira</a></li> | |
{% else %} | |
<li class="previous disabled"><a href="#"><span aria-hidden="true">←</span> Primeira</a></li> | |
{% endif %} | |
{% if acessos.has_previous %} | |
<li><a href="?page={{ acessos.previous_page_number }}">Anterior</a></li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="contact-form" action="//formspree.io/[email protected]" method="post"> | |
<input type="text" name="Name" placeholder="Name" required> | |
<input type="email" name="Email" placeholder="Email" required> | |
<textarea name="Message" cols="30" rows="6" placeholder="Message" required></textarea> | |
<!-- CONFIG --> | |
<input class="hidden" type="text" name="_gotcha"> | |
<input type="hidden" name="_subject" value="Email Subject"> | |
<!-- /CONFIG --> | |
<input class="submit" type="submit" value="Send message"> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $images = get_field('galeria'); if( $images ): ?> | |
<?php $i = 0; ?> | |
<?php foreach( $images as $image ): ?> | |
<?php if($i < 1) { ?> | |
<a href="<?php echo $image['url']; ?>"> | |
<img src="<?php echo $image['sizes']['medium']; ?>" alt="<?php echo $image['alt']; ?>"> | |
</a> | |
<?php $i++; } else { ?> | |
<a href="<?php echo $image['url']; ?>"> | |
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<section id="google-map" class="gmap" style="height: 410px;"></section> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script type="text/javascript" src="js/jquery.gmap.js"></script> | |
<script type="text/javascript"> | |
jQuery('#google-map').gMap({ |
NewerOlder