from django.urls import path
from django.views.generic import ListView, DetailView
from main.models import Queries
from . import views, reappoint, maintenance_funcs, query_funcs

urlpatterns = [
    path('', views.main, name='main'),
    path('<int:query_id>/', views.show_query, name='show_query'),
    path('new_query', views.new_query, name='new_query'),
    path('<int:query_id>/edit_query', views.edit_query, name='edit_query'),
    path('<int:query_id>/reappoint_query', views.reappoint_query, name='reappoint_query'),
    path('<int:to_id>/reappoint_to', reappoint.reappoint_to, name='reappoint_to'),
    path('equipment', views.show_equipment, name='show_equipment'),
    path('equipment/<int:eq_id>', views.show_eq, name='show_eq'),
    path('equipment/<int:eq_id>/q', views.edit_eq, name='edit_eq'),
    path('equipment/new_eq', views.new_eq, name='eq_create'),
    path('employees', views.show_employees, name='show_employees'),
    path('employees/<int:employee_id>', views.show_emp, name='show_emp'),
    path('employees/add_new', views.add_new, name='add_new'),
    path('employees/add_new/save_emp', views.save_emp, name='save_emp'),
    #path('stats', views.stats, name='stats'),
    path('stats2', views.stats2, name='stats2'),
    path('stats2/refreshed', views.stats2, name='stats2'),
    path('maintenance', views.maintenance, name='maintenance'),
    path('maintenance/new_maintenance', views.new_maintenance, name='new_maintenance'),
    path('main/maintenance/new_maintenance/new_maintenance_save', views.new_maintenance, name='new_maintenance_save'),
    path('maintenance/<int:maintenance_id>', views.show_maintenance, name='show_maintenance'),
    path('main/maintenance/new_maintenance/maintenance_edit', views.maintenance_edit, name='maintenance_edit'),
    path('main/maintenance/new_maintenance/<int:to_id>/maintenance_edit', views.maintenance_edit, name='maintenance_edit'),
    path('<int:to_id>/move_to', maintenance_funcs.move_to, name='move_to'),
    path('main/maintenance/<int:to_id>/change_time', maintenance_funcs.change_time, name='change_time'),
    path('tmc', views.tmc, name='tmc'),
    path('works', views.works, name='works'),
    path('works/<int:work_id>', views.show_work, name='show_work'),
    path('<int:work_id>/delete_work', views.delete_work, name='delete_work'),
    path('<int:work_id>/edit_work', views.edit_work, name='edit_work'),
    path('<int:work_id>/reappoint_work', views.reappoint_work, name='reappoint_work'),
    path('new_work', views.new_work, name='new_work'),
    path('pc_query/pc_query', views.pc_query, name='pc_query'),
    path('pc_query/pc_history', views.pc_history, name='pc_history'),
    path('<int:query_id>/delete_query', views.delete_query, name='delete_query'),
    path('settings', views.settings, name='settings'),
    path('main/settings/add_reason', views.add_reason, name='add_reason'),
    path('main/settings/add_type', views.add_type, name='add_type'),
    path('delete_reasons', views.delete_reasons, name='delete_reasons'),
    path('delete_types', views.delete_types, name='delete_types'),
    path('upload_stats', views.export__data, name='export__data'),
    path('main/equipment/<int:eq_id>/upload_photo_eq', views.upload_photo_eq, name='upload_photo_eq'),
    path('main/tasks', views.tasks, name='tasks'),
    path('main/tasks/save_tasks', views.save_tasks, name='save_tasks'),
    path('main/FAQ', views.FAQ, name='FAQ'),
    path('main/FAQ/edit_text', views.edit_text, name='edit_text'),
    path('main/FAQ/save_text', views.save_text, name='save_text'),
    path('main/<int:query_id>/change_query_time', query_funcs.change_time, name='change_query_time'),
]
