Skip to content

Instantly share code, notes, and snippets.

View GustavoPMex's full-sized avatar
馃挱
Hello there | 馃悕

Gustavo Alonso Pacheco Mex GustavoPMex

馃挱
Hello there | 馃悕
View GitHub Profile
var send = document.getElementById("send");
send.addEventListener("click", function(){
var content = encodeURIComponent(document.getElementById("content").value); // &
if (content.length > 0){
const url = "{% url 'messenger:add' thread.pk %}" + "?content="+content;
fetch(url, {'credentials':'include'}).then(response => response.json()).then(function(data){
// Si el mensaje se ha creado correctamente...
if (data.created) {
// Aqu铆 ir铆a el c贸digo de creaci贸n del mensaje din谩micamente
} else {
@hcosta
hcosta / pagination.html
Last active October 29, 2023 19:43
Men煤 de paginaci贸n con Bootstrap 4 para ListView en Django
<!-- Men煤 de paginaci贸n -->
{% if is_paginated %}
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
{% if page_obj.has_previous %}
<li class="page-item ">
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">&laquo;</a>
</li>
{% else %}
<li class="page-item disabled">
@hcosta
hcosta / login.html
Last active February 2, 2025 13:04
Revisi贸n del template para identificarse en el curso Django 2
{% extends 'core/base.html' %}
{% load static %}
{% block title %}Iniciar sesi贸n{% endblock %}
{% block content %}
<style>.errorlist{color:red;}</style>
<main role="main">
<div class="container">
<div class="row mt-3">
<div class="col-md-9 mx-auto mb-5">
<form action="" method="post">{% csrf_token %}
{% extends 'core/base.html' %}
{% load static %}
{% block title %}Borrar p谩gina{% endblock %}
{% block content %}
{% include 'pages/includes/pages_menu.html'%}
<main role="main">
<div class="container">
<div class="row mt-3">
<div class="col-md-9 mx-auto">
<div>
@hcosta
hcosta / page_form.html
Created March 19, 2018 15:54
Versi贸n 1
{% extends 'core/base.html' %}
{% load static %}
{% block title %}Crear p谩gina{% endblock %}
{% block content %}
{% include 'pages/includes/pages_menu.html'%}
<main role="main">
<div class="container">
<div class="row mt-3">
<div class="col-md-9 mx-auto">
<div>