Skip to content

Commit

Permalink
Merge pull request #788 from divio/bugfix/breadcrumbs-header-without-…
Browse files Browse the repository at this point in the history
…adminstyles

breadcrumbs and header improvements without adminstyles
  • Loading branch information
lory87 committed Apr 1, 2016
2 parents 0dcdf66 + 8636170 commit a5722d0
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 59 deletions.
33 changes: 20 additions & 13 deletions filer/private/sass/components/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

// resets box-sizing on every element and adds it explicitly on elements in filebrowser and popup content
.filebrowser,
.popup {
.popup,
.app-filer {
#header {
box-sizing: content-box !important;
}
*,
*:before, *:after {
box-sizing: inherit !important;
Expand Down Expand Up @@ -66,32 +70,35 @@ body {
#content #content-main {
margin-top: 0;
}
#container .breadcrumbs-container .breadcrumbs {
// required for django CMS <= 3.1 #673
position: absolute;
top: -91px;
right: 0;
left: 0;
// required for django CMS <= 3.1 #673
margin-top: 48px;
}

.filebrowser {
&.cms-admin-sideframe {
#container {
.breadcrumbs + #content {
margin-left: 0 !important;
}
.breadcrumbs {
padding-left: 20px !important;
}
}
}
&.popup #content {
box-shadow: none;
}
#container {
min-width: auto;
.breadcrumbs + #content {
margin-left: 0 !important;
}
#content {
margin-top: 90px !important;
margin-left: 0 !important;
margin-right: 0 !important;
padding: 0;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
}
}
.breadcrumbs {
margin-left: 15px;
left: 0 !important;
padding-left: 20px !important;
}
h1.folder_header {
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion filer/static/filer/css/admin_filer.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion filer/static/filer/css/maps/admin_filer.css.map

Large diffs are not rendered by default.

88 changes: 44 additions & 44 deletions filer/templates/admin/filer/folder/directory_listing.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,50 @@
{% endif %}
{% endblock %}

{% block breadcrumbs %}{% endblock %}
{% block breadcrumbs %}
{% if not is_popup %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}" title="{% trans 'Go back to admin homepage' %}">
{% trans "Home" %}
</a>
&rsaquo;
<a href="{% url 'admin:app_list' app_label='filer' %}" title="{% trans 'Go back to Filer app' %}">
{% trans "Filer" %}
</a>
{% if not instance.is_root and instance.is_smart_folder %}
&rsaquo;
<a href="{% url 'admin:filer-directory_listing-root' %}" title="{% trans 'Go back to root folder' %}">{% trans "root" %}</a>
{% endif %}
{% for ancestor_folder in instance.logical_path %}
&rsaquo;
<a href="{{ ancestor_folder.get_admin_directory_listing_url_path }}"
title="{% blocktrans with ancestor_folder.name as folder_name %}Go back to '{{ folder_name }}' folder{% endblocktrans %}">
{% if ancestor_folder.label %}{{ ancestor_folder.label }}{% else %}{{ ancestor_folder.name }}{% endif %}
</a>
{% endfor %}
{% if breadcrumbs_action %}
&rsaquo;
<a href="{{ instance.get_admin_directory_listing_url_path }}"
title="{% blocktrans with instance.name as folder_name %}Go back to '{{ folder_name }}' folder{% endblocktrans %}">
{% if instance.label %}
{{ instance.label }}
{% else %}
{{ instance.name }}
{% endif %}
</a>
&rsaquo;
{{ breadcrumbs_action }}
{% else %}
&rsaquo;
{% if instance.label %}
{{ instance.label }}
{% else %}
{{ instance.name }}
{% endif %}
{% endif %}
</div>
{% endif %}
{% endblock %}

{% block sidebar %}{% endblock %}

Expand All @@ -51,49 +94,6 @@ <h2>&nbsp;</h2>
{{ ancestor_folder }}
{% endfor %}

{% if not is_popup %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}" title="{% trans 'Go back to admin homepage' %}">
{% trans "Home" %}
</a>
&rsaquo;
<a href="{% url 'admin:app_list' app_label='filer' %}" title="{% trans 'Go back to Filer app' %}">
{% trans "Filer" %}
</a>
{% if not instance.is_root and instance.is_smart_folder %}
&rsaquo;
<a href="{% url 'admin:filer-directory_listing-root' %}" title="{% trans 'Go back to root folder' %}">{% trans "root" %}</a>
{% endif %}
{% for ancestor_folder in instance.logical_path %}
&rsaquo;
<a href="{{ ancestor_folder.get_admin_directory_listing_url_path }}"
title="{% blocktrans with ancestor_folder.name as folder_name %}Go back to '{{ folder_name }}' folder{% endblocktrans %}">
{% if ancestor_folder.label %}{{ ancestor_folder.label }}{% else %}{{ ancestor_folder.name }}{% endif %}
</a>
{% endfor %}
{% if breadcrumbs_action %}
&rsaquo;
<a href="{{ instance.get_admin_directory_listing_url_path }}"
title="{% blocktrans with instance.name as folder_name %}Go back to '{{ folder_name }}' folder{% endblocktrans %}">
{% if instance.label %}
{{ instance.label }}
{% else %}
{{ instance.name }}
{% endif %}
</a>
&rsaquo;
{{ breadcrumbs_action }}
{% else %}
&rsaquo;
{% if instance.label %}
{{ instance.label }}
{% else %}
{{ instance.name }}
{% endif %}
{% endif %}
</div>
{% endif %}

<div class="navigator-breadcrumbs">
<div class="navigator-breadcrumbs-dropdown-container">
<a href="#" data-toggle="dropdown" aria-expanded="false">
Expand Down

0 comments on commit a5722d0

Please sign in to comment.