Skip to content

Commit

Permalink
Merge pull request #3 from app-generator/inline-formset
Browse files Browse the repository at this point in the history
fix inline formsets issue and add some icons
  • Loading branch information
app-generator authored May 31, 2023
2 parents 0dfdbb1 + ad81d52 commit 58b43c5
Show file tree
Hide file tree
Showing 17 changed files with 114 additions and 24 deletions.
19 changes: 11 additions & 8 deletions admin_datta/static/assets/css/forms.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
padding: 10px;
font-size: 13px;
border-bottom: 1px solid #eee;
display: table-row !important;
}

.form-row img, .form-row input {
vertical-align: middle;
}
.form-row .field-title {
padding-left: 0 !important;
}

.form-row label input[type="checkbox"] {
margin-top: 0;
Expand Down Expand Up @@ -466,13 +469,13 @@ body.popup .submit-row {
}

.inline-group .tabular th.original {
width: 0px;
padding: 0;
width: 0px !important;
padding: 0 !important;
}

.inline-group .tabular td.original p {
position: absolute;
right: 0;
left: 5px;
/*height: 1.1em;*/
/*padding: 2px 9px;*/
overflow: hidden;
Expand Down Expand Up @@ -509,13 +512,13 @@ body.popup .submit-row {
.inline-group ul.tools a.add,
.inline-group div.add-row a,
.inline-group .tabular tr.add-row td a {
background: url(../img/icon-addlink.svg) 0 1px no-repeat;
background: url(../images/icon-addlink.svg) 0 1px no-repeat;
padding-left: 16px;
font-size: 12px;
}

.empty-form {
display: none;
display: none !important;
}

/* RELATED FIELD ADD ONE / LOOKUP */
Expand All @@ -531,13 +534,13 @@ body.popup .submit-row {
.add-another {
width: 16px;
height: 16px;
background-image: url(../img/icon-addlink.svg);
background-image: url(../images/icon-addlink.svg);
}

.related-lookup {
width: 16px;
height: 16px;
background-image: url(../img/search.svg);
background-image: url(../images/search.svg);
}

form .related-widget-wrapper ul {
Expand Down
28 changes: 14 additions & 14 deletions admin_datta/static/assets/css/widgets.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@
}

.selector-add {
background: url(../img/selector-icons.svg) 0 -96px no-repeat;
background: url(../images/selector-icons.svg) 0 -96px no-repeat;
}

.active.selector-add:focus, .active.selector-add:hover {
background-position: 0 -112px;
}

.selector-remove {
background: url(../img/selector-icons.svg) 0 -64px no-repeat;
background: url(../images/selector-icons.svg) 0 -64px no-repeat;
}

.active.selector-remove:focus, .active.selector-remove:hover {
Expand Down Expand Up @@ -166,7 +166,7 @@ a.active.selector-chooseall:hover, a.active.selector-clearall:hover {

a.selector-chooseall {
padding: 0 18px 0 0;
background: url(../img/selector-icons.svg) right -160px no-repeat;
background: url(../images/selector-icons.svg) right -160px no-repeat;
cursor: default;
}

Expand All @@ -176,7 +176,7 @@ a.active.selector-chooseall:focus, a.active.selector-chooseall:hover {

a.selector-clearall {
padding: 0 0 0 18px;
background: url(../img/selector-icons.svg) 0 -128px no-repeat;
background: url(../images/selector-icons.svg) 0 -128px no-repeat;
cursor: default;
}

Expand Down Expand Up @@ -226,7 +226,7 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
}

.stacked .selector-add {
background: url(../img/selector-icons.svg) 0 -32px no-repeat;
background: url(../images/selector-icons.svg) 0 -32px no-repeat;
cursor: default;
}

Expand All @@ -236,7 +236,7 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
}

.stacked .selector-remove {
background: url(../img/selector-icons.svg) 0 0 no-repeat;
background: url(../images/selector-icons.svg) 0 0 no-repeat;
cursor: default;
}

Expand All @@ -246,7 +246,7 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
}

.selector .help-icon {
background: url(../img/icon-unknown.svg) 0 0 no-repeat;
background: url(../images/icon-unknown.svg) 0 0 no-repeat;
display: inline-block;
vertical-align: middle;
margin: -2px 0 0 2px;
Expand All @@ -255,11 +255,11 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
}

.selector .selector-chosen .help-icon {
background: url(../img/icon-unknown-alt.svg) 0 0 no-repeat;
background: url(../images/icon-unknown-alt.svg) 0 0 no-repeat;
}

.selector .search-label-icon {
background: url(../img/search.svg) 0 0 no-repeat;
background: url(../images/search.svg) 0 0 no-repeat;
display: inline-block;
height: 25px;
width: 25px;
Expand Down Expand Up @@ -305,7 +305,7 @@ table p.datetime {
}

.datetimeshortcuts .clock-icon {
background: url(../img/icon-clock.svg) 0 0 no-repeat;
background: url(../images/icon-clock.svg) 0 0 no-repeat;
}

.datetimeshortcuts a:focus .clock-icon,
Expand All @@ -314,7 +314,7 @@ table p.datetime {
}

.datetimeshortcuts .date-icon {
background: url(../img/icon-calendar.svg) 0 0 no-repeat;
background: url(../images/icon-calendar.svg) 0 0 no-repeat;
top: -1px;
}

Expand Down Expand Up @@ -502,7 +502,7 @@ span.clearable-file-input label {

.calendarnav-previous {
left: 10px;
background: url(../img/calendar-icons.svg) 0 0 no-repeat;
background: url(../images/calendar-icons.svg) 0 0 no-repeat;
}

.calendarbox .calendarnav-previous:focus,
Expand All @@ -512,7 +512,7 @@ span.clearable-file-input label {

.calendarnav-next {
right: 10px;
background: url(../img/calendar-icons.svg) 0 -30px no-repeat;
background: url(../images/calendar-icons.svg) 0 -30px no-repeat;
}

.calendarbox .calendarnav-next:focus,
Expand Down Expand Up @@ -553,7 +553,7 @@ ul.timelist, .timelist li {
.inline-deletelink {
float: right;
text-indent: -9999px;
background: url(../img/inline-delete.svg) 0 0 no-repeat;
background: url(../images/inline-delete.svg) 0 0 no-repeat;
width: 16px;
height: 16px;
border: 0px none;
Expand Down
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/icon-addlink.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions admin_datta/static/assets/images/icon-calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/icon-changelink.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions admin_datta/static/assets/images/icon-clock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/icon-deletelink.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/icon-no.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/icon-unknown-alt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/icon-unknown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/icon-viewlink.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/icon-yes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/inline-delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions admin_datta/static/assets/images/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions admin_datta/static/assets/images/selector-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions admin_datta/templates/admin/edit_inline/tabular.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>

{% for field in inline_admin_formset.fields %}
{% if not field.widget.is_hidden %}
<th class="column-
{{ field.name }}{% if field.required %} required{% endif %}">{{ field.label|capfirst }}
<th class="column-{{ field.name }}{% if field.required %} required{% endif %}">{{ field.label|capfirst }}
{% if field.help_text %}
<img src="{% static "admin/img/icon-unknown.svg" %}" class="help help-tooltip"
width="10" height="10" alt="({{ field.help_text|striptags }})"
Expand Down
6 changes: 6 additions & 0 deletions admin_datta/templates/layouts/base.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<!DOCTYPE html>
{% load i18n static admin_datta %}
{% get_current_language as LANGUAGE_CODE %}
{% get_current_language_bidi as LANGUAGE_BIDI %}
{% get_direction as direction %}
{% get_admin_setting as admin_setting %}
<html lang="en">

<head>
{% include 'includes/head.html' %}
{% block extrastyle %}{% endblock extrastyle %}
{% block extrahead %}{% endblock extrahead %}
</head>
<body>

Expand Down

0 comments on commit 58b43c5

Please sign in to comment.