from __init__ import *
from admin.views import *

mainApp = MainApp()
# myadmin = myAdmin()

app.add_url_rule('/', 'index', admin_sign_in, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/dashboard', 'dashboard', mainApp.dashboard, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/add-listing', 'addListing', mainApp.addListing, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin', 'admin_dashboard', admin_dashboard, methods=['POST', 'GET'], strict_slashes=False)

# app.add_url_rule('/migrate-inquiries', 'migrate_inquiries', migrate_inquiries, methods=['POST', 'GET'], strict_slashes=False)
# app.add_url_rule('/migrate_inquiries_subjects', 'migrate_inquiries_subjects', migrate_inquiries_subjects, methods=['POST', 'GET'], strict_slashes=False)
# app.add_url_rule('/tryMigrate2', 'tryMigrate2', tryMigrate2, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/slider', 'admin_slider', admin_slider, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/utilities/makes', 'makes', makes, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/status', 'status', status, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/status/change/<id>', 'change_listing_status', status_change, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/utilities/delete/<id>', 'delete_status', delete_status, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/utilities/models', 'models', models, methods=['POST', 'GET'], strict_slashes=False)

# Delete Urls
app.add_url_rule('/admin/utilities/makes/delete/<id>', 'delete_make', delete_make, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/update_model/update/<make_id>', 'update_model', update_model, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/utilities/models/delete/<id>', 'delete_model', delete_model, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/body_types/delete/<id>', 'delete_body_type', delete_body_type, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/conditions/delete/<id>', 'delete_condition', delete_condition, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/drive-type/delete/<id>', 'delete_drive_type', delete_drive_type, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/transmisions/delete/<id>', 'delete_transmission', delete_transmission, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/fuel-types/delete/<id>', 'delete_fuel_type', delete_fuel_type, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/cylinders/delete/<id>', 'delete_cylinders', delete_cylinders, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/doors/delete/<id>', 'delete_door', delete_door, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/features/delete/<id>', 'delete_feature', delete_feature, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/external-colours/delete/<id>', 'delete_external_colour', delete_external_colour, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/utilities/body-types', 'body_types', body_types, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/conditions', 'conditions', conditions, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/drive-types', 'drive_types', drive_types, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/transmisions', 'transmisions', transmisions, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/fuel-types', 'fuel_types', fuel_types, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/cylinders', 'cylinders', cylinders, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/external-colours', 'external_colours', external_colours, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/doors', 'doors', doors, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/utilities/features', 'features', features, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/slider/hide/<id>', 'hide_slider', admin_slider_hide, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/slider/delete/<id>', 'delete_slider', admin_slider_delete, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/gallery/hide/<id>', 'hide_gallery', admin_gallery_hide, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/gallery/delete/<id>', 'delete_gallery', admin_gallery_delete, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/add-listing', 'add_listing', add_listing, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/all-listing', 'all_listing', all_listing, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/featured-listing/mark/<id>', 'mark_featured_listing', mark_featured_listing, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/delete-listing/mark/<id>', 'delete_listing', delete_listing, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/featured-listing', 'featured_listing', featured_listing, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/edit-listing/<id>', 'edit_listing', edit_listing, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/staff', 'admin_staff', admin_staff, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/staff/delete/<id>', 'delete_staff', delete_staff, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/departments', 'admin_departments', admin_departments, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/departments/delete/<id>', 'delete_department', delete_department, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/reviews', 'admin_reviews', admin_reviews, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/delete-review/<id>', 'admin_delete_Review', admin_delete_Review, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/news', 'admin_news', admin_news, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/news/add', 'admin_news_add', admin_news_add, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/news/edit/<slug>', 'admin_news_post', admin_news_post, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/news/delete/<id>', 'admin_delete_article', admin_delete_article, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/news/view/<slug>', 'admin_news_post_view', admin_news_post_view, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/principal', 'admin_principal', admin_principal, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/gallery', 'admin_gallery', admin_gallery, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/contacts', 'admin_contacts', admin_contacts, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/contacts/new', 'admin_new_contact', admin_new_contacts, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/contacts/edit', 'admin_edit_contact', admin_edit_contacts, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/about', 'admin_about', admin_about, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/about/new', 'admin_new_about', admin_new_about, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/about/edit', 'admin_edit_about', admin_edit_about, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/car-sell', 'admin_car_sell', admin_car_sell, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/car-sell-delete/<id>', 'delete_car_sell', delete_car_sell, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/car-sell-view/<id>', 'view_car_sell', view_car_sell, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/contact-request', 'admin_contact_request', admin_contact_request, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/contact-request-delete/<id>', 'delete_contact_request', delete_contact_request, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/contact-request-view/<id>', 'view_contact_request', view_contact_request, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/admin/requests', 'admin_requests', admin_requests, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/requests/open/<id>', 'open_request', open_request, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/requests/completed/<id>', 'completed_request', completed_request, methods=['POST', 'GET'], strict_slashes=False)


app.add_url_rule('/admin/uploader', 'uploader', uploader, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/billing', 'admin_billing', admin_billing, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/virtual-reality', 'admin_virtual_reality', admin_virtual_reality, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/rtl', 'admin_rtl', admin_rtl, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/profile', 'admin_profile', admin_profile, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/login', 'admin_sign_in', admin_sign_in, methods=['POST', 'GET'], strict_slashes=False)
# app.add_url_rule('/logout', 'logout', admin_logout, methods=['POST', 'GET'], strict_slashes=False)
app.add_url_rule('/admin/sign-up', 'admin_sign_up', admin_sign_up, methods=['POST', 'GET'], strict_slashes=False)

app.add_url_rule('/make-slugs', "make_vehicle_slugs", make_vehicle_slugs, methods=['POST', 'GET'], strict_slashes=False)


# app.add_url_rule('/client/open-request/<id>', 'open_request', open_request, methods=['POST', 'GET'], strict_slashes=False)
