diff --git a/.gitignore b/.gitignore index 00c8e61a..1e7ee450 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ dist/* .idea # vim swap files .*.swp +.vscode # Unit test / coverage reports htmlcov/* @@ -52,7 +53,7 @@ siteedit2/settings/local_test.py siteedit2/settings/gunweb.py # */migrations -static/core/scss/ +static core/static/core/scss/main.css core/management/commands/playground.py -upload/ \ No newline at end of file +upload/ diff --git a/catalogue/migrations/__init__.py b/catalogue/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/core/constant.py b/core/constant.py index 942ae27a..788f40a9 100644 --- a/core/constant.py +++ b/core/constant.py @@ -105,6 +105,9 @@ PM_CHANGE_ORGTYPE = 'core.change_cofkunionorgtype' PM_CHANGE_COLLECTWORK = 'uploader.change_cofkcollectwork' PM_CHANGE_LANGUAGE = 'core.change_iso639languagecode' +PM_CHANGE_SUGGESTIONS = 'suggestions.change_cofksuggestions' +PM_VIEW_SUGGESTIONS = 'suggestions.view_cofksuggestions' +PM_ADD_SUGGESTIONS = 'suggestions.add_cofksuggestions' PM_CHANGE_USER = 'login.change_cofkuser' PM_CHANGE_COMMENT = 'core.change_cofkunioncomment' diff --git a/core/management/commands/add_groups_and_permissions.py b/core/management/commands/add_groups_and_permissions.py index b59ab04d..1f7e0a8b 100644 --- a/core/management/commands/add_groups_and_permissions.py +++ b/core/management/commands/add_groups_and_permissions.py @@ -28,7 +28,9 @@ def handle(self, *args, **kwargs): constant.PM_CHANGE_SUBJECT, constant.PM_CHANGE_ORGTYPE, constant.PM_CHANGE_COLLECTWORK, - constant.PM_CHANGE_LANGUAGE + constant.PM_CHANGE_LANGUAGE, + constant.PM_ADD_SUGGESTIONS, + constant.PM_VIEW_SUGGESTIONS, ], } group_permissions_dict[constant.ROLE_SUPER] = group_permissions_dict[constant.ROLE_EDITOR] + [ @@ -43,7 +45,9 @@ def handle(self, *args, **kwargs): ] group_permissions_dict[constant.ROLE_CONTRIBUTING_EDITOR] = [ constant.PM_CHANGE_WORK, - constant.PM_VIEW_LOOKUPCAT + constant.PM_VIEW_LOOKUPCAT, + constant.PM_VIEW_SUGGESTIONS, + constant.PM_CHANGE_SUGGESTIONS, ] # add permissions to groups diff --git a/core/migrations/0012_alter_iso639languagecode_language_id.py b/core/migrations/0012_alter_iso639languagecode_language_id.py new file mode 100644 index 00000000..c506f933 --- /dev/null +++ b/core/migrations/0012_alter_iso639languagecode_language_id.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0.6 on 2025-02-26 03:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0011_cofklookupcatalogue_owner'), + ] + + operations = [ + migrations.AlterField( + model_name='iso639languagecode', + name='language_id', + field=models.IntegerField(unique=True), + ), + ] diff --git a/core/static/core/scss/components/alert.scss b/core/static/core/scss/components/alert.scss new file mode 100644 index 00000000..ac546670 --- /dev/null +++ b/core/static/core/scss/components/alert.scss @@ -0,0 +1,27 @@ +.alert { + padding: 20px; + background-color: #f44336; + color: white; + opacity: 1; + transition: opacity 0.6s; + margin-bottom: 15px; +} + +.alert.success {background-color: #04AA6D;} +.alert.info {background-color: #2196F3;} +.alert.warning {background-color: #ff9800;} + +.closebtn { + margin-left: 15px; + color: white; + font-weight: bold; + float: right; + font-size: 22px; + line-height: 20px; + cursor: pointer; + transition: 0.3s; +} + +.closebtn:hover { + color: black; +} \ No newline at end of file diff --git a/core/static/core/scss/emlo-common.scss b/core/static/core/scss/emlo-common.scss index 602bafc0..f5951e9c 100644 --- a/core/static/core/scss/emlo-common.scss +++ b/core/static/core/scss/emlo-common.scss @@ -461,5 +461,31 @@ $del-red: #800000; font-weight: bold; } +.right { + float: right; + margin-right: 20px; +} + +.padding-right { + padding-right: 10px; +} + +table.suggestion thead tr th { + background-color: lightgray; + font-weight: bold; +} + +table.suggestion tbody tr th { + width: 30%; +} +.suggestion-buttons { + margin-bottom: 20px; +} +.btn-text-width { + width: fit-content; +} +input.btn-text-width { + padding: 0px 5px; +} \ No newline at end of file diff --git a/core/static/core/scss/main.scss b/core/static/core/scss/main.scss index 318908b7..137f1f2c 100644 --- a/core/static/core/scss/main.scss +++ b/core/static/core/scss/main.scss @@ -26,6 +26,7 @@ @import 'components/upload.scss'; @import 'components/lookup.scss'; @import 'components/dashboard.scss'; +@import 'components/alert.scss'; @import "page-header"; @import "page-footer"; diff --git a/core/templates/core/component/alert.html b/core/templates/core/component/alert.html new file mode 100644 index 00000000..9b3bca36 --- /dev/null +++ b/core/templates/core/component/alert.html @@ -0,0 +1,28 @@ + + +{% if messages %} + {% for message in messages %} +
+ × + Success! {{message}} +
+ {% endfor %} +{% endif %} +{% if message %} +
+ × + Success! {{message}} +
+{% endif %} diff --git a/core/templates/core/emlo_logined.html b/core/templates/core/emlo_logined.html index 2cf53db3..27f6307e 100644 --- a/core/templates/core/emlo_logined.html +++ b/core/templates/core/emlo_logined.html @@ -13,6 +13,12 @@ {% include "core/component/common_section_search_menu.html" %} {% include "core/component/common_section_new_menu.html" %} + {% if constant.PM_VIEW_SUGGESTIONS in perms %} + + {% endif %} + {% if constant.PM_VIEW_LOOKUPCAT in perms %}