mirror of
https://github.com/viewflow/viewflow.git
synced 2026-03-13 10:32:34 +08:00
Changes sync
This commit is contained in:
@@ -2,6 +2,15 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
2.0.0.b7 2023-08-25
|
||||
-------------------
|
||||
|
||||
- Fix pre-populated file field value
|
||||
- Improvements for depended select widget
|
||||
- Add total counter widget
|
||||
- Improve wizard template default breadcrumbs
|
||||
- Support for %b date format
|
||||
|
||||
2.0.0.b6 2023-07-28
|
||||
-------------------
|
||||
|
||||
|
||||
@@ -183,10 +183,13 @@ modifications of Viewflow. You can find the commercial license terms in
|
||||
|
||||
## Changelog
|
||||
|
||||
2.0.0.b6 2023-07-28
|
||||
-------------------
|
||||
### 2.0.0.b7 2023-08-25
|
||||
|
||||
- Fix label for File and Image fields
|
||||
- Fix pre-populated file field value
|
||||
- Improvements for depended select widget
|
||||
- Add total counter widget
|
||||
- Improve wizard template default breadcrumbs
|
||||
- Support for %b date format
|
||||
|
||||
|
||||
[build]: https://img.shields.io/github/actions/workflow/status/viewflow/viewflow/django.yml?branch=main
|
||||
|
||||
2
setup.py
2
setup.py
@@ -4,7 +4,7 @@ README = open("README.md", "r", encoding="utf-8").read()
|
||||
|
||||
setuptools.setup(
|
||||
name="django-viewflow",
|
||||
version="2.0.0b6",
|
||||
version="2.0.0b7",
|
||||
author_email="kmmbvnr@gmail.com",
|
||||
author="Mikhail Podgurskiy",
|
||||
description="Reusable library to build business applications fast",
|
||||
|
||||
@@ -84,6 +84,14 @@ const VSelectField = customElement('vf-field-select', defaultProps, (props, {ele
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (mdcSelect) {
|
||||
mdcSelect.destroy()
|
||||
mdcSelect = new select.MDCSelect(control);
|
||||
const event = new CustomEvent('change', {
|
||||
bubbles: true,
|
||||
detail: {index: -1, value: undefined},
|
||||
});
|
||||
element.dispatchEvent(event);
|
||||
|
||||
mdcSelect.layoutOptions();
|
||||
}
|
||||
});
|
||||
|
||||
100
viewflow/static/viewflow/js/viewflow.min.js
vendored
100
viewflow/static/viewflow/js/viewflow.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,12 +1,16 @@
|
||||
{% extends 'viewflow/views/form.html' %}
|
||||
{% load i18n %}
|
||||
{% load i18n viewflow %}
|
||||
|
||||
{% block form-header-title %}
|
||||
<h1 class="vf-card__title">
|
||||
TODO
|
||||
{{ view|class_title }}
|
||||
</h1>
|
||||
{% endblock %}
|
||||
{% block breadcrumbs_items %}TODO{% endblock %}
|
||||
{% block breadcrumbs_items %}
|
||||
<a>{{ viewset|class_title }}</a>
|
||||
<a>{{ view|class_title }}</a>
|
||||
<a>{{ form|class_title }}</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block form-actions-list %}
|
||||
{{ wizard.management_form }}
|
||||
|
||||
@@ -16,6 +16,7 @@ from django.utils.html import conditional_escape
|
||||
from viewflow.contrib import auth
|
||||
from viewflow.forms import FormLayout
|
||||
from viewflow.urls import Site, Viewset, current_viewset_reverse
|
||||
from viewflow.utils import camel_case_to_title
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@@ -285,7 +286,7 @@ def list_column_order(column_def, list_view):
|
||||
|
||||
@register.filter
|
||||
def list_page_data(page, list_view):
|
||||
"""Formated page data for a table.
|
||||
"""Formatted page data for a table.
|
||||
|
||||
Returned data is a list of list of cell values zipped with column definitions.
|
||||
[[(column, value), (column, value), ...], ...]
|
||||
@@ -296,3 +297,23 @@ def list_page_data(page, list_view):
|
||||
@register.filter
|
||||
def list_order(request_kwargs, list_view):
|
||||
return request_kwargs.get(list_view.ordering_kwarg, "")
|
||||
|
||||
|
||||
@register.filter(name="class_title")
|
||||
def class_title(obj):
|
||||
# If title attribute exists, return it
|
||||
if hasattr(obj, "title"):
|
||||
return obj.title
|
||||
|
||||
# Otherwise, process class name
|
||||
class_name = obj.__class__.__name__
|
||||
|
||||
# Remove "Form" and "Wizard" substrings
|
||||
cleaned_name = (
|
||||
class_name.replace("Form", "").replace("Wizard", "").replace("View", "")
|
||||
)
|
||||
|
||||
if cleaned_name:
|
||||
return camel_case_to_title(cleaned_name)
|
||||
else:
|
||||
return camel_case_to_title(class_name)
|
||||
|
||||
Reference in New Issue
Block a user