mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-12 01:03:11 +00:00
merging from ui update branch
This commit is contained in:
parent
3873b62e6f
commit
ed7535c4fd
8 changed files with 147 additions and 114 deletions
|
|
@ -3,8 +3,12 @@ from django.contrib.auth import get_user_model
|
|||
from django.contrib.auth.forms import AuthenticationForm, PasswordResetForm
|
||||
|
||||
class SearchForm(forms.Form):
|
||||
q = forms.CharField(label="Search term", widget=forms.TextInput(attrs={'placeholder': 'Search'}))
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
placeholder_suffix = kwargs.pop('placeholder_suffix', "")
|
||||
super(SearchForm, self).__init__(*args, **kwargs)
|
||||
self.fields['q'].widget.attrs = {'placeholder': 'Search ' + placeholder_suffix}
|
||||
|
||||
q = forms.CharField(label="Search term", widget=forms.TextInput())
|
||||
|
||||
class ExternalLinkChooserForm(forms.Form):
|
||||
url = forms.URLField(required=True)
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ input[type=submit], input[type=reset], input[type=button], .button, button{
|
|||
}
|
||||
|
||||
.icon:before{
|
||||
vertical-align:middle;
|
||||
vertical-align:-1%;
|
||||
line-height:2em;
|
||||
}
|
||||
.icon:hover{
|
||||
|
|
|
|||
|
|
@ -388,7 +388,6 @@ header{
|
|||
|
||||
.left{
|
||||
float:left;
|
||||
margin-right:1em;
|
||||
width:50%;
|
||||
|
||||
.hasform &:first-child{
|
||||
|
|
@ -397,9 +396,11 @@ header{
|
|||
}
|
||||
|
||||
}
|
||||
.second{
|
||||
clear:both;
|
||||
}
|
||||
.right{
|
||||
float:right;
|
||||
text-align:right;
|
||||
}
|
||||
|
||||
/* For case where content below header should merge with it */
|
||||
|
|
@ -585,7 +586,7 @@ footer, .logo{
|
|||
.column(2);
|
||||
}
|
||||
.col3{
|
||||
.column(3) !important;
|
||||
.column(3);
|
||||
}
|
||||
.col4{
|
||||
.column(4);
|
||||
|
|
@ -750,9 +751,19 @@ footer, .logo{
|
|||
float:left;
|
||||
}
|
||||
}
|
||||
.second{
|
||||
clear:none;
|
||||
|
||||
.right, .left{
|
||||
float:right;
|
||||
}
|
||||
}
|
||||
.col3{
|
||||
.col3();
|
||||
}
|
||||
.col3.addbutton{
|
||||
width:auto;
|
||||
}
|
||||
.col6{
|
||||
.col6();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@ html{
|
|||
height:100%;
|
||||
}
|
||||
body{
|
||||
padding:0 5%;
|
||||
margin-left: 0px;
|
||||
height:100%;
|
||||
color:white;
|
||||
margin:0;
|
||||
}
|
||||
.wrapper{
|
||||
max-width:none;
|
||||
}
|
||||
h1{
|
||||
.nice-padding();
|
||||
font-weight:300;
|
||||
font-size:2em;
|
||||
line-height:1em;
|
||||
|
|
@ -31,68 +33,24 @@ h1{
|
|||
vertical-align: -15%;
|
||||
}
|
||||
}
|
||||
.content-wrapper{
|
||||
form{
|
||||
width:100%;
|
||||
float:none;
|
||||
background:none;
|
||||
border:0;
|
||||
}
|
||||
.fields{
|
||||
.unlist();
|
||||
|
||||
li.full{
|
||||
overflow:hidden;
|
||||
position:relative;
|
||||
padding:0;
|
||||
margin-bottom:1px;
|
||||
|
||||
label{
|
||||
display:none;
|
||||
}
|
||||
input{
|
||||
border:0;
|
||||
}
|
||||
|
||||
label{
|
||||
.border-radius(2px);
|
||||
text-transform:uppercase;
|
||||
padding:2px 5px;
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
margin-top:-1px;
|
||||
font-size:0.7em;
|
||||
z-index:1;
|
||||
margin:0.2em 0;
|
||||
line-height:1.5em;
|
||||
font-weight:normal;
|
||||
}
|
||||
input{
|
||||
.border-radius(0px);
|
||||
font-weight:300;
|
||||
border:0;
|
||||
padding-top:1.5em;
|
||||
padding-bottom:1.5em;
|
||||
font-size:1.6em;
|
||||
line-height:1.6em;
|
||||
}
|
||||
ul{
|
||||
.unlist();
|
||||
}
|
||||
li:first-child input{
|
||||
border-top:0;
|
||||
.fields li{
|
||||
.nice-padding();
|
||||
padding-top:1em;
|
||||
padding-bottom:1em;
|
||||
}
|
||||
.checkbox{
|
||||
.fields .checkbox{
|
||||
padding-top:2em;
|
||||
padding-bottom:2em;
|
||||
}
|
||||
.field{
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.field.icon:before{
|
||||
display:none;
|
||||
}
|
||||
}
|
||||
|
||||
label{
|
||||
color:white;
|
||||
}
|
||||
input[type=submit]{
|
||||
font-size:1.5em;
|
||||
padding:1.1em 2.4em;
|
||||
|
|
@ -102,7 +60,58 @@ input[type=checkbox]:before{
|
|||
color:#555;
|
||||
border:1px solid #555;
|
||||
}
|
||||
.fields{
|
||||
max-width:100%;
|
||||
}
|
||||
.fields li.full{
|
||||
position:relative;
|
||||
padding:0;
|
||||
|
||||
label{
|
||||
display:none;
|
||||
}
|
||||
input{
|
||||
border-top: 1px dashed @color-input-border;
|
||||
}
|
||||
}
|
||||
.fields li:first-child input{
|
||||
border-top:0;
|
||||
}
|
||||
|
||||
.field{
|
||||
padding:0;
|
||||
}
|
||||
.field.icon:before{
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
||||
.full label{
|
||||
.border-radius(2px);
|
||||
text-transform:uppercase;
|
||||
padding:2px 5px;
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
margin-top:-1px;
|
||||
font-size:0.7em;
|
||||
z-index:1;
|
||||
margin:0.2em 0;
|
||||
line-height:1.5em;
|
||||
font-weight:normal;
|
||||
}
|
||||
|
||||
/* Special full-width, one-off fields i.e a single text or textarea input */
|
||||
.full input{
|
||||
.nice-padding;
|
||||
.border-radius(0px);
|
||||
font-weight:300;
|
||||
border:0;
|
||||
padding-top:1.5em;
|
||||
padding-bottom:1.5em;
|
||||
font-size:1.6em;
|
||||
line-height:1.6em;
|
||||
}
|
||||
.help{
|
||||
opacity:1;
|
||||
position:absolute;
|
||||
|
|
@ -115,7 +124,6 @@ input[type=checkbox]:before{
|
|||
@media screen and (min-width: @breakpoint-mobile){
|
||||
body{
|
||||
font-size:85%;
|
||||
padding:0 10%;
|
||||
}
|
||||
|
||||
/* centres login form vertically */
|
||||
|
|
@ -130,43 +138,50 @@ input[type=checkbox]:before{
|
|||
margin-left:-4px;
|
||||
}
|
||||
}
|
||||
.content-wrapper{
|
||||
form{
|
||||
width:100%;
|
||||
display:inline-block;
|
||||
vertical-align: middle;
|
||||
|
||||
.fields li{
|
||||
padding-left:10%;
|
||||
}
|
||||
}
|
||||
|
||||
h1{
|
||||
padding-left:10%;
|
||||
font-weight:300;
|
||||
font-size:4em;
|
||||
line-height:1em;
|
||||
}
|
||||
.fields{
|
||||
.field.icon:before{
|
||||
display:inline-block;
|
||||
position: absolute;
|
||||
color:@color-grey-4;
|
||||
border: 2px solid @color-grey-4;
|
||||
border-radius: 100%;
|
||||
width: 1em;
|
||||
padding: 0.3em;
|
||||
left: 12%;
|
||||
margin-left: -25px;
|
||||
margin-top: -25px;
|
||||
top: 50%;
|
||||
}
|
||||
.full{
|
||||
margin:0 -13%;
|
||||
}
|
||||
.full input{
|
||||
padding-left:15%;
|
||||
}
|
||||
.submit{
|
||||
margin-top:2em;
|
||||
}
|
||||
.full input{
|
||||
padding-left:10%;
|
||||
}
|
||||
.field.icon:before{
|
||||
display:inline-block;
|
||||
position: absolute;
|
||||
color:@color-grey-4;
|
||||
border: 2px solid @color-grey-4;
|
||||
border-radius: 100%;
|
||||
width: 1em;
|
||||
padding: 0.3em;
|
||||
left: 12%;
|
||||
margin-left: 80px;
|
||||
margin-left: -25px;
|
||||
top: 50%;
|
||||
margin-top: -18px;
|
||||
}
|
||||
.full input{
|
||||
padding-left:15%;
|
||||
}
|
||||
|
||||
.messages{
|
||||
margin:0 -13%
|
||||
.messages li{
|
||||
padding-left:11%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: @breakpoint-mobile){
|
||||
body, .wrapper{
|
||||
background-color:@color-grey-1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ function makeRichTextEditable(id) {
|
|||
plugins: {
|
||||
'halloformat': {},
|
||||
'halloheadings': {formatBlocks: ["p", "h2", "h3", "h4", "h5"]},
|
||||
'hallolists': {},
|
||||
'hallolists': {},
|
||||
'hallohr': {},
|
||||
'halloreundo': {},
|
||||
'hallowagtailimage': {},
|
||||
|
|
@ -200,6 +200,7 @@ function InlinePanel(opts) {
|
|||
$(fixPrefix('#id_' + opts.emptyChildFormPrefix + '-ORDER')).val(formCount);
|
||||
}
|
||||
self.updateMoveButtonDisabledStates();
|
||||
|
||||
opts.onAdd(fixPrefix);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,22 +3,24 @@
|
|||
<div class="left col{% if search_form and add_link %}6{% else %}9{% endif %}">
|
||||
<h1>{{ title }} <span>{{ subtitle }}</span></h1>
|
||||
</div>
|
||||
{% if search_form %}
|
||||
<div class="left col3">
|
||||
<form class="search-bar" action="{% url search_url %}" method="get">
|
||||
<ul class="fields">
|
||||
{% for field in search_form %}
|
||||
{% include "wagtailadmin/shared/field_as_li.html" with field=field %}
|
||||
{% endfor %}
|
||||
<li class="submit"><input type="submit" value="Search" /></li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if add_link %}
|
||||
<div class="right col3">
|
||||
<a href="{% url add_link %}" class="button bicolor icon icon-plus">{{ add_text }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="second col{% if search_form and add_link %}6{% else %}3{% endif %}">
|
||||
{% if add_link %}
|
||||
<div class="right col3 addbutton">
|
||||
<a href="{% url add_link %}" class="button bicolor icon icon-plus">{{ add_text }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if search_form %}
|
||||
<div class="left col6">
|
||||
<form class="search-bar" action="{% url search_url %}" method="get">
|
||||
<ul class="fields">
|
||||
{% for field in search_form %}
|
||||
{% include "wagtailadmin/shared/field_as_li.html" with field=field %}
|
||||
{% endfor %}
|
||||
<li class="submit"><input type="submit" value="Search" /></li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -17,7 +17,7 @@ def index(request):
|
|||
is_searching = False
|
||||
|
||||
if 'q' in request.GET:
|
||||
form = SearchForm(request.GET)
|
||||
form = SearchForm(request.GET, placeholder_sufffix="documents")
|
||||
if form.is_valid():
|
||||
q = form.cleaned_data['q']
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ def index(request):
|
|||
if not request.user.has_perm('wagtaildocs.change_document'):
|
||||
# restrict to the user's own documents
|
||||
documents = documents.filter(uploaded_by_user=request.user)
|
||||
form = SearchForm()
|
||||
form = SearchForm(placeholder_suffix="documents")
|
||||
|
||||
if not is_searching:
|
||||
paginator = Paginator(documents, 20)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ def index(request):
|
|||
is_searching = False
|
||||
|
||||
if 'q' in request.GET:
|
||||
form = SearchForm(request.GET)
|
||||
form = SearchForm(request.GET, placeholder_suffix="images")
|
||||
if form.is_valid():
|
||||
q = form.cleaned_data['q']
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ def index(request):
|
|||
if not request.user.has_perm('wagtailimages.change_image'):
|
||||
# restrict to the user's own images
|
||||
images = images.filter(uploaded_by_user=request.user)
|
||||
form = SearchForm()
|
||||
form = SearchForm(placeholder_suffix="images")
|
||||
|
||||
if not is_searching:
|
||||
paginator = Paginator(images, 20)
|
||||
|
|
|
|||
Loading…
Reference in a new issue