diff --git a/README.rst b/README.rst index e5462430..7e648326 100644 --- a/README.rst +++ b/README.rst @@ -195,6 +195,13 @@ DB Models Changelog ========= +v. 0.7.3 +-------- + +* UX enhancements (`#149 `_, + `#146 `_) + + v. 0.7.2 -------- diff --git a/messages.pot b/messages.pot index 61592b30..8762dec8 100644 --- a/messages.pot +++ b/messages.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: xl_auth 0.7.1\n" +"Project-Id-Version: xl_auth 0.7.3\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2017-12-20 20:20+0100\n" +"POT-Creation-Date: 2017-12-27 16:20+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,15 +22,14 @@ msgid "category" msgstr "" #: tests/end2end/test_collection_editing.py:63 tests/end2end/test_collection_registering.py:59 -#: xl_auth/collection/forms.py:21 xl_auth/templates/collections/home.html:55 -#: xl_auth/templates/collections/home.html:122 xl_auth/templates/collections/home.html:188 +#: xl_auth/collection/forms.py:21 xl_auth/templates/collections/home.html:51 +#: xl_auth/templates/collections/home.html:114 msgid "No category" msgstr "" #: tests/end2end/test_collection_editing.py:86 tests/end2end/test_collection_registering.py:82 -#: xl_auth/collection/forms.py:17 xl_auth/templates/collections/home.html:33 -#: xl_auth/templates/collections/home.html:100 xl_auth/templates/collections/home.html:163 -#: xl_auth/templates/users/profile.html:69 +#: xl_auth/collection/forms.py:17 xl_auth/templates/collections/home.html:29 +#: xl_auth/templates/collections/home.html:92 xl_auth/templates/users/profile.html:74 msgid "Code" msgstr "" @@ -41,8 +40,8 @@ msgstr "" #: tests/end2end/test_collection_editing.py:108 tests/end2end/test_collection_registering.py:105 #: xl_auth/collection/forms.py:18 xl_auth/oauth/client/forms.py:14 -#: xl_auth/templates/oauth/clients/home.html:18 xl_auth/templates/users/home.html:18 -#: xl_auth/templates/users/home.html:73 +#: xl_auth/templates/oauth/clients/home.html:18 xl_auth/templates/users/home.html:27 +#: xl_auth/templates/users/home.html:91 msgid "Name" msgstr "" @@ -53,14 +52,14 @@ msgstr "" #: tests/forms/test_client_register.py:48 tests/forms/test_client_register.py:71 #: tests/forms/test_client_register.py:94 tests/forms/test_client_register.py:105 #: tests/forms/test_collection_edit.py:20 tests/forms/test_collection_register.py:21 -#: tests/forms/test_permission_edit.py:40 tests/forms/test_permission_edit.py:49 -#: tests/forms/test_permission_register.py:18 tests/forms/test_permission_register.py:26 +#: tests/forms/test_permission_edit.py:49 tests/forms/test_permission_edit.py:67 +#: tests/forms/test_permission_register.py:26 tests/forms/test_permission_register.py:42 msgid "This field is required." msgstr "" #: tests/end2end/test_collection_editing.py:130 tests/end2end/test_collection_registering.py:128 -#: xl_auth/collection/forms.py:19 xl_auth/templates/collections/home.html:35 -#: xl_auth/templates/collections/home.html:102 xl_auth/templates/collections/home.html:166 +#: xl_auth/collection/forms.py:19 xl_auth/templates/collections/home.html:31 +#: xl_auth/templates/collections/home.html:94 msgid "Category" msgstr "" @@ -70,20 +69,20 @@ msgid "Not a valid choice" msgstr "" #: tests/end2end/test_collection_editing.py:146 tests/end2end/test_collection_view.py:43 -#: xl_auth/collection/views.py:60 xl_auth/collection/views.py:75 +#: xl_auth/collection/views.py:58 xl_auth/collection/views.py:73 #, python-format msgid "Collection code \"%(code)s\" does not exist" msgstr "" #: tests/end2end/test_collection_editing.py:164 tests/end2end/test_user_editing.py:212 -#: tests/end2end/test_user_editing.py:240 xl_auth/templates/collections/home.html:60 -#: xl_auth/templates/collections/home.html:127 xl_auth/templates/collections/view.html:121 +#: tests/end2end/test_user_editing.py:238 xl_auth/templates/collections/home.html:56 +#: xl_auth/templates/collections/home.html:119 xl_auth/templates/collections/view.html:121 #: xl_auth/templates/permissions/home.html:46 xl_auth/templates/users/view.html:107 msgid "Edit" msgstr "" #: tests/end2end/test_collection_registering.py:31 tests/end2end/test_collection_registering.py:174 -#: xl_auth/templates/collections/home.html:27 xl_auth/templates/collections/home.html:94 +#: xl_auth/templates/collections/home.html:23 xl_auth/templates/collections/home.html:86 msgid "New Collection" msgstr "" @@ -100,15 +99,12 @@ msgstr "" #: tests/end2end/test_collection_view.py:61 tests/end2end/test_collection_view.py:89 #: tests/end2end/test_collection_view.py:124 tests/end2end/test_collection_view.py:153 -#: tests/end2end/test_collection_view.py:184 tests/end2end/test_permission_deleting.py:26 -#: tests/end2end/test_permission_deleting.py:66 tests/end2end/test_permission_deleting.py:103 -#: tests/end2end/test_permission_editing.py:29 tests/end2end/test_permission_editing.py:156 -#: tests/end2end/test_permission_editing.py:185 tests/end2end/test_permission_registering.py:28 -#: tests/end2end/test_permission_registering.py:156 tests/end2end/test_permission_registering.py:185 -#: tests/end2end/test_user_editing.py:206 tests/end2end/test_user_view.py:73 -#: tests/end2end/test_user_view.py:99 xl_auth/templates/collections/view.html:70 -#: xl_auth/templates/nav.html:28 xl_auth/templates/permissions/home.html:4 -#: xl_auth/templates/users/inspect.html:66 xl_auth/templates/users/view.html:54 +#: tests/end2end/test_collection_view.py:184 tests/end2end/test_permission_deleting.py:67 +#: tests/end2end/test_permission_deleting.py:104 tests/end2end/test_permission_editing.py:188 +#: tests/end2end/test_permission_registering.py:188 tests/end2end/test_user_editing.py:206 +#: tests/end2end/test_user_view.py:73 tests/end2end/test_user_view.py:99 +#: xl_auth/templates/collections/view.html:70 xl_auth/templates/permissions/home.html:4 +#: xl_auth/templates/users/view.html:54 msgid "Permissions" msgstr "" @@ -136,64 +132,64 @@ msgstr "" msgid "New Client" msgstr "" -#: tests/end2end/test_permission_deleting.py:33 xl_auth/templates/permissions/delete.html:5 +#: tests/end2end/test_permission_deleting.py:34 xl_auth/templates/permissions/delete.html:5 msgid "Acknowledge Deletion" msgstr "" -#: tests/end2end/test_permission_deleting.py:34 xl_auth/templates/permissions/delete.html:7 +#: tests/end2end/test_permission_deleting.py:35 xl_auth/templates/permissions/delete.html:7 #, python-format msgid "Delete permission for \"%(username)s\" on collection \"%(code)s\"?" msgstr "" -#: tests/end2end/test_permission_deleting.py:43 tests/end2end/test_permission_deleting.py:83 -#: xl_auth/permission/views.py:113 +#: tests/end2end/test_permission_deleting.py:44 tests/end2end/test_permission_deleting.py:84 +#: xl_auth/permission/views.py:125 #, python-format msgid "Successfully deleted permissions for \"%(username)s\" on collection \"%(code)s\"." msgstr "" -#: tests/end2end/test_permission_deleting.py:117 tests/forms/test_client_edit.py:23 +#: tests/end2end/test_permission_deleting.py:118 tests/forms/test_client_edit.py:23 #: tests/forms/test_client_register.py:25 tests/forms/test_collection_edit.py:67 #: tests/forms/test_collection_register.py:79 tests/forms/test_permission_delete.py:50 -#: tests/forms/test_permission_edit.py:96 tests/forms/test_permission_register.py:66 +#: tests/forms/test_permission_edit.py:114 tests/forms/test_permission_register.py:82 #: tests/forms/test_user_administer.py:53 tests/forms/test_user_change_password.py:45 #: tests/forms/test_user_edit_details.py:34 tests/forms/test_user_register.py:44 #: xl_auth/collection/forms.py:41 xl_auth/collection/forms.py:73 xl_auth/oauth/client/forms.py:40 -#: xl_auth/oauth/client/forms.py:67 xl_auth/permission/forms.py:69 xl_auth/permission/forms.py:133 -#: xl_auth/permission/forms.py:154 xl_auth/permission/forms.py:206 xl_auth/user/forms.py:77 +#: xl_auth/oauth/client/forms.py:67 xl_auth/permission/forms.py:74 xl_auth/permission/forms.py:134 +#: xl_auth/permission/forms.py:157 xl_auth/permission/forms.py:209 xl_auth/user/forms.py:77 #: xl_auth/user/forms.py:126 xl_auth/user/forms.py:160 xl_auth/user/forms.py:179 msgid "You do not have sufficient privileges for this operation." msgstr "" -#: tests/end2end/test_permission_editing.py:43 tests/end2end/test_permission_editing.py:83 -#: tests/end2end/test_permission_editing.py:136 xl_auth/permission/views.py:82 +#: tests/end2end/test_permission_editing.py:44 tests/end2end/test_permission_editing.py:84 +#: tests/end2end/test_permission_editing.py:138 xl_auth/permission/views.py:90 #, python-format msgid "Updated permissions for \"%(username)s\" on collection \"%(code)s\"." msgstr "" -#: tests/end2end/test_permission_editing.py:112 tests/end2end/test_permission_registering.py:67 +#: tests/end2end/test_permission_editing.py:113 tests/end2end/test_permission_registering.py:68 #: tests/end2end/test_user_registering.py:27 tests/end2end/test_user_registering.py:64 #: tests/end2end/test_user_registering.py:102 tests/end2end/test_user_registering.py:142 #: xl_auth/templates/permissions/edit.html:17 xl_auth/templates/permissions/register.html:16 -#: xl_auth/templates/users/home.html:11 xl_auth/templates/users/profile.html:55 +#: xl_auth/templates/users/home.html:20 xl_auth/templates/users/profile.html:60 msgid "New User" msgstr "" -#: tests/end2end/test_permission_editing.py:167 tests/end2end/test_permission_registering.py:167 -#: tests/forms/test_permission_edit.py:60 tests/forms/test_permission_register.py:35 -#: xl_auth/permission/forms.py:89 xl_auth/permission/forms.py:170 +#: tests/end2end/test_permission_editing.py:170 tests/end2end/test_permission_registering.py:170 +#: tests/forms/test_permission_edit.py:78 tests/forms/test_permission_register.py:51 +#: xl_auth/permission/forms.py:94 xl_auth/permission/forms.py:173 #, python-format msgid "Permissions for user \"%(username)s\" on collection \"%(code)s\" already registered" msgstr "" -#: tests/end2end/test_permission_registering.py:30 tests/end2end/test_permission_registering.py:65 -#: tests/end2end/test_permission_registering.py:123 tests/end2end/test_permission_registering.py:158 +#: tests/end2end/test_permission_registering.py:31 tests/end2end/test_permission_registering.py:66 +#: tests/end2end/test_permission_registering.py:125 tests/end2end/test_permission_registering.py:161 #: xl_auth/templates/collections/view.html:81 xl_auth/templates/permissions/home.html:11 #: xl_auth/templates/users/view.html:62 msgid "New Permission" msgstr "" -#: tests/end2end/test_permission_registering.py:41 tests/end2end/test_permission_registering.py:92 -#: tests/end2end/test_permission_registering.py:137 xl_auth/permission/views.py:52 +#: tests/end2end/test_permission_registering.py:42 tests/end2end/test_permission_registering.py:94 +#: tests/end2end/test_permission_registering.py:139 xl_auth/permission/views.py:58 #, python-format msgid "Added permissions for \"%(username)s\" on collection \"%(code)s\"." msgstr "" @@ -203,8 +199,8 @@ msgid "Approve ToS" msgstr "" #: tests/end2end/test_public_logging_in.py:54 xl_auth/templates/collections/home.html:4 -#: xl_auth/templates/nav.html:25 xl_auth/templates/users/home.html:19 -#: xl_auth/templates/users/home.html:74 +#: xl_auth/templates/nav.html:25 xl_auth/templates/users/home.html:28 +#: xl_auth/templates/users/home.html:92 xl_auth/templates/users/inspect.html:175 msgid "Collections" msgstr "" @@ -248,9 +244,8 @@ msgstr "" #: tests/end2end/test_user_editing.py:27 tests/end2end/test_user_editing.py:77 #: tests/end2end/test_user_inspection.py:23 tests/end2end/test_user_registering.py:25 #: tests/end2end/test_user_registering.py:62 tests/end2end/test_user_registering.py:179 -#: xl_auth/templates/collections/home.html:36 xl_auth/templates/collections/home.html:103 -#: xl_auth/templates/collections/home.html:167 xl_auth/templates/nav.html:27 -#: xl_auth/templates/users/home.html:4 +#: xl_auth/templates/collections/home.html:32 xl_auth/templates/collections/home.html:95 +#: xl_auth/templates/nav.html:27 xl_auth/templates/users/home.html:4 msgid "Users" msgstr "" @@ -258,17 +253,20 @@ msgstr "" #: xl_auth/templates/collections/view.html:106 xl_auth/templates/collections/view.html:109 #: xl_auth/templates/collections/view.html:112 xl_auth/templates/permissions/home.html:41 #: xl_auth/templates/permissions/home.html:42 xl_auth/templates/permissions/home.html:43 -#: xl_auth/templates/users/home.html:38 xl_auth/templates/users/home.html:93 -#: xl_auth/templates/users/inspect.html:15 xl_auth/templates/users/inspect.html:18 -#: xl_auth/templates/users/inspect.html:21 xl_auth/templates/users/inspect.html:88 -#: xl_auth/templates/users/inspect.html:91 xl_auth/templates/users/inspect.html:94 -#: xl_auth/templates/users/inspect.html:97 xl_auth/templates/users/inspect.html:128 -#: xl_auth/templates/users/inspect.html:162 xl_auth/templates/users/profile.html:87 -#: xl_auth/templates/users/profile.html:90 xl_auth/templates/users/profile.html:93 -#: xl_auth/templates/users/simple_view.html:12 xl_auth/templates/users/view.html:31 -#: xl_auth/templates/users/view.html:34 xl_auth/templates/users/view.html:37 -#: xl_auth/templates/users/view.html:88 xl_auth/templates/users/view.html:91 -#: xl_auth/templates/users/view.html:94 xl_auth/templates/users/view.html:97 +#: xl_auth/templates/users/home.html:47 xl_auth/templates/users/home.html:111 +#: xl_auth/templates/users/inspect.html:18 xl_auth/templates/users/inspect.html:21 +#: xl_auth/templates/users/inspect.html:24 xl_auth/templates/users/inspect.html:91 +#: xl_auth/templates/users/inspect.html:94 xl_auth/templates/users/inspect.html:97 +#: xl_auth/templates/users/inspect.html:100 xl_auth/templates/users/inspect.html:145 +#: xl_auth/templates/users/inspect.html:148 xl_auth/templates/users/inspect.html:151 +#: xl_auth/templates/users/inspect.html:192 xl_auth/templates/users/inspect.html:195 +#: xl_auth/templates/users/inspect.html:228 xl_auth/templates/users/inspect.html:262 +#: xl_auth/templates/users/profile.html:92 xl_auth/templates/users/profile.html:95 +#: xl_auth/templates/users/profile.html:98 xl_auth/templates/users/simple_view.html:12 +#: xl_auth/templates/users/view.html:31 xl_auth/templates/users/view.html:34 +#: xl_auth/templates/users/view.html:37 xl_auth/templates/users/view.html:88 +#: xl_auth/templates/users/view.html:91 xl_auth/templates/users/view.html:94 +#: xl_auth/templates/users/view.html:97 msgid "Yes" msgstr "" @@ -276,23 +274,27 @@ msgstr "" #: xl_auth/templates/collections/view.html:106 xl_auth/templates/collections/view.html:109 #: xl_auth/templates/collections/view.html:112 xl_auth/templates/permissions/home.html:41 #: xl_auth/templates/permissions/home.html:42 xl_auth/templates/permissions/home.html:43 -#: xl_auth/templates/users/home.html:38 xl_auth/templates/users/home.html:93 -#: xl_auth/templates/users/inspect.html:15 xl_auth/templates/users/inspect.html:18 -#: xl_auth/templates/users/inspect.html:21 xl_auth/templates/users/inspect.html:88 -#: xl_auth/templates/users/inspect.html:91 xl_auth/templates/users/inspect.html:94 -#: xl_auth/templates/users/inspect.html:97 xl_auth/templates/users/inspect.html:128 -#: xl_auth/templates/users/inspect.html:162 xl_auth/templates/users/profile.html:87 -#: xl_auth/templates/users/profile.html:90 xl_auth/templates/users/profile.html:93 -#: xl_auth/templates/users/simple_view.html:12 xl_auth/templates/users/view.html:31 -#: xl_auth/templates/users/view.html:34 xl_auth/templates/users/view.html:37 -#: xl_auth/templates/users/view.html:88 xl_auth/templates/users/view.html:91 -#: xl_auth/templates/users/view.html:94 xl_auth/templates/users/view.html:97 +#: xl_auth/templates/users/home.html:47 xl_auth/templates/users/home.html:111 +#: xl_auth/templates/users/inspect.html:18 xl_auth/templates/users/inspect.html:21 +#: xl_auth/templates/users/inspect.html:24 xl_auth/templates/users/inspect.html:91 +#: xl_auth/templates/users/inspect.html:94 xl_auth/templates/users/inspect.html:97 +#: xl_auth/templates/users/inspect.html:100 xl_auth/templates/users/inspect.html:145 +#: xl_auth/templates/users/inspect.html:148 xl_auth/templates/users/inspect.html:151 +#: xl_auth/templates/users/inspect.html:192 xl_auth/templates/users/inspect.html:195 +#: xl_auth/templates/users/inspect.html:228 xl_auth/templates/users/inspect.html:262 +#: xl_auth/templates/users/profile.html:92 xl_auth/templates/users/profile.html:95 +#: xl_auth/templates/users/profile.html:98 xl_auth/templates/users/simple_view.html:12 +#: xl_auth/templates/users/view.html:31 xl_auth/templates/users/view.html:34 +#: xl_auth/templates/users/view.html:37 xl_auth/templates/users/view.html:88 +#: xl_auth/templates/users/view.html:91 xl_auth/templates/users/view.html:94 +#: xl_auth/templates/users/view.html:97 msgid "No" msgstr "" #: tests/end2end/test_user_editing.py:124 tests/end2end/test_user_editing.py:148 -#: xl_auth/public/forms.py:53 xl_auth/public/forms.py:74 xl_auth/templates/users/home.html:17 -#: xl_auth/templates/users/home.html:72 xl_auth/user/forms.py:13 +#: xl_auth/public/forms.py:53 xl_auth/public/forms.py:74 xl_auth/templates/users/home.html:26 +#: xl_auth/templates/users/home.html:90 xl_auth/templates/users/inspect.html:124 +#: xl_auth/templates/users/inspect.html:174 xl_auth/user/forms.py:13 msgid "Email" msgstr "" @@ -310,30 +312,25 @@ msgstr "" #: tests/end2end/test_user_editing.py:187 tests/end2end/test_user_editing.py:191 #: tests/end2end/test_user_inspection.py:63 tests/end2end/test_user_view.py:49 -#: tests/forms/test_permission_edit.py:72 tests/forms/test_permission_register.py:46 -#: xl_auth/permission/forms.py:50 xl_auth/user/views.py:91 xl_auth/user/views.py:110 -#: xl_auth/user/views.py:145 xl_auth/user/views.py:173 xl_auth/user/views.py:198 +#: tests/forms/test_permission_edit.py:90 tests/forms/test_permission_register.py:62 +#: xl_auth/permission/forms.py:53 xl_auth/user/views.py:92 xl_auth/user/views.py:111 +#: xl_auth/user/views.py:157 xl_auth/user/views.py:185 xl_auth/user/views.py:210 #, python-format msgid "User ID \"%(user_id)s\" does not exist" msgstr "" -#: tests/end2end/test_user_editing.py:213 xl_auth/templates/users/home.html:52 -#: xl_auth/templates/users/home.html:106 xl_auth/templates/users/profile.html:17 +#: tests/end2end/test_user_editing.py:213 xl_auth/templates/users/home.html:61 +#: xl_auth/templates/users/home.html:124 xl_auth/templates/users/profile.html:22 msgid "Change Password" msgstr "" -#: tests/end2end/test_user_editing.py:237 tests/end2end/test_user_editing.py:257 -#: tests/end2end/test_user_editing.py:258 xl_auth/templates/users/profile.html:6 -msgid "Welcome" -msgstr "" - #: tests/end2end/test_user_inspection.py:28 xl_auth/templates/users/inspect.html:4 #, python-format msgid "Inspect User '%(email)s'" msgstr "" #: tests/end2end/test_user_registering.py:100 tests/end2end/test_user_registering.py:140 -#: xl_auth/templates/users/profile.html:42 +#: xl_auth/templates/users/profile.html:47 msgid "Your Responsibilities as Cataloging Admin" msgstr "" @@ -373,8 +370,8 @@ msgid "Field must be between 1 and 5 characters long." msgstr "" #: tests/forms/test_permission_delete.py:20 tests/forms/test_permission_edit.py:20 -#: xl_auth/permission/forms.py:123 xl_auth/permission/forms.py:210 xl_auth/permission/views.py:74 -#: xl_auth/permission/views.py:104 +#: xl_auth/permission/forms.py:128 xl_auth/permission/forms.py:213 xl_auth/permission/views.py:82 +#: xl_auth/permission/views.py:116 #, python-format msgid "Permission ID \"%(permission_id)s\" does not exist" msgstr "" @@ -385,14 +382,24 @@ msgstr "" msgid "Invalid value, must be one of: %(values)s." msgstr "" -#: tests/forms/test_permission_edit.py:83 tests/forms/test_permission_register.py:56 -#: xl_auth/permission/forms.py:71 xl_auth/permission/forms.py:128 xl_auth/permission/forms.py:140 +#: tests/forms/test_permission_edit.py:40 tests/forms/test_permission_register.py:18 +#: xl_auth/permission/forms.py:51 +msgid "A user must be selected." +msgstr "" + +#: tests/forms/test_permission_edit.py:58 tests/forms/test_permission_register.py:34 +#: xl_auth/permission/forms.py:68 xl_auth/permission/forms.py:141 +msgid "A collection must be selected." +msgstr "" + +#: tests/forms/test_permission_edit.py:101 tests/forms/test_permission_register.py:72 +#: xl_auth/permission/forms.py:76 xl_auth/permission/forms.py:143 #, python-format msgid "Collection ID \"%(collection_id)s\" does not exist" msgstr "" -#: tests/forms/test_permission_edit.py:117 tests/forms/test_permission_register.py:79 -#: xl_auth/permission/forms.py:78 xl_auth/permission/forms.py:160 +#: tests/forms/test_permission_edit.py:135 tests/forms/test_permission_register.py:95 +#: xl_auth/permission/forms.py:83 xl_auth/permission/forms.py:163 msgid "Cataloging admin rights can only be granted by system admins." msgstr "" @@ -441,11 +448,11 @@ msgstr "" msgid "Library" msgstr "" -#: xl_auth/collection/views.py:46 +#: xl_auth/collection/views.py:44 msgid "Thank you for registering a new collection." msgstr "" -#: xl_auth/collection/views.py:83 +#: xl_auth/collection/views.py:81 #, python-format msgid "Thank you for editing collection \"%(code)s\"." msgstr "" @@ -502,29 +509,40 @@ msgid "User" msgstr "" #: xl_auth/permission/forms.py:20 xl_auth/templates/permissions/home.html:18 -#: xl_auth/templates/users/inspect.html:71 xl_auth/templates/users/view.html:69 +#: xl_auth/templates/users/inspect.html:74 xl_auth/templates/users/inspect.html:123 +#: xl_auth/templates/users/view.html:69 msgid "Collection" msgstr "" #: xl_auth/permission/forms.py:22 xl_auth/templates/collections/view.html:89 -#: xl_auth/templates/permissions/home.html:19 xl_auth/templates/users/inspect.html:72 -#: xl_auth/templates/users/profile.html:71 xl_auth/templates/users/view.html:70 +#: xl_auth/templates/permissions/home.html:19 xl_auth/templates/users/inspect.html:75 +#: xl_auth/templates/users/inspect.html:125 xl_auth/templates/users/profile.html:76 +#: xl_auth/templates/users/view.html:70 msgid "Registrant" msgstr "" #: xl_auth/permission/forms.py:23 xl_auth/templates/collections/view.html:90 -#: xl_auth/templates/permissions/home.html:20 xl_auth/templates/users/inspect.html:73 -#: xl_auth/templates/users/profile.html:72 xl_auth/templates/users/view.html:71 +#: xl_auth/templates/permissions/home.html:20 xl_auth/templates/users/inspect.html:76 +#: xl_auth/templates/users/inspect.html:126 xl_auth/templates/users/profile.html:77 +#: xl_auth/templates/users/view.html:71 msgid "Cataloger" msgstr "" #: xl_auth/permission/forms.py:24 xl_auth/templates/collections/view.html:91 -#: xl_auth/templates/permissions/home.html:21 xl_auth/templates/users/inspect.html:20 -#: xl_auth/templates/users/inspect.html:74 xl_auth/templates/users/profile.html:73 +#: xl_auth/templates/permissions/home.html:21 xl_auth/templates/users/inspect.html:23 +#: xl_auth/templates/users/inspect.html:77 xl_auth/templates/users/profile.html:78 #: xl_auth/templates/users/view.html:36 xl_auth/templates/users/view.html:72 msgid "Cataloging Admin" msgstr "" +#: xl_auth/permission/forms.py:31 +msgid "--- Select User ---" +msgstr "" + +#: xl_auth/permission/forms.py:34 +msgid "--- Select Collection ---" +msgstr "" + #: xl_auth/public/forms.py:19 xl_auth/templates/public/home.html:39 msgid "Username" msgstr "" @@ -589,7 +607,7 @@ msgstr "" msgid "xl_auth" msgstr "" -#: xl_auth/templates/nav.html:39 +#: xl_auth/templates/nav.html:38 msgid "Log out" msgstr "" @@ -604,53 +622,43 @@ msgstr "" msgid "Save" msgstr "" -#: xl_auth/templates/collections/home.html:6 xl_auth/templates/collections/home.html:73 -#: xl_auth/templates/collections/home.html:140 xl_auth/templates/collections/home.html:197 +#: xl_auth/templates/collections/home.html:6 xl_auth/templates/collections/home.html:69 +#: xl_auth/templates/collections/home.html:131 xl_auth/templates/users/home.html:6 +#: xl_auth/templates/users/home.html:74 msgid "Go to" msgstr "" -#: xl_auth/templates/collections/home.html:9 xl_auth/templates/collections/home.html:89 -#: xl_auth/templates/collections/home.html:147 +#: xl_auth/templates/collections/home.html:9 xl_auth/templates/collections/home.html:81 msgid "Active Collections without Users" msgstr "" -#: xl_auth/templates/collections/home.html:13 xl_auth/templates/collections/home.html:80 -#: xl_auth/templates/collections/home.html:156 -msgid "Inactive Collections" -msgstr "" - -#: xl_auth/templates/collections/home.html:22 xl_auth/templates/collections/home.html:76 -#: xl_auth/templates/collections/home.html:143 +#: xl_auth/templates/collections/home.html:18 xl_auth/templates/collections/home.html:72 msgid "Active Collections with Users" msgstr "" -#: xl_auth/templates/collections/home.html:34 xl_auth/templates/collections/home.html:101 -#: xl_auth/templates/collections/home.html:164 xl_auth/templates/users/profile.html:70 +#: xl_auth/templates/collections/home.html:30 xl_auth/templates/collections/home.html:93 +#: xl_auth/templates/users/profile.html:75 msgid "Friendly Name" msgstr "" -#: xl_auth/templates/collections/home.html:37 xl_auth/templates/collections/home.html:104 -#: xl_auth/templates/collections/home.html:168 xl_auth/templates/collections/view.html:56 -#: xl_auth/templates/collections/view.html:92 xl_auth/templates/permissions/home.html:22 -#: xl_auth/templates/users/home.html:22 xl_auth/templates/users/home.html:77 -#: xl_auth/templates/users/inspect.html:55 xl_auth/templates/users/inspect.html:120 -#: xl_auth/templates/users/view.html:22 +#: xl_auth/templates/collections/home.html:33 xl_auth/templates/collections/home.html:96 +#: xl_auth/templates/collections/view.html:56 xl_auth/templates/collections/view.html:92 +#: xl_auth/templates/permissions/home.html:22 xl_auth/templates/users/home.html:31 +#: xl_auth/templates/users/home.html:95 xl_auth/templates/users/inspect.html:58 +#: xl_auth/templates/users/inspect.html:128 xl_auth/templates/users/inspect.html:179 +#: xl_auth/templates/users/inspect.html:220 xl_auth/templates/users/view.html:22 msgid "Created At" msgstr "" -#: xl_auth/templates/collections/home.html:49 xl_auth/templates/collections/home.html:116 -#: xl_auth/templates/collections/home.html:175 xl_auth/templates/collections/view.html:14 -#: xl_auth/templates/collections/view.html:26 xl_auth/templates/permissions/home.html:30 -#: xl_auth/templates/permissions/home.html:36 xl_auth/templates/users/home.html:32 -#: xl_auth/templates/users/home.html:87 xl_auth/templates/users/profile.html:80 +#: xl_auth/templates/collections/home.html:45 xl_auth/templates/collections/home.html:108 +#: xl_auth/templates/collections/view.html:14 xl_auth/templates/collections/view.html:26 +#: xl_auth/templates/permissions/home.html:30 xl_auth/templates/permissions/home.html:36 +#: xl_auth/templates/users/home.html:41 xl_auth/templates/users/home.html:105 +#: xl_auth/templates/users/profile.html:85 msgid "View" msgstr "" -#: xl_auth/templates/collections/home.html:165 xl_auth/templates/collections/view.html:23 -msgid "Replaced By" -msgstr "" - -#: xl_auth/templates/collections/home.html:197 +#: xl_auth/templates/collections/home.html:131 msgid "Top of page" msgstr "" @@ -663,8 +671,8 @@ msgstr "" msgid "Register" msgstr "" -#: xl_auth/templates/collections/view.html:8 xl_auth/templates/users/inspect.html:117 -#: xl_auth/templates/users/inspect.html:149 xl_auth/user/forms.py:141 +#: xl_auth/templates/collections/view.html:8 xl_auth/templates/users/inspect.html:217 +#: xl_auth/templates/users/inspect.html:249 xl_auth/user/forms.py:141 msgid "Active" msgstr "" @@ -672,6 +680,10 @@ msgstr "" msgid "Replaces" msgstr "" +#: xl_auth/templates/collections/view.html:23 +msgid "Replaced By" +msgstr "" + #: xl_auth/templates/collections/view.html:40 msgid " and " msgstr "" @@ -680,15 +692,16 @@ msgstr "" msgid "None registered, please contact libris@kb.se to create one." msgstr "" -#: xl_auth/templates/collections/view.html:48 xl_auth/templates/users/inspect.html:47 -#: xl_auth/templates/users/inspect.html:76 xl_auth/templates/users/inspect.html:119 +#: xl_auth/templates/collections/view.html:48 xl_auth/templates/users/inspect.html:50 +#: xl_auth/templates/users/inspect.html:79 xl_auth/templates/users/inspect.html:219 #: xl_auth/templates/users/view.html:14 xl_auth/templates/users/view.html:74 msgid "Last Modified" msgstr "" #: xl_auth/templates/collections/view.html:50 xl_auth/templates/collections/view.html:58 -#: xl_auth/templates/collections/view.html:114 xl_auth/templates/users/inspect.html:49 -#: xl_auth/templates/users/inspect.html:57 xl_auth/templates/users/inspect.html:99 +#: xl_auth/templates/collections/view.html:114 xl_auth/templates/users/inspect.html:52 +#: xl_auth/templates/users/inspect.html:60 xl_auth/templates/users/inspect.html:103 +#: xl_auth/templates/users/inspect.html:154 xl_auth/templates/users/inspect.html:199 #: xl_auth/templates/users/view.html:16 xl_auth/templates/users/view.html:24 #: xl_auth/templates/users/view.html:99 msgid "by" @@ -729,7 +742,7 @@ msgid "OAuth2 Client Credentials" msgstr "" #: xl_auth/templates/oauth/clients/edit.html:12 xl_auth/templates/oauth/clients/home.html:17 -#: xl_auth/templates/users/inspect.html:146 +#: xl_auth/templates/users/inspect.html:246 msgid "Client ID" msgstr "" @@ -771,17 +784,17 @@ msgid "OAuth2 Grant Tokens" msgstr "" #: xl_auth/templates/oauth/grants/home.html:13 xl_auth/templates/oauth/tokens/home.html:13 -#: xl_auth/templates/users/inspect.html:145 +#: xl_auth/templates/users/inspect.html:245 msgid "ID" msgstr "" #: xl_auth/templates/oauth/grants/home.html:15 xl_auth/templates/oauth/tokens/home.html:15 -#: xl_auth/templates/users/inspect.html:147 +#: xl_auth/templates/users/inspect.html:247 msgid "Client" msgstr "" #: xl_auth/templates/oauth/grants/home.html:16 xl_auth/templates/oauth/tokens/home.html:16 -#: xl_auth/templates/users/inspect.html:118 xl_auth/templates/users/inspect.html:150 +#: xl_auth/templates/users/inspect.html:218 xl_auth/templates/users/inspect.html:250 msgid "Expires At" msgstr "" @@ -790,11 +803,11 @@ msgid "Delete Grant" msgstr "" #: xl_auth/templates/oauth/tokens/home.html:4 xl_auth/templates/oauth/tokens/home.html:8 -#: xl_auth/templates/users/inspect.html:140 +#: xl_auth/templates/users/inspect.html:240 msgid "OAuth2 Bearer Tokens" msgstr "" -#: xl_auth/templates/oauth/tokens/home.html:28 xl_auth/templates/users/inspect.html:166 +#: xl_auth/templates/oauth/tokens/home.html:28 xl_auth/templates/users/inspect.html:266 msgid "Delete Token" msgstr "" @@ -931,108 +944,134 @@ msgstr "" msgid "Change User Password" msgstr "" -#: xl_auth/templates/users/home.html:8 +#: xl_auth/templates/users/home.html:9 xl_auth/templates/users/home.html:85 +msgid "Inactive Users" +msgstr "" + +#: xl_auth/templates/users/home.html:17 xl_auth/templates/users/home.html:77 msgid "Active Users" msgstr "" -#: xl_auth/templates/users/home.html:20 xl_auth/templates/users/home.html:75 +#: xl_auth/templates/users/home.html:29 xl_auth/templates/users/home.html:93 +#: xl_auth/templates/users/inspect.html:177 msgid "Admin" msgstr "" -#: xl_auth/templates/users/home.html:21 xl_auth/templates/users/home.html:76 -#: xl_auth/templates/users/inspect.html:11 xl_auth/templates/users/view.html:11 +#: xl_auth/templates/users/home.html:30 xl_auth/templates/users/home.html:94 +#: xl_auth/templates/users/inspect.html:11 xl_auth/templates/users/inspect.html:178 +#: xl_auth/templates/users/view.html:11 msgid "Last Login At" msgstr "" -#: xl_auth/templates/users/home.html:43 xl_auth/templates/users/home.html:98 +#: xl_auth/templates/users/home.html:52 xl_auth/templates/users/home.html:116 msgid "Inspect" msgstr "" -#: xl_auth/templates/users/home.html:47 xl_auth/templates/users/home.html:102 +#: xl_auth/templates/users/home.html:56 xl_auth/templates/users/home.html:120 msgid "Edit Details" msgstr "" -#: xl_auth/templates/users/home.html:67 -msgid "Inactive Users" +#: xl_auth/templates/users/inspect.html:14 xl_auth/user/forms.py:20 +msgid "ToS Approved" msgstr "" -#: xl_auth/templates/users/inspect.html:14 xl_auth/templates/users/simple_view.html:11 +#: xl_auth/templates/users/inspect.html:17 xl_auth/templates/users/simple_view.html:11 #: xl_auth/templates/users/view.html:30 msgid "Active Account" msgstr "" -#: xl_auth/templates/users/inspect.html:17 xl_auth/templates/users/view.html:33 +#: xl_auth/templates/users/inspect.html:20 xl_auth/templates/users/view.html:33 #: xl_auth/user/forms.py:142 msgid "System Administrator" msgstr "" -#: xl_auth/templates/users/inspect.html:23 +#: xl_auth/templates/users/inspect.html:26 msgid "Users Created" msgstr "" -#: xl_auth/templates/users/inspect.html:26 +#: xl_auth/templates/users/inspect.html:29 msgid "Users Modified" msgstr "" -#: xl_auth/templates/users/inspect.html:29 +#: xl_auth/templates/users/inspect.html:32 msgid "Permissions Created" msgstr "" -#: xl_auth/templates/users/inspect.html:32 +#: xl_auth/templates/users/inspect.html:35 msgid "Permissions Modified" msgstr "" -#: xl_auth/templates/users/inspect.html:35 +#: xl_auth/templates/users/inspect.html:38 msgid "Collections Created" msgstr "" -#: xl_auth/templates/users/inspect.html:38 +#: xl_auth/templates/users/inspect.html:41 msgid "Collections Modified" msgstr "" -#: xl_auth/templates/users/inspect.html:41 +#: xl_auth/templates/users/inspect.html:44 msgid "Clients Created" msgstr "" -#: xl_auth/templates/users/inspect.html:44 +#: xl_auth/templates/users/inspect.html:47 msgid "Clients Modified" msgstr "" -#: xl_auth/templates/users/inspect.html:75 xl_auth/templates/users/view.html:73 +#: xl_auth/templates/users/inspect.html:69 +msgid "Own Permissions" +msgstr "" + +#: xl_auth/templates/users/inspect.html:78 xl_auth/templates/users/view.html:73 msgid "Active Collection" msgstr "" -#: xl_auth/templates/users/inspect.html:111 +#: xl_auth/templates/users/inspect.html:116 +msgid "Permissions Created or Modified by This User" +msgstr "" + +#: xl_auth/templates/users/inspect.html:127 xl_auth/templates/users/inspect.html:176 +msgid "CatAdm" +msgstr "" + +#: xl_auth/templates/users/inspect.html:167 +msgid "Users Created or Modified by This One" +msgstr "" + +#: xl_auth/templates/users/inspect.html:211 msgid "Password Resets" msgstr "" -#: xl_auth/templates/users/inspect.html:116 +#: xl_auth/templates/users/inspect.html:216 msgid "Reset Code" msgstr "" -#: xl_auth/templates/users/inspect.html:148 +#: xl_auth/templates/users/inspect.html:248 msgid "Access Token" msgstr "" -#: xl_auth/templates/users/profile.html:9 -msgid "This is your personal profile page." +#: xl_auth/templates/users/profile.html:7 +msgid "Welcome" msgstr "" #: xl_auth/templates/users/profile.html:14 +msgid "This is your personal profile page." +msgstr "" + +#: xl_auth/templates/users/profile.html:19 msgid "Edit Display Name" msgstr "" -#: xl_auth/templates/users/profile.html:25 +#: xl_auth/templates/users/profile.html:30 msgid "Information About Your Permissions" msgstr "" -#: xl_auth/templates/users/profile.html:28 +#: xl_auth/templates/users/profile.html:33 msgid "" "If you are missing a permission or any of the permissions below are incorrect, please contact the" " cataloging admin for that collection." msgstr "" -#: xl_auth/templates/users/profile.html:30 +#: xl_auth/templates/users/profile.html:35 #, python-format msgid "" "You can find the collection administrator contact information by following the collection link " @@ -1040,26 +1079,26 @@ msgid "" " the collection there." msgstr "" -#: xl_auth/templates/users/profile.html:33 +#: xl_auth/templates/users/profile.html:38 msgid "" "For any other questions or concerns, please contact customer service at libris@kb.se." msgstr "" -#: xl_auth/templates/users/profile.html:46 +#: xl_auth/templates/users/profile.html:51 msgid "" "You are a cataloging admin in Libris Login. This means that you are responsible for managing " "other users' access to your collections. You manage permissions by going to your collection's " "detail view and use the add/edit/delete buttons." msgstr "" -#: xl_auth/templates/users/profile.html:52 +#: xl_auth/templates/users/profile.html:57 msgid "" "When attempting to grant a new permission, you might find that the intended user does not exist. " "In this event, you may register the user account by following this link:" msgstr "" -#: xl_auth/templates/users/profile.html:63 +#: xl_auth/templates/users/profile.html:68 msgid "Your Permissions" msgstr "" @@ -1075,10 +1114,6 @@ msgstr "" msgid "Cataloging Admin for" msgstr "" -#: xl_auth/user/forms.py:20 -msgid "ToS Approved" -msgstr "" - #: xl_auth/user/forms.py:54 msgid "Send password reset email" msgstr "" @@ -1113,26 +1148,26 @@ msgid "" "href=\"mailto:libris@kb.se\">libris@kb.se!

" msgstr "" -#: xl_auth/user/views.py:39 +#: xl_auth/user/views.py:40 msgid "ToS approved." msgstr "" -#: xl_auth/user/views.py:72 +#: xl_auth/user/views.py:73 #, python-format msgid "User \"%(username)s\" registered and emailed with a password reset link." msgstr "" -#: xl_auth/user/views.py:76 +#: xl_auth/user/views.py:77 #, python-format msgid "User \"%(username)s\" registered." msgstr "" -#: xl_auth/user/views.py:154 xl_auth/user/views.py:179 +#: xl_auth/user/views.py:166 xl_auth/user/views.py:191 #, python-format msgid "Thank you for updating user details for \"%(username)s\"." msgstr "" -#: xl_auth/user/views.py:205 +#: xl_auth/user/views.py:217 #, python-format msgid "Thank you for changing password for \"%(username)s\"." msgstr "" diff --git a/package-lock.json b/package-lock.json index 1bb1b888..9b7101ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "xl_auth", - "version": "0.7.2", + "version": "0.7.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5d303560..7c8d009d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xl_auth", - "version": "0.7.2", + "version": "0.7.3", "author": "National Library of Sweden", "license": "Apache-2.0", "description": "Authorization and OAuth2 provider for LibrisXL", diff --git a/tests/end2end/test_permission_editing.py b/tests/end2end/test_permission_editing.py index 88eae0e6..e39a9e5f 100644 --- a/tests/end2end/test_permission_editing.py +++ b/tests/end2end/test_permission_editing.py @@ -120,13 +120,14 @@ def test_cataloging_admin_can_edit_permission_from_user_view(user, permission, s assert res.status_code == 302 assert url_for('permission.edit', permission_id=permission.id) in res.location other_user = User.get_by_email('other_user@ub.uu.se') - # Fills out the form to grant 'other_user' permissions on 'collection' - res = res.follow() + assert other_user is not None + # Saves the form to grant 'other_user' permissions on 'collection' + res = res.follow(headers={'Referer': res.request.referrer}) # FIXME: Webtest dropping referer. assert res.status_code == 200 # Fills out the form, by changing to 'other_user'' form = res.forms['editPermissionForm'] + # New user is preset, ``form['user_id'] = other_user.id`` is redundant # Defaults are kept, setting ``form['collection_id'] = permission.collection.id`` is redundant - form['user_id'] = other_user.id # Submits res = form.submit() assert res.status_code == 302 diff --git a/tests/end2end/test_permission_registering.py b/tests/end2end/test_permission_registering.py index 4db596a0..3aad1546 100644 --- a/tests/end2end/test_permission_registering.py +++ b/tests/end2end/test_permission_registering.py @@ -75,11 +75,12 @@ def test_cataloging_admin_can_register_permission_from_collection_view(user, col assert res.status_code == 302 assert url_for('permission.register', collection_id=collection.id) in res.location other_user = User.get_by_email('my_registrant@su.se') - # Fills out the form to grant 'other_user' permissions on 'collection' - res = res.follow() + assert other_user is not None + # Saves the form to grant 'other_user' permissions on 'collection' + res = res.follow(headers={'Referer': res.request.referrer}) # FIXME: Webtest dropping referer. assert res.status_code == 200 register_permission_form = res.forms['registerPermissionForm'] - register_permission_form['user_id'] = other_user.id + # New user is preset, ``register_permission_form['user_id'] = other_user.id`` is redundant # Defaults are kept, ``register_permission_form['collection_id'] = collection.id`` is redundant register_permission_form['registrant'].checked = True register_permission_form['cataloger'].checked = True diff --git a/tests/forms/test_permission_edit.py b/tests/forms/test_permission_edit.py index ff40c7b5..dca05b54 100644 --- a/tests/forms/test_permission_edit.py +++ b/tests/forms/test_permission_edit.py @@ -31,6 +31,15 @@ def test_validate_inconsistent_permission_id(permission, superuser): form.permission_id.errors +def test_validate_with_placeholder_user_id(superuser, permission): + """Attempt editing entry with the placeholder ID.""" + form = EditForm(superuser, permission.id, permission_id=permission.id, + user_id='-1', collection_id=permission.collection.id) + + assert form.validate() is False + assert _('A user must be selected.') in form.user_id.errors + + def test_validate_without_user_id(superuser, permission): """Attempt editing entry with empty string for user ID.""" form = EditForm(superuser, permission.id, permission_id=permission.id, @@ -40,6 +49,15 @@ def test_validate_without_user_id(superuser, permission): assert _('This field is required.') in form.user_id.errors +def test_validate_with_placeholder_collection_id(superuser, permission): + """Attempt editing entry with the placeholder ID.""" + form = EditForm(superuser, permission.id, permission_id=permission.id, + user_id=permission.user.id, collection_id='-1') + + assert form.validate() is False + assert _('A collection must be selected.') in form.collection_id.errors + + def test_validate_without_collection_id(superuser, permission): """Attempt editing entry with empty string for collection ID.""" form = EditForm(superuser, permission.id, permission_id=permission.id, diff --git a/tests/forms/test_permission_register.py b/tests/forms/test_permission_register.py index 6a209434..2460208f 100644 --- a/tests/forms/test_permission_register.py +++ b/tests/forms/test_permission_register.py @@ -10,6 +10,14 @@ from ..factories import PermissionFactory, UserFactory +def test_validate_with_placeholder_user_id(superuser, collection): + """Attempt registering entry with the placeholder ID.""" + form = RegisterForm(superuser, user_id='-1', collection_id=collection.id) + + assert form.validate() is False + assert _('A user must be selected.') in form.user_id.errors + + def test_validate_without_user_id(superuser, collection): """Attempt registering entry with empty string for user ID.""" form = RegisterForm(superuser, user_id='', collection_id=collection.id) @@ -18,6 +26,14 @@ def test_validate_without_user_id(superuser, collection): assert _('This field is required.') in form.user_id.errors +def test_validate_with_placeholder_collection_id(superuser, user): + """Attempt registering entry with the placeholder ID.""" + form = RegisterForm(superuser, user_id=user.id, collection_id='-1') + + assert form.validate() is False + assert _('A collection must be selected.') in form.collection_id.errors + + def test_validate_without_collection_id(superuser, user): """Attempt registering entry with empty string for collection ID.""" form = RegisterForm(superuser, user_id=user.id, collection_id='') diff --git a/xl_auth/permission/forms.py b/xl_auth/permission/forms.py index 1b113ccc..ba5b95b9 100644 --- a/xl_auth/permission/forms.py +++ b/xl_auth/permission/forms.py @@ -28,16 +28,17 @@ def __init__(self, current_user, *args, **kwargs): """Create instance.""" super(PermissionForm, self).__init__(*args, **kwargs) self.current_user = current_user - self.user_id.choices = [(user.id, user.email) - for user in User.query.order_by('email').all()] + self.user_id.choices = [(-1, _('--- Select User ---'))] + [ + (user.id, user.email) for user in User.query.order_by('email').all()] + self.collection_id.choices = [(-1, _('--- Select Collection ---'))] if current_user.is_admin: - self.collection_id.choices = [ + self.collection_id.choices += [ (collection.id, collection.code) for collection in Collection.query.filter_by(is_active=True).order_by('code').all() ] else: - self.collection_id.choices = sorted( + self.collection_id.choices += sorted( [(permission.collection.id, permission.collection.code) for permission in current_user.get_cataloging_admin_permissions()], key=lambda _: _[1] @@ -45,7 +46,9 @@ def __init__(self, current_user, *args, **kwargs): # noinspection PyMethodMayBeStatic def validate_user_id(self, field): - """Validate user ID exists in 'users' table.""" + """Validate user ID is selected and exists in 'users' table.""" + if field.data == -1: + raise ValidationError(_('A user must be selected.')) if not User.get_by_id(field.data): raise ValidationError(_('User ID "%(user_id)s" does not exist', user_id=field.data)) @@ -61,6 +64,8 @@ def set_defaults(self, user_id, collection_id): def validate_collection_id(self, field): """Validate collection ID exists and current user may register permissions on it.""" + if field.data == -1: + raise ValidationError(_('A collection must be selected.')) collection = Collection.get_by_id(field.data) if collection: if not (self.current_user.is_cataloging_admin_for(collection) or @@ -105,10 +110,10 @@ def __init__(self, current_user, target_permission_id, *args, **kwargs): self.target_permission_id = target_permission_id self.permission_id.validators = [AnyOf([target_permission_id])] - def set_defaults(self, permission): - """Apply 'permission' attributes as field defaults.""" + def set_defaults(self, permission, new_user_id=None): + """Apply 'permission' attributes as field defaults, maybe overridden by 'new_user_id'.""" self.permission_id.default = permission.id - self.user_id.default = permission.user_id + self.user_id.default = new_user_id or permission.user_id self.collection_id.default = permission.collection_id self.registrant.default = permission.registrant self.cataloger.default = permission.cataloger @@ -124,18 +129,16 @@ def validate_permission_id(self, field): permission_id=self.target_permission_id)) current_collection = target_permission.collection form_collection = Collection.get_by_id(self.collection_id.data) - if not form_collection: - raise ValidationError(_('Collection ID "%(collection_id)s" does not exist', - collection_id=self.collection_id.data)) - - if not (self.current_user.is_cataloging_admin_for( + if form_collection and not (self.current_user.is_cataloging_admin_for( current_collection, form_collection) or self.current_user.is_admin): raise ValidationError(_('You do not have sufficient privileges ' 'for this operation.')) # noinspection PyMethodMayBeStatic def validate_collection_id(self, field): - """Validate collection ID exists in 'collections' table.""" + """Validate collection ID is selected and exists in 'collections' table.""" + if field.data == -1: + raise ValidationError(_('A collection must be selected.')) if not Collection.get_by_id(field.data): raise ValidationError(_('Collection ID "%(collection_id)s" does not exist', collection_id=field.data)) diff --git a/xl_auth/permission/views.py b/xl_auth/permission/views.py index ae447515..c450a792 100644 --- a/xl_auth/permission/views.py +++ b/xl_auth/permission/views.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function, unicode_literals -from flask import Blueprint, abort, flash, redirect, render_template, request +from flask import Blueprint, abort, flash, redirect, render_template, request, url_for from flask_babel import lazy_gettext as _ from flask_login import current_user, login_required from sqlalchemy.orm import contains_eager @@ -61,6 +61,8 @@ def register(user_id, collection_id): else: flash_errors(register_permission_form) + if request.referrer and url_for('user.register') in request.referrer: + user_id = User.query.filter_by(created_by=current_user).order_by(-User.id).all()[0].id register_permission_form.set_defaults(user_id, collection_id) return render_template('permissions/register.html', register_permission_form=register_permission_form, @@ -91,7 +93,11 @@ def edit(permission_id): else: flash_errors(edit_permission_form) - edit_permission_form.set_defaults(permission) + if request.referrer and url_for('user.register') in request.referrer: + new_user_id = User.query.filter_by(created_by=current_user).order_by(-User.id).all()[0].id + edit_permission_form.set_defaults(permission, new_user_id=new_user_id) + else: + edit_permission_form.set_defaults(permission) return render_template('permissions/edit.html', permission=permission, edit_permission_form=edit_permission_form, full_path_quoted=quote(request.full_path), diff --git a/xl_auth/templates/users/inspect.html b/xl_auth/templates/users/inspect.html index 77c1f2c4..6818a1e0 100644 --- a/xl_auth/templates/users/inspect.html +++ b/xl_auth/templates/users/inspect.html @@ -24,28 +24,28 @@

{{ _('Inspect User \'%(email)s\'', email=user.email) }}

{{ _('Yes') if user.is_cataloging_admin else _('No') }}
{{ _('Users Created') }}:
-
{{ users_created }}
+
{{ num_users_created }}
{{ _('Users Modified') }}:
-
{{ users_modified }}
+
{{ num_users_modified }}
{{ _('Permissions Created') }}:
-
{{ permissions_created }}
+
{{ num_permissions_created }}
{{ _('Permissions Modified') }}:
-
{{ permissions_modified }}
+
{{ num_permissions_modified }}
{{ _('Collections Created') }}:
-
{{ collections_created }}
+
{{ num_collections_created }}
{{ _('Collections Modified') }}:
-
{{ collections_modified }}
+
{{ num_collections_modified }}
{{ _('Clients Created') }}:
-
{{ clients_created }}
+
{{ num_clients_created }}
{{ _('Clients Modified') }}:
-
{{ clients_modified }}
+
{{ num_clients_modified }}
{{ _('Last Modified') }}:
@@ -66,7 +66,7 @@

{{ _('Inspect User \'%(email)s\'', email=user.email) }}

- {{ _('Permissions') }} + {{ _('Own Permissions') }} ({{ user.permissions | length }})
@@ -99,7 +99,8 @@

{{ _('Inspect User \'%(email)s\'', email=user.email) }}

-
{{ _('Yes') if permission.collection.is_active else _('No') }} {{ permission.modified_at.strftime('%y-%m-%d') }}, {{ _('by') }} + + {{ permission.modified_at.strftime('%y-%m-%d') }}, {{ _('by') }} {{ permission.modified_by.full_name }} @@ -109,6 +110,102 @@

{{ _('Inspect User \'%(email)s\'', email=user.email) }}

+
+
+ + {{ _('Permissions Created or Modified by This User') }} + ({{ permissions_created_or_modified | length }}) + +
+ + + + + + + + + + + + + {% for permission in permissions_created_or_modified | sort(attribute='collection.code') %} + + + + + + + + + {% endfor %} + +
{{ _('Collection') }}{{ _('Email') }}{{ _('Registrant') }}{{ _('Cataloger') }}{{ _('CatAdm') }}{{ _('Created At') }}
+ + {{ permission.collection.code }} + + + + {{ permission.user.email }} + + + {{ _('Yes') if permission.registrant else _('No') }} + + {{ _('Yes') if permission.cataloger else _('No') }} + + {{ _('Yes') if permission.cataloging_admin else _('No') }} + + {{ permission.created_at.strftime('%y-%m-%d') }}, {{ _('by') }} + + {{ permission.created_by.full_name }} + +
+
+
+
+ + {{ _('Users Created or Modified by This One') }} + ({{ users_created_or_modified | length }}) + +
+ + + + + + + + + + + + + {% for user in users_created_or_modified %} + + + + + + + + + {% endfor %} + +
{{ _('Email') }}{{ _('Collections') }}{{ _('CatAdm') }}{{ _('Admin') }}{{ _('Last Login At') }}{{ _('Created At') }}
+ + {{ user.email }} + + {{ user.permissions | length }} + {{ _('Yes') if user.is_cataloging_admin else _('No') }} + + {{ _('Yes') if user.is_admin else _('No') }} + {{ '-' if not user.last_login_at else user.last_login_at.strftime('%y-%m-%d') }} + {{ user.created_at.strftime('%y-%m-%d') }}, {{ _('by') }} + + {{ user.created_by.full_name }} + +
+
{{ _('Password Resets') }} diff --git a/xl_auth/translations/sv/LC_MESSAGES/messages.po b/xl_auth/translations/sv/LC_MESSAGES/messages.po index bae89c04..585b4822 100644 --- a/xl_auth/translations/sv/LC_MESSAGES/messages.po +++ b/xl_auth/translations/sv/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.2.1\n" "Report-Msgid-Bugs-To: mats.blomdahl@gmail.com\n" -"POT-Creation-Date: 2017-12-20 20:20+0100\n" +"POT-Creation-Date: 2017-12-27 16:20+0100\n" "PO-Revision-Date: 2017-09-19 12:23+0200\n" "Last-Translator: Mats Blomdahl \n" "Language: sv\n" @@ -23,15 +23,14 @@ msgid "category" msgstr "kategori" #: tests/end2end/test_collection_editing.py:63 tests/end2end/test_collection_registering.py:59 -#: xl_auth/collection/forms.py:21 xl_auth/templates/collections/home.html:55 -#: xl_auth/templates/collections/home.html:122 xl_auth/templates/collections/home.html:188 +#: xl_auth/collection/forms.py:21 xl_auth/templates/collections/home.html:51 +#: xl_auth/templates/collections/home.html:114 msgid "No category" msgstr "Kategori saknas" #: tests/end2end/test_collection_editing.py:86 tests/end2end/test_collection_registering.py:82 -#: xl_auth/collection/forms.py:17 xl_auth/templates/collections/home.html:33 -#: xl_auth/templates/collections/home.html:100 xl_auth/templates/collections/home.html:163 -#: xl_auth/templates/users/profile.html:69 +#: xl_auth/collection/forms.py:17 xl_auth/templates/collections/home.html:29 +#: xl_auth/templates/collections/home.html:92 xl_auth/templates/users/profile.html:74 msgid "Code" msgstr "Sigel" @@ -42,8 +41,8 @@ msgstr "Koden kan inte ändras" #: tests/end2end/test_collection_editing.py:108 tests/end2end/test_collection_registering.py:105 #: xl_auth/collection/forms.py:18 xl_auth/oauth/client/forms.py:14 -#: xl_auth/templates/oauth/clients/home.html:18 xl_auth/templates/users/home.html:18 -#: xl_auth/templates/users/home.html:73 +#: xl_auth/templates/oauth/clients/home.html:18 xl_auth/templates/users/home.html:27 +#: xl_auth/templates/users/home.html:91 msgid "Name" msgstr "Namn" @@ -54,14 +53,14 @@ msgstr "Namn" #: tests/forms/test_client_register.py:48 tests/forms/test_client_register.py:71 #: tests/forms/test_client_register.py:94 tests/forms/test_client_register.py:105 #: tests/forms/test_collection_edit.py:20 tests/forms/test_collection_register.py:21 -#: tests/forms/test_permission_edit.py:40 tests/forms/test_permission_edit.py:49 -#: tests/forms/test_permission_register.py:18 tests/forms/test_permission_register.py:26 +#: tests/forms/test_permission_edit.py:49 tests/forms/test_permission_edit.py:67 +#: tests/forms/test_permission_register.py:26 tests/forms/test_permission_register.py:42 msgid "This field is required." msgstr "Det här fältet är obligatoriskt." #: tests/end2end/test_collection_editing.py:130 tests/end2end/test_collection_registering.py:128 -#: xl_auth/collection/forms.py:19 xl_auth/templates/collections/home.html:35 -#: xl_auth/templates/collections/home.html:102 xl_auth/templates/collections/home.html:166 +#: xl_auth/collection/forms.py:19 xl_auth/templates/collections/home.html:31 +#: xl_auth/templates/collections/home.html:94 msgid "Category" msgstr "Kategori" @@ -71,20 +70,20 @@ msgid "Not a valid choice" msgstr "Inte ett giltigt val" #: tests/end2end/test_collection_editing.py:146 tests/end2end/test_collection_view.py:43 -#: xl_auth/collection/views.py:60 xl_auth/collection/views.py:75 +#: xl_auth/collection/views.py:58 xl_auth/collection/views.py:73 #, python-format msgid "Collection code \"%(code)s\" does not exist" msgstr "Sigel \"%(code)s\" existerar inte" #: tests/end2end/test_collection_editing.py:164 tests/end2end/test_user_editing.py:212 -#: tests/end2end/test_user_editing.py:240 xl_auth/templates/collections/home.html:60 -#: xl_auth/templates/collections/home.html:127 xl_auth/templates/collections/view.html:121 +#: tests/end2end/test_user_editing.py:238 xl_auth/templates/collections/home.html:56 +#: xl_auth/templates/collections/home.html:119 xl_auth/templates/collections/view.html:121 #: xl_auth/templates/permissions/home.html:46 xl_auth/templates/users/view.html:107 msgid "Edit" msgstr "Ändra" #: tests/end2end/test_collection_registering.py:31 tests/end2end/test_collection_registering.py:174 -#: xl_auth/templates/collections/home.html:27 xl_auth/templates/collections/home.html:94 +#: xl_auth/templates/collections/home.html:23 xl_auth/templates/collections/home.html:86 msgid "New Collection" msgstr "Lägg till nytt sigel" @@ -101,15 +100,12 @@ msgstr "Sigel '%(code)s'" #: tests/end2end/test_collection_view.py:61 tests/end2end/test_collection_view.py:89 #: tests/end2end/test_collection_view.py:124 tests/end2end/test_collection_view.py:153 -#: tests/end2end/test_collection_view.py:184 tests/end2end/test_permission_deleting.py:26 -#: tests/end2end/test_permission_deleting.py:66 tests/end2end/test_permission_deleting.py:103 -#: tests/end2end/test_permission_editing.py:29 tests/end2end/test_permission_editing.py:156 -#: tests/end2end/test_permission_editing.py:185 tests/end2end/test_permission_registering.py:28 -#: tests/end2end/test_permission_registering.py:156 tests/end2end/test_permission_registering.py:185 -#: tests/end2end/test_user_editing.py:206 tests/end2end/test_user_view.py:73 -#: tests/end2end/test_user_view.py:99 xl_auth/templates/collections/view.html:70 -#: xl_auth/templates/nav.html:28 xl_auth/templates/permissions/home.html:4 -#: xl_auth/templates/users/inspect.html:66 xl_auth/templates/users/view.html:54 +#: tests/end2end/test_collection_view.py:184 tests/end2end/test_permission_deleting.py:67 +#: tests/end2end/test_permission_deleting.py:104 tests/end2end/test_permission_editing.py:188 +#: tests/end2end/test_permission_registering.py:188 tests/end2end/test_user_editing.py:206 +#: tests/end2end/test_user_view.py:73 tests/end2end/test_user_view.py:99 +#: xl_auth/templates/collections/view.html:70 xl_auth/templates/permissions/home.html:4 +#: xl_auth/templates/users/view.html:54 msgid "Permissions" msgstr "Behörigheter" @@ -137,64 +133,64 @@ msgstr "Klienter" msgid "New Client" msgstr "Ny klient" -#: tests/end2end/test_permission_deleting.py:33 xl_auth/templates/permissions/delete.html:5 +#: tests/end2end/test_permission_deleting.py:34 xl_auth/templates/permissions/delete.html:5 msgid "Acknowledge Deletion" msgstr "Bekräfta borttagning" -#: tests/end2end/test_permission_deleting.py:34 xl_auth/templates/permissions/delete.html:7 +#: tests/end2end/test_permission_deleting.py:35 xl_auth/templates/permissions/delete.html:7 #, python-format msgid "Delete permission for \"%(username)s\" on collection \"%(code)s\"?" msgstr "Ta bort behörigheter för \"%(username)s\" på sigel \"%(code)s\"?" -#: tests/end2end/test_permission_deleting.py:43 tests/end2end/test_permission_deleting.py:83 -#: xl_auth/permission/views.py:113 +#: tests/end2end/test_permission_deleting.py:44 tests/end2end/test_permission_deleting.py:84 +#: xl_auth/permission/views.py:125 #, python-format msgid "Successfully deleted permissions for \"%(username)s\" on collection \"%(code)s\"." msgstr "Behörighet borttagen för \"%(username)s\" på sigel \"%(code)s\"." -#: tests/end2end/test_permission_deleting.py:117 tests/forms/test_client_edit.py:23 +#: tests/end2end/test_permission_deleting.py:118 tests/forms/test_client_edit.py:23 #: tests/forms/test_client_register.py:25 tests/forms/test_collection_edit.py:67 #: tests/forms/test_collection_register.py:79 tests/forms/test_permission_delete.py:50 -#: tests/forms/test_permission_edit.py:96 tests/forms/test_permission_register.py:66 +#: tests/forms/test_permission_edit.py:114 tests/forms/test_permission_register.py:82 #: tests/forms/test_user_administer.py:53 tests/forms/test_user_change_password.py:45 #: tests/forms/test_user_edit_details.py:34 tests/forms/test_user_register.py:44 #: xl_auth/collection/forms.py:41 xl_auth/collection/forms.py:73 xl_auth/oauth/client/forms.py:40 -#: xl_auth/oauth/client/forms.py:67 xl_auth/permission/forms.py:69 xl_auth/permission/forms.py:133 -#: xl_auth/permission/forms.py:154 xl_auth/permission/forms.py:206 xl_auth/user/forms.py:77 +#: xl_auth/oauth/client/forms.py:67 xl_auth/permission/forms.py:74 xl_auth/permission/forms.py:134 +#: xl_auth/permission/forms.py:157 xl_auth/permission/forms.py:209 xl_auth/user/forms.py:77 #: xl_auth/user/forms.py:126 xl_auth/user/forms.py:160 xl_auth/user/forms.py:179 msgid "You do not have sufficient privileges for this operation." msgstr "Du har inte tillräcklig behörighet för att utföra denna operation." -#: tests/end2end/test_permission_editing.py:43 tests/end2end/test_permission_editing.py:83 -#: tests/end2end/test_permission_editing.py:136 xl_auth/permission/views.py:82 +#: tests/end2end/test_permission_editing.py:44 tests/end2end/test_permission_editing.py:84 +#: tests/end2end/test_permission_editing.py:138 xl_auth/permission/views.py:90 #, python-format msgid "Updated permissions for \"%(username)s\" on collection \"%(code)s\"." msgstr "Behörighet uppdaterad för \"%(username)s\" på sigel \"%(code)s\"." -#: tests/end2end/test_permission_editing.py:112 tests/end2end/test_permission_registering.py:67 +#: tests/end2end/test_permission_editing.py:113 tests/end2end/test_permission_registering.py:68 #: tests/end2end/test_user_registering.py:27 tests/end2end/test_user_registering.py:64 #: tests/end2end/test_user_registering.py:102 tests/end2end/test_user_registering.py:142 #: xl_auth/templates/permissions/edit.html:17 xl_auth/templates/permissions/register.html:16 -#: xl_auth/templates/users/home.html:11 xl_auth/templates/users/profile.html:55 +#: xl_auth/templates/users/home.html:20 xl_auth/templates/users/profile.html:60 msgid "New User" msgstr "Lägg till ny användare" -#: tests/end2end/test_permission_editing.py:167 tests/end2end/test_permission_registering.py:167 -#: tests/forms/test_permission_edit.py:60 tests/forms/test_permission_register.py:35 -#: xl_auth/permission/forms.py:89 xl_auth/permission/forms.py:170 +#: tests/end2end/test_permission_editing.py:170 tests/end2end/test_permission_registering.py:170 +#: tests/forms/test_permission_edit.py:78 tests/forms/test_permission_register.py:51 +#: xl_auth/permission/forms.py:94 xl_auth/permission/forms.py:173 #, python-format msgid "Permissions for user \"%(username)s\" on collection \"%(code)s\" already registered" msgstr "En behörighet för användare \"%(username)s\" på sigel \"%(code)s\" finns redan registrerad" -#: tests/end2end/test_permission_registering.py:30 tests/end2end/test_permission_registering.py:65 -#: tests/end2end/test_permission_registering.py:123 tests/end2end/test_permission_registering.py:158 +#: tests/end2end/test_permission_registering.py:31 tests/end2end/test_permission_registering.py:66 +#: tests/end2end/test_permission_registering.py:125 tests/end2end/test_permission_registering.py:161 #: xl_auth/templates/collections/view.html:81 xl_auth/templates/permissions/home.html:11 #: xl_auth/templates/users/view.html:62 msgid "New Permission" msgstr "Lägg till behörighet" -#: tests/end2end/test_permission_registering.py:41 tests/end2end/test_permission_registering.py:92 -#: tests/end2end/test_permission_registering.py:137 xl_auth/permission/views.py:52 +#: tests/end2end/test_permission_registering.py:42 tests/end2end/test_permission_registering.py:94 +#: tests/end2end/test_permission_registering.py:139 xl_auth/permission/views.py:58 #, python-format msgid "Added permissions for \"%(username)s\" on collection \"%(code)s\"." msgstr "Behörighet tillagd för användare \"%(username)s\" på sigel \"%(code)s\"." @@ -204,8 +200,8 @@ msgid "Approve ToS" msgstr "Godkänn tjänstevillkor" #: tests/end2end/test_public_logging_in.py:54 xl_auth/templates/collections/home.html:4 -#: xl_auth/templates/nav.html:25 xl_auth/templates/users/home.html:19 -#: xl_auth/templates/users/home.html:74 +#: xl_auth/templates/nav.html:25 xl_auth/templates/users/home.html:28 +#: xl_auth/templates/users/home.html:92 xl_auth/templates/users/inspect.html:175 msgid "Collections" msgstr "Sigler" @@ -249,9 +245,8 @@ msgstr "Återställningsnyckel \"%(code)s\" har redan förbrukats (%(isoformat)s #: tests/end2end/test_user_editing.py:27 tests/end2end/test_user_editing.py:77 #: tests/end2end/test_user_inspection.py:23 tests/end2end/test_user_registering.py:25 #: tests/end2end/test_user_registering.py:62 tests/end2end/test_user_registering.py:179 -#: xl_auth/templates/collections/home.html:36 xl_auth/templates/collections/home.html:103 -#: xl_auth/templates/collections/home.html:167 xl_auth/templates/nav.html:27 -#: xl_auth/templates/users/home.html:4 +#: xl_auth/templates/collections/home.html:32 xl_auth/templates/collections/home.html:95 +#: xl_auth/templates/nav.html:27 xl_auth/templates/users/home.html:4 msgid "Users" msgstr "Användare" @@ -259,17 +254,20 @@ msgstr "Användare" #: xl_auth/templates/collections/view.html:106 xl_auth/templates/collections/view.html:109 #: xl_auth/templates/collections/view.html:112 xl_auth/templates/permissions/home.html:41 #: xl_auth/templates/permissions/home.html:42 xl_auth/templates/permissions/home.html:43 -#: xl_auth/templates/users/home.html:38 xl_auth/templates/users/home.html:93 -#: xl_auth/templates/users/inspect.html:15 xl_auth/templates/users/inspect.html:18 -#: xl_auth/templates/users/inspect.html:21 xl_auth/templates/users/inspect.html:88 -#: xl_auth/templates/users/inspect.html:91 xl_auth/templates/users/inspect.html:94 -#: xl_auth/templates/users/inspect.html:97 xl_auth/templates/users/inspect.html:128 -#: xl_auth/templates/users/inspect.html:162 xl_auth/templates/users/profile.html:87 -#: xl_auth/templates/users/profile.html:90 xl_auth/templates/users/profile.html:93 -#: xl_auth/templates/users/simple_view.html:12 xl_auth/templates/users/view.html:31 -#: xl_auth/templates/users/view.html:34 xl_auth/templates/users/view.html:37 -#: xl_auth/templates/users/view.html:88 xl_auth/templates/users/view.html:91 -#: xl_auth/templates/users/view.html:94 xl_auth/templates/users/view.html:97 +#: xl_auth/templates/users/home.html:47 xl_auth/templates/users/home.html:111 +#: xl_auth/templates/users/inspect.html:18 xl_auth/templates/users/inspect.html:21 +#: xl_auth/templates/users/inspect.html:24 xl_auth/templates/users/inspect.html:91 +#: xl_auth/templates/users/inspect.html:94 xl_auth/templates/users/inspect.html:97 +#: xl_auth/templates/users/inspect.html:100 xl_auth/templates/users/inspect.html:145 +#: xl_auth/templates/users/inspect.html:148 xl_auth/templates/users/inspect.html:151 +#: xl_auth/templates/users/inspect.html:192 xl_auth/templates/users/inspect.html:195 +#: xl_auth/templates/users/inspect.html:228 xl_auth/templates/users/inspect.html:262 +#: xl_auth/templates/users/profile.html:92 xl_auth/templates/users/profile.html:95 +#: xl_auth/templates/users/profile.html:98 xl_auth/templates/users/simple_view.html:12 +#: xl_auth/templates/users/view.html:31 xl_auth/templates/users/view.html:34 +#: xl_auth/templates/users/view.html:37 xl_auth/templates/users/view.html:88 +#: xl_auth/templates/users/view.html:91 xl_auth/templates/users/view.html:94 +#: xl_auth/templates/users/view.html:97 msgid "Yes" msgstr "Ja" @@ -277,23 +275,27 @@ msgstr "Ja" #: xl_auth/templates/collections/view.html:106 xl_auth/templates/collections/view.html:109 #: xl_auth/templates/collections/view.html:112 xl_auth/templates/permissions/home.html:41 #: xl_auth/templates/permissions/home.html:42 xl_auth/templates/permissions/home.html:43 -#: xl_auth/templates/users/home.html:38 xl_auth/templates/users/home.html:93 -#: xl_auth/templates/users/inspect.html:15 xl_auth/templates/users/inspect.html:18 -#: xl_auth/templates/users/inspect.html:21 xl_auth/templates/users/inspect.html:88 -#: xl_auth/templates/users/inspect.html:91 xl_auth/templates/users/inspect.html:94 -#: xl_auth/templates/users/inspect.html:97 xl_auth/templates/users/inspect.html:128 -#: xl_auth/templates/users/inspect.html:162 xl_auth/templates/users/profile.html:87 -#: xl_auth/templates/users/profile.html:90 xl_auth/templates/users/profile.html:93 -#: xl_auth/templates/users/simple_view.html:12 xl_auth/templates/users/view.html:31 -#: xl_auth/templates/users/view.html:34 xl_auth/templates/users/view.html:37 -#: xl_auth/templates/users/view.html:88 xl_auth/templates/users/view.html:91 -#: xl_auth/templates/users/view.html:94 xl_auth/templates/users/view.html:97 +#: xl_auth/templates/users/home.html:47 xl_auth/templates/users/home.html:111 +#: xl_auth/templates/users/inspect.html:18 xl_auth/templates/users/inspect.html:21 +#: xl_auth/templates/users/inspect.html:24 xl_auth/templates/users/inspect.html:91 +#: xl_auth/templates/users/inspect.html:94 xl_auth/templates/users/inspect.html:97 +#: xl_auth/templates/users/inspect.html:100 xl_auth/templates/users/inspect.html:145 +#: xl_auth/templates/users/inspect.html:148 xl_auth/templates/users/inspect.html:151 +#: xl_auth/templates/users/inspect.html:192 xl_auth/templates/users/inspect.html:195 +#: xl_auth/templates/users/inspect.html:228 xl_auth/templates/users/inspect.html:262 +#: xl_auth/templates/users/profile.html:92 xl_auth/templates/users/profile.html:95 +#: xl_auth/templates/users/profile.html:98 xl_auth/templates/users/simple_view.html:12 +#: xl_auth/templates/users/view.html:31 xl_auth/templates/users/view.html:34 +#: xl_auth/templates/users/view.html:37 xl_auth/templates/users/view.html:88 +#: xl_auth/templates/users/view.html:91 xl_auth/templates/users/view.html:94 +#: xl_auth/templates/users/view.html:97 msgid "No" msgstr "Nej" #: tests/end2end/test_user_editing.py:124 tests/end2end/test_user_editing.py:148 -#: xl_auth/public/forms.py:53 xl_auth/public/forms.py:74 xl_auth/templates/users/home.html:17 -#: xl_auth/templates/users/home.html:72 xl_auth/user/forms.py:13 +#: xl_auth/public/forms.py:53 xl_auth/public/forms.py:74 xl_auth/templates/users/home.html:26 +#: xl_auth/templates/users/home.html:90 xl_auth/templates/users/inspect.html:124 +#: xl_auth/templates/users/inspect.html:174 xl_auth/user/forms.py:13 msgid "Email" msgstr "Epost" @@ -311,30 +313,25 @@ msgstr "Fullständigt namn" #: tests/end2end/test_user_editing.py:187 tests/end2end/test_user_editing.py:191 #: tests/end2end/test_user_inspection.py:63 tests/end2end/test_user_view.py:49 -#: tests/forms/test_permission_edit.py:72 tests/forms/test_permission_register.py:46 -#: xl_auth/permission/forms.py:50 xl_auth/user/views.py:91 xl_auth/user/views.py:110 -#: xl_auth/user/views.py:145 xl_auth/user/views.py:173 xl_auth/user/views.py:198 +#: tests/forms/test_permission_edit.py:90 tests/forms/test_permission_register.py:62 +#: xl_auth/permission/forms.py:53 xl_auth/user/views.py:92 xl_auth/user/views.py:111 +#: xl_auth/user/views.py:157 xl_auth/user/views.py:185 xl_auth/user/views.py:210 #, python-format msgid "User ID \"%(user_id)s\" does not exist" msgstr "Användare med databas-ID \"%(user_id)s\" existerar inte" -#: tests/end2end/test_user_editing.py:213 xl_auth/templates/users/home.html:52 -#: xl_auth/templates/users/home.html:106 xl_auth/templates/users/profile.html:17 +#: tests/end2end/test_user_editing.py:213 xl_auth/templates/users/home.html:61 +#: xl_auth/templates/users/home.html:124 xl_auth/templates/users/profile.html:22 msgid "Change Password" msgstr "Byt lösenord" -#: tests/end2end/test_user_editing.py:237 tests/end2end/test_user_editing.py:257 -#: tests/end2end/test_user_editing.py:258 xl_auth/templates/users/profile.html:6 -msgid "Welcome" -msgstr "Välkommen" - #: tests/end2end/test_user_inspection.py:28 xl_auth/templates/users/inspect.html:4 #, python-format msgid "Inspect User '%(email)s'" msgstr "Inspektera '%(email)s'" #: tests/end2end/test_user_registering.py:100 tests/end2end/test_user_registering.py:140 -#: xl_auth/templates/users/profile.html:42 +#: xl_auth/templates/users/profile.html:47 msgid "Your Responsibilities as Cataloging Admin" msgstr "Ditt ansvar som katalogiseringsadmin" @@ -374,8 +371,8 @@ msgid "Field must be between 1 and 5 characters long." msgstr "Fältet måste vara mellan 1 och 5 tecken långt." #: tests/forms/test_permission_delete.py:20 tests/forms/test_permission_edit.py:20 -#: xl_auth/permission/forms.py:123 xl_auth/permission/forms.py:210 xl_auth/permission/views.py:74 -#: xl_auth/permission/views.py:104 +#: xl_auth/permission/forms.py:128 xl_auth/permission/forms.py:213 xl_auth/permission/views.py:82 +#: xl_auth/permission/views.py:116 #, python-format msgid "Permission ID \"%(permission_id)s\" does not exist" msgstr "Behörighet med databas-ID \"%(permission_id)s\" existerar inte" @@ -386,14 +383,24 @@ msgstr "Behörighet med databas-ID \"%(permission_id)s\" existerar inte" msgid "Invalid value, must be one of: %(values)s." msgstr "Felaktigt värde, måste vara ett av: %(values)s." -#: tests/forms/test_permission_edit.py:83 tests/forms/test_permission_register.py:56 -#: xl_auth/permission/forms.py:71 xl_auth/permission/forms.py:128 xl_auth/permission/forms.py:140 +#: tests/forms/test_permission_edit.py:40 tests/forms/test_permission_register.py:18 +#: xl_auth/permission/forms.py:51 +msgid "A user must be selected." +msgstr "En användare måste väljas." + +#: tests/forms/test_permission_edit.py:58 tests/forms/test_permission_register.py:34 +#: xl_auth/permission/forms.py:68 xl_auth/permission/forms.py:141 +msgid "A collection must be selected." +msgstr "Ett sigel måste väljas." + +#: tests/forms/test_permission_edit.py:101 tests/forms/test_permission_register.py:72 +#: xl_auth/permission/forms.py:76 xl_auth/permission/forms.py:143 #, python-format msgid "Collection ID \"%(collection_id)s\" does not exist" msgstr "Sigel med databas-ID \"%(collection_id)s\" existerar inte" -#: tests/forms/test_permission_edit.py:117 tests/forms/test_permission_register.py:79 -#: xl_auth/permission/forms.py:78 xl_auth/permission/forms.py:160 +#: tests/forms/test_permission_edit.py:135 tests/forms/test_permission_register.py:95 +#: xl_auth/permission/forms.py:83 xl_auth/permission/forms.py:163 msgid "Cataloging admin rights can only be granted by system admins." msgstr "" "I nuläget kan endast systemadministratörer utse katalogiseringsadmins, vänligen kontakta " @@ -444,11 +451,11 @@ msgstr "Bibliografi" msgid "Library" msgstr "Bibliotek" -#: xl_auth/collection/views.py:46 +#: xl_auth/collection/views.py:44 msgid "Thank you for registering a new collection." msgstr "Nytt sigel registrerat." -#: xl_auth/collection/views.py:83 +#: xl_auth/collection/views.py:81 #, python-format msgid "Thank you for editing collection \"%(code)s\"." msgstr "Sigel \"%(code)s\" har uppdaterats." @@ -505,29 +512,40 @@ msgid "User" msgstr "Användare" #: xl_auth/permission/forms.py:20 xl_auth/templates/permissions/home.html:18 -#: xl_auth/templates/users/inspect.html:71 xl_auth/templates/users/view.html:69 +#: xl_auth/templates/users/inspect.html:74 xl_auth/templates/users/inspect.html:123 +#: xl_auth/templates/users/view.html:69 msgid "Collection" msgstr "Sigel" #: xl_auth/permission/forms.py:22 xl_auth/templates/collections/view.html:89 -#: xl_auth/templates/permissions/home.html:19 xl_auth/templates/users/inspect.html:72 -#: xl_auth/templates/users/profile.html:71 xl_auth/templates/users/view.html:70 +#: xl_auth/templates/permissions/home.html:19 xl_auth/templates/users/inspect.html:75 +#: xl_auth/templates/users/inspect.html:125 xl_auth/templates/users/profile.html:76 +#: xl_auth/templates/users/view.html:70 msgid "Registrant" msgstr "Beståndsregistrerare" #: xl_auth/permission/forms.py:23 xl_auth/templates/collections/view.html:90 -#: xl_auth/templates/permissions/home.html:20 xl_auth/templates/users/inspect.html:73 -#: xl_auth/templates/users/profile.html:72 xl_auth/templates/users/view.html:71 +#: xl_auth/templates/permissions/home.html:20 xl_auth/templates/users/inspect.html:76 +#: xl_auth/templates/users/inspect.html:126 xl_auth/templates/users/profile.html:77 +#: xl_auth/templates/users/view.html:71 msgid "Cataloger" msgstr "Katalogisatör" #: xl_auth/permission/forms.py:24 xl_auth/templates/collections/view.html:91 -#: xl_auth/templates/permissions/home.html:21 xl_auth/templates/users/inspect.html:20 -#: xl_auth/templates/users/inspect.html:74 xl_auth/templates/users/profile.html:73 +#: xl_auth/templates/permissions/home.html:21 xl_auth/templates/users/inspect.html:23 +#: xl_auth/templates/users/inspect.html:77 xl_auth/templates/users/profile.html:78 #: xl_auth/templates/users/view.html:36 xl_auth/templates/users/view.html:72 msgid "Cataloging Admin" msgstr "Katalogiseringsadmin" +#: xl_auth/permission/forms.py:31 +msgid "--- Select User ---" +msgstr "--- Välj användare ---" + +#: xl_auth/permission/forms.py:34 +msgid "--- Select Collection ---" +msgstr "--- Välj sigel ---" + #: xl_auth/public/forms.py:19 xl_auth/templates/public/home.html:39 msgid "Username" msgstr "Användarnamn" @@ -592,7 +610,7 @@ msgstr "Kontakt" msgid "xl_auth" msgstr "Libris Loginbeta" -#: xl_auth/templates/nav.html:39 +#: xl_auth/templates/nav.html:38 msgid "Log out" msgstr "Logga ut" @@ -607,53 +625,43 @@ msgstr "Ändra befintligt sigel" msgid "Save" msgstr "Spara" -#: xl_auth/templates/collections/home.html:6 xl_auth/templates/collections/home.html:73 -#: xl_auth/templates/collections/home.html:140 xl_auth/templates/collections/home.html:197 +#: xl_auth/templates/collections/home.html:6 xl_auth/templates/collections/home.html:69 +#: xl_auth/templates/collections/home.html:131 xl_auth/templates/users/home.html:6 +#: xl_auth/templates/users/home.html:74 msgid "Go to" msgstr "Gå till" -#: xl_auth/templates/collections/home.html:9 xl_auth/templates/collections/home.html:89 -#: xl_auth/templates/collections/home.html:147 +#: xl_auth/templates/collections/home.html:9 xl_auth/templates/collections/home.html:81 msgid "Active Collections without Users" msgstr "Aktiva sigler utan användare" -#: xl_auth/templates/collections/home.html:13 xl_auth/templates/collections/home.html:80 -#: xl_auth/templates/collections/home.html:156 -msgid "Inactive Collections" -msgstr "Inaktiva sigler" - -#: xl_auth/templates/collections/home.html:22 xl_auth/templates/collections/home.html:76 -#: xl_auth/templates/collections/home.html:143 +#: xl_auth/templates/collections/home.html:18 xl_auth/templates/collections/home.html:72 msgid "Active Collections with Users" msgstr "Aktiva sigler med användare" -#: xl_auth/templates/collections/home.html:34 xl_auth/templates/collections/home.html:101 -#: xl_auth/templates/collections/home.html:164 xl_auth/templates/users/profile.html:70 +#: xl_auth/templates/collections/home.html:30 xl_auth/templates/collections/home.html:93 +#: xl_auth/templates/users/profile.html:75 msgid "Friendly Name" msgstr "Namn" -#: xl_auth/templates/collections/home.html:37 xl_auth/templates/collections/home.html:104 -#: xl_auth/templates/collections/home.html:168 xl_auth/templates/collections/view.html:56 -#: xl_auth/templates/collections/view.html:92 xl_auth/templates/permissions/home.html:22 -#: xl_auth/templates/users/home.html:22 xl_auth/templates/users/home.html:77 -#: xl_auth/templates/users/inspect.html:55 xl_auth/templates/users/inspect.html:120 -#: xl_auth/templates/users/view.html:22 +#: xl_auth/templates/collections/home.html:33 xl_auth/templates/collections/home.html:96 +#: xl_auth/templates/collections/view.html:56 xl_auth/templates/collections/view.html:92 +#: xl_auth/templates/permissions/home.html:22 xl_auth/templates/users/home.html:31 +#: xl_auth/templates/users/home.html:95 xl_auth/templates/users/inspect.html:58 +#: xl_auth/templates/users/inspect.html:128 xl_auth/templates/users/inspect.html:179 +#: xl_auth/templates/users/inspect.html:220 xl_auth/templates/users/view.html:22 msgid "Created At" msgstr "Skapad" -#: xl_auth/templates/collections/home.html:49 xl_auth/templates/collections/home.html:116 -#: xl_auth/templates/collections/home.html:175 xl_auth/templates/collections/view.html:14 -#: xl_auth/templates/collections/view.html:26 xl_auth/templates/permissions/home.html:30 -#: xl_auth/templates/permissions/home.html:36 xl_auth/templates/users/home.html:32 -#: xl_auth/templates/users/home.html:87 xl_auth/templates/users/profile.html:80 +#: xl_auth/templates/collections/home.html:45 xl_auth/templates/collections/home.html:108 +#: xl_auth/templates/collections/view.html:14 xl_auth/templates/collections/view.html:26 +#: xl_auth/templates/permissions/home.html:30 xl_auth/templates/permissions/home.html:36 +#: xl_auth/templates/users/home.html:41 xl_auth/templates/users/home.html:105 +#: xl_auth/templates/users/profile.html:85 msgid "View" msgstr "Visa" -#: xl_auth/templates/collections/home.html:165 xl_auth/templates/collections/view.html:23 -msgid "Replaced By" -msgstr "Ersatt av" - -#: xl_auth/templates/collections/home.html:197 +#: xl_auth/templates/collections/home.html:131 msgid "Top of page" msgstr "Sidtopp" @@ -666,8 +674,8 @@ msgstr "Registrera nytt sigel" msgid "Register" msgstr "Registrera" -#: xl_auth/templates/collections/view.html:8 xl_auth/templates/users/inspect.html:117 -#: xl_auth/templates/users/inspect.html:149 xl_auth/user/forms.py:141 +#: xl_auth/templates/collections/view.html:8 xl_auth/templates/users/inspect.html:217 +#: xl_auth/templates/users/inspect.html:249 xl_auth/user/forms.py:141 msgid "Active" msgstr "Aktiv" @@ -675,6 +683,10 @@ msgstr "Aktiv" msgid "Replaces" msgstr "Ersätter" +#: xl_auth/templates/collections/view.html:23 +msgid "Replaced By" +msgstr "Ersatt av" + #: xl_auth/templates/collections/view.html:40 msgid " and " msgstr " och " @@ -683,15 +695,16 @@ msgstr " och " msgid "None registered, please contact libris@kb.se to create one." msgstr "Ej registrerad, kontakta libris@kb.se för information." -#: xl_auth/templates/collections/view.html:48 xl_auth/templates/users/inspect.html:47 -#: xl_auth/templates/users/inspect.html:76 xl_auth/templates/users/inspect.html:119 +#: xl_auth/templates/collections/view.html:48 xl_auth/templates/users/inspect.html:50 +#: xl_auth/templates/users/inspect.html:79 xl_auth/templates/users/inspect.html:219 #: xl_auth/templates/users/view.html:14 xl_auth/templates/users/view.html:74 msgid "Last Modified" msgstr "Ändrad" #: xl_auth/templates/collections/view.html:50 xl_auth/templates/collections/view.html:58 -#: xl_auth/templates/collections/view.html:114 xl_auth/templates/users/inspect.html:49 -#: xl_auth/templates/users/inspect.html:57 xl_auth/templates/users/inspect.html:99 +#: xl_auth/templates/collections/view.html:114 xl_auth/templates/users/inspect.html:52 +#: xl_auth/templates/users/inspect.html:60 xl_auth/templates/users/inspect.html:103 +#: xl_auth/templates/users/inspect.html:154 xl_auth/templates/users/inspect.html:199 #: xl_auth/templates/users/view.html:16 xl_auth/templates/users/view.html:24 #: xl_auth/templates/users/view.html:99 msgid "by" @@ -732,7 +745,7 @@ msgid "OAuth2 Client Credentials" msgstr "OAuth2-credentials" #: xl_auth/templates/oauth/clients/edit.html:12 xl_auth/templates/oauth/clients/home.html:17 -#: xl_auth/templates/users/inspect.html:146 +#: xl_auth/templates/users/inspect.html:246 msgid "Client ID" msgstr "Klient-ID" @@ -774,17 +787,17 @@ msgid "OAuth2 Grant Tokens" msgstr "Grant-tokens för OAuth2" #: xl_auth/templates/oauth/grants/home.html:13 xl_auth/templates/oauth/tokens/home.html:13 -#: xl_auth/templates/users/inspect.html:145 +#: xl_auth/templates/users/inspect.html:245 msgid "ID" msgstr "ID" #: xl_auth/templates/oauth/grants/home.html:15 xl_auth/templates/oauth/tokens/home.html:15 -#: xl_auth/templates/users/inspect.html:147 +#: xl_auth/templates/users/inspect.html:247 msgid "Client" msgstr "Klient" #: xl_auth/templates/oauth/grants/home.html:16 xl_auth/templates/oauth/tokens/home.html:16 -#: xl_auth/templates/users/inspect.html:118 xl_auth/templates/users/inspect.html:150 +#: xl_auth/templates/users/inspect.html:218 xl_auth/templates/users/inspect.html:250 msgid "Expires At" msgstr "Förfaller" @@ -793,11 +806,11 @@ msgid "Delete Grant" msgstr "Ta bort grant" #: xl_auth/templates/oauth/tokens/home.html:4 xl_auth/templates/oauth/tokens/home.html:8 -#: xl_auth/templates/users/inspect.html:140 +#: xl_auth/templates/users/inspect.html:240 msgid "OAuth2 Bearer Tokens" msgstr "Bearer-tokens för OAuth2" -#: xl_auth/templates/oauth/tokens/home.html:28 xl_auth/templates/users/inspect.html:166 +#: xl_auth/templates/oauth/tokens/home.html:28 xl_auth/templates/users/inspect.html:266 msgid "Delete Token" msgstr "Ta bort token" @@ -941,102 +954,128 @@ msgstr "(Om du inte accepterar villkoren så måste du logga ut igen, knappen fi msgid "Change User Password" msgstr "Byt användarlösenord" -#: xl_auth/templates/users/home.html:8 +#: xl_auth/templates/users/home.html:9 xl_auth/templates/users/home.html:85 +msgid "Inactive Users" +msgstr "Inaktiva användare" + +#: xl_auth/templates/users/home.html:17 xl_auth/templates/users/home.html:77 msgid "Active Users" msgstr "Aktiva användare" -#: xl_auth/templates/users/home.html:20 xl_auth/templates/users/home.html:75 +#: xl_auth/templates/users/home.html:29 xl_auth/templates/users/home.html:93 +#: xl_auth/templates/users/inspect.html:177 msgid "Admin" msgstr "Admin" -#: xl_auth/templates/users/home.html:21 xl_auth/templates/users/home.html:76 -#: xl_auth/templates/users/inspect.html:11 xl_auth/templates/users/view.html:11 +#: xl_auth/templates/users/home.html:30 xl_auth/templates/users/home.html:94 +#: xl_auth/templates/users/inspect.html:11 xl_auth/templates/users/inspect.html:178 +#: xl_auth/templates/users/view.html:11 msgid "Last Login At" msgstr "Inloggad" -#: xl_auth/templates/users/home.html:43 xl_auth/templates/users/home.html:98 +#: xl_auth/templates/users/home.html:52 xl_auth/templates/users/home.html:116 msgid "Inspect" msgstr "Inspektera" -#: xl_auth/templates/users/home.html:47 xl_auth/templates/users/home.html:102 +#: xl_auth/templates/users/home.html:56 xl_auth/templates/users/home.html:120 msgid "Edit Details" msgstr "Ändra profil" -#: xl_auth/templates/users/home.html:67 -msgid "Inactive Users" -msgstr "Inaktiva användare" +#: xl_auth/templates/users/inspect.html:14 xl_auth/user/forms.py:20 +msgid "ToS Approved" +msgstr "Tjänstevillkor godkända" -#: xl_auth/templates/users/inspect.html:14 xl_auth/templates/users/simple_view.html:11 +#: xl_auth/templates/users/inspect.html:17 xl_auth/templates/users/simple_view.html:11 #: xl_auth/templates/users/view.html:30 msgid "Active Account" msgstr "Konto aktivt" -#: xl_auth/templates/users/inspect.html:17 xl_auth/templates/users/view.html:33 +#: xl_auth/templates/users/inspect.html:20 xl_auth/templates/users/view.html:33 #: xl_auth/user/forms.py:142 msgid "System Administrator" msgstr "Systemadministratör" -#: xl_auth/templates/users/inspect.html:23 +#: xl_auth/templates/users/inspect.html:26 msgid "Users Created" msgstr "Användare skapade" -#: xl_auth/templates/users/inspect.html:26 +#: xl_auth/templates/users/inspect.html:29 msgid "Users Modified" msgstr "Användare ändrade" -#: xl_auth/templates/users/inspect.html:29 +#: xl_auth/templates/users/inspect.html:32 msgid "Permissions Created" msgstr "Behörigheter skapade" -#: xl_auth/templates/users/inspect.html:32 +#: xl_auth/templates/users/inspect.html:35 msgid "Permissions Modified" msgstr "Behörigheter ändrade" -#: xl_auth/templates/users/inspect.html:35 +#: xl_auth/templates/users/inspect.html:38 msgid "Collections Created" msgstr "Sigler skapade" -#: xl_auth/templates/users/inspect.html:38 +#: xl_auth/templates/users/inspect.html:41 msgid "Collections Modified" msgstr "Sigler ändrade" -#: xl_auth/templates/users/inspect.html:41 +#: xl_auth/templates/users/inspect.html:44 msgid "Clients Created" msgstr "OAuth2-klienter skapade" -#: xl_auth/templates/users/inspect.html:44 +#: xl_auth/templates/users/inspect.html:47 msgid "Clients Modified" msgstr "OAuth2-klienter ändrade" -#: xl_auth/templates/users/inspect.html:75 xl_auth/templates/users/view.html:73 +#: xl_auth/templates/users/inspect.html:69 +msgid "Own Permissions" +msgstr "Egna behörigheter" + +#: xl_auth/templates/users/inspect.html:78 xl_auth/templates/users/view.html:73 msgid "Active Collection" msgstr "Sigel aktivt" -#: xl_auth/templates/users/inspect.html:111 +#: xl_auth/templates/users/inspect.html:116 +msgid "Permissions Created or Modified by This User" +msgstr "Behörigheter skapade/ändrade av denna användare" + +#: xl_auth/templates/users/inspect.html:127 xl_auth/templates/users/inspect.html:176 +msgid "CatAdm" +msgstr "KatAdm" + +#: xl_auth/templates/users/inspect.html:167 +msgid "Users Created or Modified by This One" +msgstr "Användarkonton skapade/ändrade av denna användare" + +#: xl_auth/templates/users/inspect.html:211 msgid "Password Resets" msgstr "Lösenordsåterställningar" -#: xl_auth/templates/users/inspect.html:116 +#: xl_auth/templates/users/inspect.html:216 msgid "Reset Code" msgstr "Återställningskod" -#: xl_auth/templates/users/inspect.html:148 +#: xl_auth/templates/users/inspect.html:248 msgid "Access Token" msgstr "Access-token" -#: xl_auth/templates/users/profile.html:9 +#: xl_auth/templates/users/profile.html:7 +msgid "Welcome" +msgstr "Välkommen" + +#: xl_auth/templates/users/profile.html:14 msgid "This is your personal profile page." msgstr "Det här är din personliga profil-sida." -#: xl_auth/templates/users/profile.html:14 +#: xl_auth/templates/users/profile.html:19 msgid "Edit Display Name" msgstr "Ändra visningsnamn" -#: xl_auth/templates/users/profile.html:25 +#: xl_auth/templates/users/profile.html:30 msgid "Information About Your Permissions" msgstr "Information om dina behörigheter" -#: xl_auth/templates/users/profile.html:28 +#: xl_auth/templates/users/profile.html:33 msgid "" "If you are missing a permission or any of the permissions below are incorrect, please contact the" " cataloging admin for that collection." @@ -1044,7 +1083,7 @@ msgstr "" "Om du saknar en behörighet eller om någon av behörigheterna nedan är felaktiga, vänligen kontakta" " katalogiseringsadmin för aktuellt sigel." -#: xl_auth/templates/users/profile.html:30 +#: xl_auth/templates/users/profile.html:35 #, python-format msgid "" "You can find the collection administrator contact information by following the collection link " @@ -1055,7 +1094,7 @@ msgstr "" "sigel, eller genom att gå till listvyn för Sigler och där " "klicka på aktuellt sigel." -#: xl_auth/templates/users/profile.html:33 +#: xl_auth/templates/users/profile.html:38 msgid "" "For any other questions or concerns, please contact customer service at libris@kb.se." @@ -1063,7 +1102,7 @@ msgstr "" "För övriga frågor, vänligen kontakta Libris kundservice på libris@kb.se." -#: xl_auth/templates/users/profile.html:46 +#: xl_auth/templates/users/profile.html:51 msgid "" "You are a cataloging admin in Libris Login. This means that you are responsible for managing " "other users' access to your collections. You manage permissions by going to your collection's " @@ -1074,7 +1113,7 @@ msgstr "" " till detaljvyn för ett sigel och använda knapparna \"Lägg till\", \"Ändra\" " "och \"Ta bort\"." -#: xl_auth/templates/users/profile.html:52 +#: xl_auth/templates/users/profile.html:57 msgid "" "When attempting to grant a new permission, you might find that the intended user does not exist. " "In this event, you may register the user account by following this link:" @@ -1083,7 +1122,7 @@ msgstr "" "avsedda mottagaren inte finns registrerad. I detta fall bör du lägga till ett nytt konto via " "länken som följer:" -#: xl_auth/templates/users/profile.html:63 +#: xl_auth/templates/users/profile.html:68 msgid "Your Permissions" msgstr "Dina behörigheter" @@ -1099,10 +1138,6 @@ msgstr "Förnamn Efternamn" msgid "Cataloging Admin for" msgstr "Ansvarig för" -#: xl_auth/user/forms.py:20 -msgid "ToS Approved" -msgstr "Tjänstevillkor godkända" - #: xl_auth/user/forms.py:54 msgid "Send password reset email" msgstr "Maila ut lösenordsåterställningslänk" @@ -1152,27 +1187,30 @@ msgstr "" " vet varför du mottagit detta mail, vänligen kontakta Libris " "kundtjänst!

" -#: xl_auth/user/views.py:39 +#: xl_auth/user/views.py:40 msgid "ToS approved." msgstr "Tjänstevillkorsgodkännande sparat." -#: xl_auth/user/views.py:72 +#: xl_auth/user/views.py:73 #, python-format msgid "User \"%(username)s\" registered and emailed with a password reset link." msgstr "Användaren \"%(username)s\" har registrerats och mailats en lösenordsåterställningslänk." -#: xl_auth/user/views.py:76 +#: xl_auth/user/views.py:77 #, python-format msgid "User \"%(username)s\" registered." msgstr "Användaren \"%(username)s\" har registrerats." -#: xl_auth/user/views.py:154 xl_auth/user/views.py:179 +#: xl_auth/user/views.py:166 xl_auth/user/views.py:191 #, python-format msgid "Thank you for updating user details for \"%(username)s\"." msgstr "Användarinställningar uppdaterade för \"%(username)s\"." -#: xl_auth/user/views.py:205 +#: xl_auth/user/views.py:217 #, python-format msgid "Thank you for changing password for \"%(username)s\"." msgstr "Lösenord för \"%(username)s\" har ändrats." +#~ msgid "Inactive Collections" +#~ msgstr "Inaktiva sigler" + diff --git a/xl_auth/user/views.py b/xl_auth/user/views.py index 9bc4a390..65377a73 100644 --- a/xl_auth/user/views.py +++ b/xl_auth/user/views.py @@ -112,26 +112,37 @@ def inspect(user_id): return redirect(get_redirect_target()) else: tokens = Token.query.filter_by(user=user).all() - permissions_created = Permission.query.filter_by(created_by=user).count() - permissions_modified = Permission.query.filter_by(modified_by=user).count() - collections_created = Collection.query.filter_by(created_by=user).count() - collections_modified = Collection.query.filter_by(modified_by=user).count() - users_created = User.query.filter_by(created_by=user).count() - users_modified = User.query.filter_by(modified_by=user).count() - clients_created = Client.query.filter_by(created_by=user).count() - clients_modified = Client.query.filter_by(modified_by=user).count() + + num_permissions_created = Permission.query.filter_by(created_by=user).count() + num_permissions_modified = Permission.query.filter_by(modified_by=user).count() + permissions_created_or_modified = Permission.query.filter( + (Permission.created_by == user) | (Permission.modified_by == user)).all() + + num_collections_created = Collection.query.filter_by(created_by=user).count() + num_collections_modified = Collection.query.filter_by(modified_by=user).count() + + num_users_created = User.query.filter_by(created_by=user).count() + num_users_modified = User.query.filter_by(modified_by=user).count() + users_created_or_modified = User.query.filter( + ((User.created_by == user) | (User.modified_by == user)) & (User.id != user.id) + ).order_by(User.email).all() + + num_clients_created = Client.query.filter_by(created_by=user).count() + num_clients_modified = Client.query.filter_by(modified_by=user).count() return render_template('users/inspect.html', user=user, tokens=tokens, - permissions_created=permissions_created, - permissions_modified=permissions_modified, - collections_created=collections_created, - collections_modified=collections_modified, - users_created=users_created, - users_modified=users_modified, - clients_created=clients_created, - clients_modified=clients_modified) + num_permissions_created=num_permissions_created, + num_permissions_modified=num_permissions_modified, + permissions_created_or_modified=permissions_created_or_modified, + num_collections_created=num_collections_created, + num_collections_modified=num_collections_modified, + num_users_created=num_users_created, + num_users_modified=num_users_modified, + users_created_or_modified=users_created_or_modified, + num_clients_created=num_clients_created, + num_clients_modified=num_clients_modified) @blueprint.route('/administer/', methods=['GET', 'POST'])