Skip to content

Commit

Permalink
Merge pull request #529 from delijati/main
Browse files Browse the repository at this point in the history
[WIP] bootstrap5 + icons
  • Loading branch information
stevepiercy authored Nov 15, 2023
2 parents f4da7df + 2a86675 commit fdc43d5
Show file tree
Hide file tree
Showing 39 changed files with 186 additions and 576 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ jobs:
strategy:
matrix:
py:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "pypy-3.7"
- "3.10"
- "3.11"
- "3.12"
- "pypy-3.10"
os:
- "ubuntu-latest"
- "windows-latest"
Expand Down Expand Up @@ -48,7 +49,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
architecture: ${{ matrix.architecture }}
Expand All @@ -69,9 +70,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
architecture: x64
- name: Install requirements
run: |
Expand All @@ -91,22 +92,22 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
architecture: x64
- run: |
pip install tox
tox -e py39-cover,coverage
tox -e py311-cover,coverage
docs:
runs-on: ubuntu-latest
name: Build the documentation
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
architecture: x64
- run: |
pip install tox
Expand All @@ -117,9 +118,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11
architecture: x64
- run: |
pip install tox
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ use cases <https://deformdemo.pylonsproject.org/>`_ are supported out of the box

Deform integrates with the `Pyramid web framework <https://trypyramid.com/>`_
and several other web frameworks. Deform comes with `Chameleon templates
<https://chameleon.readthedocs.io/en/latest/>`_ and `Bootstrap 3
<https://getbootstrap.com/docs/3.3/>`_ styling. Under the hood, `Colander schemas
<https://chameleon.readthedocs.io/en/latest/>`_ and `Bootstrap 5
<https://getbootstrap.com/docs/5.3/>`_ styling. Under the hood, `Colander schemas
<https://github.com/Pylons/colander>`_ are used for serialization and
validation. The `Peppercorn <https://github.com/Pylons/peppercorn>`_ library
maps HTTP form submissions to nested structure.
Expand Down
75 changes: 0 additions & 75 deletions deform/compat.py

This file was deleted.

8 changes: 3 additions & 5 deletions deform/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# Deform
from deform.widget import HiddenWidget

from . import compat
from . import decorator
from . import exception
from . import schema
Expand Down Expand Up @@ -235,7 +234,7 @@ def __init__(
focus == "on"
and not focused
and type(child.typ) in Field.focusable_input_types
and type(child.widget) != Field.hidden_type
and type(child.widget) is not Field.hidden_type
and not self.have_first_input
):
first_input_index = child_count
Expand Down Expand Up @@ -331,7 +330,6 @@ def set_default_renderer(cls, renderer):

@classmethod
def set_default_resource_registry(cls, registry):

"""Set the callable that will act as a default
:term:`resource registry` for instances of the associated
class when no ``resource_registry`` argument is provided to
Expand Down Expand Up @@ -407,7 +405,7 @@ def widget(self):
self.schema.typ.__class__
)
if widget_maker is None:
for (cls, wgt) in schema.default_widget_makers.items():
for cls, wgt in schema.default_widget_makers.items():
if isinstance(self.schema.typ, cls):
widget_maker = wgt
break
Expand All @@ -420,7 +418,7 @@ def default_item_css_class(self):
return None

css_class = (
unicodedata.normalize("NFKD", compat.text_type(self.name))
unicodedata.normalize("NFKD", str(self.name))
.encode("ascii", "ignore")
.decode("ascii")
)
Expand Down
3 changes: 1 addition & 2 deletions deform/form.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from chameleon.utils import Markup

from . import compat
from . import field
from . import widget

Expand Down Expand Up @@ -142,7 +141,7 @@ def __init__(
field.Field.__init__(self, schema, **kw)
_buttons = []
for button in buttons:
if isinstance(button, compat.string_types):
if isinstance(button, str):
button = Button(button)
_buttons.append(button)
self.action = action
Expand Down
5 changes: 5 additions & 0 deletions deform/static/css/bootstrap-icons.min.css

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions deform/static/css/bootstrap.min.css

Large diffs are not rendered by default.

Binary file added deform/static/css/fonts/bootstrap-icons.woff
Binary file not shown.
Binary file added deform/static/css/fonts/bootstrap-icons.woff2
Binary file not shown.
27 changes: 0 additions & 27 deletions deform/static/css/form.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,30 +40,3 @@ form .deform-readonly-text {
.upload-filename[readonly] {
background-color: #fdfdfd;
}


/**
* Accordion styling
*
* http://stackoverflow.com/a/18568997/315168
*/


.deform-collapse-heading > a {
display: block; /* Make target area more touch friendly */
text-decoration: none;
}


.deform-collapse-heading > a:after {
/* symbol for "opening" panels */
font-family: 'Glyphicons Halflings'; /* essential for enabling glyphicon */
float: right; /* adjust as needed */
content: "\e080"; /* adjust as needed, taken from bootstrap.css */

}

.deform-collapse-heading > a[aria-expanded="true"]:after {
/* symbol for "collapsed" panels */
content: "\e114";
}
4 changes: 2 additions & 2 deletions deform/static/css/typeahead.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
border-radius: 4px !important;
}

.input-group-addon + .twitter-typeahead > .tt-query {
.input-group-text + .twitter-typeahead > .tt-query {
border-top-left-radius: 0!important;
border-bottom-left-radius: 0!important;
}
Expand Down Expand Up @@ -78,4 +78,4 @@

.tt-suggestion p {
margin: 0;
}
}
Binary file removed deform/static/fonts/glyphicons-halflings-regular.eot
Binary file not shown.
Loading

0 comments on commit fdc43d5

Please sign in to comment.