Skip to content

Commit

Permalink
Merge 8a3c784 into 310f48e
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Esteves committed Jul 4, 2019
2 parents 310f48e + 8a3c784 commit 83708c9
Show file tree
Hide file tree
Showing 17 changed files with 18,293 additions and 99 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ Always reference the ticket number at the end of the issue description.
## [unreleased]

### Added

- Added Dark Mode support
- Added CSV file export function to the ListView
- Added ability to use * to keep sidebar open for menu urls
- Added support for Django 2.2
- Added support for Python 3.7

### Fixed
- Fixed advanced search form was being removed from the DOM when it was closed
- Fixed old packages
- Fixed inline form bugs with datepicker and max number of forms allowed

## Removed

- Removed support for Django 2.0
Expand All @@ -30,7 +36,7 @@ Always reference the ticket number at the end of the issue description.

### Changed
- Javascript widgets are not initialised with anonymous functions anymore
- Separated javascript widgets into their own files (selectize, pickers, float labels, inlines)
- Separated javascript widgets into their own files (selectize, pickers, float labels, inlines)
- Added new size (extra large) to modals

### Fixed
Expand Down
21 changes: 17 additions & 4 deletions arctic/generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,17 @@ def get_context_data(self, **kwargs):
context["SIDEBAR_COLOR"] = self.get_sidebar_color()
context["SIDEBAR_ALT_COLOR"] = self.get_sidebar_alt_color()
context["HIGHLIGHT_BACKGROUND"] = self.get_highlight_background()
context["SIDEBAR_ALT_COLOR_DARK"] = self.get_sidebar_alt_color_dark()
context["SIDEBAR_COLOR_DARK"] = self.get_sidebar_color_dark()
context["SIDEBAR_BACKGROUND_DARK"] = self.get_sidebar_background_dark()
context["HIGHLIGHT_COLOR"] = self.get_highlight_color()
context["DATETIME_FORMATS"] = self.get_datetime_formats()
context["LOGIN_URL"] = self.get_login_url()
context["LOGOUT_URL"] = self.get_logout_url()
context["media"] = self.media
context["form_display"] = self.get_form_display()
context["in_modal"] = self.request.GET.get("inmodal", False)
context["dark_mode"] = self.get_dark_mode()
return context

def get_breadcrumbs(self):
Expand Down Expand Up @@ -209,6 +213,18 @@ def get_highlight_color(self):
def get_highlight_background(self):
return getattr(settings, "ARCTIC_HIGHLIGHT_BACKGROUND", None)

def get_sidebar_alt_color_dark(self):
return getattr(settings, "ARCTIC_SIDEBAR_ALT_COLOR_DARK", None)

def get_sidebar_color_dark(self):
return getattr(settings, "ARCTIC_SIDEBAR_COLOR_DARK", None)

def get_sidebar_background_dark(self):
return getattr(settings, "ARCTIC_SIDEBAR_BACKGROUND_DARK", None)

def get_dark_mode(self):
return getattr(settings, "ARCTIC_DARK_MODE", None)

def get_index_url(self):
try:
return reverse(getattr(settings, "ARCTIC_INDEX_URL", "index"))
Expand Down Expand Up @@ -397,14 +413,11 @@ def get(self, request, *args, **kwargs):

return self.render_to_response(context)

def _get_export_url(self, format):
def get_export_url(self, format):
return append_query_parameter(
self.request.get_full_path(), {"format": format}
)

def get_csv_export_url(self):
return self._get_export_url("csv")

def get_object_list(self):
qs = self.get_queryset()

Expand Down
9 changes: 6 additions & 3 deletions arctic/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ def get_context_data(self, **kwargs):
except AttributeError:
verbose_name = formset.model._meta.verbose_name_plural
setattr(context["inlines"][i], "verbose_name", verbose_name)
extra = getattr(self.inlines[i], 'inline_extra', 1)
extra = getattr(self.inlines[i], "inline_extra", 1)
context["inlines"][i].extra = extra
if hasattr(self.inlines[i], "sorting_field"):
setattr(
Expand Down Expand Up @@ -746,8 +746,11 @@ def get_tool_links(self):
else:
allowed_tool_links = []
for link in self.tool_links:
if callable(getattr(self, link[1], None)):
url = getattr(self, link[1])
if (
(type(link[1]) in [tuple, list])
and callable(getattr(self, link[1][0], None))
) or callable(getattr(self, link[1], None)):
url = getattr(self, link[1][0])(*link[1][1:])
view = None
else:
url = reverse_url(link[1], None)
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.
17,777 changes: 17,776 additions & 1 deletion arctic/static/arctic/dist/assets/js/app.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion arctic/static/arctic/src/assets/scss/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ $sidebar-alt-color: var(--sidebar-alt-color, lighten($black, 25%));
$highlight-background: var(--highlight-background, #dfdff2);
$highlight-color: var(--highlight-color, $gray-dark);


// Options
//
// Quickly modify global styling by enabling or disabling optional features.
Expand Down
2 changes: 2 additions & 0 deletions arctic/static/arctic/src/assets/scss/arctic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@import "font-awesome";
@import "custom";
@import "dark";
@import "bootstrap";

// Datepicker
Expand All @@ -22,6 +23,7 @@
@import "partials/modal";
@import "partials/offcanvas";
@import "partials/advanced-search-form";
@import "partials/dark-mode-switch";

//pages
@import "pages/login";
Expand Down
186 changes: 186 additions & 0 deletions arctic/static/arctic/src/assets/scss/dark.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
body.dark {
color: $gray-lightest;

&:not(.page-login) {
background-color: $gray-dark;
}

#sidebar, &.page-login {
background-color: var(--sidebar-background-dark, #203541);
}

.sidebar__menu>li a {
color: var(--sidebar-color-dark, #ECEEEF);
}

.sidebar__submenu>li a.active>:after {
border-right: 0.8rem solid $gray-dark;
}

.sidebar__submenu>li a.active {
color: var(--sidebar-alt-color-dark, lighten($gray-light, 10%));
}

.arctic-card, .log-in-form, .popover, .popover-body, .modal-content,
.selectize-dropdown {
background-color: #252728;
color: $gray-lightest;
border-color: darken($gray, 5%);
}

.close {
color: $gray-lightest;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
color: $gray-light;
border-color: darken($gray, 5%);
background-color: #252728;
}

.datepicker, .datepicker--nav, .datepicker--time, .datepicker--buttons {
color: darken($gray-lightest, 5%);
border-color: darken($gray, 5%);
background-color: lighten(#252728, 3%);
}

.datepicker--pointer {
background-color: lighten(#252728, 3%);
border-top: 1px solid darken($gray, 5%);
border-right: 1px solid darken($gray, 5%);
}

.datepicker--cell-day.-other-month-,
.datepicker--cell-year.-other-decade- {
color: $gray-light;
}

.datepicker--cell-day.-other-month-:hover, .datepicker--cell-year.-other-decade-:hover,
.datepicker--cell.datepicker--cell-day:hover {
background-color: #252728;
}

.datepicker--time-current-hours:after,
.datepicker--time-current-minutes:after {
background-color: lighten(#252728, 10%);
}

.nav-tabs .nav-link:hover, .nav-tabs .nav-link:focus, .nav-tabs {
border-color: darken($gray, 5%);
}

.arctic-card__form-header .arctic-card__title {
color: $gray-lightest;
border-bottom: 1px solid $gray;
}

.form-control {
background-color: inherit;
color: $gray-lightest;
border: 1px solid $gray;
}

.float-label .form-group label {
color: lighten($gray-light, 10%);
}
.float-label .form-group textarea:not([disabled])+label {
background-color: #252728;
}

.form-group .label-element {
color: lighten($gray-light, 10%);
}

.better-file .better-file-label {
background-color: transparent;
border: 1px solid $gray;
}

.quick-filters {
background-color: transparent;

.btn-outline-secondary {
&:hover {
color: $gray-lightest;
}
}
}

.search-input button {
background-color: transparent;
}

.btn-secondary, .btn-outline-secondary {
color: $gray-lightest;
background-color: inherit;
border-color: $gray;
&:hover {
background-color: darken($gray, 3%);
}
}

label.btn.btn-outline-secondary.active {
background-color: darken($gray, 3%);
}

.btn-secondary {
background-color: darken($gray, 8%);
}

.selectize-control {
background-color: #252728;
}

.selectize-input {
background-color: #252728;
border: 1px solid $gray;

input {
color: $gray-lightest;
}
}

.selectize-control.single .item {
background-color: transparent;
color: inherit;
}

.table {
background-color: #252728;
color: inherit;

thead th {
border-bottom: 2px solid $gray;
}

tbody th, td {
border-top: 1px solid $gray;
}

tr {
background-color: #252728;
.list-actions-placeholder {
background-color: #252728;
}
}

tbody tr:hover {
color: inherit;
background-color: rgba(255, 255, 255, 0.05);
}

tbody tr:nth-of-type(odd) {
background-color: lighten(#252728, 2%);
.list-actions-placeholder {
background-color: lighten(#252728, 2%);
}
}

tbody tr:hover:nth-of-type(odd) {
color: inherit;
background-color: rgba(255, 255, 255, 0.05);
}

}
}

0 comments on commit 83708c9

Please sign in to comment.