Skip to content

Commit

Permalink
Restore this
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jun 2, 2024
1 parent 840db4d commit e12a85a
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
3 changes: 3 additions & 0 deletions feincms3/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ class MoveForm(forms.Form):
Requires the node to be moved as ``obj`` keyword argument.
"""

class Media:
css = {"screen": ["feincms3/move-form.css"]}

def __init__(self, *args, **kwargs):
self.instance = kwargs.pop("obj")
self.modeladmin = kwargs.pop("modeladmin")
Expand Down
67 changes: 67 additions & 0 deletions feincms3/static/feincms3/move-form.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#id_new_location {
clear: both;
min-width: 100%;
position: relative;
}

#id_new_location li {
line-height: 1;
position: relative;
top: -8px;
}

#id_new_location label {
display: block;
float: none;
width: auto;
}

#id_new_location label::after {
display: none !important;
}

#id_new_location .mv.is-self {
background: var(--selected-bg, #e4e4e4);
}

#id_new_location .mv.to-first {
align-self: flex-end;
margin: 2px 0 -4px 0;
}

#id_new_location .mv.is-self,
#id_new_location .mv-mark {
padding: 8px 0 8px 2px;
margin: 4px 0 0 0;
}

#id_new_location .mv-mark {
cursor: pointer;
transition: 0.15s;
}

#id_new_location .mv-mark:hover {
background: var(--selected-row, #ffc);
}

#id_new_location input {
display: none;
align-self: flex-end;
}

#id_new_location input:checked + .mv.mv-mark,
#id_new_location input:checked + .mv .mv-mark {
font-weight: bold;
background: var(--selected-row, #ffc);
}

@media (max-width: 767px) {
label[for^="id_new_location_"] {
display: none;
}
}

/* Suppress the rendering of the save as new button in the move form */
input[name="_saveasnew"] {
display: none !important;
}

0 comments on commit e12a85a

Please sign in to comment.