This file contains 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({ |
This file contains 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 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/your@email.com" 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 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 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 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 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 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 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
$('.table').on('click', '.table__delete', function() { | |
if ($(this).parent().is(':not(:last-child)')) { | |
var linhaClicada = $(this).parent().index(); | |
console.log(linhaClicada); | |
$.ajax({ | |
type: 'POST', | |
dataType: 'json', | |
url: "/atendimento/deletar-servico-ou-item-selecionado/", | |
data: { | |
item: linhaClicada, |
This file contains 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
# Sample i2of5 barcode generation. | |
from reportlab.pdfgen import canvas | |
from reportlab.lib.pagesizes import A4 | |
from reportlab.lib.units import mm | |
from reportlab.graphics.barcode.common import I2of5 | |
c=canvas.Canvas("barcode_example.pdf",pagesize=A4) | |
tb=0.254320987654 * mm # thin bar | |
bh=20 * mm # bar height |
OlderNewer