Compare commits

...

25 Commits

Author SHA1 Message Date
Guido Longoni 98eefe2877 Merge commit '8d3d7c9648c58c7c5d0cc219bae2ef6fa43abd8b' into my-merge-progressivo1 2023-06-22 11:47:41 +02:00
Guido Longoni a302ea49dc Merge commit '363bc310a1cc8641810debb94529ec651105b87a' into my-merge-progressivo1 2023-06-22 11:41:05 +02:00
Guido Longoni ae53c43b29 Merge commit '951c07b76d7835b72a4e1f636639ad1219c207b6' into my-merge-progressivo1 2023-06-22 11:24:21 +02:00
Fabio Caccamo 8d3d7c9648 [css] Fix variable name typo. 2022-09-28 18:00:05 +02:00
Fabio Caccamo 668c8c806b [html] Add missing version cache-buster to some stylesheets. 2022-09-28 16:58:44 +02:00
Fabio Caccamo 8562c2dbfb [css] Move `language-chooser` style to its own CSS file. 2022-09-28 16:55:00 +02:00
Fabio Caccamo 585575dce7 [js] Fix modal window not closing on save with `django >= 4.0`. #169 2022-09-28 16:34:26 +02:00
Fabio Caccamo 990db6fdc8 [css] Fix sticky list filter scrolling. #175 2022-09-28 15:37:06 +02:00
Fabio Caccamo 5fb85d02a2 [css] Fix paginator missing `border-top` on mobile. 2022-09-28 12:46:11 +02:00
Yury V. Zaytsev 833acf49a1
Fix `README.md` typo on French language name. (#171) 2022-09-20 11:17:25 +02:00
Fabio Caccamo 951c07b76d Update `CHANGELOG` and version. 2022-08-25 12:17:01 +02:00
Fabio Caccamo 769fab5e84 Add `django-streamfield` compatibility. 2022-08-25 12:03:39 +02:00
Fabio Caccamo 6eebeb62c1 Removed testing comments. 2022-08-25 12:00:44 +02:00
Fabio Caccamo 53e9b3f9f7 Fix CSS variable name typo. 2022-08-25 11:58:54 +02:00
Fabio Caccamo b90ed72ef6 Update `README` css variables section. 2022-08-25 11:58:20 +02:00
Fabio Caccamo 11bde80a36 Update `CHANGELOG` and version. 2022-08-04 14:41:46 +02:00
Jon 003b0f9892
Update admin_interface_tags.py (#168) 2022-08-03 20:07:08 +02:00
Tim Gates 3156882cba
docs: Fix a few typos (#166) 2022-07-31 08:15:07 +02:00
Fabio Caccamo de09ffd7b1
Update FUNDING.yml 2022-06-22 14:43:31 +02:00
Fabio Caccamo ce552f9f0c
Updated README. [ci skip] 2022-06-16 00:41:11 +02:00
Fabio Caccamo 502b1af775 Updated CHANGELOG and version. 2022-05-14 15:55:16 +02:00
Fabio Caccamo 4212a695f0 Updated create-release workflow. 2022-05-14 15:55:05 +02:00
Fabio Caccamo 04632078d1 [css] Fixed dashboard alignment when recent-actions are not visible. 2022-05-10 10:44:05 +02:00
Fabio Caccamo 94c436b137 Reformatted Theme model choices. 2022-05-10 10:43:40 +02:00
Fabio Caccamo 1e3b71825b Corrected wrong PyPI project urls. 2022-03-15 08:55:28 +01:00
20 changed files with 520 additions and 220 deletions

1
.github/FUNDING.yml vendored
View File

@ -1,2 +1 @@
github: [fabiocaccamo]
custom: ['https://www.paypal.me/fabiocaccamo']

View File

@ -18,12 +18,7 @@ jobs:
uses: ffurrer2/extract-release-notes@v1
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
body: ${{ steps.extract-release-notes.outputs.release_notes }}
token: ${{ secrets.WORKFLOWS_CREATE_RELEASE_TOKEN }}

View File

@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.20.0](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.20.0) - 2022-08-25
- Add `django-streamfield` compatibility.
## [0.19.2](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.19.2) - 2022-08-04
- Fix `hashlib` compatibility with `FIPS` enabled systems. #167 (by [@jonlev1n](https://github.com/jonlev1n) in #168)
## [0.19.1](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.19.1) - 2022-05-14
- [css] Fixed dashboard alignment when recent-actions are not visible.
## [0.19.0](https://github.com/fabiocaccamo/django-admin-interface/releases/tag/0.19.0) - 2022-03-08
- Converted dynamic inline CSS to external static CSS using CSS variables. #157 #93 (thanks to [@Mustafa-Abu-Ghazy](https://github.com/Mustafa-Abu-Ghazy))

View File

@ -37,6 +37,7 @@ django-admin-interface is a modern **responsive flat admin interface customizabl
- `django-json-widget`
- `django-modeltranslation`
- `django-tabbed-admin`
- `django-streamfield`
- `sorl-thumbnail`
---
@ -100,31 +101,48 @@ You can add a theme you've created through the admin to this repository by [send
4. Edit the section above to document your theme.
### Add theme support to third-party libraries
You can add **theme support to existing third-party libraries** using the following **css variables**:
You can add **theme support to existing third-party libraries** using the following **CSS variables**:
- `--admin-interface-title-color`
- `--admin-interface-logo-color`
- `--admin-interface-env-color`
- `--admin-interface-header-background-color:`
#### Header
- `--admin-interface-header-background-color`
- `--admin-interface-header-text-color`
- `--admin-interface-header-link-color`
- `--admin-interface-header-link_hover-color`
- `--admin-interface-title-color`
- `--admin-interface-env-color`
#### Logo
- `--admin-interface-logo-color`
- `--admin-interface-logo-default-background-image`
- `--admin-interface-logo-max-width`
- `--admin-interface-logo-max-height`
#### Modules / Links
- `--admin-interface-module-background-color`
- `--admin-interface-module-background-selected-color`
- `--admin-interface-module-border-radius`
- `--admin-interface-module-text-color`
- `--admin-interface-module-link-color`
- `--admin-interface-module-link-selected-color`
- `--admin-interface-module-link-hover-color`
- `--admin-interface-generic-link-color`
- `--admin-interface-generic-link-hover-color`
#### Buttons
- `--admin-interface-save-button-background-color`
- `--admin-interface-save-button-background-hover-color`
- `--admin-interface-save-button-text-color`
- `--admin-interface-delete-button-background-color`
- `--admin-interface-delete-button-background-hover-color`
- `--admin-interface-delete-button-text-color`
#### Related Modal
- `--admin-interface-related-modal-background-color`
- `--admin-interface-related-modal-background-opacity`
- `--admin-interface-related-modal-border-radius`
- `--admin-interface-related-modal-close-button-display`
---
@ -158,7 +176,7 @@ You must configure multilanguage `settings` and `urls` correctly:
LANGUAGES = (
("en", _("English")),
("it", _("Italiano")),
("fr", _("Française")),
("fr", _("Français")),
# more than one language is expected here
)
LANGUAGE_CODE = "en"
@ -187,18 +205,17 @@ urlpatterns += i18n_patterns(path("admin/", admin.site.urls))
## Testing
```bash
# create python virtual environment
virtualenv testing_django_admin_interface
# clone repository
git clone https://github.com/fabiocaccamo/django-admin-interface.git && cd django-admin-interface
# activate virtualenv
cd testing_django_admin_interface && . bin/activate
# create virtualenv and activate it
python -m venv venv && . venv/bin/activate
# clone repo
git clone https://github.com/fabiocaccamo/django-admin-interface.git src && cd src
# upgrade pip
python -m pip install --upgrade pip
# install dependencies
pip install -r requirements.txt
pip install -r requirements-test.txt
# install requirements
pip install -r requirements.txt -r requirements-test.txt
# run tests
tox
@ -215,6 +232,13 @@ Released under [MIT License](LICENSE.txt).
---
## Supporting
- :star: Star this project on [GitHub](https://github.com/fabiocaccamo/django-admin-interface)
- :octocat: Follow me on [GitHub](https://github.com/fabiocaccamo)
- :blue_heart: Follow me on [Twitter](https://twitter.com/fabiocaccamo)
- :moneybag: Sponsor me on [Github](https://github.com/sponsors/fabiocaccamo)
## See also
- [`django-colorfield`](https://github.com/fabiocaccamo/django-colorfield) - simple color field for models with a nice color-picker in the admin. 🎨

View File

@ -172,14 +172,8 @@ class Theme(models.Model):
default=True, verbose_name=_("active")
)
language_chooser_display_choices = (
(
"code",
_("code"),
),
(
"name",
_("name"),
),
("code", _("code")),
("name", _("name")),
)
language_chooser_display = models.CharField(
max_length=10,
@ -332,42 +326,15 @@ class Theme(models.Model):
verbose_name=_("background color"),
)
related_modal_background_opacity_choices = (
(
"0.1",
"10%",
),
(
"0.2",
"20%",
),
(
"0.3",
"30%",
),
(
"0.4",
"40%",
),
(
"0.5",
"50%",
),
(
"0.6",
"60%",
),
(
"0.7",
"70%",
),
(
"0.8",
"80%",
),
(
"0.9",
"90%",
),
("0.1", "10%"),
("0.2", "20%"),
("0.3", "30%"),
("0.4", "40%"),
("0.5", "50%"),
("0.6", "60%"),
("0.7", "70%"),
("0.8", "80%"),
("0.9", "90%"),
)
related_modal_background_opacity = models.CharField(
max_length=5,

View File

@ -3,6 +3,7 @@
'use strict';
var windowRef = window;
var windowRefProxy;
var windowName, widgetName;
var openerRef = windowRef.opener;
if (!openerRef) {
@ -14,12 +15,14 @@
// django < 3.1 compatibility
widgetName = openerRef.id_to_windowname(widgetName);
}
windowRef = {
windowRefProxy = {
name: widgetName,
location: windowRef.location,
close: function() {
openerRef.dismissRelatedObjectModal();
}
};
windowRef = windowRefProxy;
}
// default django popup_response.js

View File

@ -1507,7 +1507,7 @@
}
},
// Get element postion relative to viewport
// Get element position relative to viewport
_getOffset: function(isLarge) {
var el;
if(isLarge) {

View File

@ -136,23 +136,30 @@ if (typeof(django) !== 'undefined' && typeof(django.jQuery) !== 'undefined')
window.presentRelatedObjectModalOnClickOn = presentRelatedObjectModalOnClickOn;
// django 1.7 compatibility
// $('a.add-another').removeAttr('onclick').click({ lookup:false }, presentRelatedObjectModal);
presentRelatedObjectModalOnClickOn('a.add-another');
// django 1.8 and above
// $('a.related-widget-wrapper-link').click({ lookup:false }, presentRelatedObjectModal);
presentRelatedObjectModalOnClickOn('a.related-widget-wrapper-link');
// raw_id_fields support
// $('a.related-lookup').unbind('click').click({ lookup:true }, presentRelatedObjectModal);
presentRelatedObjectModalOnClickOn('a.related-lookup', true);
// django-dynamic-raw-id support - #61
// https://github.com/lincolnloop/django-dynamic-raw-id
presentRelatedObjectModalOnClickOn('a.dynamic_raw_id-related-lookup', true);
// show_change_link=True support
presentRelatedObjectModalOnClickOn('a.inlinechangelink');
// django-streamfield support
// https://github.com/raagin/django-streamfield/
presentRelatedObjectModalOnClickOn('.streamfield_app a.stream-btn[href*="_popup=1"]');
// Vanilla js for catching the click during capture phase for anticipating Vue.js listener.
document.addEventListener('click', function(event) {
// console.log('click intercepted before Vue.');
if (event.target.matches('.streamfield_app a.stream-btn[href*="_popup=1"]')) {
event.stopImmediatePropagation();
event.preventDefault();
$(event.target).trigger('click');
}
}, { capture: true });
});
})(django.jQuery);

View File

@ -49,7 +49,7 @@ CKEDITOR.skin.name = 'husky';
// the complete list:
// http://docs.ckeditor.com/#!/api/CKEDITOR.env
//
// Internet explorer is an expection and the browser version is also accepted
// Internet explorer is an exception and the browser version is also accepted
// (ie7, ie8, ie9, ie10), as well as a special name for IE in Quirks mode (iequirks).
//
// The available browser specific files must be set separately for editor.css

View File

@ -0,0 +1,22 @@
(function() {
'use strict';
var windowRef = window;
var openerRef = windowRef.parent;
var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse);
switch (initData.action) {
case 'change':
openerRef.streamapps[initData.app_id].updateBlock(initData.block_id, initData.instance_id);
openerRef.dismissRelatedObjectModal();
break;
case 'delete':
break;
default:
openerRef.streamapps[initData.app_id].updateBlock(initData.block_id, initData.instance_id);
openerRef.dismissRelatedObjectModal();
break;
}
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
white-space: nowrap;
text-overflow: ellipsis;
border-radius: 0;
border-top: 1px solid #EEEEEE;
border-top: 1px solid #EEEEEE !important;
border-bottom: none;
margin: 0;
}

View File

@ -0,0 +1,29 @@
.admin-interface .language-chooser {
display: inline-block;
position: absolute;
top: 15px;
right: 15px;
z-index: 10;
}
@media (min-width: 768px) {
.admin-interface .language-chooser {
right: 30px;
}
}
@media (min-width: 1024px) {
.admin-interface .language-chooser {
position: static;
float: right;
margin-left: 20px;
}
}
.admin-interface .language-chooser-hidden-form {
display: none;
}
.admin-interface .language-chooser-select-form {
display: inline-block;
}

View File

@ -3,10 +3,14 @@ list-filter-dropdown
*/
.admin-interface .list-filter-dropdown {
margin-top:10px;
margin-top: 0;
margin-bottom: 20px;
}
.admin-interface .list-filter-dropdown h3 {
margin-top: 0;
}
.admin-interface .list-filter-dropdown select {
background-color: #FFFFFF;
width: calc(100% - 30px);

View File

@ -1,8 +1,11 @@
{% if not theme.recent_actions_visible %}
.admin-interface.dashboard #content {
width: auto;
max-width: 600px;
margin-right: 0;
margin-left: 0;
}
.admin-interface.dashboard #content #recent-actions-module {
display: none;
}

View File

@ -0,0 +1,200 @@
/*
django-streamfield support
https://github.com/raagin/django-streamfield/
*/
.admin-interface .form-row.field-stream {
margin: 0;
padding: 0;
border-bottom: none;
}
.admin-interface .form-row.field-stream label[for=id_stream] {
display: none;
}
.admin-interface .streamfield_app {
clear: both;
width: 100%;
}
.admin-interface .streamfield_app .stream-help-text {
margin-bottom: 15px;
display: flex;
flex-direction: column;
clear: both;
}
.admin-interface .streamfield_app .stream-help-text .stream-help-text__title {
align-self: flex-end;
user-select: none;
padding: 8px;
padding-right: 0;
color: var(--admin-interface-generic-link-color);
}
.admin-interface .streamfield_app .stream-help-text .stream-help-text__title:hover {
color: var(--admin-interface-generic-link-hover-color);
}
.admin-interface .streamfield_app .stream-help-text .stream-help-text__content {
background: var(--admin-interface-module-background-selected-color);
border-radius: var(--admin-interface-module-border-radius);
border: 1px solid rgba(0,0,0,0.1);
padding: 15px;
}
.admin-interface .streamfield_app .stream-help-text .stream-help-text__content > ul {
margin: 0;
padding: 0;
}
.admin-interface .streamfield_app .collapse-handler {
user-select: none;
padding: 8px;
padding-right: 0;
margin: 0 0 5px 0;
color: var(--admin-interface-generic-link-color);
text-decoration: none;
}
.admin-interface .streamfield_app .collapse-handler:hover {
color: var(--admin-interface-generic-link-hover-color);
text-decoration: none;
}
.admin-interface .streamfield_app .stream-model-block {
position: relative;
box-shadow: none;
border: 1px solid rgba(0,0,0,0.1);
border-radius: var(--admin-interface-module-border-radius);
overflow: hidden;
}
.admin-interface .streamfield_app .stream-model-block,
.admin-interface .streamfield_app .streamfield-models.collapsed .stream-model-block {
margin-bottom: 10px;
}
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin: 0;
padding: 10px 10px 10px 20px;
}
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title span {
font-size: 18px;
}
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle {
position: static;
right: 0;
top: 0;
color: var(--admin-interface-generic-link-color);
}
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle:hover {
color: var(--admin-interface-generic-link-hover-color);
}
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle {
display: flex;
justify-content: center;
align-items: center;
}
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-move,
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-delete {
display: flex;
justify-content: center;
align-items: center;
width: 40px;
height: 40px;
font-weight: normal;
background: none;
flex-shrink: 0;
color: inherit;
font-size: 16px;
}
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-move {
cursor: move; /* fallback if grab cursor is unsupported */
cursor: grab;
cursor: -moz-grab;
cursor: -webkit-grab;
}
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-move:before {
content: "↕";
display: block;
}
.admin-interface .streamfield_app .stream-model-block .streamblock__block__title .streamblock__block-handle .block-delete:before {
content: "×";
display: block;
font-size: 18px;
}
.admin-interface .streamfield_app .block-fields > div {
margin-bottom: 15px;
}
.admin-interface .streamfield_app .stream-model-block .stream-model-block__content {
background-color: #f8f8f8;
padding: 20px;
}
.admin-interface .streamfield_app .stream-model-block .stream-model-block__content.no-subblocks.abstract-block {
display: none;
}
.admin-interface .streamfield_app .stream-insert-new-block {
margin-bottom: 20px;
}
.admin-interface .streamfield_app .stream-insert-new-block .add-new-block-button {
color: var(--admin-interface-generic-link-color);
text-decoration: none;
}
.admin-interface .streamfield_app .stream-insert-new-block .add-new-block-button:hover {
color: var(--admin-interface-generic-link-hover-color);
text-decoration: none;
}
.admin-interface .streamfield_app .stream-insert-new-block ul {
display: block;
width: 100%;
margin: 10px 0 0 0;
padding: 0;
user-select: none;
}
.admin-interface .streamfield_app .stream-insert-new-block ul li {
display: inline-block;
font-size: 12px;
margin: 0;
padding: 0;
}
.admin-interface .streamfield_app .stream-btn {
font-weight: normal;
text-decoration: none;
background-color: var(--admin-interface-generic-link-color);
padding: 6px 12px;
border-radius: 4px;
}
.admin-interface .streamfield_app .stream-btn:hover {
text-decoration: none;
background-color: var(--admin-interface-generic-link-hover-color);
}
.admin-interface .streamfield_app .stream-insert-new-block ul li .stream-btn {
margin-top: 5px;
margin-left: 5px;
}

View File

@ -80,9 +80,9 @@ def get_admin_interface_version():
def hash_string(text):
hash_object = hashlib.md5(text.encode())
md5_hash = hash_object.hexdigest()
return md5_hash
hash_object = hashlib.sha224(text.encode())
sha224_hash = hash_object.hexdigest()
return sha224_hash
@simple_tag(takes_context=False)

View File

@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
__version__ = "0.19.4"
__version__ = "0.20.0"

View File

@ -12,7 +12,6 @@ sponsor_url = "https://github.com/sponsors/fabiocaccamo/"
twitter_url = "https://twitter.com/fabiocaccamo"
package_name = "django-admin-interface"
package_url = "{}/{}".format(github_url, package_name)
package_issues_url = "{}/issues".format(github_url)
package_path = os.path.abspath(os.path.dirname(__file__))
long_description_file_path = os.path.join(package_path, "README.md")
long_description_content_type = "text/markdown"
@ -39,8 +38,8 @@ setup(
url=package_url,
download_url="{}/archive/{}.tar.gz".format(package_url, __version__),
project_urls={
"Documentation": package_url,
"Issues": package_issues_url,
"Documentation": "{}#readme".format(package_url),
"Issues": "{}/issues".format(package_url),
"Funding": sponsor_url,
"Twitter": twitter_url,
},