Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
django-cms-highlighted-content
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WebU
shared
django-cms-highlighted-content
Commits
35905c27
Commit
35905c27
authored
6 years ago
by
Dylann Cordel
Browse files
Options
Downloads
Patches
Plain Diff
fix setting
parent
6ddc6c9c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-12
2 additions, 12 deletions
README.md
cms_highlighted_content/forms.py
+1
-1
1 addition, 1 deletion
cms_highlighted_content/forms.py
cms_highlighted_content/models.py
+1
-1
1 addition, 1 deletion
cms_highlighted_content/models.py
with
4 additions
and
14 deletions
README.md
+
2
−
12
View file @
35905c27
...
@@ -8,16 +8,6 @@ Each item is a related instance of whatever model you allow. You can have a high
...
@@ -8,16 +8,6 @@ Each item is a related instance of whatever model you allow. You can have a high
item which is a
`News`
instance, then a item which is a
`Page`
instance, then a item which is a
item which is a
`News`
instance, then a item which is a
`Page`
instance, then a item which is a
`MagicPony`
instance etc.
`MagicPony`
instance etc.
HighlightedContent is built with WAI consideration and use recommendations you can find on the w3c:
https://www.w3.org/WAI/tutorials/highlighted_contents/
Javascript part is done with
[
tinyhighlighted_content
](
https://github.com/wieringen/tinyhighlighted_content
)
, a light
jQuery module, with some custom improvment:
*
when hovering the highlighted_content, it is stopped, and restarted when your mouse leaves the area
*
axis of the highlighted_content (x / y) is changed when your highlighted_content area width is bellow the breakpoint
you defined
## How to use it
## How to use it
...
@@ -34,7 +24,7 @@ INSTALLED_APPS = [
...
@@ -34,7 +24,7 @@ INSTALLED_APPS = [
'highlighted_content',
'highlighted_content',
]
]
CMS_
CAROUSEL_SLIDE
S_MODELS = (
CMS_
HIGHLIGHTED_CONTENT_ITEM
S_MODELS = (
# format: ('app_name', ('SomeModel', 'AnOther', )),
# format: ('app_name', ('SomeModel', 'AnOther', )),
('news', ('News', ),),
('news', ('News', ),),
('fosm', ('Chronicle', 'Note', 'Dossier', 'Conference')),
('fosm', ('Chronicle', 'Note', 'Dossier', 'Conference')),
...
@@ -78,7 +68,7 @@ plugin_pool.register_plugin(HighlightedContentPlugin)
...
@@ -78,7 +68,7 @@ plugin_pool.register_plugin(HighlightedContentPlugin)
### 4. Templates
### 4. Templates
Slides can be from multiple models (configured in
`CMS_
CAROUSEL_SLIDE
S_MODELS`
). You must create
Slides can be from multiple models (configured in
`CMS_
HIGHLIGHTED_CONTENT_ITEM
S_MODELS`
). You must create
at least a general template (
`highlighted_content/highlighted_content_item.html`
) which can manage all available
at least a general template (
`highlighted_content/highlighted_content_item.html`
) which can manage all available
models.
models.
...
...
This diff is collapsed.
Click to expand it.
cms_highlighted_content/forms.py
+
1
−
1
View file @
35905c27
...
@@ -44,7 +44,7 @@ class HighlightedContentItemForm(ModelForm):
...
@@ -44,7 +44,7 @@ class HighlightedContentItemForm(ModelForm):
def
get_content_types_queryset
(
self
):
def
get_content_types_queryset
(
self
):
items_models
=
getattr
(
self
,
'
highlighted_content_items_models
'
,
items_models
=
getattr
(
self
,
'
highlighted_content_items_models
'
,
settings
.
CMS_
CAROUSEL_SLIDE
S_MODELS
)
settings
.
CMS_
HIGHLIGHTED_CONTENT_ITEM
S_MODELS
)
q
=
Q
()
q
=
Q
()
if
items_models
:
if
items_models
:
for
app
,
models
in
items_models
:
for
app
,
models
in
items_models
:
...
...
This diff is collapsed.
Click to expand it.
cms_highlighted_content/models.py
+
1
−
1
View file @
35905c27
...
@@ -10,6 +10,7 @@ from django.utils.encoding import python_2_unicode_compatible
...
@@ -10,6 +10,7 @@ from django.utils.encoding import python_2_unicode_compatible
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
cms.models
import
CMSPlugin
from
cms.models
import
CMSPlugin
from
cms.models.fields
import
PageField
###################################################################################################
###################################################################################################
...
@@ -27,7 +28,6 @@ class HighlightedContentPluginBase(CMSPlugin):
...
@@ -27,7 +28,6 @@ class HighlightedContentPluginBase(CMSPlugin):
null
=
True
,
blank
=
True
,
null
=
True
,
blank
=
True
,
help_text
=
_
(
'
Page displaying all elements
'
))
help_text
=
_
(
'
Page displaying all elements
'
))
def
__str__
(
self
):
def
__str__
(
self
):
if
self
.
title
:
if
self
.
title
:
return
'
%s
"
%s
"'
%
(
self
.
_meta
.
verbose_name
,
self
.
title
)
return
'
%s
"
%s
"'
%
(
self
.
_meta
.
verbose_name
,
self
.
title
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment