2 Angajamente bb00ecb941 ... 65a2354a52

Autor SHA1 Permisiunea de a trimite mesaje. Dacă este dezactivată, utilizatorul nu va putea trimite nici un fel de mesaj Data
  Nastya 65a2354a52 style changes 11 luni în urmă
  Nastya a3a77e147e changed page services 11 luni în urmă

+ 4 - 1
SharixAdmin/static/drf-yasg/navbar-style.css

@@ -6,6 +6,9 @@
     padding: 0;
     box-sizing: border-box;
 }
+body {
+    height: 130vh;
+}
 
 .nav-item {
     margin-bottom: 6px;
@@ -22,7 +25,7 @@
     display: flex;
     top: 0;
     left: 0;
-    width: 75px;
+    width: 78px;
     height: 40px;
     align-items: center;
     vertical-align: middle;

+ 95 - 5
SharixAdmin/static/drf-yasg/service_type.css

@@ -34,7 +34,9 @@ table.table thead th.desc {
 }
 
 .delete_col {
-    background: url('service_type/delete.svg') no-repeat center right;
+    background-image: url('service_type/delete.svg');
+    background-position: center right;
+    background-repeat: no-repeat;
 }
 .delete_col a {
     color: transparent;
@@ -81,8 +83,96 @@ table.table thead th {
 }
 
 table.table {
-    border-collapse: collapse;
+    border-spacing: 0;
 }
-table tr {
-    
-}
+/* table tr {
+    border-top: 1px #95C0F6;
+} */
+table.table tbody tr:hover {
+    box-shadow: 0px 0px 0px 1.5px #95C0F6;
+    border-radius: 10px;
+    border-top: transparent;
+    border-bottom: transparent;
+    border-left: transparent;
+    border-right: transparent;
+}
+
+
+/* test */
+
+.modal {
+    display: none;
+    position: fixed;
+    z-index: 1;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+    background-color: rgba(0,0,0,0.4);
+    animation-name: fadeIn;
+    animation-duration: 0.4s;
+}
+
+.modal-content {
+    position: relative;
+    background-color: #fefefe;
+    margin: 15% auto;
+    padding: 20px;
+    border: 1px solid #888;
+    width: 80%;
+    animation-name: slideIn;
+    animation-duration: 0.4s;
+}
+
+.close {
+    color: #aaa;
+    float: right;
+    font-size: 28px;
+    font-weight: bold;
+}
+
+.close:hover,
+.close:focus {
+    color: black;
+    text-decoration: none;
+    cursor: pointer;
+}
+
+@keyframes slideIn {
+    from {bottom: -300px; opacity: 0} 
+    to {bottom: 0; opacity: 1}
+}
+
+@keyframes fadeIn {
+    from {opacity: 0} 
+    to {opacity: 1}
+}
+/* Добавить в конец файла style.css */
+
+@keyframes fadeOut {
+    from {opacity: 1} 
+    to {opacity: 0}
+}
+
+.modal.fadeOut {
+    animation-name: fadeOut;
+    animation-duration: 0.4s;
+}
+/* table.table td {
+    border-radius: 10px;
+} */
+
+
+/* tr {
+    box-shadow: 0 0 10px 0;
+    border-radius: 10px;
+} */
+/* tbody tr:last-child {
+    border-radius: 0 0 10px 10px;
+    background-color: #f2f2f2;
+} */
+  
+/* tbody tr:not(:first-child):not(:last-child) {
+    border-radius: 0;
+} */

+ 4 - 4
SharixAdmin/templates/SharixAdmin/index.html

@@ -10,7 +10,7 @@
     <div class="row">
         <div class="col-3" id="leftmainpage">
             <div class="d-flex flex-column p-2" style="width: 100%; min-width: 72px; max-width: 280px; height: 464px; position: sticky; top: 76px;
-            border-radius: 10px; border: 1px solid #D8D8D8; box-shadow: 4px 5px 40px 0px #E5E5E5; align-items: center;">
+            border-radius: 10px; border: 1px solid #D8D8D8; box-shadow: 4px 5px 40px 0px #E5E5E5;">
 
 
               <ul class="nav nav-pills flex-column mb-auto" style="margin-top: 12px;">
@@ -109,7 +109,7 @@ style="cursor: pointer; position: fixed; align-items: center;">
   hideCheck = document.getElementById('hideMenuCheckBox')
   rowBarMenu = document.getElementById('row-bar-menu')
 
-  function show(){
+  function showmenu(){
     rowBarMenu.style.transform = 'rotate(0deg)';
     shMenuRow.style.display = "inline"
       usNameExit.style.display = "inline"
@@ -141,11 +141,11 @@ style="cursor: pointer; position: fixed; align-items: center;">
       hide()
     } else {
       hideCheck.checked = true
-      show()
+      showmenu()
     }
   }
   if(hideCheck.checked == true){
-      show()
+      showmenu()
     } else {
       hide()
     }

+ 23 - 2
SharixAdmin/templates/SharixAdmin/overlay.html

@@ -1,3 +1,5 @@
+{% load i18n %}
+
 <!DOCTYPE html>
 <html lang="en">
 <head>
@@ -6,6 +8,25 @@
     <title>Document</title>
 </head>
 <body>
-    
+    <h1 class="mb-4">{{ title }}</h1>
+    <form method="post" style="overflow: auto">
+        {% csrf_token %}
+        <div class="container m-2">
+            {% for field in form %}
+            {{field.errors}}
+            <div class="row">
+                {{field.label_tag}}
+                {{field}}
+                <p class="fs-6 fst-italic">{{field.help_text|truncatewords:20}}</p>
+            </div>
+            {% endfor %}
+        </div>
+        <div class="text-center mt-2 mb-5">
+            <input class="btn btn-primary center" type="Submit" name="submit" value="{% trans 'Submit' %}"/>
+        </div>
+    </form>
 </body>
-</html>
+</html>
+
+
+

+ 61 - 55
SharixAdmin/templates/SharixAdmin/service_type.html

@@ -15,77 +15,83 @@
     color: black;
   }
 </style>
+
+
     
     <div class="container">
       <h1 class="mainHeader">{{ title }}</h1>
       <p class="description_service">Это система управления государством, источником власти в которой является сам народ. Именно народ решает, какие законы и нормы необходимы для гармоничного существования и развития государства. Таким образом, каждый человек в демократическом обществе 
         Получает определенный набор свобод и обязательств сформированных с учетом интересов всего сообщества. Исходя из вышесказанного, можно заключить, что демократия – это возможность для каждого человека свободно участвовать в непосредственном управлении своим государством, обществом и личной судьбой в конечном счете.</p>
       <div class="row justify-content-start">
-        <div class="smalldesc" id="maintable">
-          {% render_table table %}
-        </div>
-        
-
-
-        <!-- {% comment %} {% if table.page %}
-          <nav aria-label="...">
-            <ul class="pagination">
-              {% if table.page.has_previous %}
-              <li class="page-item">
-                <a class="page-link" style="width: 10px; text-decoration: none;" href="?page={{ table.page.previous_page_number }}" tabindex="-1">{% trans 'Previous' %}</a>
-              </li>
-              {% else %}
-              <li class="page-item disabled">
-                <span class="page-link">{% trans 'Previous' %}</span>
-              </li>
-              {% endif %}
-              {% for page in table.page_range %}
-                {% if page == table.page.number %}
-                <li class="page-item active">
-                  <span class="page-link" style="width: 30px;">{{ page }} <span class="sr-only">{% trans '(current)' %}</span></span>
-                </li>
-                {% else %}
-                <li class="page-item">
-                  <a class="page-link" style="width: 30px;" href="?page={{page }}">{{ page }}</a>
-                  
-                </li>
-                {% endif %}
-              {% endfor %}
-              {% if table.page.has_next %}
-              <li class="page-item">
-                <a class="page-link" style="width: 30px; text-decoration: none;" href="?page={{ table.page.next_page_number }}">{% trans 'Next' %}</a>
-              </li>
-              {% else %}
-              <li class="page-item disabled">
-                <span class="page-link" style="width: 30px;">{% trans 'Next' %}</span>
-              </li>
-              {% endif %}
-            </ul>
-          </nav>
-        {% endif %} {% endcomment %} -->
+          <div class="maintable" id="maintable">
+            {% render_table table %}
+          </div>     
+
+
+
   </div>
 
   <div class="container text-end mt-2">
     <a class="btn btn-primary" id="bord" href="/service_type/add">{% trans 'Add' %}</a>
   </div>
+  
+  <button id="openModalBtn">Открыть окно</button>
+
+  <div id="myModal" class="modal">
+      <div class="modal-content">
+          <span id="closeModalBtn" class="close">&times;</span>
+          <div class="fields">
+            <h1 class="mb-4">{{ title }}</h1>
+            <form method="post" style="overflow: auto">
+                {% csrf_token %}
+                <div class="container m-2">
+                    {% for field in form %}
+                    {{field.errors}}
+                    <div class="row">
+                        {{field.label_tag}}
+                        {{field}}
+                        <p class="fs-6 fst-italic">{{field.help_text|truncatewords:20}}</p>
+                    </div>
+                    {% endfor %}
+                </div>
+                <div class="text-center mt-2 mb-5">
+                    <input class="btn btn-primary center" type="Submit" name="submit" value="{% trans 'Submit' %}"/>
+                </div>
+            </form>
+          </div>
       </div>
+  </div>
 
 <script>
-  // var colors = document.getElementById("test1"); 
-  // var changeBorder =  
-  //     document.getElementById("test1"); 
-  // changeBorder.addEventListener("click", function () { 
-  //   test1.style.border = "3px solid green"; 
-  //   test1.style.borderRadius = "10px"; 
-  // }); 
-
-  var rows = document.getElementsByTagName("tr");
-  changeBorder.addEventListener("click", function () { 
-    row.style.border = "3px solid green"; 
-    row.style.borderRadius = "10px"; 
-  }); 
+document.getElementById('openModalBtn').onclick = function() {
+    var modal = document.getElementById('myModal');
+    modal.classList.remove('fadeOut');
+    modal.style.display = "block";
+}
+
+document.getElementById('closeModalBtn').onclick = function() {
+    var modal = document.getElementById('myModal');
+    modal.classList.add('fadeOut');
+    setTimeout(function() {
+        modal.style.display = "none";
+    }, 400); // 400ms - длительность анимации
+}
+
+window.onclick = function(event) {
+    var modal = document.getElementById('myModal');
+    if (event.target == modal) {
+        modal.classList.add('fadeOut');
+        setTimeout(function() {
+            modal.style.display = "none";
+        }, 400); // 400ms - длительность анимации
+    }
+}
+
+
 </script>
 
 
 
+
+
 {% endblock contenthome %}

+ 2 - 7
SharixAdmin/templates/SharixAdmin/service_type_form.html

@@ -1,7 +1,7 @@
-{% extends 'SharixAdmin/index.html' %}
+
 {% load i18n %}
 
-{% block contenthome %}
+
 <h1 class="mb-4">{{ title }}</h1>
 <form method="post" style="overflow: auto">
     {% csrf_token %}
@@ -19,9 +19,4 @@
         <input class="btn btn-primary center" type="Submit" name="submit" value="{% trans 'Submit' %}"/>
     </div>
 </form>
-{% endblock %}
 
-<script>
-document.querySelector(".description_col").addEventListener("click", ({ target }) =>
-target.closest('.description_col')?.classList.toggle('description_col-active'));
-</script>

+ 7 - 1
SharixAdmin/views/service_type.py

@@ -8,6 +8,8 @@ from django.urls import reverse
 from SharixAdmin.views.context import get_context
 from django.utils.translation import gettext as _
 
+    
+    
 class ServiceTypeCreate(UserPassesTestMixin, CreateView):
     model = ServiceType
     form_class = ServiceTypeCreateForm
@@ -16,7 +18,7 @@ class ServiceTypeCreate(UserPassesTestMixin, CreateView):
     def get_context_data(self, **kwargs):
         context = super().get_context_data(**kwargs)
         context.update(get_context(self.request, {
-            'title': _('Услуги сервиса'),
+            'title': _('Услуги сервиса test'),
             'object': self.object,
         }))
         return context
@@ -30,6 +32,10 @@ class ServiceTypeCreate(UserPassesTestMixin, CreateView):
             return True
         return False
     
+    
+    
+
+    
 
 class ServiceTypeListView(UserPassesTestMixin, SingleTableView):
     table_class = ServiceTypeTable