diff --git a/backend/multimail/static/multimail/css/simple-sidebar.css b/backend/multimail/static/multimail/css/simple-sidebar.css index 055888c..c60444e 100644 --- a/backend/multimail/static/multimail/css/simple-sidebar.css +++ b/backend/multimail/static/multimail/css/simple-sidebar.css @@ -4,47 +4,93 @@ * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-simple-sidebar/blob/master/LICENSE) */ - #wrapper { +#wrapper { overflow-x: hidden; - } +} #sidebar-wrapper { - min-height: 100vh; - margin-left: -15rem; - -webkit-transition: margin .25s ease-out; - -moz-transition: margin .25s ease-out; - -o-transition: margin .25s ease-out; - transition: margin .25s ease-out; + min-height: 100vh; + margin-left: -15rem; + -webkit-transition: margin .25s ease-out; + -moz-transition: margin .25s ease-out; + -o-transition: margin .25s ease-out; + transition: margin .25s ease-out; } #sidebar-wrapper .sidebar-heading { - padding: 0.875rem 1.25rem; - font-size: 1.2rem; + padding: 0.875rem 1.25rem; + font-size: 1.2rem; } #sidebar-wrapper .list-group { - width: 15rem; + width: 15rem; } #page-content-wrapper { - min-width: 100vw; + min-width: 100vw; } #wrapper.toggled #sidebar-wrapper { - margin-left: 0; -} - -@media (min-width: 768px) { - #sidebar-wrapper { margin-left: 0; - } - - #page-content-wrapper { - min-width: 0; - width: 100%; - } - - #wrapper.toggled #sidebar-wrapper { - margin-left: -15rem; - } } + +.link-unstyled, .link-unstyled:link, .link-unstyled:hover { + color: inherit; + text-decoration: inherit; +} + +.optional-column-replacement { + display: none; +} + +@media (min-width: 1024px) , (max-width: 700px) and (min-width: 610px) { + #sidebar-wrapper { + margin-left: 0; + } + + #page-content-wrapper { + min-width: 0; + width: 100%; + } + + #wrapper.toggled #sidebar-wrapper { + margin-left: -15rem; + } +} + + +@media (max-width: 700px) { + + .card-columns { + column-count: 1; + } + + .optional-column { + display: none; + } + + .optional-column-replacement { + display: initial; + } +} + +@media (min-width: 700px) and (max-width: 1300px) { + + .card-columns { + column-count: 2; + } +} + +@media (min-width: 1300px) and (max-width: 1700px) { + + .card-columns { + column-count: 3; + } +} + +@media (min-width: 1700px) { + + .card-columns { + column-count: 4; + } +} \ No newline at end of file diff --git a/backend/multimail/templates/multimail/aliases.html b/backend/multimail/templates/multimail/aliases.html index 40301cd..c5f8cd6 100644 --- a/backend/multimail/templates/multimail/aliases.html +++ b/backend/multimail/templates/multimail/aliases.html @@ -4,11 +4,13 @@
Source | -Destination | +Source + / Destination + | +Destination | Actions |
---|---|---|---|---|
{{ alias.source_username }}@{{ alias.source_domain }} + {{ alias.destination_username }}@{{ alias.destination_domain }} | -{{ alias.destination_username }}@{{ alias.destination_domain }} | +{{ alias.destination_username }}@{{ alias.destination_domain }} | Delete | |
- | - | Add + | + | Add Alias |
You haven't set up any aliases yet.
- Add + Add Alias {% endif %} {% endblock %} \ No newline at end of file diff --git a/backend/multimail/templates/multimail/base.html b/backend/multimail/templates/multimail/base.html index 593a09b..772ba04 100644 --- a/backend/multimail/templates/multimail/base.html +++ b/backend/multimail/templates/multimail/base.html @@ -26,10 +26,13 @@ @@ -41,9 +44,9 @@ +You haven't set up any domains yet.
- Add + Add Domain {% endif %} {% endblock %} \ No newline at end of file diff --git a/backend/multimail/templates/multimail/index.html b/backend/multimail/templates/multimail/index.html index c0d7e63..3a1f2c7 100644 --- a/backend/multimail/templates/multimail/index.html +++ b/backend/multimail/templates/multimail/index.html @@ -1,16 +1,92 @@ {% extends 'multimail/base.html' %} {% block content %} -No multimail are available.
- {% endif %} +Mailboxes | ++ |
---|---|
{{ mailbox.username }}@{{ mailbox.domain }} + | ++ |
You dont't have any mailboxes for this domain yet. | +|
Aliases | ++ |
{{ alias.source_username }}@{{ alias.source_domain }} + {{ alias.destination_username }}@{{ alias.destination_domain }} + | ++ |
You dont't have any aliases for this domain yet. | +
You haven't set up any domains yet.
+ Add Domain + {% endif %} +You haven't set up any mailboxes yet.
- Add + Add Mailbox {% endif %} {% endblock %} \ No newline at end of file diff --git a/backend/multimail/urls.py b/backend/multimail/urls.py index 072d8db..6c09ee0 100644 --- a/backend/multimail/urls.py +++ b/backend/multimail/urls.py @@ -6,7 +6,7 @@ from . import actions app_name = 'multimail' urlpatterns = [ - path('', views.DomainListView.as_view(), name='index'), + path('', views.IndexView.as_view(), name='index'), path('domains/', views.DomainListView.as_view(), name='domains'), path('domain/new/', forms.new_domain, name='new_domain'), diff --git a/backend/multimail/views.py b/backend/multimail/views.py index e9d359e..36e235b 100644 --- a/backend/multimail/views.py +++ b/backend/multimail/views.py @@ -10,6 +10,23 @@ class UserLoginView(LoginView): template_name = 'multimail/login.html' +class IndexView(LoginRequiredMixin, generic.ListView): + login_url = 'login/' + template_name = 'multimail/index.html' + context_object_name = 'domain_list' + + def fill_related(self, domains): + for domain in domains: + domain.mailboxes = Mailbox.objects.filter(domain=domain) + domain.aliases = Alias.objects.filter(source_domain=domain) + yield domain + + def get_queryset(self): + """Return the last five published questions.""" + user = user_from_request(self.request) + return self.fill_related(Domain.objects.filter(admin__admin=user['name'], admin__source=user['source'])) + + class DomainListView(LoginRequiredMixin, generic.ListView): login_url = 'login/' template_name = 'multimail/domains.html'