Browse Source

"responsive para circulares actualizado"

FREDY 4 months ago
parent
commit
afe69d6dd9

+ 1 - 1
Back/backendP-Educativa/.env

@@ -14,7 +14,7 @@ DB_PORT=3306
 # DB_DATABASE=p_educativa
 DB_DATABASE=platafor_plateduqa
 DB_USERNAME=root
-DB_PASSWORD=
+DB_PASSWORD=root
 
 BROADCAST_DRIVER=log
 CACHE_DRIVER=file

+ 181 - 535
Front/src/app/modules/Administrador/pages/circulares/circulares.component.css

@@ -1,604 +1,250 @@
 .centrar {
-  margin-top: 4%;
-  line-height: auto;
-  text-align: center;
+    margin-top: 4%;
+    line-height: auto;
+    text-align: center;
 }
 
 .fondo {
-  border-radius: 10px;
-  line-height: 1;
-  display: inline-block;
-  vertical-align: middle;
-
+    border-radius: 10px;
+    line-height: 1;
+    display: inline-block;
+    vertical-align: middle;
 }
 
 .content {
-  margin-bottom: 0;
-  margin-top: 0;
-  padding-top: 10px;
-  padding-bottom: 10px;
-  padding-left: 70px;
-  padding-right: 70px;
-  font-weight: 500;
-  font-size: 32px;
-  color: white;
-  font-family: "Serenity Medium";
+    margin-bottom: 0;
+    margin-top: 0;
+    padding-top: 10px;
+    padding-bottom: 10px;
+    padding-left: 70px;
+    padding-right: 70px;
+    font-weight: 500;
+    font-size: 32px;
+    color: white;
+    font-family: "Serenity Medium";
 }
 
 .input {
-  width: 500px;
-  color: rgb(0, 140, 255);
+    width: 500px;
+    color: rgb(0, 140, 255);
 }
 
 .container-col {
-  display: flex;
-  flex-direction: column;
-  padding-top: 100px;
-  padding-left: 30px;
-  padding-right: 65px;
-  width: 100%;
-  box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
+    padding-top: 100px;
+    padding-left: 30px;
+    padding-right: 65px;
+    width: 100%;
+    box-sizing: border-box;
 }
 
-
-
-
-
 .button {
-  margin-left: 5px;
-  background-color: #ebac3f;
+    margin-left: 5px;
+    background-color: #ebac3f;
 }
 
-
-
 .action-edit {
-  margin-left: 5px;
-  background-color: #1d156e;
-  color: white;
-  height: 30px;
-  width: 30px;
+    margin-left: 5px;
+    background-color: #1d156e;
+    color: white;
+    height: 30px;
+    width: 30px;
 }
 
 .action-delete {
-  margin-left: 5px;
-  background-color: #e43b3d;
-  color: white;
-  height: 30px;
-  width: 30px;
+    margin-left: 5px;
+    background-color: #e43b3d;
+    color: white;
+    height: 30px;
+    width: 30px;
 }
 
 .inline {
-  display: flex;
-  align-items: center;
-  color: red;
-  cursor: pointer;
+    display: flex;
+    align-items: center;
+    color: red;
+    cursor: pointer;
 }
 
 .icon {
-  transform: scale(0.8);
-  vertical-align: middle;
+    transform: scale(0.8);
+    vertical-align: middle;
 }
 
-
 .green {
-  background-color: #2a6c42;
-  border: none;
-  color: white !important;
-  cursor: pointer;
-  border-radius: 6px;
-  height: 35px;
+    background-color: #2a6c42;
+    border: none;
+    color: white !important;
+    cursor: pointer;
+    border-radius: 6px;
+    height: 35px;
 }
 
 .green:hover {
-  background-color: #205232;
+    background-color: #205232;
 }
 
 .buttons {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  width: 100%;
-  margin-bottom: 15px;
-  padding-left: 20px;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+    margin-bottom: 15px;
+    padding-left: 20px;
 }
 
 .badge-active {
-  color: #026AA2;
-  font-weight: 500;
-  padding: 3px 7px;
-  background-color: #E0F2FE;
-  border-radius: 15px;
+    color: #026AA2;
+    font-weight: 500;
+    padding: 3px 7px;
+    background-color: #E0F2FE;
+    border-radius: 15px;
 }
 
 .badge-inactive {
-  color: #AC2722;
-  font-weight: 500;
-  padding: 3px 7px;
-  background-color: #FEE4E2;
-  border-radius: 15px;
+    color: #AC2722;
+    font-weight: 500;
+    padding: 3px 7px;
+    background-color: #FEE4E2;
+    border-radius: 15px;
 }
-/* Media query para teléfonos (pantallas menores a 768px) */
-@media (max-width: 768px) {
-  .centrar {
-    margin-top: 8%;
-    text-align: center;
-  }
 
-  .fondo {
+/* --------------- Table and responsive styles ---------------- */
+.table-container {
     width: 100%;
-    padding: 10px;
-    border-radius: 8px;
-  }
-
-  .content {
-    font-size: 22px;
-    padding: 10px 20px;
-    text-align: center;
-  }
-
-  .input {
-    width: 100%;
-    font-size: 16px;
-  }
-
-  .container-col {
-    padding-top: 50px;
-    padding-left: 15px;
-    padding-right: 15px;
-  }
-
-  .button,
-  .green,
-  .action-edit,
-  .action-delete {
-    width: 100%;
-    margin: 5px 0;
-  }
-
-  .buttons {
-    flex-direction: column;
-    align-items: stretch;
-    padding-left: 0;
-    gap: 10px;
-  }
-
-  .inline {
-    flex-direction: column;
-    align-items: flex-start;
-    font-size: 14px;
-  }
-
-  .badge-active,
-  .badge-inactive {
-    font-size: 12px;
-    padding: 2px 5px;
-  }
-}
-
-
-/* ---------------modal----------------- */
-
-.close {
-  padding-top: 20px;
-  padding-right: 20px;
-  display: flex;
-  justify-content: end;
-
-}
-
-.cerrar-b {
-  background-color: #fff;
-  border: none;
-}
-
-.center {
-  text-align: center;
-  font-size: 32px;
-  font-weight: 600;
-}
-
-.input {
-  width: 100%;
-  margin-right: 20px;
-  margin-left: 20px;
-}
-
-.responsive {
-  display: flex;
-  flex-direction: row;
-}
-
-.is-invalid {
-  color: red;
-
+    overflow: auto;
 }
 
-.is-invalid-icon {
-  color: rgb(218, 113, 113);
-}
-
-.align {
-  margin-top: 30px;
-  display: flex;
-  justify-content: center;
-}
-
-.yellow {
-  background-color: #ebac3f;
-
-  border: none;
-  color: white;
-  padding: 5px 5px;
-  text-align: center;
-  cursor: pointer;
-  display: inline !important;
-  font-size: 16px;
-  border-radius: 10px;
-  margin-right: 5px;
-  height: 35px;
-}
-
-.yellow:hover {
-  background-color: #c99235;
-
-}
-
-.orange {
-  background-color: #f56227;
-
-  border: none;
-  color: white;
-  text-align: center;
-  cursor: pointer;
-  display: inline !important;
-  font-size: 16px;
-  border-radius: 10px;
-  margin-right: 5px;
-  height: 35px;
-}
-
-.orange:hover {
-  background-color: #cc501f;
-
-}
-
-.red {
-  background-color: red;
-
-  border: none;
-  color: white;
-  text-align: center;
-  cursor: pointer;
-  display: inline !important;
-  font-size: 16px;
-
-  border-radius: 6px;
-  height: 35px;
-}
-
-.red:hover {
-  background-color: rgb(204, 3, 3);
-}
-
-.form-container {
-  display: flex;
-  flex-wrap: wrap;
-  justify-content: flex-start;
-}
-
-.item {
-  flex: 1 0 25%;
-  box-sizing: border-box;
-  padding: 10px;
-}
-
-.w-responsive {
-  width: 160px;
-}
-
-.file-input {
-  display: none;
-}
-
-.mat-column-titulo,
-.mat-column-estado,
-.mat-column-receptoresAudiencia,
-.mat-column-importancia,
-.mat-column-fechaPub,
-.mat-column-fechaCad,
-.mat-column-adjuntos,
-.mat-column-acciones {
-  text-align: center !important;
-}
-
-@media (max-width: 768px) {
-  .close {
-    padding-top: 10px;
-    padding-right: 10px;
-    justify-content: flex-end;
-  }
-
-  .center {
-    font-size: 22px;
-    text-align: center;
-  }
-
-  .input {
-    width: 90%;
-    margin: 10px auto;
-  }
-
-  .responsive {
-    flex-direction: column;
-    gap: 10px;
-  }
-
-  .align {
-    flex-direction: column;
-    margin-top: 20px;
-  }
-
-  .yellow,
-  .orange,
-  .red {
-    width: 100%;
-    font-size: 14px;
-    height: 40px;
-    margin-bottom: 10px;
-  }
-
-  .form-container {
-    flex-direction: column;
-    align-items: stretch;
-  }
-
-  .item {
-    flex: 1 0 100%;
-    padding: 5px 0;
-  }
-
-  .w-responsive {
-    width: 100%;
-  }
-
-  .mat-column-titulo,
-  .mat-column-estado,
-  .mat-column-receptoresAudiencia,
-  .mat-column-importancia,
-  .mat-column-fechaPub,
-  .mat-column-fechaCad,
-  .mat-column-adjuntos,
-  .mat-column-acciones {
-    font-size: 12px;
-    padding: 4px;
-  }
+.table-responsive {
+    min-height: 300px;
+    overflow: auto;
 }
-@media (max-width: 768px) {
-  .mat-table {
-    display: block;
-    overflow-x: auto;
-    width: 100%;
-  }
-
-
 
-}
-/* Mostrar solo el botón grande en pantallas mayores a 600px */
+/* --------------- Special button styles for Circulares ---------------- */
 .btn-grande {
-  display: inline-flex;
+    display: inline-flex;
+    align-items: center;
+    background-color: rgb(184, 221, 247);
+    border-radius: 4px;
+    padding: 0 12px;
+    height: 36px;
 }
 
 .btn-movil {
-  display: none;
-}
-
-@media (max-width: 600px) {
-  .btn-grande {
     display: none;
-  }
-
-  .btn-movil {
-    display: inline-flex;
-    padding: 4px 8px;
-  }
+    background: none;
+    border: none;
+    padding: 0;
+    margin: 0;
 }
 
-
-
-
-@media screen and (max-width: 768px) {
-  .centrar {
-    text-align: center;
-  }
-
-  .fondo {
-    padding: 10px;
-  }
-
-  .content {
-    font-size: 18px !important;
-  }
-
-  .container-col {
-    padding: 10px;
-  }
-
-  .container-search {
-    flex-direction: column !important;
-    align-items: stretch;
-  }
-
-  .container-search mat-form-field,
-  .container-search .buttons {
-    width: 100% !important;
-    margin: 5px 0;
-  }
-
-  .buttons {
+/* --------------- Modal and form styles ---------------- */
+.close {
+    padding-top: 20px;
+    padding-right: 20px;
     display: flex;
-    flex-direction: column;
-    gap: 10px;
-    align-items: stretch;
-  }
-
-  .buttons .flex-row {
-    flex-direction: column;
-    align-items: stretch;
-  }
-
-  mat-form-field {
-    width: 100% !important;
-  }
-
-  .table-container {
-    overflow-x: auto;
-  }
-
-  table {
-    min-width: 600px;
-  }
-
-  .mat-slide-toggle {
-    transform: scale(0.9);
-  }
-
-  .action-edit {
-    width: 40px;
-    height: 40px;
-  }
-
-  .ml-10 {
-    margin-left: 0 !important;
-    margin-top: 10px;
-  }
-
-  .icon {
-    font-size: 18px;
-  }
+    justify-content: end;
 }
 
-
-/* -------------------- Modal stats -------------------- */
-
-.modalTable {
-  border-collapse: collapse;
-  width: 100%;
-}
-
-.modalTh {
-  color: #81a3d2;
-  font-weight: 500;
-}
-
-.modalTr {
-  border-bottom: 1px solid rgb(223, 223, 223);
-  border-top: 1px solid rgb(223, 223, 223);
-}
-
-
-.modalTd {
-  font-size: 14px;
-  text-align: center;
-  padding-left: 20px;
-  padding-right: 20px;
-  color: black;
+.center {
+    text-align: center;
+    font-size: 32px;
+    font-weight: 600;
 }
 
-@media only screen and (max-width: 600px) {
-  .w-responsive {
-    width: 100%;
-  }
-
-  .responsive {
+.responsive {
     display: flex;
-    flex-direction: column;
-  }
+    flex-direction: row;
+}
 
-  /* titulo */
-  .centrar {
-    width: 100%;
-    margin-top: 5%;
+.align {
+    margin-top: 30px;
     display: flex;
     justify-content: center;
-  }
-
-
-  .fondo {
-    width: 85%;
-  }
-
-  .content {
-    margin-bottom: 0;
-    margin-top: 0;
-    padding-top: 10px;
-    padding-bottom: 10px;
-    padding-left: 10px;
-    padding-right: 10px;
-    font-weight: 500;
-    font-size: 24px;
-    color: white;
-    font-family: "Serenity Medium";
-  }
-
-  .container-col {
-    display: flex;
-    flex-direction: column;
-    padding-top: 80px;
-    margin-left: -15px;
-    padding-right: 65px;
-    width: 100%;
-    box-sizing: border-box;
-  }
-
-
-  .container-search {
-    display: flex;
-    flex-direction: column;
-    justify-content: space-between;
-    width: 120%;
-  }
-
-  .input {
-    width: 100%;
-  }
-
-  .buttons {
-    display: flex;
-    justify-content: space-around;
-    align-items: center;
-    margin-bottom: 10px;
-    flex-direction: column;
-  }
-
-  .green {
-    background-color: #2a6c42;
-    border: none;
-    color: white;
-    cursor: pointer;
-    border-radius: 6px;
-    height: 35px;
-  }
-
-  .green {
-    background-color: #2a6c42;
-  }
-
-  .table-container {
-    width: 130%;
-  }
-
-  .table-responsive {
-    overflow-x: scroll;
-    white-space: nowrap;
-  }
-
-  /* .table-containerM {
-    width: 100%;
-  }
+}
 
-  .table-responsive {
-    overflow-x: scroll;
-    white-space: nowrap;
-  } */
+/* --------------- Media Queries ---------------- */
+@media only screen and (max-width: 600px) {
+    .centrar {
+        margin-top: 8%;
+    }
+
+    .fondo {
+        width: 90%;
+    }
+
+    .content {
+        font-size: 24px;
+        padding: 10px 20px;
+    }
+
+    .container-col {
+        padding-top: 50px;
+        padding-left: 15px;
+        padding-right: 15px;
+    }
+
+    .input {
+        width: 100%;
+    }
+
+    .container-search {
+        flex-direction: column;
+    }
+
+    .buttons {
+        flex-direction: column;
+        align-items: stretch;
+        gap: 10px;
+        padding-left: 0;
+    }
+
+    .table-container {
+        width: 100%;
+    }
+
+    /* Special mobile styles for Circulares buttons */
+    .btn-grande {
+        display: none;
+    }
+
+    .btn-movil {
+        display: inline-flex;
+    }
+
+    .btn-movil img {
+        width: 24px;
+        height: 24px;
+    }
+
+    /* Adjust action buttons container */
+    .flex-row.items-center {
+        justify-content: center;
+    }
+}
 
+@media (max-width: 768px) {
+    .content {
+        font-size: 22px;
+        padding: 10px 15px;
+    }
+
+    .table-responsive {
+        overflow-x: auto;
+    }
+
+    /* Ensure table cells have proper spacing */
+    .mat-cell, .mat-header-cell {
+        padding: 4px 8px;
+    }
+
+    /* Adjust column widths for mobile */
+    .mat-column-acciones {
+        min-width: 80px;
+    }
+
+    .mat-column-adjuntos {
+        min-width: 100px;
+    }
 }

+ 34 - 58
Front/src/app/modules/Administrador/pages/circulares/circulares.component.html

@@ -10,7 +10,6 @@
             <mat-form-field class="input">
                 <input class="input" (keyup)="applyFilter($event)" matInput placeholder="Buscar" #input>
                 <mat-icon matSuffix>search</mat-icon>
-                <!-- <mat-hint>Hint</mat-hint> -->
             </mat-form-field>
         </div>
         <div class="buttons">
@@ -33,26 +32,9 @@
         </div>
     </div>
     <div class="table-container mat-elevation-z8">
-        <div class="table-responsive " #TABLE>
+        <div class="table-responsive" #TABLE>
             <table mat-table [dataSource]="dataSource" #table class="mat-elevation-z8">
 
-                <!-- <ng-container matColumnDef="check">
-                    <th mat-header-cell *matHeaderCellDef>
-                        <mat-checkbox class="example-margin" [checked]="allComplete" [color]="task.color"
-                            [indeterminate]="someComplete()" (change)="setAll($event.checked)">
-                        </mat-checkbox>
-                    </th>
-                    @for (subtask of task.subtasks; track subtask) {
-                    <td mat-cell *matCellDef="let circular">
-                        <mat-checkbox [(ngModel)]="circular.completed" [color]="subtask.color"
-                            (ngModelChange)="updateAllComplete()">
-                        </mat-checkbox>
-                    </td>
-                    }
-                </ng-container> -->
-
-
-
                 <ng-container matColumnDef="titulo">
                     <th mat-header-cell *matHeaderCellDef> Título </th>
                     <td mat-cell *matCellDef="let circular"> {{circular.titulo}} </td>
@@ -71,7 +53,6 @@
                 <ng-container matColumnDef="receptoresAudiencia">
                     <th mat-header-cell *matHeaderCellDef> Receptores-Audiencia</th>
                     <td mat-cell *matCellDef="let circular"> {{circular.rolName}}</td>
-
                 </ng-container>
 
                 <ng-container matColumnDef="importancia">
@@ -89,45 +70,41 @@
                     <td mat-cell *matCellDef="let circular"> {{circular.fechaCaducidad| date: 'dd/MM/yyyy hh:mm:ss'}} </td>
                 </ng-container>
 
-                <ng-container matColumnDef="adjuntos">
-                    <th mat-header-cell *matHeaderCellDef style="text-align: center;"> Adjuntos </th>
-                    <td mat-cell *matCellDef="let circular" style="text-align: center;">
-                        <button *ngIf="circular.jsonAdjuntos.length>0" mat-button [matMenuTriggerFor]="menuAd"
-                        class="btn-grande"
-        style="background-color: rgb(184, 221, 247);">Adjuntos <mat-icon
-                                matSuffix>keyboard_arrow_down</mat-icon></button>
-                                <button mat-button [matMenuTriggerFor]="menu" class="btn-movil">
-  <img src="../../../../../assets/icons/carpeta.png" alt="icono" width="30" height="30">
-</button>
-                        <mat-menu #menuAd="matMenu">
-                            <button mat-menu-item *ngFor="let option of circular.jsonAdjuntos"
-                                (click)="buscarArchivo(option.id, option.nombre)">
-                                <span style="font-size: 13px;">
-                                    {{option.nombre}}
-                                </span>
-                            </button>
-                        </mat-menu>
-                        <span *ngIf="circular.jsonAdjuntos.length==0">No aplica</span>
-                    </td>
-                </ng-container>
+              <ng-container matColumnDef="adjuntos">
+    <th mat-header-cell *matHeaderCellDef style="text-align: center;"> Adjuntos </th>
+    <td mat-cell *matCellDef="let circular" style="text-align: center;">
+        <button *ngIf="circular.jsonAdjuntos.length>0" mat-button [matMenuTriggerFor]="menuAd"
+            class="btn-grande"
+            style="background-color: rgb(184, 221, 247);">Adjuntos <mat-icon
+                matSuffix>keyboard_arrow_down</mat-icon></button>
+        <button *ngIf="circular.jsonAdjuntos.length>0" mat-button [matMenuTriggerFor]="menuAd" class="btn-movil">
+            <img src="../../../../../assets/icons/carpeta.png" alt="icono carpeta" width="30" height="30">
+        </button>
+        <span *ngIf="circular.jsonAdjuntos.length==0">No aplica</span>
+        <mat-menu #menuAd="matMenu">
+            <button mat-menu-item *ngFor="let option of circular.jsonAdjuntos"
+                (click)="buscarArchivo(option.id, option.nombre)">
+                <span style="font-size: 13px;">
+                    {{option.nombre}}
+                </span>
+            </button>
+        </mat-menu>
+    </td>
+</ng-container>
+
                 <ng-container matColumnDef="acciones">
                     <th mat-header-cell *matHeaderCellDef> Acciones</th>
                     <td mat-cell *matCellDef="let circular">
                         <div class="flex-row items-center">
-      <!-- Botón para pantallas grandes -->
-<button mat-button [matMenuTriggerFor]="menu"
-        class="btn-grande"
-        style="background-color: rgb(184, 221, 247);">
-  Acciones
-  <mat-icon matSuffix>keyboard_arrow_down</mat-icon>
-</button>
-
-<!-- Botón para pantallas pequeñas -->
-<button mat-button [matMenuTriggerFor]="menu" class="btn-movil">
-  <img src="../../../../../assets/icons/Acciones.svg" alt="icono" width="30" height="30">
-</button>
-
-
+                            <button mat-button [matMenuTriggerFor]="menu"
+                                class="btn-grande"
+                                style="background-color: rgb(184, 221, 247);">
+                                Acciones
+                                <mat-icon matSuffix>keyboard_arrow_down</mat-icon>
+                            </button>
+                            <button mat-button [matMenuTriggerFor]="menu" class="btn-movil">
+                                <img src="../../../../../assets/icons/Acciones.svg" alt="icono" width="30" height="30">
+                            </button>
                             <mat-menu #menu="matMenu">
                                 <button mat-menu-item (click)="openDialogEdit(circular)">
                                     <mat-icon>edit</mat-icon>
@@ -154,14 +131,13 @@
                         </div>
                     </td>
                 </ng-container>
+
                 <tr mat-header-row *matHeaderRowDef="columnas"></tr>
                 <tr mat-row *matRowDef="let row; columns: columnas;"></tr>
                 <tr class="mat-row" *matNoDataRow>
-                    <td class="mat-cell" colspan="4">No hay resultados para "{{input.value}}"</td>
+                    <td class="mat-cell" colspan="7">No hay resultados para "{{input.value}}"</td>
                 </tr>
             </table>
-            <!-- <mat-spinner></mat-spinner> -->
-
             <mat-progress-bar *ngIf="isLoading" mode="indeterminate"></mat-progress-bar>
         </div>
         <mat-paginator [pageSizeOptions]="[5, 10, 15]" showFirstLastButtons class="mat-elevation-z8"></mat-paginator>