Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addlink button #3

Merged
merged 7 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
- pypy
- 3.7
- 3.8
- pypy3
env:
- DJANGO=1.11
- DJANGO=2.0
- DJANGO=2.2.17
install:
- pip install -e .
- pip install -q Django==$DJANGO
Expand All @@ -16,6 +14,6 @@ script:
matrix:
exclude:
- python: 2.7
env: DJANGO=2.0
env: DJANGO=2.2.17
- python: pypy
env: DJANGO=2.0
env: DJANGO=2.2.17
26 changes: 23 additions & 3 deletions demo/demo/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class Meta:
attrs={'placeholder': 'Country area'}),
'population': EnclosedInput(
prepend='fa-users',
append='<button class="btn btn-secondary" type="button" '
'onclick="window.open(\'https://www.google.com/\')">Search</button>',
append_class='btn', attrs={'placeholder': 'Human population'}),
append='Search',
onclick_append="window.open(\'https://www.google.com/\')",
append_class='addon', attrs={'placeholder': 'Human population' }),
'description': AutosizedTextarea,
'architecture': AutosizedTextarea,
}
Expand Down Expand Up @@ -327,3 +327,23 @@ def showcase_custom_view_example(request, pk):
messages.success(request, 'Something legendary was done to "%s"' % instance)

return redirect('admin:demo_showcase_change', pk)

#
# class LargeFilterHorizontalForm(ModelForm):
# class Meta:
# pass
#
#
# @admin.register(LargeFilterHorizontal)
# class LargeFilterHorizontalAdmin(RelatedFieldAdmin):
# form = LargeFilterHorizontalForm
# search_fields = ('title',)
# list_display = ('horizontal_choices1', 'horizontal_choices2', 'horizontal_choices3', 'horizontal_choices4',)
# list_filter = ('horizontal_choices1', 'horizontal_choices2', 'horizontal_choices3', 'horizontal_choices4',
# 'horizontal_choices5', 'horizontal_choices6', 'horizontal_choices7', 'horizontal_choices8')
# suit_list_filter_horizontal = list_filter
#
# fieldsets = [
# ('Main', {'fields': ['horizontal_choices1', 'horizontal_choices2', 'horizontal_choices3', 'horizontal_choices4',
# 'horizontal_choices5', 'horizontal_choices6', 'horizontal_choices7', 'horizontal_choices8']}),
# ]
36 changes: 36 additions & 0 deletions demo/demo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,39 @@ class Meta:

def __unicode__(self):
return self.title


# class LargeFilterHorizontal(models.Model):
# title = models.CharField(max_length=64)
#
# TYPE_CHOICES= ((1, 'Awesome'), (2, 'Good'), (3, 'Normal'), (4, 'Bad'))
# TYPE_CHOICES2 = ((1, 'Hot'), (2, 'Normal'), (3, 'Cold'))
# TYPE_CHOICES3 = ((1, 'Tall'), (2, 'Normal'), (3, 'Short'))
# TYPE_CHOICES4 = ((1, 'Black'), (2, 'Purple'), (3, 'Pink'))
# TYPE_CHOICES5 = ((1, 'Image'), (2, 'Video'), (3, 'Sound'))
# TYPE_CHOICES6 = ((1, 'Square'), (2, 'Circle'), (3, 'Triangle'))
# TYPE_CHOICES7 = ((1, 'GIF'), (2, 'JPG'), (3, 'PNG'))
# TYPE_CHOICES8 = ((1, 'Color'), (2, 'B&W'), (3, 'Others'))
# horizontal_choices1 = models.SmallIntegerField(
# choices=TYPE_CHOICES, default=1, help_text='Horizontal1 choices look like this')
# horizontal_choices2 = models.SmallIntegerField(
# choices=TYPE_CHOICES2, default=2, help_text="Horizontal2 choices look like this")
# horizontal_choices3 = models.SmallIntegerField(
# choices=TYPE_CHOICES3, default=3, help_text="Horizontal3 choices look like this")
# horizontal_choices4 = models.SmallIntegerField(
# choices=TYPE_CHOICES4, default=1, help_text='Horizontal4 choices look like this')
# horizontal_choices5 = models.SmallIntegerField(
# choices=TYPE_CHOICES5, default=2, help_text="Horizontal5 choices look like this")
# horizontal_choices6 = models.SmallIntegerField(
# choices=TYPE_CHOICES6, default=3, help_text="Horizontal6 choices look like this")
# horizontal_choices7 = models.SmallIntegerField(
# choices=TYPE_CHOICES7, default=2, help_text="Horizontal7 choices look like this")
# horizontal_choices8 = models.SmallIntegerField(
# choices=TYPE_CHOICES8, default=3, help_text="Horizontal8 choices look like this")
#
# class Meta:
# verbose_name = 'Large Filter Horizontal choice'
# verbose_name_plural = 'Large Filter Horizontal choices'
#
# def __unicode__(self):
# return self.title
24 changes: 24 additions & 0 deletions suit/sass/layout/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,27 @@ body.change-form {
}
}
}

#toolbar {
> .object-tools {
@include reset-list();
position: relative;
overflow: hidden;
z-index: 6;
> li {
display: inline;
&:not(:first-child) {
margin-left: .5rem;
}
> a {
&:not([class*="btn-"]) {
@extend .btn-round;
@include btn-mixin(info, none, sm, round=true);
&.addlink {
@include btn-mixin(success, $icon-plus-circle, sm, round=true);
}
}
}
}
}
}
7 changes: 6 additions & 1 deletion suit/sass/pages/_changelist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $filter-col-width: 15rem;
margin-right: 2rem;
}
#toolbar {
margin-bottom: 1.5rem;
margin-bottom: 0.75rem;
#changelist-search {
label {
display: none;
Expand All @@ -34,17 +34,22 @@ $filter-col-width: 15rem;
@extend .btn-primary;
@include btn-mixin(primary, $icon-plus-circle);
margin-right: 1rem;
margin-bottom: 0.375rem;
}
input[type='text'] {
@extend .form-control;
display: inline-block;
width: auto;
vertical-align: middle;
margin-bottom: 0.375rem;
&:before {
@include fa-icon-font();
content: $icon-plus;
}
}
select {
margin-bottom: 0.375rem;
}
.small {
font-size: $font-size-sm;
}
Expand Down
Loading