5 Commits a3a77e147e ... 6f0e07ef01

Author SHA1 Message Date
  Nastya 6f0e07ef01 updated services of the service 11 months ago
  Nastya a3a77e147e changed page services 11 months ago
  Nastya bb00ecb941 some changes 11 months ago
  Nastya 292718150d add filter by id/ style changes 11 months ago
  Nastya 098d1a49bc first commit 11 months ago

+ 4 - 3
SharixAdmin/forms.py

@@ -88,15 +88,16 @@ class ServiceTypeCreateForm(forms.ModelForm):
     requirements = forms.CharField(label="Требования")
     requirements = forms.CharField(label="Требования")
     price_type = forms.ChoiceField(choices=PRICE_CHOICES, label="Ценообразование")
     price_type = forms.ChoiceField(choices=PRICE_CHOICES, label="Ценообразование")
     description = forms.CharField(label="Описание")
     description = forms.CharField(label="Описание")
-    is_global = forms.BooleanField(label="Доступно во всех сервисах")
-    is_visible = forms.BooleanField(label="Доступно для планирования цепочек во всех сервисах")
+    is_global = forms.BooleanField(label="Доступно во всех сервисах", required=False)
+    is_visible = forms.BooleanField(label="Доступно для планирования цепочек во всех сервисах", required=False)
+
     def __init__(self, *args, **kwargs):
     def __init__(self, *args, **kwargs):
         super(ServiceTypeCreateForm, self).__init__(*args, **kwargs)
         super(ServiceTypeCreateForm, self).__init__(*args, **kwargs)
     class Meta:
     class Meta:
         model = ServiceType
         model = ServiceType
         fields = ['codename','requirements', 'price_type',
         fields = ['codename','requirements', 'price_type',
                   'description',
                   'description',
-                  'is_global','is_visible','id_metaservice']
+                  'is_global','is_visible',]
 
 
         widgets = {
         widgets = {
 
 

+ 2 - 2
SharixAdmin/static/drf-yasg/colors2.css

@@ -1,7 +1,7 @@
 
 
 :root{
 :root{
-  --btn-bg-color: #fdb4b4;
-  --btn-txt-color: #ff0000;
+  --btn-bg-color: #479FF8;
+  --btn-txt-color: #ffffff;
   --btn-hover-color: #0a58ca;
   --btn-hover-color: #0a58ca;
   --pills-bg-color: #479FF8;
   --pills-bg-color: #479FF8;
   --pills-txt-color: None;
   --pills-txt-color: None;

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

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

+ 10 - 74
SharixAdmin/static/drf-yasg/service_type.css

@@ -15,14 +15,6 @@ p.description_service {
 }
 }
 
 
 
 
-/* table th {
-    font-size: 14px;
-    line-height: 24px;
-    font-weight: 700;
-    border: 1px solid #ffffff;
-    text-decoration: none;
-} */
-
 table.table thead th.orderable {
 table.table thead th.orderable {
     background: url('service_type/arrow_fil.svg') no-repeat center right;
     background: url('service_type/arrow_fil.svg') no-repeat center right;
 }
 }
@@ -85,74 +77,18 @@ table.table thead th {
 table.table {
 table.table {
     border-spacing: 0;
     border-spacing: 0;
 }
 }
-/* table tr {
-    border-top: 1px #95C0F6;
-} */
-table.table tbody tr:hover {
-    border-bottom: 1.5px solid #95C0F6;
-    border-top: 1.5px solid #95C0F6;
-    border-left: 1.5px solid #95C0F6;
-    border-right: 1.5px solid #95C0F6;
-}
-
-/* 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}
+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;
 }
 }
-/* Добавить в конец файла style.css */
 
 
-@keyframes fadeOut {
-    from {opacity: 1} 
-    to {opacity: 0}
+#bord {
+    background-color: #479FF8;
+    color: #ffffff;
 }
 }
 
 
-.modal.fadeOut {
-    animation-name: fadeOut;
-    animation-duration: 0.4s;
-}

+ 1 - 1
SharixAdmin/tables.py

@@ -114,7 +114,7 @@ class ServiceTariffTable(tables.Table):
 
 
 class ServiceTypeTable(tables.Table):
 class ServiceTypeTable(tables.Table):
 
 
-    id = tables.Column( attrs={"td":{"width":"5%"}})
+    id = tables.Column( attrs={"td":{"width":"50px"}})
     codename = tables.LinkColumn('service_type/edit/', verbose_name='Услуга', orderable=False, text = lambda record: record.codename,
     codename = tables.LinkColumn('service_type/edit/', verbose_name='Услуга', orderable=False, text = lambda record: record.codename,
         args=[tables.A('pk')], attrs= {"a": {"style": "pointer-events: none;"}, 'th':{'scope':'col'}, "td":{"class":"name_col"}})
         args=[tables.A('pk')], attrs= {"a": {"style": "pointer-events: none;"}, 'th':{'scope':'col'}, "td":{"class":"name_col"}})
     description = tables.LinkColumn('service_type/edit/', orderable=False, verbose_name='Описание', text = lambda record: record.description,
     description = tables.LinkColumn('service_type/edit/', orderable=False, verbose_name='Описание', text = lambda record: record.description,

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

@@ -10,7 +10,7 @@
     <div class="row">
     <div class="row">
         <div class="col-3" id="leftmainpage">
         <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;
             <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;">
               <ul class="nav nav-pills flex-column mb-auto" style="margin-top: 12px;">

+ 3 - 76
SharixAdmin/templates/SharixAdmin/service_type.html

@@ -15,6 +15,8 @@
     color: black;
     color: black;
   }
   }
 </style>
 </style>
+
+
     
     
     <div class="container">
     <div class="container">
       <h1 class="mainHeader">{{ title }}</h1>
       <h1 class="mainHeader">{{ title }}</h1>
@@ -26,88 +28,13 @@
           </div>     
           </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>
   </div>
 
 
   <div class="container text-end mt-2">
   <div class="container text-end mt-2">
     <a class="btn btn-primary" id="bord" href="/service_type/add">{% trans 'Add' %}</a>
     <a class="btn btn-primary" id="bord" href="/service_type/add">{% trans 'Add' %}</a>
   </div>
   </div>
   
   
-  <button id="openModalBtn">Открыть окно</button>
-
-  <div id="myModal" class="modal">
-      <div class="modal-content">
-          <span id="closeModalBtn" class="close">&times;</span>
-          <div class="fields">
-            
-          </div>
-      </div>
-  </div>
-
-<script>
-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>
-
-
 
 
 
 
 
 

+ 19 - 31
SharixAdmin/templates/SharixAdmin/service_type_form.html

@@ -1,34 +1,22 @@
-
+{% extends 'SharixAdmin/index.html' %}
 {% load i18n %}
 {% load i18n %}
 
 
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <title></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' %}"/>
+{% block contenthome %}
+<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>
         </div>
-    </form>
-</body>
-</html>
-
-
-
-
+        {% 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>
+{% endblock %}

+ 2 - 1
SharixAdmin/views/service_type.py

@@ -8,6 +8,8 @@ from django.urls import reverse
 from SharixAdmin.views.context import get_context
 from SharixAdmin.views.context import get_context
 from django.utils.translation import gettext as _
 from django.utils.translation import gettext as _
 
 
+    
+    
 class ServiceTypeCreate(UserPassesTestMixin, CreateView):
 class ServiceTypeCreate(UserPassesTestMixin, CreateView):
     model = ServiceType
     model = ServiceType
     form_class = ServiceTypeCreateForm
     form_class = ServiceTypeCreateForm
@@ -30,7 +32,6 @@ class ServiceTypeCreate(UserPassesTestMixin, CreateView):
             return True
             return True
         return False
         return False
     
     
-