componentsDjangoType 1.0.5__tar.gz → 1.0.7__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (16) hide show
  1. {componentsdjangotype-1.0.5/componentsDjangoType.egg-info → componentsdjangotype-1.0.7}/PKG-INFO +1 -1
  2. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/componentsDjangoType/management/commands/createApp.py +269 -271
  3. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7/componentsDjangoType.egg-info}/PKG-INFO +1 -1
  4. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/setup.py +1 -1
  5. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/LICENSE +0 -0
  6. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/MANIFEST.in +0 -0
  7. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/README.md +0 -0
  8. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/componentsDjangoType/__init__.py +0 -0
  9. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/componentsDjangoType/management/__init__.py +0 -0
  10. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/componentsDjangoType/management/commands/__init__.py +0 -0
  11. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/componentsDjangoType/management/commands/createcomponent.py +0 -0
  12. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/componentsDjangoType.egg-info/SOURCES.txt +0 -0
  13. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/componentsDjangoType.egg-info/dependency_links.txt +0 -0
  14. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/componentsDjangoType.egg-info/requires.txt +0 -0
  15. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/componentsDjangoType.egg-info/top_level.txt +0 -0
  16. {componentsdjangotype-1.0.5 → componentsdjangotype-1.0.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: A Django app for creating HTML components
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -11,6 +11,15 @@ class Command(BaseCommand):
11
11
  # Nombre de la aplicación a crear
12
12
  app_name = "Home"
13
13
 
14
+ # definiendoerrores
15
+ def write_file(file_path, content):
16
+ try:
17
+ with open(file_path, 'w') as file:
18
+ file.write(content)
19
+ print(f"Archivo escrito correctamente: {file_path}")
20
+ except Exception as e:
21
+ print(f"Error al escribir el archivo {file_path}: {e}")
22
+
14
23
  # Paso 1: Solicitar el nombre de la aplicación principal al usuario
15
24
  project_name = input(
16
25
  "Por favor, ingresa el nombre de la aplicación principal del proyecto: ")
@@ -262,290 +271,279 @@ class Command(BaseCommand):
262
271
  }
263
272
  for template_file, content in template_files.items():
264
273
  template_file_path = os.path.join(templates_dir, template_file)
274
+ # escritura de los archivoos html
275
+ write_file(template_file_path, content)
265
276
 
266
277
  # escritura de los archivos
267
278
 
268
- # definiendoerrores
269
-
270
- def write_file(file_path, content):
271
- try:
272
- with open(file_path, 'w') as file:
273
- file.write(content)
274
- print(f"Archivo escrito correctamente: {file_path}")
275
- except Exception as e:
276
- print(f"Error al escribir el archivo {file_path}: {e}")
277
-
278
279
  # escritura del archivos js
279
280
  write_file(js_file_path, """
280
- function closeAlert() {
281
- const alert = document.getElementById('alert');
282
- if (alert) {
283
- alert.remove();
284
- }
285
- }
281
+ function closeAlert() {
282
+ const alert = document.getElementById('alert');
283
+ if (alert) {
284
+ alert.remove();
285
+ }
286
+ }
286
287
  """)
287
288
 
288
289
  # escritura del archivo css
289
290
  write_file(css_file_path, """
290
- /* Navbar */
291
- .navbar {
292
- display: flex;
293
- justify-content: space-between;
294
- align-items: center;
295
- padding: 10px 20px;
296
- background-color: #333; /* Color de fondo */
297
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
298
- }
299
-
300
- /* Logo */
301
- .navbar .logo a {
302
- color: #ffffff;
303
- font-size: 1.5em;
304
- text-decoration: none;
305
- transition: color 0.3s ease;
306
- }
307
-
308
- .navbar .logo a:hover {
309
- color: #4a90e2; /* Hover del logo */
310
- }
311
-
312
- /* Links de navegación */
313
- .nav-links {
314
- display: flex;
315
- gap: 15px;
316
- list-style: none;
317
- margin: 0;
318
- padding: 0;
319
- }
320
-
321
- .nav-links .nav-item {
322
- color: #ffffff;
323
- font-size: 1em;
324
- text-decoration: none;
325
- padding: 8px 15px;
326
- border-radius: 5px;
327
- transition: background-color 0.3s ease, color 0.3s ease;
328
- }
329
-
330
- .nav-links .nav-item:hover {
331
- background-color: #4a90e2; /* Hover */
332
- color: #ffffff;
333
- }
334
-
335
- /* Estilos para dispositivos móviles */
336
- .menu-toggle {
337
- display: none;
338
- }
339
-
340
- @media (max-width: 768px) {
341
- .menu-toggle {
342
- display: inline-block;
343
- font-size: 1.5em;
344
- color: #ffffff;
345
- cursor: pointer;
346
- padding: 8px 15px;
347
- }
348
-
349
- .nav-links {
350
- flex-direction: column;
351
- position: absolute;
352
- top: 100%;
353
- right: 0;
354
- width: 100%;
355
- background-color: #333;
356
- max-height: 0;
357
- overflow: hidden;
358
- transition: max-height 0.3s ease;
359
- }
360
-
361
- /* Activar menú desplegable */
362
- .nav-links.active {
363
- max-height: 300px; /* Ajustar altura */
364
- }
365
-
366
- .nav-links .nav-item {
367
- padding: 10px 20px;
368
- }
369
- }
370
-
371
- /* formularios */
372
- /* Contenedor para centrar el formulario */
373
- .form-wrapper {
374
- display: flex;
375
- justify-content: center;
376
- align-items: center;
377
- margin-top: 50px;
378
- }
379
-
380
- /* Contenedor del formulario */
381
- .form-container {
382
- padding: 20px;
383
- background: black; /* Fondo azul con transparencia */
384
- border-radius: 8px;
385
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
386
- color: white;
387
- text-align: center;
388
- max-width: 400px;
389
- width: 100%;
390
- }
391
-
392
- /* Estilo del formulario */
393
- .form-control {
394
- display: flex;
395
- flex-direction: column;
396
- gap: 15px;
397
- }
398
-
399
- /* Estilo para las etiquetas */
400
- label {
401
- font-size: 0.9em;
402
- color: #d1d5db; /* Color gris claro */
403
- margin-bottom: 5px;
404
- text-align: left;
405
- }
406
-
407
- /* Estilo para los campos de entrada */
408
- input[type="text"],
409
- input[type="password"] {
410
- padding: 10px;
411
- background: rgba(255, 255, 255, 0.2);
412
- border: 1px solid rgba(255, 255, 255, 0.3);
413
- border-radius: 5px;
414
- color: #ffffff;
415
- outline: none;
416
- font-size: 1em;
417
- transition: background 0.3s ease, box-shadow 0.3s ease;
418
- }
419
-
420
- input[type="text"]:focus,
421
- input[type="password"]:focus {
422
- background: rgba(255, 255, 255, 0.4);
423
- box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
424
- }
425
-
426
- /* Estilo del botón */
427
- button[type="submit"] {
428
- padding: 10px;
429
- background: #4a90e2;
430
- color: white;
431
- border: none;
432
- border-radius: 5px;
433
- cursor: pointer;
434
- transition: background 0.3s ease;
435
- }
436
-
437
- button[type="submit"]:hover {
438
- background: #357ab8;
439
- }
291
+ /* Navbar */
292
+ .navbar {
293
+ display: flex;
294
+ justify-content: space-between;
295
+ align-items: center;
296
+ padding: 10px 20px;
297
+ background-color: #333; /* Color de fondo */
298
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
299
+ }
300
+
301
+ /* Logo */
302
+ .navbar .logo a {
303
+ color: #ffffff;
304
+ font-size: 1.5em;
305
+ text-decoration: none;
306
+ transition: color 0.3s ease;
307
+ }
308
+
309
+ .navbar .logo a:hover {
310
+ color: #4a90e2; /* Hover del logo */
311
+ }
312
+
313
+ /* Links de navegación */
314
+ .nav-links {
315
+ display: flex;
316
+ gap: 15px;
317
+ list-style: none;
318
+ margin: 0;
319
+ padding: 0;
320
+ }
321
+
322
+ .nav-links .nav-item {
323
+ color: #ffffff;
324
+ font-size: 1em;
325
+ text-decoration: none;
326
+ padding: 8px 15px;
327
+ border-radius: 5px;
328
+ transition: background-color 0.3s ease, color 0.3s ease;
329
+ }
330
+
331
+ .nav-links .nav-item:hover {
332
+ background-color: #4a90e2; /* Hover */
333
+ color: #ffffff;
334
+ }
335
+
336
+ /* Estilos para dispositivos móviles */
337
+ .menu-toggle {
338
+ display: none;
339
+ }
340
+
341
+ @media (max-width: 768px) {
342
+ .menu-toggle {
343
+ display: inline-block;
344
+ font-size: 1.5em;
345
+ color: #ffffff;
346
+ cursor: pointer;
347
+ padding: 8px 15px;
348
+ }
349
+
350
+ .nav-links {
351
+ flex-direction: column;
352
+ position: absolute;
353
+ top: 100%;
354
+ right: 0;
355
+ width: 100%;
356
+ background-color: #333;
357
+ max-height: 0;
358
+ overflow: hidden;
359
+ transition: max-height 0.3s ease;
360
+ }
361
+
362
+ /* Activar menú desplegable */
363
+ .nav-links.active {
364
+ max-height: 300px; /* Ajustar altura */
365
+ }
366
+
367
+ .nav-links .nav-item {
368
+ padding: 10px 20px;
369
+ }
370
+ }
371
+
372
+ /* formularios */
373
+ /* Contenedor para centrar el formulario */
374
+ .form-wrapper {
375
+ display: flex;
376
+ justify-content: center;
377
+ align-items: center;
378
+ margin-top: 50px;
379
+ }
380
+
381
+ /* Contenedor del formulario */
382
+ .form-container {
383
+ padding: 20px;
384
+ background: black; /* Fondo azul con transparencia */
385
+ border-radius: 8px;
386
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
387
+ color: white;
388
+ text-align: center;
389
+ max-width: 400px;
390
+ width: 100%;
391
+ }
392
+
393
+ /* Estilo del formulario */
394
+ .form-control {
395
+ display: flex;
396
+ flex-direction: column;
397
+ gap: 15px;
398
+ }
399
+
400
+ /* Estilo para las etiquetas */
401
+ label {
402
+ font-size: 0.9em;
403
+ color: #d1d5db; /* Color gris claro */
404
+ margin-bottom: 5px;
405
+ text-align: left;
406
+ }
407
+
408
+ /* Estilo para los campos de entrada */
409
+ input[type="text"],
410
+ input[type="password"] {
411
+ padding: 10px;
412
+ background: rgba(255, 255, 255, 0.2);
413
+ border: 1px solid rgba(255, 255, 255, 0.3);
414
+ border-radius: 5px;
415
+ color: #ffffff;
416
+ outline: none;
417
+ font-size: 1em;
418
+ transition: background 0.3s ease, box-shadow 0.3s ease;
419
+ }
420
+
421
+ input[type="text"]:focus,
422
+ input[type="password"]:focus {
423
+ background: rgba(255, 255, 255, 0.4);
424
+ box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
425
+ }
426
+
427
+ /* Estilo del botón */
428
+ button[type="submit"] {
429
+ padding: 10px;
430
+ background: #4a90e2;
431
+ color: white;
432
+ border: none;
433
+ border-radius: 5px;
434
+ cursor: pointer;
435
+ transition: background 0.3s ease;
436
+ }
437
+
438
+ button[type="submit"]:hover {
439
+ background: #357ab8;
440
+ }
440
441
 
441
- /* alert */
442
-
443
- /* Estilos para la alerta */
444
- .alert {
445
- max-width: 400px;
446
- background-color: #333;
447
- color: #ffffff;
448
- border-radius: 8px;
449
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
450
- margin: 0 auto;
451
- position: relative;
452
- top: 20px;
453
- padding: 15px;
454
- }
455
-
456
- .alert-content {
457
- display: flex;
458
- justify-content: space-between;
459
- align-items: center;
460
- }
461
-
462
- .close-btn {
463
- background: none;
464
- border: none;
465
- cursor: pointer;
466
- color: #ffffff;
467
- transition: color 0.3s ease;
468
- }
469
-
470
- .close-btn:hover {
471
- color: #ff6b6b;
472
- }
473
-
474
- .close-icon {
475
- width: 16px;
476
- height: 16px;
477
- }
478
-
479
- /* logged */
480
-
481
- /* Estilos para el contenedor del bloque */
482
- .layout-container {
483
- display: flex;
484
- justify-content: center;
485
- align-items: center;
486
- height: 100vh;
487
- background-color: #f0f4f8;
488
- font-family: Arial, sans-serif;
489
- }
490
-
491
- /* Estilos para el título */
492
- .layout-container h1 {
493
- font-size: 2.5rem;
494
- color: #4a90e2;
495
- font-weight: bold;
496
- text-align: center;
497
- padding: 20px;
498
- border-radius: 8px;
499
- background: #ffffff;
500
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
501
- }
502
- """)
442
+ /* alert */
443
+
444
+ /* Estilos para la alerta */
445
+ .alert {
446
+ max-width: 400px;
447
+ background-color: #333;
448
+ color: #ffffff;
449
+ border-radius: 8px;
450
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
451
+ margin: 0 auto;
452
+ position: relative;
453
+ top: 20px;
454
+ padding: 15px;
455
+ }
456
+
457
+ .alert-content {
458
+ display: flex;
459
+ justify-content: space-between;
460
+ align-items: center;
461
+ }
462
+
463
+ .close-btn {
464
+ background: none;
465
+ border: none;
466
+ cursor: pointer;
467
+ color: #ffffff;
468
+ transition: color 0.3s ease;
469
+ }
470
+
471
+ .close-btn:hover {
472
+ color: #ff6b6b;
473
+ }
474
+
475
+ .close-icon {
476
+ width: 16px;
477
+ height: 16px;
478
+ }
479
+
480
+ /* logged */
481
+
482
+ /* Estilos para el contenedor del bloque */
483
+ .layout-container {
484
+ display: flex;
485
+ justify-content: center;
486
+ align-items: center;
487
+ height: 100vh;
488
+ background-color: #f0f4f8;
489
+ font-family: Arial, sans-serif;
490
+ }
491
+
492
+ /* Estilos para el título */
493
+ .layout-container h1 {
494
+ font-size: 2.5rem;
495
+ color: #4a90e2;
496
+ font-weight: bold;
497
+ text-align: center;
498
+ padding: 20px;
499
+ border-radius: 8px;
500
+ background: #ffffff;
501
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
502
+ }
503
+ """)
503
504
  # escritura del archivos que estan en la carpeta layouts
504
505
  write_file(layout_files_path, """
505
- {% load static %}
506
- <!DOCTYPE html>
507
- <html lang="en">
508
- <head>
509
- <meta charset="UTF-8">
510
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
511
- <link rel="stylesheet" href="{% static 'css/authentication.css' %}">
512
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
513
- <title>django components</title>
514
- </head>
515
- <body class="bg-gray-100 text-gray-800">
506
+ {% load static %}
507
+ <!DOCTYPE html>
508
+ <html lang="en">
509
+ <head>
510
+ <meta charset="UTF-8">
511
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
512
+ <link rel="stylesheet" href="{% static 'css/authentication.css' %}">
513
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
514
+ <title>django components</title>
515
+ </head>
516
+ <body class="bg-gray-100 text-gray-800">
516
517
 
517
- <nav class="navbar">
518
- <div class="logo">
519
- <a href="{% url 'home' %}">
520
- <i class="fa-solid fa-house"></i>
521
- </a>
522
- </div>
523
- <div class="menu-toggle">
524
- <i class="fa fa-bars"></i>
525
- </div>
526
- <ul class="nav-links">
527
- {% if user.is_authenticated %}
528
- <li><a href="{% url 'logout' %}" class="nav-item">Logout</a></li>
529
- {% else %}
530
- <li><a href="{% url 'signup' %}" class="nav-item">Sign Up</a></li>
531
- <li><a href="{% url 'login' %}" class="nav-item">Login</a></li>
532
- {% endif %}
533
- </ul>
534
- </nav>
535
-
536
- <div class="container mx-auto p-4">
537
- {% block layout %}
538
- {% endblock %}
539
- </div>
540
-
541
- {% block script %}
542
- {% endblock %}
543
- </body>
544
- </html>
545
- """)
546
-
547
- # escritura de los archivoos html
548
- write_file(template_file_path, content)
518
+ <nav class="navbar">
519
+ <div class="logo">
520
+ <a href="{% url 'home' %}">
521
+ <i class="fa-solid fa-house"></i>
522
+ </a>
523
+ </div>
524
+ <div class="menu-toggle">
525
+ <i class="fa fa-bars"></i>
526
+ </div>
527
+ <ul class="nav-links">
528
+ {% if user.is_authenticated %}
529
+ <li><a href="{% url 'logout' %}" class="nav-item">Logout</a></li>
530
+ {% else %}
531
+ <li><a href="{% url 'signup' %}" class="nav-item">Sign Up</a></li>
532
+ <li><a href="{% url 'login' %}" class="nav-item">Login</a></li>
533
+ {% endif %}
534
+ </ul>
535
+ </nav>
536
+
537
+ <div class="container mx-auto p-4">
538
+ {% block layout %}
539
+ {% endblock %}
540
+ </div>
541
+
542
+ {% block script %}
543
+ {% endblock %}
544
+ </body>
545
+ </html>
546
+ """)
549
547
 
550
548
  self.stdout.write(self.style.SUCCESS(
551
549
  "Comando ejecutado exitosamente."))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: componentsDjangoType
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: A Django app for creating HTML components
5
5
  Home-page: https://github.com/jose-CR/componentsDjangoType
6
6
  Author: Alejandro
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='componentsDjangoType',
5
- version='1.0.5',
5
+ version='1.0.7',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  license='MIT',