componentsDjangoType 0.0.4__tar.gz → 1.0.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. {componentsdjangotype-0.0.4/componentsDjangoType.egg-info → componentsdjangotype-1.0.1}/PKG-INFO +2 -2
  2. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/README.md +1 -1
  3. componentsdjangotype-1.0.1/componentsDjangoType/management/commands/createApp.py +250 -0
  4. componentsdjangotype-1.0.1/componentsDjangoType/management/commands/utils/css/authentication.css +212 -0
  5. componentsdjangotype-1.0.1/componentsDjangoType/management/commands/utils/js/alertErrors.js +0 -0
  6. componentsdjangotype-1.0.1/componentsDjangoType/management/commands/utils/layouts/index.html +40 -0
  7. componentsdjangotype-1.0.1/componentsDjangoType/management/commands/utils/pages/home.html +3 -0
  8. componentsdjangotype-1.0.1/componentsDjangoType/management/commands/utils/pages/logged.html +6 -0
  9. componentsdjangotype-1.0.1/componentsDjangoType/management/commands/utils/pages/login.html +35 -0
  10. componentsdjangotype-1.0.1/componentsDjangoType/management/commands/utils/pages/singup.html +38 -0
  11. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1/componentsDjangoType.egg-info}/PKG-INFO +2 -2
  12. componentsdjangotype-1.0.1/componentsDjangoType.egg-info/SOURCES.txt +21 -0
  13. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/setup.py +1 -1
  14. componentsdjangotype-0.0.4/componentsDjangoType.egg-info/SOURCES.txt +0 -13
  15. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/LICENSE +0 -0
  16. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/MANIFEST.in +0 -0
  17. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/componentsDjangoType/__init__.py +0 -0
  18. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/componentsDjangoType/management/__init__.py +0 -0
  19. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/componentsDjangoType/management/commands/__init__.py +0 -0
  20. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  21. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  22. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/componentsDjangoType.egg-info/requires.txt +0 -0
  23. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/componentsDjangoType.egg-info/top_level.txt +0 -0
  24. {componentsdjangotype-0.0.4 → componentsdjangotype-1.0.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 0.0.4
3
+ Version: 1.0.1
4
4
  Summary: A Django app for creating HTML components
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -39,7 +39,7 @@ Este comando de Django te permite crear un componente HTML dentro del directorio
39
39
 
40
40
  ## Uso
41
41
 
42
- 1. Ejecuta el comando en tu terminal: `python manage.py create_html_component <nombre_de_aplicación> <ruta_del_archivo> --type=<template|static>`
42
+ 1. Ejecuta el comando en tu terminal: `python manage.py createcomponent <nombre_de_aplicación> <carpeta/archivo> --type=<template|static>`
43
43
  2. Reemplaza `<nombre_de_aplicación>` con el nombre de la aplicación donde deseas crear el componente.
44
44
  3. Reemplaza `<ruta_del_archivo>` con la ruta donde deseas crear el componente dentro del directorio `templates` o `static` de la aplicación.
45
45
  4. La bandera `--type` especifica si deseas crear un componente en el directorio `templates` o `static`. Por defecto, se establece en `template`.
@@ -18,7 +18,7 @@ Este comando de Django te permite crear un componente HTML dentro del directorio
18
18
 
19
19
  ## Uso
20
20
 
21
- 1. Ejecuta el comando en tu terminal: `python manage.py create_html_component <nombre_de_aplicación> <ruta_del_archivo> --type=<template|static>`
21
+ 1. Ejecuta el comando en tu terminal: `python manage.py createcomponent <nombre_de_aplicación> <carpeta/archivo> --type=<template|static>`
22
22
  2. Reemplaza `<nombre_de_aplicación>` con el nombre de la aplicación donde deseas crear el componente.
23
23
  3. Reemplaza `<ruta_del_archivo>` con la ruta donde deseas crear el componente dentro del directorio `templates` o `static` de la aplicación.
24
24
  4. La bandera `--type` especifica si deseas crear un componente en el directorio `templates` o `static`. Por defecto, se establece en `template`.
@@ -0,0 +1,250 @@
1
+ # componentsDjangoType/management/commands/createcomponentApp.py
2
+ import os
3
+ from django.core.management.base import BaseCommand
4
+ from django.core.management import call_command
5
+
6
+
7
+ class Command(BaseCommand):
8
+ help = 'Crea una aplicación llamada Home, estructura de carpetas y configura urls automáticamente en el proyecto especificado'
9
+
10
+ def handle(self, *args, **kwargs):
11
+ # Nombre de la aplicación a crear
12
+ app_name = "Home"
13
+
14
+ # Paso 1: Solicitar el nombre de la aplicación principal al usuario
15
+ project_name = input(
16
+ "Por favor, ingresa el nombre de la aplicación principal del proyecto: ")
17
+
18
+ # Paso 2: Crear la aplicación "Home" si no existe
19
+ if not os.path.exists(app_name):
20
+ self.stdout.write(f"Creando la aplicación '{app_name}'...")
21
+ call_command('startapp', app_name)
22
+ else:
23
+ self.stdout.write(f"La aplicación '{app_name}' ya existe.")
24
+
25
+ # Paso 3: Crear el archivo urls.py en la aplicación "Home" si no existe
26
+ urls_path = os.path.join(app_name, 'urls.py')
27
+ if not os.path.exists(urls_path):
28
+ self.stdout.write(f"Creando el archivo '{urls_path}'...")
29
+ with open(urls_path, 'w') as f:
30
+ f.write(
31
+ "from django.urls import path\n\n"
32
+ "urlpatterns = [\n"
33
+ " # Añade tus rutas aquí\n"
34
+ "]\n"
35
+ )
36
+ else:
37
+ self.stdout.write(f"El archivo '{urls_path}' ya existe.")
38
+
39
+ # Paso 4: Modificar el archivo urls.py principal del proyecto
40
+ project_urls_path = os.path.join(project_name, 'urls.py')
41
+ if os.path.exists(project_urls_path):
42
+ with open(project_urls_path, 'r') as f:
43
+ content = f.read()
44
+
45
+ include_statement = "path('', include('Home.urls'))"
46
+ if include_statement not in content:
47
+ self.stdout.write(f"Añadiendo la ruta '{
48
+ include_statement}' al archivo urls.py principal...")
49
+ with open(project_urls_path, 'a') as f:
50
+ f.write(
51
+ "\nfrom django.urls import include, path\n\n"
52
+ "urlpatterns += [\n"
53
+ f" {include_statement},\n"
54
+ "]\n"
55
+ )
56
+ else:
57
+ self.stdout.write(
58
+ "La ruta ya existe en el archivo urls.py principal.")
59
+ else:
60
+ self.stdout.write(f"No se encontró el archivo principal urls.py en '{
61
+ project_urls_path}'. Asegúrate de que el nombre del proyecto sea correcto.")
62
+
63
+ # Paso 5: Crear la carpeta services y el archivo authentication.py en Home
64
+ services_dir = os.path.join(app_name, 'services')
65
+ # Crea la carpeta si no existe
66
+ os.makedirs(services_dir, exist_ok=True)
67
+ authentication_file_path = os.path.join(
68
+ services_dir, 'authentication.py')
69
+
70
+ if not os.path.exists(authentication_file_path):
71
+ self.stdout.write(f"Creando el archivo '{
72
+ authentication_file_path}'...")
73
+ with open(authentication_file_path, 'w') as f:
74
+ f.write(
75
+ "from django.shortcuts import render, redirect\n"
76
+ "from django.contrib.auth.forms import UserCreationForm, AuthenticationForm\n"
77
+ "from django.contrib.auth.models import User\n"
78
+ "from django.contrib.auth import login, logout, authenticate\n"
79
+ "from django.db import IntegrityError\n\n\n"
80
+ "class Authentication:\n"
81
+ " @staticmethod\n"
82
+ " def get_signup(request):\n"
83
+ " if request.method == 'GET':\n"
84
+ " return render(request, 'singup.html', {\n"
85
+ " 'form': UserCreationForm()\n"
86
+ " })\n"
87
+ " elif request.method == 'POST':\n"
88
+ " if request.POST['password1'] == request.POST['password2']:\n"
89
+ " try:\n"
90
+ " # Register user\n"
91
+ " user = User.objects.create_user(\n"
92
+ " username=request.POST['username'], password=request.POST['password2'])\n"
93
+ " user.save()\n"
94
+ " login(request, user)\n"
95
+ " return redirect('logged')\n"
96
+ " except IntegrityError:\n"
97
+ " return render(request, 'singup.html', {\n"
98
+ " 'form': UserCreationForm(),\n"
99
+ " 'error': 'User already exists'\n"
100
+ " })\n"
101
+ " return render(request, 'singup.html', {\n"
102
+ " 'form': UserCreationForm(),\n"
103
+ " 'error': 'Passwords do not match'\n"
104
+ " })\n\n"
105
+ " @staticmethod\n"
106
+ " def get_signout(request):\n"
107
+ " logout(request)\n"
108
+ " return redirect('home')\n\n"
109
+ " @staticmethod\n"
110
+ " def get_signing(request):\n"
111
+ " if request.method == 'GET':\n"
112
+ " return render(request, 'login.html', {\n"
113
+ " 'form': AuthenticationForm,\n"
114
+ " })\n"
115
+ " elif request.method == 'POST':\n"
116
+ " try:\n"
117
+ " User.objects.get(username=request.POST['username'])\n"
118
+ " except User.DoesNotExist:\n"
119
+ " return render(request, 'login.html', {\n"
120
+ " 'form': AuthenticationForm,\n"
121
+ " 'error': 'User does not exist in the database'\n"
122
+ " })\n"
123
+ " user = authenticate(\n"
124
+ " request, username=request.POST['username'], password=request.POST['password'])\n"
125
+ " if user is None:\n"
126
+ " return render(request, 'login.html', {\n"
127
+ " 'form': AuthenticationForm,\n"
128
+ " 'error': 'username or password is incorrect'\n"
129
+ " })\n"
130
+ " else:\n"
131
+ " login(request, user)\n"
132
+ " return redirect('logged')\n\n"
133
+ " @staticmethod\n"
134
+ " def get_logged(request):\n"
135
+ " return render(request, 'logged.html')\n\n"
136
+ " def dispatch(self, request, *args, **kwargs):\n"
137
+ " match request.path:\n"
138
+ " case \"/signup\":\n"
139
+ " return self.get_signup(request)\n"
140
+ " case \"/login\":\n"
141
+ " return self.get_signing(request)\n"
142
+ " case \"/logout\":\n"
143
+ " return self.get_signout(request)\n"
144
+ " case \"/logged\":\n"
145
+ " return self.get_logged(request)\n"
146
+ " case \"/\":\n"
147
+ " return self.get(request)\n"
148
+ " case _:\n"
149
+ " return self.get(request)\n"
150
+ )
151
+ else:
152
+ self.stdout.write(
153
+ f"El archivo '{authentication_file_path}' ya existe.")
154
+
155
+ import os
156
+
157
+ # Paso 6: Crear la carpeta templates y los archivos HTML
158
+ # Asumiendo que `project_name` ya está definido
159
+ templates_dir = os.path.join(project_name, 'templates')
160
+ layouts_dir = os.path.join(templates_dir, 'layouts')
161
+ static_dir = os.path.join(project_name, 'static')
162
+ css_dir = os.path.join(static_dir, 'css')
163
+ js_dir = os.path.join(static_dir, 'js')
164
+
165
+ # Crear los directorios necesarios
166
+ os.makedirs(js_dir, exist_ok=True)
167
+ os.makedirs(css_dir, exist_ok=True)
168
+ os.makedirs(layouts_dir, exist_ok=True)
169
+ os.makedirs(templates_dir, exist_ok=True)
170
+ os.makedirs(static_dir, exist_ok=True)
171
+
172
+ # Rutas de los archivos fuente y destino
173
+ css_source_path = os.path.join('utils', 'css', 'authentication.css')
174
+ authentication_css = os.path.join(css_dir, 'authentication.css')
175
+ js_source_path = os.path.join('utils', 'js', 'alertErrors.js')
176
+ alertErrors_js = os.path.join(js_dir, 'alertErrors.js')
177
+
178
+ # Crear archivos si no existen
179
+ if not os.path.exists(authentication_css):
180
+ try:
181
+ with open(css_source_path, 'r') as source_file:
182
+ css_content = source_file.read()
183
+ with open(js_source_path, 'r') as source_file:
184
+ js_content = source_file.read()
185
+
186
+ with open(authentication_css, 'w') as f:
187
+ f.write(css_content)
188
+ with open(alertErrors_js, 'w') as f:
189
+ f.write(js_content)
190
+
191
+ print(f"Archivo CSS creado exitosamente en {
192
+ authentication_css}")
193
+ print(f"Archivo JS creado exitosamente en {alertErrors_js}")
194
+ except FileNotFoundError as e:
195
+ print(f"Archivo fuente no encontrado: {e}")
196
+ except Exception as e:
197
+ print(f"Error al crear el archivo: {e}")
198
+
199
+ # Crear el archivo de layout (index.html) si no existe
200
+ index_page_source = os.path.join('utils', 'layouts', 'index.html')
201
+ layouts_source = os.path.join(layouts_dir, 'index.html')
202
+
203
+ if not os.path.exists(layouts_source):
204
+ try:
205
+ with open(index_page_source, 'r') as source_file:
206
+ index_content = source_file.read()
207
+
208
+ with open(layouts_source, 'w') as f:
209
+ f.write(index_content)
210
+
211
+ print("Archivo de layout creado exitosamente")
212
+ except FileNotFoundError as e:
213
+ print(f"Archivo fuente no encontrado: {e}")
214
+ except Exception as e:
215
+ print(f"Error al crear el archivo: {e}")
216
+
217
+ # Crear las páginas HTML adicionales (home, signup, login, logged)
218
+ home_page = os.path.join('utils', 'pages', 'home.html')
219
+ signup_page = os.path.join('utils', 'pages', 'signup.html')
220
+ login_page = os.path.join('utils', 'pages', 'login.html')
221
+ logged_page = os.path.join('utils', 'pages', 'logged.html')
222
+
223
+ # Rutas de los archivos de destino
224
+ home_dest = os.path.join(templates_dir, 'home.html')
225
+ signup_dest = os.path.join(templates_dir, 'signup.html')
226
+ login_dest = os.path.join(templates_dir, 'login.html')
227
+ logged_dest = os.path.join(templates_dir, 'logged.html')
228
+
229
+ # Crear cada archivo HTML si no existe
230
+ for source_path, dest_path, page_name in [
231
+ (home_page, home_dest, 'Home'),
232
+ (signup_page, signup_dest, 'Signup'),
233
+ (login_page, login_dest, 'Login'),
234
+ (logged_page, logged_dest, 'Logged')
235
+ ]:
236
+ if not os.path.exists(dest_path):
237
+ try:
238
+ with open(source_path, 'r') as source_file:
239
+ content = source_file.read()
240
+ with open(dest_path, 'w') as dest_file:
241
+ dest_file.write(content)
242
+ print(f"Archivo {page_name} creado exitosamente en {
243
+ dest_path}")
244
+ except FileNotFoundError as e:
245
+ print(f"Archivo fuente no encontrado: {source_path}")
246
+ except Exception as e:
247
+ print(f"Error al crear el archivo {page_name}: {e}")
248
+
249
+ self.stdout.write(self.style.SUCCESS(
250
+ "Comando ejecutado exitosamente."))
@@ -0,0 +1,212 @@
1
+ /* Navbar */
2
+ .navbar {
3
+ display: flex;
4
+ justify-content: space-between;
5
+ align-items: center;
6
+ padding: 10px 20px;
7
+ background-color: #333; /* Color de fondo */
8
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
9
+ }
10
+
11
+ /* Logo */
12
+ .navbar .logo a {
13
+ color: #ffffff;
14
+ font-size: 1.5em;
15
+ text-decoration: none;
16
+ transition: color 0.3s ease;
17
+ }
18
+
19
+ .navbar .logo a:hover {
20
+ color: #4a90e2; /* Hover del logo */
21
+ }
22
+
23
+ /* Links de navegación */
24
+ .nav-links {
25
+ display: flex;
26
+ gap: 15px;
27
+ list-style: none;
28
+ margin: 0;
29
+ padding: 0;
30
+ }
31
+
32
+ .nav-links .nav-item {
33
+ color: #ffffff;
34
+ font-size: 1em;
35
+ text-decoration: none;
36
+ padding: 8px 15px;
37
+ border-radius: 5px;
38
+ transition: background-color 0.3s ease, color 0.3s ease;
39
+ }
40
+
41
+ .nav-links .nav-item:hover {
42
+ background-color: #4a90e2; /* Hover */
43
+ color: #ffffff;
44
+ }
45
+
46
+ /* Estilos para dispositivos móviles */
47
+ .menu-toggle {
48
+ display: none;
49
+ }
50
+
51
+ @media (max-width: 768px) {
52
+ .menu-toggle {
53
+ display: inline-block;
54
+ font-size: 1.5em;
55
+ color: #ffffff;
56
+ cursor: pointer;
57
+ padding: 8px 15px;
58
+ }
59
+
60
+ .nav-links {
61
+ flex-direction: column;
62
+ position: absolute;
63
+ top: 100%;
64
+ right: 0;
65
+ width: 100%;
66
+ background-color: #333;
67
+ max-height: 0;
68
+ overflow: hidden;
69
+ transition: max-height 0.3s ease;
70
+ }
71
+
72
+ /* Activar menú desplegable */
73
+ .nav-links.active {
74
+ max-height: 300px; /* Ajustar altura */
75
+ }
76
+
77
+ .nav-links .nav-item {
78
+ padding: 10px 20px;
79
+ }
80
+ }
81
+
82
+ /* formularios */
83
+ /* Contenedor para centrar el formulario */
84
+ .form-wrapper {
85
+ display: flex;
86
+ justify-content: center;
87
+ align-items: center;
88
+ margin-top: 50px;
89
+ }
90
+
91
+ /* Contenedor del formulario */
92
+ .form-container {
93
+ padding: 20px;
94
+ background: black; /* Fondo azul con transparencia */
95
+ border-radius: 8px;
96
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
97
+ color: white;
98
+ text-align: center;
99
+ max-width: 400px;
100
+ width: 100%;
101
+ }
102
+
103
+ /* Estilo del formulario */
104
+ .form-control {
105
+ display: flex;
106
+ flex-direction: column;
107
+ gap: 15px;
108
+ }
109
+
110
+ /* Estilo para las etiquetas */
111
+ label {
112
+ font-size: 0.9em;
113
+ color: #d1d5db; /* Color gris claro */
114
+ margin-bottom: 5px;
115
+ text-align: left;
116
+ }
117
+
118
+ /* Estilo para los campos de entrada */
119
+ input[type="text"],
120
+ input[type="password"] {
121
+ padding: 10px;
122
+ background: rgba(255, 255, 255, 0.2);
123
+ border: 1px solid rgba(255, 255, 255, 0.3);
124
+ border-radius: 5px;
125
+ color: #ffffff;
126
+ outline: none;
127
+ font-size: 1em;
128
+ transition: background 0.3s ease, box-shadow 0.3s ease;
129
+ }
130
+
131
+ input[type="text"]:focus,
132
+ input[type="password"]:focus {
133
+ background: rgba(255, 255, 255, 0.4);
134
+ box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
135
+ }
136
+
137
+ /* Estilo del botón */
138
+ button[type="submit"] {
139
+ padding: 10px;
140
+ background: #4a90e2;
141
+ color: white;
142
+ border: none;
143
+ border-radius: 5px;
144
+ cursor: pointer;
145
+ transition: background 0.3s ease;
146
+ }
147
+
148
+ button[type="submit"]:hover {
149
+ background: #357ab8;
150
+ }
151
+
152
+ /* alert */
153
+
154
+ /* Estilos para la alerta */
155
+ .alert {
156
+ max-width: 400px;
157
+ background-color: #333;
158
+ color: #ffffff;
159
+ border-radius: 8px;
160
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
161
+ margin: 0 auto;
162
+ position: relative;
163
+ top: 20px;
164
+ padding: 15px;
165
+ }
166
+
167
+ .alert-content {
168
+ display: flex;
169
+ justify-content: space-between;
170
+ align-items: center;
171
+ }
172
+
173
+ .close-btn {
174
+ background: none;
175
+ border: none;
176
+ cursor: pointer;
177
+ color: #ffffff;
178
+ transition: color 0.3s ease;
179
+ }
180
+
181
+ .close-btn:hover {
182
+ color: #ff6b6b;
183
+ }
184
+
185
+ .close-icon {
186
+ width: 16px;
187
+ height: 16px;
188
+ }
189
+
190
+ /* logged */
191
+
192
+ /* Estilos para el contenedor del bloque */
193
+ .layout-container {
194
+ display: flex;
195
+ justify-content: center;
196
+ align-items: center;
197
+ height: 100vh;
198
+ background-color: #f0f4f8;
199
+ font-family: Arial, sans-serif;
200
+ }
201
+
202
+ /* Estilos para el título */
203
+ .layout-container h1 {
204
+ font-size: 2.5rem;
205
+ color: #4a90e2;
206
+ font-weight: bold;
207
+ text-align: center;
208
+ padding: 20px;
209
+ border-radius: 8px;
210
+ background: #ffffff;
211
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
212
+ }
@@ -0,0 +1,40 @@
1
+ {% load static %}
2
+ <!DOCTYPE html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <link rel="stylesheet" href="{% static 'css/authentication.css' %}">
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
9
+ <title>django components</title>
10
+ </head>
11
+ <body class="bg-gray-100 text-gray-800">
12
+
13
+ <nav class="navbar">
14
+ <div class="logo">
15
+ <a href="{% url 'home' %}">
16
+ <i class="fa-solid fa-house"></i>
17
+ </a>
18
+ </div>
19
+ <div class="menu-toggle">
20
+ <i class="fa fa-bars"></i>
21
+ </div>
22
+ <ul class="nav-links">
23
+ {% if user.is_authenticated %}
24
+ <li><a href="{% url 'logout' %}" class="nav-item">Logout</a></li>
25
+ {% else %}
26
+ <li><a href="{% url 'signup' %}" class="nav-item">Sign Up</a></li>
27
+ <li><a href="{% url 'login' %}" class="nav-item">Login</a></li>
28
+ {% endif %}
29
+ </ul>
30
+ </nav>
31
+
32
+ <div class="container mx-auto p-4">
33
+ {% block layout %}
34
+ {% endblock %}
35
+ </div>
36
+
37
+ {% block script %}
38
+ {% endblock %}
39
+ </body>
40
+ </html>
@@ -0,0 +1,3 @@
1
+ {% extends "layouts/index.html" %}
2
+ {% block layout %}
3
+ {% endblock %}
@@ -0,0 +1,6 @@
1
+ {% extends "layouts/index.html" %}
2
+ {% block layout %}
3
+ <div class="layout-container">
4
+ <h1>¡Has iniciado sesión!</h1>
5
+ </div>
6
+ {% endblock %}
@@ -0,0 +1,35 @@
1
+ {% extends "layouts/index.html" %}
2
+ {% block layout %}
3
+ {% if error %}
4
+ <div class="alert" id="alert">
5
+ <div class="alert-content">
6
+ {{ error }}
7
+ <button class="close-btn" onclick="closeAlert()">
8
+ <span class="sr-only">Close</span>
9
+ <svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
10
+ <path d="M0.92524 0.687069C1.126 0.486219 1.39823 0.373377 1.68209 0.373377C1.96597 0.373377 2.2382 0.486219 2.43894 0.687069L8.10514 6.35813L13.7714 0.687069C13.8701 0.584748 13.9882 0.503105 14.1188 0.446962C14.2494 0.39082 14.3899 0.361248 14.5321 0.360026C14.6742 0.358783 14.8151 0.38589 14.9468 0.439762C15.0782 0.493633 15.1977 0.573197 15.2983 0.673783C15.3987 0.774389 15.4784 0.894026 15.5321 1.02568C15.5859 1.15736 15.6131 1.29845 15.6118 1.44071C15.6105 1.58297 15.5809 1.72357 15.5248 1.85428C15.4688 1.98499 15.3872 2.10324 15.2851 2.20206L9.61883 7.87312L15.2851 13.5441C15.4801 13.7462 15.588 14.0168 15.5854 14.2977C15.5831 14.5787 15.4705 14.8474 15.272 15.046C15.0735 15.2449 14.805 15.3574 14.5244 15.3599C14.2437 15.3623 13.9733 15.2543 13.7714 15.0591L8.10514 9.38812L2.43894 15.0591C2.23704 15.2543 1.96663 15.3623 1.68594 15.3599C1.40526 15.3574 1.13677 15.2449 0.938279 15.046C0.739807 14.8474 0.627232 14.5787 0.624791 14.2977C0.62235 14.0168 0.730236 13.7462 0.92524 13.5441L6.59144 7.87312L0.92524 2.20206C0.724562 2.00115 0.611816 1.72867 0.611816 1.44457C0.611816 1.16047 0.724562 0.887983 0.92524 0.687069Z" fill="currentColor"/>
11
+ </svg>
12
+ </button>
13
+ </div>
14
+ </div>
15
+ {% endif %}
16
+ <div class="form-wrapper">
17
+ <div class="form-container">
18
+ <form action="" method="post" class="form-control">
19
+ {% csrf_token %}
20
+ <h1>Login</h1>
21
+
22
+ <label for="username">Usuario:</label>
23
+ {{ form.username }}
24
+
25
+ <label for="password">Contraseña:</label>
26
+ <input type="password" id="password" name="password" value="{{ form.password2 }}" required>
27
+
28
+ <button type="submit">Login</button>
29
+ </form>
30
+ </div>
31
+ </div>
32
+ {% endblock %}
33
+ {% block script %}
34
+ <script src="{% static 'js/alertErrors.js'%}"></script>
35
+ {% endblock %}
@@ -0,0 +1,38 @@
1
+ {% extends "layouts/index.html" %}
2
+ {% block layout %}
3
+ {% if error %}
4
+ <div class="alert" id="alert">
5
+ <div class="alert-content">
6
+ {{ error }}
7
+ <button class="close-btn" onclick="closeAlert()">
8
+ <span class="sr-only">Close</span>
9
+ <svg class="close-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
10
+ <path d="M0.92524 0.687069C1.126 0.486219 1.39823 0.373377 1.68209 0.373377C1.96597 0.373377 2.2382 0.486219 2.43894 0.687069L8.10514 6.35813L13.7714 0.687069C13.8701 0.584748 13.9882 0.503105 14.1188 0.446962C14.2494 0.39082 14.3899 0.361248 14.5321 0.360026C14.6742 0.358783 14.8151 0.38589 14.9468 0.439762C15.0782 0.493633 15.1977 0.573197 15.2983 0.673783C15.3987 0.774389 15.4784 0.894026 15.5321 1.02568C15.5859 1.15736 15.6131 1.29845 15.6118 1.44071C15.6105 1.58297 15.5809 1.72357 15.5248 1.85428C15.4688 1.98499 15.3872 2.10324 15.2851 2.20206L9.61883 7.87312L15.2851 13.5441C15.4801 13.7462 15.588 14.0168 15.5854 14.2977C15.5831 14.5787 15.4705 14.8474 15.272 15.046C15.0735 15.2449 14.805 15.3574 14.5244 15.3599C14.2437 15.3623 13.9733 15.2543 13.7714 15.0591L8.10514 9.38812L2.43894 15.0591C2.23704 15.2543 1.96663 15.3623 1.68594 15.3599C1.40526 15.3574 1.13677 15.2449 0.938279 15.046C0.739807 14.8474 0.627232 14.5787 0.624791 14.2977C0.62235 14.0168 0.730236 13.7462 0.92524 13.5441L6.59144 7.87312L0.92524 2.20206C0.724562 2.00115 0.611816 1.72867 0.611816 1.44457C0.611816 1.16047 0.724562 0.887983 0.92524 0.687069Z" fill="currentColor"/>
11
+ </svg>
12
+ </button>
13
+ </div>
14
+ </div>
15
+ {% endif %}
16
+ <div class="form-wrapper">
17
+ <div class="form-container">
18
+ <form action="" method="post" class="form-control">
19
+ {% csrf_token %}
20
+ <h1>sing up</h1>
21
+
22
+ <label for="username">Usuario:</label>
23
+ {{ form.username }}
24
+
25
+ <label for="password1">Contraseña:</label>
26
+ {{ form.password1 }}
27
+
28
+ <label for="password2">Confirmar Contraseña:</label>
29
+ {{ form.password2 }}
30
+
31
+ <button type="submit">sing Up</button>
32
+ </form>
33
+ </div>
34
+ </div>
35
+ {% endblock %}
36
+ {% block script %}
37
+ <script src="{% static 'js/alertErrors.js'%}"></script>
38
+ {% endblock %}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 0.0.4
3
+ Version: 1.0.1
4
4
  Summary: A Django app for creating HTML components
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -39,7 +39,7 @@ Este comando de Django te permite crear un componente HTML dentro del directorio
39
39
 
40
40
  ## Uso
41
41
 
42
- 1. Ejecuta el comando en tu terminal: `python manage.py create_html_component <nombre_de_aplicación> <ruta_del_archivo> --type=<template|static>`
42
+ 1. Ejecuta el comando en tu terminal: `python manage.py createcomponent <nombre_de_aplicación> <carpeta/archivo> --type=<template|static>`
43
43
  2. Reemplaza `<nombre_de_aplicación>` con el nombre de la aplicación donde deseas crear el componente.
44
44
  3. Reemplaza `<ruta_del_archivo>` con la ruta donde deseas crear el componente dentro del directorio `templates` o `static` de la aplicación.
45
45
  4. La bandera `--type` especifica si deseas crear un componente en el directorio `templates` o `static`. Por defecto, se establece en `template`.
@@ -0,0 +1,21 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ setup.py
5
+ componentsDjangoType/__init__.py
6
+ componentsDjangoType.egg-info/PKG-INFO
7
+ componentsDjangoType.egg-info/SOURCES.txt
8
+ componentsDjangoType.egg-info/dependency_links.txt
9
+ componentsDjangoType.egg-info/requires.txt
10
+ componentsDjangoType.egg-info/top_level.txt
11
+ componentsDjangoType/management/__init__.py
12
+ componentsDjangoType/management/commands/__init__.py
13
+ componentsDjangoType/management/commands/createApp.py
14
+ componentsDjangoType/management/commands/createcomponent.py
15
+ componentsDjangoType/management/commands/utils/css/authentication.css
16
+ componentsDjangoType/management/commands/utils/js/alertErrors.js
17
+ componentsDjangoType/management/commands/utils/layouts/index.html
18
+ componentsDjangoType/management/commands/utils/pages/home.html
19
+ componentsDjangoType/management/commands/utils/pages/logged.html
20
+ componentsDjangoType/management/commands/utils/pages/login.html
21
+ componentsDjangoType/management/commands/utils/pages/singup.html
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='0.0.4',
5
+ version='1.0.1',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  license='MIT',
@@ -1,13 +0,0 @@
1
- LICENSE
2
- MANIFEST.in
3
- README.md
4
- setup.py
5
- componentsDjangoType/__init__.py
6
- componentsDjangoType.egg-info/PKG-INFO
7
- componentsDjangoType.egg-info/SOURCES.txt
8
- componentsDjangoType.egg-info/dependency_links.txt
9
- componentsDjangoType.egg-info/requires.txt
10
- componentsDjangoType.egg-info/top_level.txt
11
- componentsDjangoType/management/__init__.py
12
- componentsDjangoType/management/commands/__init__.py
13
- componentsDjangoType/management/commands/createcomponent.py