Skip to content

Commit

Permalink
Feature/slugify fix for accents (#309)
Browse files Browse the repository at this point in the history
* wip new slugify function

* New slugify function

* Added changelog
  • Loading branch information
David-Esteves authored and mmarcos committed Sep 3, 2018
1 parent cf29f52 commit 6afd8e6
Show file tree
Hide file tree
Showing 5 changed files with 15,895 additions and 12 deletions.
24 changes: 17 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

Always reference the ticket number at the end of the issue description.
Expand All @@ -14,6 +14,16 @@ Always reference the ticket number at the end of the issue description.
- added black check into CI


## 1.3.3

### Changed
- Changed slugify function

### Breaking
- Previous slugify ignored characters with accents (é á etc...)
This can affect existing slug depending on how the project is setup


## 1.3.3

- fix bug with iframe view containing params
Expand Down Expand Up @@ -71,7 +81,7 @@ Always reference the ticket number at the end of the issue description.
- added collapsible and collapsible_gettext helper functions to help define
form layouts.
- added confirmation dialog support in Form actions [#294][294]
- added modal iFrame support in Lists (`tool_links`, `field_links`,
- added modal iFrame support in Lists (`tool_links`, `field_links`,
`action_links`) and Forms (`actions`) [#243][243]
- extended tutorial documentation of Forms.

Expand All @@ -98,7 +108,7 @@ Always reference the ticket number at the end of the issue description.
## Removed

- QuickFiltersFormMixin this is no longer needed, the same functionality can be
added by using a `ChoiceField` with a `QuickFiltersSelect` or a
added by using a `ChoiceField` with a `QuickFiltersSelect` or a
`QuickFiltersSelectMultiple` widget.


Expand Down Expand Up @@ -201,7 +211,7 @@ Always reference the ticket number at the end of the issue description.

## Added

- `DataListView`, a `ListView` that uses APIs as source of data - [#172][172]
- `DataListView`, a `ListView` that uses APIs as source of data - [#172][172]
- Float Labels option for form displays - [#221][221]

## Changed
Expand Down Expand Up @@ -262,12 +272,12 @@ Always reference the ticket number at the end of the issue description.

### Changed

- Simplified the frontend tooling, removing Bower and foundation-cli, setup is
- Simplified the frontend tooling, removing Bower and foundation-cli, setup is
now based on npm and gulp - [#161][161]

### Fixed

- In the listview, don't generate NoReverseMatch exception if any value of
- In the listview, don't generate NoReverseMatch exception if any value of
the arguments is None.

[161]: //github.com/sanoma/django-arctic/issues/161
Expand All @@ -277,7 +287,7 @@ Always reference the ticket number at the end of the issue description.

### Changed

- `FormView`, `CreateView` and `UpdateView` added a `layout` property to
- `FormView`, `CreateView` and `UpdateView` added a `layout` property to
easily customize positioning and width of form fields - [#75][75]
- Added support for virtual fields in `ListView` - [#73][73]
- Improved the date/time picker in Date/Time fields - [#78][78]
Expand Down
6 changes: 4 additions & 2 deletions arctic/static/arctic/dist/assets/css/arctic.css

Large diffs are not rendered by default.

17 changes: 16 additions & 1 deletion arctic/static/arctic/dist/assets/img/arctic_logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15,851 changes: 15,850 additions & 1 deletion arctic/static/arctic/dist/assets/js/app.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion arctic/static/arctic/src/assets/js/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ window.arctic.utils = {
},

slugify: function ( text ) {
text = text.toLowerCase();

// remove accents, swap ñ for n, etc
let from = 'àáäâèéëêìíïîòóöôùúüûñç';
let to = 'aaaaeeeeiiiioooouuuunc';
for (let i=0, l=from.length ; i<l ; i++) {
text = text.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}
return text
.toLowerCase()
.replace( /[^\w ]+/g, '' )
.replace( / +/g, '-' );
}
Expand Down

0 comments on commit 6afd8e6

Please sign in to comment.