libreqda 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CHANGELOG.md +481 -0
- libreqda-1.2.0.dist-info/LICENSE.txt +28 -0
- libreqda-1.2.0.dist-info/METADATA +131 -0
- libreqda-1.2.0.dist-info/RECORD +255 -0
- libreqda-1.2.0.dist-info/WHEEL +4 -0
- libreqda-1.2.0.dist-info/entry_points.txt +4 -0
- scripts/babelrc +8 -0
- scripts/dist/LICENSE.txt +33 -0
- scripts/dist/RELEASE.txt +23 -0
- scripts/dist/macos/libreqda.icns +0 -0
- scripts/dist/macos/macos.spec +43 -0
- scripts/dist/macos/plist.patch +10 -0
- scripts/dist/macos/taguette.icns +0 -0
- scripts/dist/macos/taguette_console_wrapper +4 -0
- scripts/dist/macos.sh +32 -0
- scripts/dist/pyinstaller_entrypoint.py +19 -0
- scripts/dist/windows/windows-installer.iss +51 -0
- scripts/dist/windows/windows.spec +39 -0
- scripts/edugain/worker_update_edugain_idps.py +89 -0
- scripts/edugain/worker_update_edugain_idps.sh +9 -0
- scripts/make_password_reset_link.py +56 -0
- scripts/make_theme.py +99 -0
- scripts/new_db_revision.sh +8 -0
- scripts/register_user.py +76 -0
- scripts/update_pot.sh +33 -0
- scripts/update_translations.sh +17 -0
- scripts/validate.py +140 -0
- scripts/wipe_and_disable_user.py +90 -0
- taguette/__init__.py +13 -0
- taguette/access_control.py +145 -0
- taguette/convert.py +623 -0
- taguette/database/__init__.py +177 -0
- taguette/database/base.py +9 -0
- taguette/database/copy.py +433 -0
- taguette/database/models.py +920 -0
- taguette/demodata.py +688 -0
- taguette/export.py +500 -0
- taguette/extract.py +287 -0
- taguette/import_codebook.py +110 -0
- taguette/l10n/de_DE/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/de_DE/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/l10n/el_EL/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/el_GR/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/el_GR/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/l10n/en_US/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/en_US/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/l10n/es_ES/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/es_ES/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/l10n/fr_FR/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/fr_FR/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/l10n/id_ID/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/id_ID/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/l10n/it_IT/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/it_IT/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/l10n/nl_NL/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/nl_NL/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/l10n/pt_PT/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/pt_PT/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/l10n/sv_SE/LC_MESSAGES/taguette_javascript.mo +0 -0
- taguette/l10n/sv_SE/LC_MESSAGES/taguette_main.mo +0 -0
- taguette/loki_handler.py +107 -0
- taguette/main.py +649 -0
- taguette/migrations/env.py +72 -0
- taguette/migrations/script.py.mako +24 -0
- taguette/migrations/versions/09c662cd9483_make_documents_filename_not_null.py +39 -0
- taguette/migrations/versions/1b29e68900c1_add_user_roles.py +55 -0
- taguette/migrations/versions/1b96a606551d_update_user_to_have_a_display_name.py +34 -0
- taguette/migrations/versions/2467bab602b7_add_color_column_to_tags_table.py +33 -0
- taguette/migrations/versions/382db36f20f4_add_user_disabled.py +66 -0
- taguette/migrations/versions/43d6c240309d_remove_document_groups.py +81 -0
- taguette/migrations/versions/447d636f72c5_cascades.py +40 -0
- taguette/migrations/versions/491de2dc7cd7_add_indexes.py +51 -0
- taguette/migrations/versions/4c55b3b3ff30_user_login_length.py +58 -0
- taguette/migrations/versions/61a4abcc8769_user_with_parent_for_permissions.py +40 -0
- taguette/migrations/versions/6489b5f9cfb5_increase_password_hash_size.py +34 -0
- taguette/migrations/versions/679f625e6e6a_fix_unique_tags.py +59 -0
- taguette/migrations/versions/77c4543a5b9b_add_parent_id_column_to_collection_table.py +41 -0
- taguette/migrations/versions/7c94b7a31e69_add_is_archived_column_to_projets.py +39 -0
- taguette/migrations/versions/7f56de97e3c8_change_edugain_displayname_length.py +42 -0
- taguette/migrations/versions/807c0cc0ecf6_remove_invalid_hltags.py +43 -0
- taguette/migrations/versions/80b1cc9d4c22_add_user_email.py +35 -0
- taguette/migrations/versions/91ade71ccf4d_add_user_language.py +28 -0
- taguette/migrations/versions/955db2e523d1_add_collections_tables_and_associations_.py +60 -0
- taguette/migrations/versions/a1b2c3d4e5f6_add_user_hide_code_counts.py +28 -0
- taguette/migrations/versions/b23f3b7a638e_add_user_password_change_date.py +36 -0
- taguette/migrations/versions/b7c1e2d3f4a5_add_project_compact_layout.py +28 -0
- taguette/migrations/versions/bc8e0e0677e9_rename_command_fields.py +126 -0
- taguette/migrations/versions/bce44849c2f2_lowercase_logins.py +96 -0
- taguette/migrations/versions/ca076140922f_update_user_for_external_logins.py +32 -0
- taguette/migrations/versions/d86c45d7aa8a_add_document_direction.py +127 -0
- taguette/migrations/versions/db5e31a0233d_remove_blank_highlights.py +88 -0
- taguette/migrations/versions/dd37d9027a24_unique_tags.py +68 -0
- taguette/migrations/versions/de678cef2a94_add_project_id_to_collections_and_.py +41 -0
- taguette/migrations/versions/e459991d960e_add_table_edugainidps.py +39 -0
- taguette/migrations/versions/e4cf92942271_add_index.py +29 -0
- taguette/migrations/versions/e4e090a5b511_remove_commands_document_id_fk.py +38 -0
- taguette/migrations/versions/e9a9f1c77971_add_favorite_column_to_document.py +32 -0
- taguette/migrations/versions/ecb4065de575_don_t_use_server_default_now_timezone_.py +44 -0
- taguette/migrations/versions/fbdc29566f62_edugain_fix_field_type.py +42 -0
- taguette/migrations/versions/fdc6eb54b034_add_parent_id_column_to_tags_table.py +31 -0
- taguette/static/README.md +34 -0
- taguette/static/alt_templates/.gitkeep +0 -0
- taguette/static/assets/test/logos/monsters-university-logo.png +0 -0
- taguette/static/css/custom.css +1696 -0
- taguette/static/css/fa-all.min.css +5 -0
- taguette/static/css/themed.css +3 -0
- taguette/static/css/themed.css.map +25 -0
- taguette/static/css/vendor/bootstrap-treeview.min.css +1 -0
- taguette/static/css/vendor/bootstrap.min.css +6 -0
- taguette/static/css/vendor/font/context-menu-icons.eot +0 -0
- taguette/static/css/vendor/font/context-menu-icons.ttf +0 -0
- taguette/static/css/vendor/font/context-menu-icons.woff +0 -0
- taguette/static/css/vendor/font/context-menu-icons.woff2 +0 -0
- taguette/static/css/vendor/hierarchy-select.min.css +1 -0
- taguette/static/css/vendor/introjs.min.css +2 -0
- taguette/static/css/vendor/jquery.contextMenu.min.css +16 -0
- taguette/static/favicon.ico +0 -0
- taguette/static/js/codebook-viz.js +428 -0
- taguette/static/js/collection/context-menu.js +180 -0
- taguette/static/js/collection/hierarchy-select.js +71 -0
- taguette/static/js/collection/manager.js +217 -0
- taguette/static/js/document/context-menu.js +92 -0
- taguette/static/js/document/custom-select.js +82 -0
- taguette/static/js/document/manager.js +943 -0
- taguette/static/js/document/treeview.js +593 -0
- taguette/static/js/highlight/README.md +18 -0
- taguette/static/js/highlight/crud.js +119 -0
- taguette/static/js/highlight/extracts.js +497 -0
- taguette/static/js/highlight/loader.js +109 -0
- taguette/static/js/highlight/renderer.js +405 -0
- taguette/static/js/login.js +15 -0
- taguette/static/js/permissions.js +153 -0
- taguette/static/js/polling-event.js +145 -0
- taguette/static/js/project/intro.js +524 -0
- taguette/static/js/project/manager.js +0 -0
- taguette/static/js/project/search.js +124 -0
- taguette/static/js/tag/context-menu.js +133 -0
- taguette/static/js/tag/explore-codes.js +400 -0
- taguette/static/js/tag/hierarchy-select.js +69 -0
- taguette/static/js/tag/manager.js +545 -0
- taguette/static/js/tag/treeview.js +613 -0
- taguette/static/js/taguette.js +1790 -0
- taguette/static/js/utilities.js +714 -0
- taguette/static/js/vendor/bootstrap-treeview-custum.js +421 -0
- taguette/static/js/vendor/bootstrap-treeview-custum.min.js +1 -0
- taguette/static/js/vendor/bootstrap-treeview-default.min.js +1 -0
- taguette/static/js/vendor/bootstrap.bundle.min.js +7 -0
- taguette/static/js/vendor/bootstrap.bundle.min.js.map +1 -0
- taguette/static/js/vendor/hierarchy-select.min.js +1 -0
- taguette/static/js/vendor/introjs.min.js +17 -0
- taguette/static/js/vendor/jquery-3.7.1.js +2 -0
- taguette/static/js/vendor/jquery.contextMenu.min.js +2 -0
- taguette/static/libreqda.ico +0 -0
- taguette/static/logo-h.png +0 -0
- taguette/static/logo.png +0 -0
- taguette/static/logo_blanc.png +0 -0
- taguette/static/missing.png +0 -0
- taguette/static/robots.txt +2 -0
- taguette/static/scss/components/_badge.scss +42 -0
- taguette/static/scss/components/_button.scss +169 -0
- taguette/static/scss/components/_checkbox.scss +40 -0
- taguette/static/scss/components/_context_menu.scss +28 -0
- taguette/static/scss/components/_custom_select.scss +150 -0
- taguette/static/scss/components/_dropdown.scss +43 -0
- taguette/static/scss/components/_form.scss +54 -0
- taguette/static/scss/components/_modal.scss +57 -0
- taguette/static/scss/components/_project_card.scss +163 -0
- taguette/static/scss/components/_tag.scss +308 -0
- taguette/static/scss/components/_treeview.scss +76 -0
- taguette/static/scss/custom.scss +809 -0
- taguette/static/scss/layout/_credits.scss +62 -0
- taguette/static/scss/layout/_footer.scss +6 -0
- taguette/static/scss/layout/_navigation.scss +165 -0
- taguette/static/scss/layout/_sidebar.scss +37 -0
- taguette/static/scss/themes/default/_variables.scss +103 -0
- taguette/static/scss/themes/default/theme.css +3 -0
- taguette/static/scss/themes/default/theme.css.map +26 -0
- taguette/static/scss/themes/default/theme.scss +4 -0
- taguette/static/webfonts/BadScript-OFL.txt +94 -0
- taguette/static/webfonts/BadScript.ttf +0 -0
- taguette/static/webfonts/Montserrat-Light.ttf +0 -0
- taguette/static/webfonts/Montserrat-OFL.txt +93 -0
- taguette/static/webfonts/fa-brands-400.eot +0 -0
- taguette/static/webfonts/fa-brands-400.svg +1184 -0
- taguette/static/webfonts/fa-brands-400.ttf +0 -0
- taguette/static/webfonts/fa-brands-400.woff +0 -0
- taguette/static/webfonts/fa-brands-400.woff2 +0 -0
- taguette/static/webfonts/fa-regular-400.eot +0 -0
- taguette/static/webfonts/fa-regular-400.svg +467 -0
- taguette/static/webfonts/fa-regular-400.ttf +0 -0
- taguette/static/webfonts/fa-regular-400.woff +0 -0
- taguette/static/webfonts/fa-regular-400.woff2 +0 -0
- taguette/static/webfonts/fa-solid-900.eot +0 -0
- taguette/static/webfonts/fa-solid-900.svg +2618 -0
- taguette/static/webfonts/fa-solid-900.ttf +0 -0
- taguette/static/webfonts/fa-solid-900.woff +0 -0
- taguette/static/webfonts/fa-solid-900.woff2 +0 -0
- taguette/templates/alt_templates/.gitkeep +0 -0
- taguette/templates/archived_projects.html +50 -0
- taguette/templates/auth/account.html +74 -0
- taguette/templates/auth/cilogon.login.html +89 -0
- taguette/templates/auth/email_reset_password.html +5 -0
- taguette/templates/auth/external_account.html +60 -0
- taguette/templates/auth/login.html +144 -0
- taguette/templates/auth/reset_password.html +27 -0
- taguette/templates/auth/token_needed.html +7 -0
- taguette/templates/base.html +209 -0
- taguette/templates/bug_report.html +158 -0
- taguette/templates/cookies_prompt.html +15 -0
- taguette/templates/downloads.html +127 -0
- taguette/templates/email_bug_report.txt +9 -0
- taguette/templates/email_reset_password.txt +5 -0
- taguette/templates/error.html +8 -0
- taguette/templates/export_codebook.html +20 -0
- taguette/templates/export_document.html +20 -0
- taguette/templates/export_highlights.html +47 -0
- taguette/templates/index.html +347 -0
- taguette/templates/maintenance.html +8 -0
- taguette/templates/messages.js +74 -0
- taguette/templates/modal/change_document.html +68 -0
- taguette/templates/modal/create_collection.html +100 -0
- taguette/templates/modal/create_document.html +84 -0
- taguette/templates/modal/create_highlight.html +38 -0
- taguette/templates/modal/create_tag.html +73 -0
- taguette/templates/modal/explore_codes.html +58 -0
- taguette/templates/modal/manage_collaborators.html +44 -0
- taguette/templates/modal/merge_tag.html +49 -0
- taguette/templates/new_password.html +32 -0
- taguette/templates/partials/alert.html +16 -0
- taguette/templates/partials/codebook_viz_modal.html +34 -0
- taguette/templates/partials/confirm.html +17 -0
- taguette/templates/partials/document_toolbar.html +37 -0
- taguette/templates/partials/hlinfo.html +13 -0
- taguette/templates/partials/project_card.html +44 -0
- taguette/templates/partials/project_card_archived.html +41 -0
- taguette/templates/partials/project_sidebar.html +99 -0
- taguette/templates/partials/spinner.html +11 -0
- taguette/templates/permissions.html +54 -0
- taguette/templates/project.html +288 -0
- taguette/templates/project_delete.html +17 -0
- taguette/templates/project_import.html +122 -0
- taguette/templates/project_import_codebook.html +34 -0
- taguette/templates/project_import_codebook_confirm.html +49 -0
- taguette/templates/project_new.html +31 -0
- taguette/templates/tos.html +8 -0
- taguette/templates/trans.js +7 -0
- taguette/templates/welcome.html +15 -0
- taguette/utils.py +177 -0
- taguette/validate.py +141 -0
- taguette/version_check.py +102 -0
- taguette/web/__init__.py +252 -0
- taguette/web/api.py +1835 -0
- taguette/web/base.py +864 -0
- taguette/web/export.py +338 -0
- taguette/web/views.py +1618 -0
taguette/web/__init__.py
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import gettext
|
|
2
|
+
import json
|
|
3
|
+
import logging
|
|
4
|
+
from markupsafe import Markup
|
|
5
|
+
import pkg_resources
|
|
6
|
+
from tornado.routing import URLSpec
|
|
7
|
+
from tornado.web import HTTPError
|
|
8
|
+
|
|
9
|
+
from .. import database
|
|
10
|
+
from .base import Application, BaseHandler
|
|
11
|
+
from . import api, export, views
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
logger = logging.getLogger(__name__)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class RedirectAccount(BaseHandler):
|
|
18
|
+
def get(self):
|
|
19
|
+
if not self.application.config['MULTIUSER']:
|
|
20
|
+
raise HTTPError(404)
|
|
21
|
+
return self.redirect(self.reverse_url('account'), True)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class TranslationJs(BaseHandler):
|
|
25
|
+
def get(self):
|
|
26
|
+
catalog = {}
|
|
27
|
+
|
|
28
|
+
d = pkg_resources.resource_filename('taguette', 'l10n')
|
|
29
|
+
gettext_trans = gettext.translation('taguette_javascript', d,
|
|
30
|
+
[self.locale.code], fallback=True)
|
|
31
|
+
if gettext_trans is not None:
|
|
32
|
+
if isinstance(gettext_trans, gettext.GNUTranslations):
|
|
33
|
+
catalog = gettext_trans._catalog
|
|
34
|
+
|
|
35
|
+
language = Markup(json.dumps(self.locale.code))
|
|
36
|
+
catalog = Markup(json.dumps(catalog))
|
|
37
|
+
self.set_header('Content-Type', 'text/javascript')
|
|
38
|
+
return self.render('trans.js',
|
|
39
|
+
language=language,
|
|
40
|
+
catalog=catalog)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class MessagesJs(BaseHandler):
|
|
44
|
+
async def get(self):
|
|
45
|
+
if not self.application.messages_event.is_set():
|
|
46
|
+
await self.application.messages_event.wait()
|
|
47
|
+
# Hot-reload the JSON file if its mtime has changed.
|
|
48
|
+
self.application.refresh_messages_if_file()
|
|
49
|
+
# Resolve per-locale variants against the current user's locale.
|
|
50
|
+
resolved = [
|
|
51
|
+
self.application.resolve_message_for_locale(m, self.locale.code)
|
|
52
|
+
for m in self.application.messages
|
|
53
|
+
]
|
|
54
|
+
messages = json.dumps(resolved)
|
|
55
|
+
self.set_header('Content-Type', 'text/javascript')
|
|
56
|
+
self.set_header('Cache-Control', 'no-store')
|
|
57
|
+
return await self.render('messages.js',
|
|
58
|
+
messages=Markup(messages))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class Error404(BaseHandler):
|
|
62
|
+
def initialize(self):
|
|
63
|
+
self.set_status(404)
|
|
64
|
+
|
|
65
|
+
def prepare(self):
|
|
66
|
+
self.render(
|
|
67
|
+
'error.html',
|
|
68
|
+
error_title=self.pgettext("page title", "Error 404"),
|
|
69
|
+
error_message=self.gettext("This page does not exist."),
|
|
70
|
+
)
|
|
71
|
+
raise HTTPError(404)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class Health(BaseHandler):
|
|
75
|
+
@views.PROM_REQUESTS.async_('health')
|
|
76
|
+
async def get(self):
|
|
77
|
+
errors = []
|
|
78
|
+
|
|
79
|
+
if self.application.is_exiting:
|
|
80
|
+
errors.append("Shutting down")
|
|
81
|
+
|
|
82
|
+
try:
|
|
83
|
+
self.db.query(database.Project).first()
|
|
84
|
+
except Exception:
|
|
85
|
+
errors.append("Database unavailable")
|
|
86
|
+
|
|
87
|
+
if self.application.redis is not None:
|
|
88
|
+
try:
|
|
89
|
+
await self.application.redis.ping()
|
|
90
|
+
except Exception:
|
|
91
|
+
errors.append("Redis unavailable")
|
|
92
|
+
|
|
93
|
+
self.set_header('Content-Type', 'text/plain')
|
|
94
|
+
if errors:
|
|
95
|
+
self.set_status(503)
|
|
96
|
+
return await self.finish("\n".join(errors))
|
|
97
|
+
else:
|
|
98
|
+
return await self.finish("Ok")
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
class UnbakedURLSpec(object):
|
|
102
|
+
def __init__(self, pattern, handler, kwargs=None, name=None):
|
|
103
|
+
self.pattern = pattern
|
|
104
|
+
self.handler = handler
|
|
105
|
+
self.kwargs = kwargs
|
|
106
|
+
self.name = name
|
|
107
|
+
|
|
108
|
+
def bake(self, *, base_path):
|
|
109
|
+
return URLSpec(
|
|
110
|
+
base_path + self.pattern,
|
|
111
|
+
self.handler,
|
|
112
|
+
kwargs=self.kwargs,
|
|
113
|
+
name=self.name,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def make_app(config, debug=False, xsrf_cookies=True):
|
|
118
|
+
routes = [
|
|
119
|
+
# Basic pages
|
|
120
|
+
UnbakedURLSpec('/', views.Index, name='index'),
|
|
121
|
+
UnbakedURLSpec('/cookies', views.CookiesPrompt, name='cookies_prompt'),
|
|
122
|
+
UnbakedURLSpec('/login', views.Login, name='login'),
|
|
123
|
+
UnbakedURLSpec('/logout', views.Logout, name='logout'),
|
|
124
|
+
UnbakedURLSpec('/register', views.Register, name='register'),
|
|
125
|
+
UnbakedURLSpec('/cilogon', views.Cilogon, name='cilogon'),
|
|
126
|
+
UnbakedURLSpec('/ci_callback', views.CilogonCallback,
|
|
127
|
+
name='ci_callback'),
|
|
128
|
+
UnbakedURLSpec('/tos', views.TermsOfService, name='tos'),
|
|
129
|
+
UnbakedURLSpec('/downloads', views.Downloads, name='downloads'),
|
|
130
|
+
UnbakedURLSpec('/download/([a-z]+)', views.DownloadTracker,
|
|
131
|
+
name='download_track'),
|
|
132
|
+
UnbakedURLSpec('/account', views.Account, name='account'),
|
|
133
|
+
UnbakedURLSpec('/reset_password', views.AskResetPassword,
|
|
134
|
+
name='reset_password'),
|
|
135
|
+
UnbakedURLSpec('/new_password', views.SetNewPassword,
|
|
136
|
+
name='new_password'),
|
|
137
|
+
UnbakedURLSpec('/bug_report', views.BugReport,
|
|
138
|
+
name='bug_report'),
|
|
139
|
+
UnbakedURLSpec('/permissions', views.UserPermissions,
|
|
140
|
+
name='permissions'),
|
|
141
|
+
UnbakedURLSpec('/project/new', views.ProjectAdd, name='new_project'),
|
|
142
|
+
UnbakedURLSpec('/project/import', views.ProjectImport,
|
|
143
|
+
name='import_project'),
|
|
144
|
+
UnbakedURLSpec('/project/([0-9]+)/delete', views.ProjectDelete,
|
|
145
|
+
name='delete_project'),
|
|
146
|
+
UnbakedURLSpec('/project/([0-9]+)/archive', views.ProjectArchive,
|
|
147
|
+
name='archive_project'),
|
|
148
|
+
UnbakedURLSpec('/project/([0-9]+)/unarchive', views.ProjectUnarchive,
|
|
149
|
+
name='unarchive_project'),
|
|
150
|
+
UnbakedURLSpec('/projects/archived', views.ArchivedProjects,
|
|
151
|
+
name='archived_projects'),
|
|
152
|
+
UnbakedURLSpec('/project/([0-9]+)/import_codebook',
|
|
153
|
+
views.ImportCodebook,
|
|
154
|
+
name='import_codebook'),
|
|
155
|
+
|
|
156
|
+
# Project view
|
|
157
|
+
UnbakedURLSpec('/project/([0-9]+)', views.Project, name='project'),
|
|
158
|
+
UnbakedURLSpec('/project/([0-9]+)/document/[0-9]+', views.Project,
|
|
159
|
+
name='project_doc'),
|
|
160
|
+
UnbakedURLSpec('/project/([0-9]+)/document/[0-9]+/highlight/'
|
|
161
|
+
'[0-9]+', views.Project, name='project_doc'),
|
|
162
|
+
UnbakedURLSpec('/project/([0-9]+)/document/[0-9]+/search/'
|
|
163
|
+
'[^/]+/[0-9]+', views.Project, name='project_doc'),
|
|
164
|
+
UnbakedURLSpec('/project/([0-9]+)/highlights/.*', views.Project,
|
|
165
|
+
name='project_tag'),
|
|
166
|
+
|
|
167
|
+
# Export options
|
|
168
|
+
UnbakedURLSpec('/project/([0-9]+)/export/project\\.sqlite3',
|
|
169
|
+
export.ExportSqlite, name='export_project_sqlite'),
|
|
170
|
+
UnbakedURLSpec('/project/([0-9]+)/export/codebook\\.qdc',
|
|
171
|
+
export.ExportCodebookXml, name='export_codebook_qdc'),
|
|
172
|
+
UnbakedURLSpec('/project/([0-9]+)/export/codebook\\.csv',
|
|
173
|
+
export.ExportCodebookCsv, name='export_codebook_csv'),
|
|
174
|
+
UnbakedURLSpec('/project/([0-9]+)/export/codebook\\.xlsx',
|
|
175
|
+
export.ExportCodebookXlsx, name='export_codebook_xlsx'),
|
|
176
|
+
UnbakedURLSpec('/project/([0-9]+)/export/codebook\\.([a-z0-3]{2,4})',
|
|
177
|
+
export.ExportCodebookDoc, name='export_codebook_doc'),
|
|
178
|
+
UnbakedURLSpec('/project/([0-9]+)/export/document/'
|
|
179
|
+
'([^/]+)\\.([a-z0-9]{2,4})',
|
|
180
|
+
export.ExportDocument, name='export_document'),
|
|
181
|
+
UnbakedURLSpec('/project/([0-9]+)/export/highlights/(.*)\\.csv',
|
|
182
|
+
export.ExportHighlightsCsv),
|
|
183
|
+
UnbakedURLSpec('/project/([0-9]+)/export/highlights/(.*)\\.xlsx',
|
|
184
|
+
export.ExportHighlightsXlsx),
|
|
185
|
+
UnbakedURLSpec('/project/([0-9]+)/export/highlights/'
|
|
186
|
+
'(.*)\\.([a-z0-3]{2,4})',
|
|
187
|
+
export.ExportHighlightsDoc,
|
|
188
|
+
name='export_highlights_doc'),
|
|
189
|
+
|
|
190
|
+
# API
|
|
191
|
+
UnbakedURLSpec('/api/check_user', api.CheckUser),
|
|
192
|
+
UnbakedURLSpec('/api/create_demo_project', api.CreateDemoProject),
|
|
193
|
+
UnbakedURLSpec('/api/import', api.ProjectImport),
|
|
194
|
+
UnbakedURLSpec('/api/project/([0-9]+)', api.ProjectMeta),
|
|
195
|
+
UnbakedURLSpec(
|
|
196
|
+
'/api/project/([0-9]+)/display', api.ProjectDisplay),
|
|
197
|
+
UnbakedURLSpec('/api/project/([0-9]+)/document/new', api.DocumentAdd),
|
|
198
|
+
UnbakedURLSpec(
|
|
199
|
+
'/api/project/([0-9]+)/collection/new', api.CreateCollection),
|
|
200
|
+
UnbakedURLSpec(
|
|
201
|
+
'/api/project/([0-9]+)/collection/([0-9]+)', api.CollectionUpdate),
|
|
202
|
+
UnbakedURLSpec('/api/project/([0-9]+)/document/([0-9]+)',
|
|
203
|
+
api.Document),
|
|
204
|
+
UnbakedURLSpec('/api/project/([0-9]+)/document/([0-9]+)/contents',
|
|
205
|
+
api.DocumentContents),
|
|
206
|
+
UnbakedURLSpec('/api/project/([0-9]+)/document/([0-9]+)/highlight/new',
|
|
207
|
+
api.HighlightAdd),
|
|
208
|
+
UnbakedURLSpec(
|
|
209
|
+
'/api/project/([0-9]+)/document/([0-9]+)/highlight/([0-9]+)',
|
|
210
|
+
api.HighlightUpdate),
|
|
211
|
+
UnbakedURLSpec('/api/project/([0-9]+)/highlights/(.*)',
|
|
212
|
+
api.Highlights),
|
|
213
|
+
UnbakedURLSpec('/api/project/([0-9]+)/search/(.*)',
|
|
214
|
+
api.Search),
|
|
215
|
+
UnbakedURLSpec('/api/project/([0-9]+)/tag/new', api.TagAdd),
|
|
216
|
+
UnbakedURLSpec('/api/project/([0-9]+)/tag/([0-9]+)', api.TagUpdate),
|
|
217
|
+
UnbakedURLSpec('/api/project/([0-9]+)/tag/merge', api.TagMerge),
|
|
218
|
+
UnbakedURLSpec('/api/project/([0-9]+)/members', api.MembersUpdate),
|
|
219
|
+
UnbakedURLSpec('/api/project/([0-9]+)/events', api.ProjectEvents),
|
|
220
|
+
UnbakedURLSpec('/api/permissions', api.PermissionsUpdate),
|
|
221
|
+
|
|
222
|
+
# Translation catalog and functions
|
|
223
|
+
UnbakedURLSpec('/trans\\.js', TranslationJs, name='trans.js'),
|
|
224
|
+
|
|
225
|
+
# Messages
|
|
226
|
+
URLSpec('/messages\\.js', MessagesJs, name='messages.js'),
|
|
227
|
+
|
|
228
|
+
# Well-known URLs
|
|
229
|
+
URLSpec('/\\.well-known/change-password', RedirectAccount),
|
|
230
|
+
UnbakedURLSpec('/health', Health),
|
|
231
|
+
]
|
|
232
|
+
|
|
233
|
+
base_path = config['BASE_PATH']
|
|
234
|
+
routes = [
|
|
235
|
+
spec.bake(base_path=base_path) if isinstance(spec, UnbakedURLSpec)
|
|
236
|
+
else spec
|
|
237
|
+
for spec in routes
|
|
238
|
+
]
|
|
239
|
+
|
|
240
|
+
if base_path:
|
|
241
|
+
routes.append(URLSpec('/', views.BrokenBasePath))
|
|
242
|
+
|
|
243
|
+
return Application(
|
|
244
|
+
routes,
|
|
245
|
+
static_path=pkg_resources.resource_filename('taguette', 'static'),
|
|
246
|
+
static_url_prefix=base_path + "/static/",
|
|
247
|
+
login_url=base_path + '/login',
|
|
248
|
+
xsrf_cookies=xsrf_cookies,
|
|
249
|
+
debug=debug,
|
|
250
|
+
config=config,
|
|
251
|
+
default_handler_class=Error404,
|
|
252
|
+
)
|