componentsDjangoType 2.1.7__tar.gz → 2.1.12__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. {componentsdjangotype-2.1.7/componentsDjangoType.egg-info → componentsdjangotype-2.1.12}/PKG-INFO +1 -1
  2. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  3. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType.egg-info/SOURCES.txt +0 -3
  4. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/authenticator_configurator.py +14 -37
  5. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/copy_source.py +7 -10
  6. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/utils/views/layouts/index.html +4 -7
  7. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/utils/views/login.html +0 -4
  8. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/utils/views/signup.html +1 -8
  9. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/setup.py +1 -1
  10. componentsdjangotype-2.1.7/services/utils/css/aside.css +0 -41
  11. componentsdjangotype-2.1.7/services/utils/views/aside.html +0 -32
  12. componentsdjangotype-2.1.7/services/utils/views/user.html +0 -4
  13. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/LICENSE +0 -0
  14. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/MANIFEST.in +0 -0
  15. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/README.md +0 -0
  16. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType/__init__.py +0 -0
  17. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType/__pycache__/__init__.cpython-312.pyc +0 -0
  18. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType/management/__init__.py +0 -0
  19. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType/management/__pycache__/__init__.cpython-312.pyc +0 -0
  20. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/__init__.py +0 -0
  21. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/__pycache__/__init__.cpython-312.pyc +0 -0
  22. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/__pycache__/createApp.cpython-312.pyc +0 -0
  23. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/createApp.py +0 -0
  24. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  25. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  26. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType.egg-info/requires.txt +0 -0
  27. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/componentsDjangoType.egg-info/top_level.txt +0 -0
  28. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/__init__.py +0 -0
  29. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/authentication/__init__.py +0 -0
  30. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/authentication/auth.py +0 -0
  31. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/authentication/forms.py +0 -0
  32. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/utils/__init__.py +0 -0
  33. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/utils/css/authentication.css +0 -0
  34. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/utils/js/alertErrors.js +0 -0
  35. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/utils/views/home.html +0 -0
  36. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/services/utils/views/logged.html +0 -0
  37. {componentsdjangotype-2.1.7 → componentsdjangotype-2.1.12}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.1.7
3
+ Version: 2.1.12
4
4
  Summary: Comandos para crear archivos html, css y js
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 2.1.7
3
+ Version: 2.1.12
4
4
  Summary: Comandos para crear archivos html, css y js
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -23,13 +23,10 @@ services/authentication/__init__.py
23
23
  services/authentication/auth.py
24
24
  services/authentication/forms.py
25
25
  services/utils/__init__.py
26
- services/utils/css/aside.css
27
26
  services/utils/css/authentication.css
28
27
  services/utils/js/alertErrors.js
29
- services/utils/views/aside.html
30
28
  services/utils/views/home.html
31
29
  services/utils/views/logged.html
32
30
  services/utils/views/login.html
33
31
  services/utils/views/signup.html
34
- services/utils/views/user.html
35
32
  services/utils/views/layouts/index.html
@@ -2,7 +2,6 @@ import os
2
2
  from django.core.management import call_command
3
3
  from services.authentication import auth, forms
4
4
  from services.copy_source import copy_static_file
5
- import importlib.resources as pkg_resources
6
5
 
7
6
  class DjangoProjectManager:
8
7
  def __init__(self, app_name, project_name):
@@ -135,41 +134,38 @@ urlpatterns = [
135
134
 
136
135
  # Ruta para el nuevo archivo a crear
137
136
  authentication_path = os.path.join(authentication_dir, 'auth.py')
138
- form_path = os.path.join(authentication_dir, 'form.py')
137
+ forms_path = os.path.join(authentication_dir, 'forms.py')
139
138
 
140
139
  # Usar el atributo __file__ del módulo 'auth' para obtener la ruta del archivo fuente
141
140
  auth_source_path = os.path.abspath(auth.__file__)
142
- form_source_path = os.path.abspath(forms.__file__)
141
+ forms_source_path = os.path.abspath(auth.__file__)
143
142
 
144
143
  if not os.path.exists(auth_source_path):
145
144
  stdout.write(f"El archivo fuente '{auth_source_path}' no existe. Verifica la instalación del paquete.")
146
- return
147
-
148
- if not os.path.exists(form_source_path):
149
- stdout.write(f"El archivo fuente '{form_source_path}' no existe. Verifica la instalación del paquete.")
145
+ stdout.write(f"El archivo fuente '{forms_source_path}' no existe. Verifica la instalación del paquete.")
150
146
  return
151
147
 
152
148
  if not os.path.exists(authentication_path):
153
149
  stdout.write(f"Creando el archivo '{authentication_path}'...")
154
- stdout.write(f"Creando el archivo '{form_path}'...")
150
+ stdout.write(f"Creando el archivo '{forms_path}'...")
155
151
 
156
152
  # Leer el contenido de 'auth.py' del paquete
157
153
  try:
158
154
  with open(auth_source_path, 'r') as source_file:
159
155
  auth_code = source_file.read()
160
156
 
161
- with open(form_source_path, 'r') as source_file:
162
- form_code = source_file.read
157
+ with open(forms_source_path, 'r') as source_file:
158
+ forms_code = source_file.read()
163
159
 
164
160
  # Escribir el contenido en el nuevo archivo 'authentication.py'
165
161
  with open(authentication_path, 'w') as dest_file:
166
162
  dest_file.write(auth_code)
167
-
168
- with open(form_path, 'w') as dest_file:
169
- dest_file.write(form_code)
163
+
164
+ with open(forms_path, 'w') as dest_file:
165
+ dest_file.write(forms_code)
170
166
 
171
167
  stdout.write(f"El archivo '{authentication_path}' fue creado y el código fue copiado.")
172
- stdout.write(f"El archivo '{form_path}' fue creado y el código fue copiado.")
168
+ stdout.write(f"El archivo '{forms_path}' fue creado y el código fue copiado.")
173
169
  except Exception as e:
174
170
  stdout.write(f"Error al copiar el archivo: {e}")
175
171
  else:
@@ -237,50 +233,31 @@ urlpatterns = [
237
233
  templates_dir = os.path.join(app_name, 'templates')
238
234
  static_dir = os.path.join(app_name, 'static')
239
235
 
240
- #creacion de subcarpetas
236
+ #creacin de subcarpetas
241
237
  layouts_dir = os.path.join(templates_dir, 'layouts')
242
238
  js_dir = os.path.join(static_dir, 'js')
243
239
  css_dir = os.path.join(static_dir, 'css')
244
- user_dir_css = os.path.join(css_dir, 'user')
245
240
 
246
241
  # Crear las carpetas principales y subcarpetas
247
242
  os.makedirs(templates_dir, exist_ok=True)
248
243
  os.makedirs(layouts_dir, exist_ok=True)
249
244
  os.makedirs(static_dir, exist_ok=True)
250
245
  os.makedirs(js_dir, exist_ok=True)
251
- os.makedirs(css_dir, exist_ok=True)
252
- os.makedirs(user_dir_css, exist_ok=True)
246
+ os.makedirs(css_dir, exist_ok=True)
253
247
 
254
248
  stdout.write("Estructura de carpetas creada.\n")
255
249
 
256
250
  files_to_copy = [
257
251
  ("services.utils.js", "alertErrors.js", os.path.join(js_dir, "alertErrors.js")),
258
252
  ("services.utils.css", "authentication.css", os.path.join(css_dir, "authentication.css")),
259
- ("services.utils.css", "aside.css", os.path.join(css_dir, "aside.css")), # Subpaquete específico
260
253
  ("services.utils.views.layouts", "index.html", os.path.join(layouts_dir, "index.html")),
261
254
  ("services.utils.views", "home.html", os.path.join(templates_dir, "home.html")),
262
255
  ("services.utils.views", "signup.html", os.path.join(templates_dir, "signup.html")),
263
256
  ("services.utils.views", "login.html", os.path.join(templates_dir, "login.html")),
264
257
  ("services.utils.views", "logged.html", os.path.join(templates_dir, "logged.html")),
265
- ("services.utils.views", "user.html", os.path.join(templates_dir, "user.html")), # Subpaquete específico
266
- ("services.utils.views", "aside.html", os.path.join(templates_dir, "aside.html")), # Subpaquete específico
267
258
  ]
268
259
 
269
- packages_to_check = [
270
- "services.utils.css",
271
- "services.utils.css.user",
272
- "services.utils.views",
273
- "services.utils.views.user",
274
- "services.utils.views.components"
275
- ]
276
-
277
- for package in packages_to_check:
278
- try:
279
- resources = list(pkg_resources.contents(package))
280
- print(f"Recursos disponibles en '{package}': {resources}")
281
- except ImportError as e:
282
- print(f"Error al importar el paquete '{package}': {e}")
283
- except Exception as e:
284
- print(f"Error desconocido en el paquete '{package}': {e}")
260
+ for package, resource_name, destination_path in files_to_copy:
261
+ copy_static_file(package, resource_name, destination_path, stdout)
285
262
 
286
263
  stdout.write("Archivos estáticos copiados.\n")
@@ -8,27 +8,24 @@ def copy_static_file(package, resource_name, destination_path, stdout=sys.stdout
8
8
  Copia un archivo estático empaquetado a una ruta de destino.
9
9
 
10
10
  :param package: El nombre del paquete donde está el recurso.
11
- :param resource_name: Nombre del archivo dentro del paquete.
11
+ :param resource_name: Ruta relativa del recurso dentro del paquete.
12
12
  :param destination_path: Ruta completa donde se copiará el archivo.
13
13
  :param stdout: Salida estándar para mensajes (por defecto usa sys.stdout).
14
14
  """
15
15
  try:
16
- # Crear el directorio de destino si no existe
17
- os.makedirs(os.path.dirname(destination_path), exist_ok=True)
18
-
19
- # Verificar que el recurso existe
16
+ # Verifica si el recurso existe en el paquete
20
17
  if not pkg_resources.is_resource(package, resource_name):
21
18
  stdout.write(f"El recurso '{resource_name}' no existe en el paquete '{package}'.\n")
22
19
  return
23
20
 
24
- # Leer el archivo y escribirlo en la ruta destino
21
+ # Crear el directorio de destino si no existe
22
+ os.makedirs(os.path.dirname(destination_path), exist_ok=True)
23
+
24
+ # Leer el archivo desde el paquete y escribirlo en la ruta destino
25
25
  with pkg_resources.open_binary(package, resource_name) as resource_file:
26
26
  with open(destination_path, 'wb') as dest_file:
27
27
  shutil.copyfileobj(resource_file, dest_file)
28
28
 
29
29
  stdout.write(f"El recurso '{resource_name}' fue copiado a '{destination_path}'.\n")
30
- except ImportError as e:
31
- stdout.write(f"Error: No se pudo importar el paquete '{package}': {e}\n")
32
30
  except Exception as e:
33
- stdout.write(f"Error al copiar el archivo '{resource_name}': {e}\n")
34
-
31
+ stdout.write(f"Error al copiar el archivo: {e}\n")
@@ -5,10 +5,7 @@
5
5
  <meta charset="UTF-8">
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
7
  <link rel="stylesheet" href="{% static 'css/authentication.css' %}">
8
- {% block css %}
9
- {% endblock %}
10
- <!-- boxicons -->
11
- <script src="https://unpkg.com/boxicons@2.1.4/dist/boxicons.js"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
12
9
  <title>django components</title>
13
10
  </head>
14
11
  <body class="bg-gray-100 text-gray-800">
@@ -16,7 +13,7 @@
16
13
  <nav class="navbar">
17
14
  <div class="logo">
18
15
  <a href="{% url 'home' %}">
19
- <box-icon name='home' flip='horizontal' size="md" color="#ffffff"></box-icon>
16
+ <i class="fa-solid fa-house"></i>
20
17
  </a>
21
18
  </div>
22
19
  <div class="menu-toggle">
@@ -37,7 +34,7 @@
37
34
  {% endblock %}
38
35
  </div>
39
36
 
40
- {% block script %}
41
- {% endblock %}
37
+
38
+ <script src="{% static 'js/alertErrors.js'%}"></script>
42
39
  </body>
43
40
  </html>
@@ -1,5 +1,4 @@
1
1
  {% extends "layouts/index.html" %}
2
- {% load static %}
3
2
  {% block layout %}
4
3
  {% if error %}
5
4
  <div class="alert" id="alert">
@@ -31,7 +30,4 @@
31
30
  </form>
32
31
  </div>
33
32
  </div>
34
- {% endblock %}
35
- {% block script %}
36
- <script src="{% static 'js/alertErrors.js'%}"></script>
37
33
  {% endblock %}
@@ -1,5 +1,4 @@
1
1
  {% extends "layouts/index.html" %}
2
- {% load static %}
3
2
  {% block layout %}
4
3
  {% if error %}
5
4
  <div class="alert" id="alert">
@@ -17,13 +16,10 @@
17
16
 
18
17
  <div class="form-wrapper">
19
18
  <div class="form-container">
20
- <form action="" method="post" class="form-control" enctype="multipart/form-data">
19
+ <form action="" method="post" class="form-control">
21
20
  {% csrf_token %}
22
21
  <h1>sing up</h1>
23
22
 
24
- <label for="img_url">Imagen de Perfil:</label>
25
- {{ form.image }}
26
-
27
23
  <label for="username">Usuario:</label>
28
24
  {{ form.username }}
29
25
 
@@ -37,7 +33,4 @@
37
33
  </form>
38
34
  </div>
39
35
  </div>
40
- {% endblock %}
41
- {% block script %}
42
- <script src="{% static 'js/alertErrors.js'%}"></script>
43
36
  {% endblock %}
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='2.1.7',
5
+ version='2.1.12',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  package_data={
@@ -1,41 +0,0 @@
1
- .user-sidebar {
2
- max-width: 300px;
3
- background-color: #f9fafb;
4
- border: 1px solid #e5e7eb;
5
- border-radius: 0.5rem;
6
- padding: 1rem;
7
- display: inline-block;
8
- overflow: hidden;
9
- }
10
-
11
- .user-menu {
12
- list-style-type: none;
13
- margin: 0;
14
- padding: 0;
15
- }
16
-
17
- .user-item {
18
- display: flex;
19
- align-items: center;
20
- margin-bottom: 1rem;
21
- }
22
-
23
- .user-item .icon {
24
- display: flex;
25
- justify-content: center;
26
- align-items: center;
27
- width: 2.5rem;
28
- height: 2.5rem;
29
- font-size: 1.2rem;
30
- }
31
-
32
- .user-item .text {
33
- font-size: 1rem;
34
- color: #1f2937;
35
- font-weight: 500;
36
- }
37
-
38
- .user-item:last-child {
39
- margin-bottom: 0;
40
- }
41
-
@@ -1,32 +0,0 @@
1
- {% load static %}
2
- {% block css %}
3
- <link rel="stylesheet" href="{% static 'css/user/aside.css' %}">
4
- {% endblock %}
5
- <aside class="user-sidebar bg-gray-100 p-4 rounded-lg shadow-md">
6
- <ul class="user-menu list-none m-0 p-0">
7
- <li class="user-item flex items-center mb-4">
8
- <span class="icon bg-blue-500 text-white rounded-full p-2 mr-3">
9
- <box-icon type='solid' name='image-alt'></box-icon>
10
- </span>
11
- <span class="text">Image</span>
12
- </li>
13
- <li class="user-item flex items-center mb-4">
14
- <span class="icon bg-green-500 text-white rounded-full p-2 mr-3">
15
- <box-icon name='user'></box-icon>
16
- </span>
17
- <span class="text">Name</span>
18
- </li>
19
- <li class="user-item flex items-center mb-4">
20
- <span class="icon bg-orange-500 text-white rounded-full p-2 mr-3">
21
- <box-icon type='solid' name='lock-alt'></box-icon>
22
- </span>
23
- <span class="text">Password</span>
24
- </li>
25
- <li class="user-item flex items-center">
26
- <span class="icon bg-red-500 text-white rounded-full p-2 mr-3">
27
- <box-icon name='trash-alt' type='solid' ></box-icon>
28
- </span>
29
- <span class="text">Delete User</span>
30
- </li>
31
- </ul>
32
- </aside>
@@ -1,4 +0,0 @@
1
- {% extends "layouts/index.html" %}
2
- {% block layout %}
3
- {% include 'components/user/aside.html' %}
4
- {% endblock %}