from django.conf.urls import patterns, url
from tables import views, views_render, views_export

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^save-milestone-data/?$',
        views.save_milestone_data, name="save_milestone_data"),

    url(r'^hitos_e_avances/?$',
        views.hitos_e_avances, name="hitos_e_avances"),
    url(r'^ucmilestone/?$',
        views.ucmilestone, name="ucmilestone"),
    url(r'^sm2015milestone/?$',
        views.sm2015milestone, name="sm2015milestone"),
    url(r'^metas_sm2015/?$',
        views.metas_sm2015, name="metas_sm2015"),
    url(r'^grants_finances/?$',
        views.grants_finances, name="grants_finances"),
    url(r'^grants_finances_editable/?$',
        views.grants_finances_editable, name="grants_finances_editable"),
    url(r'^life_save/?$', views.life_save, name="life_save"),
    url(r'^country_operation/?$',
        views.country_operation, name="country_operation"),

    url(r'render/hitos/(?P<country_slug>[-\w]+)/?$',
        views_render.render_hitos, name="table_render_hitos"),
    url(r'render/hitos-noneditable/(?P<country_slug>[-\w]+)/?$',
        views_render.render_hitos_noneditable, name="table_render_hitos-noneditable"),
    url(r'render/avances_financeiros/(?P<country_slug>[-\w]+)/?$',
        views_render.render_avances_financeiros,
        name="table_render_avances_financeiros"),
    url(r'render/ucmilestone/(?P<year>\d{4})/?$',
        views_render.render_ucmilestone, name="table_render_ucmilestone"),
    url(r'render/ucmilestone-noneditable/(?P<year>\d{4})/?$',
        views_render.render_ucmilestone_noneditable,
        name="table_render_ucmilestone-noneditable"),
    url(r'render/sm2015milestone/(?P<year>\d{4})?$',
        views_render.render_sm2015milestone,
        name="table_render_sm2015milestone"),
    url(r'render/sm2015milestone-noneditable/(?P<year>\d{4})/?$',
        views_render.render_sm2015milestone_noneditable,
        name="table_render_sm2015milestone-noneditable"),
    url(r'render/grants_finances/?$',
        views_render.render_grants_finances,
        name="table_render_grants_finances"),
    url(r'render/grants_finances_noneditable/?$',
        views_render.render_grants_finances_noneditable,
        name="table_render_grants_finances_noneditable"),
    url(r'render/life_save/(?P<country_slug>[-\w]+)/?$',
        views_render.render_life_save, name="table_render_life_save"),
    url(r'render/country_operation/?$',
        views_render.render_country_operation,
        name="table_render_country_operation"),
    url(r'render/country_operation_noneditable/?$',
        views_render.render_country_operation_noneditable,
        name="table_render_country_operation_noneditable"),
    url(r'render/country_details/?$',
        views_render.render_country_details,
        name="table_render_country_details"),
    url(r'render/operation_total_investment/(?P<country_slug>[-\w]+)/?$',
        views_render.render_operation_total_investment,
        name="table_render_operation_total_investment"),
    url(r'render/country_risk_identification/(?P<country_slug>[-\w]+)/?$',
        views_render.render_country_risk_identification,
        name="table_render_country_risk_identificaction"),
    url(r'render/country_risk_top/(?P<country_slug>[-\w]+)/?$',
        views_render.render_country_risk_top,
        name="table_render_country_risk_top"),
    url(r'render/country_risk_causes/?$',
        views_render.render_country_risk_causes,
        name="table_render_country_risk_causes"),
    url(r'render/country_operations/(?P<country_slug>[-\w]+)/?$',
        views_render.country_operations,
        name="table_render_country_operations"),


    url(r'render/export/hitos_y_avances/(?P<country_slug>[-\w]+)/?$',
        views_export.render_export_hitos_and_avances,
        name="table_export_hitos_and_avances"),

    url(r'grants_finances/ongoing/(?P<uuid_origin>[\_A-Z]+)/?$',
        views.grants_finances_ongoing, name="grants_finances_ongoing"),
    url(r'country/ongoing/(?P<country_slug>[\_\-a-z]+)/(?P<values_type>[\w]+)/?$',
        views.countries_ongoing, name="countries_ongoing"),
    url(r'chart_flot/?$',
        views.chart_flot, name="chart_flot"),
    url(r'chart_bar/(?P<uuid_type>[\_A-Z]+)/?$',
        views.chart_bar, name="chart_bar"),

    url(r'import/excel/', views.import_excel, name="table_import_excel"),
)
