Commit f99eb930 by ichuang

new static/admin files for django 1.4 admin

parent 881f07f3
...@@ -189,6 +189,10 @@ p.mini { ...@@ -189,6 +189,10 @@ p.mini {
color: #999; color: #999;
} }
img.help-tooltip {
cursor: help;
}
p img, h1 img, h2 img, h3 img, h4 img, td img { p img, h1 img, h2 img, h3 img, h4 img, td img {
vertical-align: middle; vertical-align: middle;
} }
...@@ -259,7 +263,7 @@ tfoot td { ...@@ -259,7 +263,7 @@ tfoot td {
color: #666; color: #666;
padding: 2px 5px; padding: 2px 5px;
font-size: 11px; font-size: 11px;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
border-left: 1px solid #ddd; border-left: 1px solid #ddd;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
...@@ -305,25 +309,84 @@ tr.alt { ...@@ -305,25 +309,84 @@ tr.alt {
/* SORTABLE TABLES */ /* SORTABLE TABLES */
thead th {
padding: 2px 5px;
line-height: normal;
}
thead th a:link, thead th a:visited { thead th a:link, thead th a:visited {
color: #666; color: #666;
}
thead th.sorted {
background: #c5c5c5 url(../img/nav-bg-selected.gif) top left repeat-x;
}
table thead th .text span {
padding: 2px 5px;
display:block;
}
table thead th .text a {
display: block;
cursor: pointer;
padding: 2px 5px;
}
table thead th.sortable:hover {
background: white url(../img/nav-bg-reverse.gif) 0 -5px repeat-x;
}
thead th.sorted a.sortremove {
visibility: hidden;
}
table thead th.sorted:hover a.sortremove {
visibility: visible;
}
table thead th.sorted .sortoptions {
display: block; display: block;
padding: 4px 5px 0 5px;
float: right;
text-align: right;
}
table thead th.sorted .sortpriority {
font-size: .8em;
min-width: 12px;
text-align: center;
vertical-align: top;
}
table thead th.sorted .sortoptions a {
width: 14px;
height: 12px;
display: inline-block;
}
table thead th.sorted .sortoptions a.sortremove {
background: url(../img/sorting-icons.gif) -4px -5px no-repeat;
}
table thead th.sorted .sortoptions a.sortremove:hover {
background: url(../img/sorting-icons.gif) -4px -27px no-repeat;
} }
table thead th.sorted { table thead th.sorted .sortoptions a.ascending {
background-position: bottom left !important; background: url(../img/sorting-icons.gif) -5px -50px no-repeat;
} }
table thead th.sorted a { table thead th.sorted .sortoptions a.ascending:hover {
padding-right: 13px; background: url(../img/sorting-icons.gif) -5px -72px no-repeat;
} }
table thead th.ascending a { table thead th.sorted .sortoptions a.descending {
background: url(../img/admin/arrow-up.gif) right .4em no-repeat; background: url(../img/sorting-icons.gif) -5px -94px no-repeat;
} }
table thead th.descending a { table thead th.sorted .sortoptions a.descending:hover {
background: url(../img/admin/arrow-down.gif) right .4em no-repeat; background: url(../img/sorting-icons.gif) -5px -115px no-repeat;
} }
/* ORDERABLE TABLES */ /* ORDERABLE TABLES */
...@@ -334,7 +397,7 @@ table.orderable tbody tr td:hover { ...@@ -334,7 +397,7 @@ table.orderable tbody tr td:hover {
table.orderable tbody tr td:first-child { table.orderable tbody tr td:first-child {
padding-left: 14px; padding-left: 14px;
background-image: url(../img/admin/nav-bg-grabber.gif); background-image: url(../img/nav-bg-grabber.gif);
background-repeat: repeat-y; background-repeat: repeat-y;
} }
...@@ -364,7 +427,7 @@ input[type=text], input[type=password], textarea, select, .vTextField { ...@@ -364,7 +427,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
/* FORM BUTTONS */ /* FORM BUTTONS */
.button, input[type=submit], input[type=button], .submit-row input { .button, input[type=submit], input[type=button], .submit-row input {
background: white url(../img/admin/nav-bg.gif) bottom repeat-x; background: white url(../img/nav-bg.gif) bottom repeat-x;
padding: 3px 5px; padding: 3px 5px;
color: black; color: black;
border: 1px solid #bbb; border: 1px solid #bbb;
...@@ -372,31 +435,31 @@ input[type=text], input[type=password], textarea, select, .vTextField { ...@@ -372,31 +435,31 @@ input[type=text], input[type=password], textarea, select, .vTextField {
} }
.button:active, input[type=submit]:active, input[type=button]:active { .button:active, input[type=submit]:active, input[type=button]:active {
background-image: url(../img/admin/nav-bg-reverse.gif); background-image: url(../img/nav-bg-reverse.gif);
background-position: top; background-position: top;
} }
.button[disabled], input[type=submit][disabled], input[type=button][disabled] { .button[disabled], input[type=submit][disabled], input[type=button][disabled] {
background-image: url(../img/admin/nav-bg.gif); background-image: url(../img/nav-bg.gif);
background-position: bottom; background-position: bottom;
opacity: 0.4; opacity: 0.4;
} }
.button.default, input[type=submit].default, .submit-row input.default { .button.default, input[type=submit].default, .submit-row input.default {
border: 2px solid #5b80b2; border: 2px solid #5b80b2;
background: #7CA0C7 url(../img/admin/default-bg.gif) bottom repeat-x; background: #7CA0C7 url(../img/default-bg.gif) bottom repeat-x;
font-weight: bold; font-weight: bold;
color: white; color: white;
float: right; float: right;
} }
.button.default:active, input[type=submit].default:active { .button.default:active, input[type=submit].default:active {
background-image: url(../img/admin/default-bg-reverse.gif); background-image: url(../img/default-bg-reverse.gif);
background-position: top; background-position: top;
} }
.button[disabled].default, input[type=submit][disabled].default, input[type=button][disabled].default { .button[disabled].default, input[type=submit][disabled].default, input[type=button][disabled].default {
background-image: url(../img/admin/default-bg.gif); background-image: url(../img/default-bg.gif);
background-position: bottom; background-position: bottom;
opacity: 0.4; opacity: 0.4;
} }
...@@ -433,7 +496,7 @@ input[type=text], input[type=password], textarea, select, .vTextField { ...@@ -433,7 +496,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
font-size: 11px; font-size: 11px;
text-align: left; text-align: left;
font-weight: bold; font-weight: bold;
background: #7CA0C7 url(../img/admin/default-bg.gif) top left repeat-x; background: #7CA0C7 url(../img/default-bg.gif) top left repeat-x;
color: white; color: white;
} }
...@@ -455,15 +518,15 @@ ul.messagelist li { ...@@ -455,15 +518,15 @@ ul.messagelist li {
margin: 0 0 3px 0; margin: 0 0 3px 0;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
color: #666; color: #666;
background: #ffc url(../img/admin/icon_success.gif) 5px .3em no-repeat; background: #ffc url(../img/icon_success.gif) 5px .3em no-repeat;
} }
ul.messagelist li.warning{ ul.messagelist li.warning{
background-image: url(../img/admin/icon_alert.gif); background-image: url(../img/icon_alert.gif);
} }
ul.messagelist li.error{ ul.messagelist li.error{
background-image: url(../img/admin/icon_error.gif); background-image: url(../img/icon_error.gif);
} }
.errornote { .errornote {
...@@ -473,7 +536,7 @@ ul.messagelist li.error{ ...@@ -473,7 +536,7 @@ ul.messagelist li.error{
margin: 0 0 3px 0; margin: 0 0 3px 0;
border: 1px solid red; border: 1px solid red;
color: red; color: red;
background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat; background: #ffc url(../img/icon_error.gif) 5px .3em no-repeat;
} }
ul.errorlist { ul.errorlist {
...@@ -488,7 +551,7 @@ ul.errorlist { ...@@ -488,7 +551,7 @@ ul.errorlist {
margin: 0 0 3px 0; margin: 0 0 3px 0;
border: 1px solid red; border: 1px solid red;
color: white; color: white;
background: red url(../img/admin/icon_alert.gif) 5px .3em no-repeat; background: red url(../img/icon_alert.gif) 5px .3em no-repeat;
} }
.errorlist li a { .errorlist li a {
...@@ -524,7 +587,7 @@ div.system-message p.system-message-title { ...@@ -524,7 +587,7 @@ div.system-message p.system-message-title {
padding: 4px 5px 4px 25px; padding: 4px 5px 4px 25px;
margin: 0; margin: 0;
color: red; color: red;
background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat; background: #ffc url(../img/icon_error.gif) 5px .3em no-repeat;
} }
.description { .description {
...@@ -535,7 +598,7 @@ div.system-message p.system-message-title { ...@@ -535,7 +598,7 @@ div.system-message p.system-message-title {
/* BREADCRUMBS */ /* BREADCRUMBS */
div.breadcrumbs { div.breadcrumbs {
background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x; background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x;
padding: 2px 8px 3px 8px; padding: 2px 8px 3px 8px;
font-size: 11px; font-size: 11px;
color: #999; color: #999;
...@@ -548,17 +611,17 @@ div.breadcrumbs { ...@@ -548,17 +611,17 @@ div.breadcrumbs {
.addlink { .addlink {
padding-left: 12px; padding-left: 12px;
background: url(../img/admin/icon_addlink.gif) 0 .2em no-repeat; background: url(../img/icon_addlink.gif) 0 .2em no-repeat;
} }
.changelink { .changelink {
padding-left: 12px; padding-left: 12px;
background: url(../img/admin/icon_changelink.gif) 0 .2em no-repeat; background: url(../img/icon_changelink.gif) 0 .2em no-repeat;
} }
.deletelink { .deletelink {
padding-left: 12px; padding-left: 12px;
background: url(../img/admin/icon_deletelink.gif) 0 .25em no-repeat; background: url(../img/icon_deletelink.gif) 0 .25em no-repeat;
} }
a.deletelink:link, a.deletelink:visited { a.deletelink:link, a.deletelink:visited {
...@@ -593,14 +656,14 @@ a.deletelink:hover { ...@@ -593,14 +656,14 @@ a.deletelink:hover {
.object-tools li { .object-tools li {
display: block; display: block;
float: left; float: left;
background: url(../img/admin/tool-left.gif) 0 0 no-repeat; background: url(../img/tool-left.gif) 0 0 no-repeat;
padding: 0 0 0 8px; padding: 0 0 0 8px;
margin-left: 2px; margin-left: 2px;
height: 16px; height: 16px;
} }
.object-tools li:hover { .object-tools li:hover {
background: url(../img/admin/tool-left_over.gif) 0 0 no-repeat; background: url(../img/tool-left_over.gif) 0 0 no-repeat;
} }
.object-tools a:link, .object-tools a:visited { .object-tools a:link, .object-tools a:visited {
...@@ -609,29 +672,29 @@ a.deletelink:hover { ...@@ -609,29 +672,29 @@ a.deletelink:hover {
color: white; color: white;
padding: .1em 14px .1em 8px; padding: .1em 14px .1em 8px;
height: 14px; height: 14px;
background: #999 url(../img/admin/tool-right.gif) 100% 0 no-repeat; background: #999 url(../img/tool-right.gif) 100% 0 no-repeat;
} }
.object-tools a:hover, .object-tools li:hover a { .object-tools a:hover, .object-tools li:hover a {
background: #5b80b2 url(../img/admin/tool-right_over.gif) 100% 0 no-repeat; background: #5b80b2 url(../img/tool-right_over.gif) 100% 0 no-repeat;
} }
.object-tools a.viewsitelink, .object-tools a.golink { .object-tools a.viewsitelink, .object-tools a.golink {
background: #999 url(../img/admin/tooltag-arrowright.gif) top right no-repeat; background: #999 url(../img/tooltag-arrowright.gif) top right no-repeat;
padding-right: 28px; padding-right: 28px;
} }
.object-tools a.viewsitelink:hover, .object-tools a.golink:hover { .object-tools a.viewsitelink:hover, .object-tools a.golink:hover {
background: #5b80b2 url(../img/admin/tooltag-arrowright_over.gif) top right no-repeat; background: #5b80b2 url(../img/tooltag-arrowright_over.gif) top right no-repeat;
} }
.object-tools a.addlink { .object-tools a.addlink {
background: #999 url(../img/admin/tooltag-add.gif) top right no-repeat; background: #999 url(../img/tooltag-add.gif) top right no-repeat;
padding-right: 28px; padding-right: 28px;
} }
.object-tools a.addlink:hover { .object-tools a.addlink:hover {
background: #5b80b2 url(../img/admin/tooltag-add_over.gif) top right no-repeat; background: #5b80b2 url(../img/tooltag-add_over.gif) top right no-repeat;
} }
/* OBJECT HISTORY */ /* OBJECT HISTORY */
...@@ -766,7 +829,7 @@ table#change-history tbody th { ...@@ -766,7 +829,7 @@ table#change-history tbody th {
} }
#content-related .module h2 { #content-related .module h2 {
background: #eee url(../img/admin/nav-bg.gif) bottom left repeat-x; background: #eee url(../img/nav-bg.gif) bottom left repeat-x;
color: #666; color: #666;
} }
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
} }
.change-list .filtered { .change-list .filtered {
background: white url(../img/admin/changelist-bg.gif) top right repeat-y !important; background: white url(../img/changelist-bg.gif) top right repeat-y !important;
} }
.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { .change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull {
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
color: #666; color: #666;
border-top: 1px solid #eee; border-top: 1px solid #eee;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
background: white url(../img/admin/nav-bg.gif) 0 180% repeat-x; background: white url(../img/nav-bg.gif) 0 180% repeat-x;
overflow: hidden; overflow: hidden;
} }
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
/* CHANGELIST TABLES */ /* CHANGELIST TABLES */
#changelist table thead th { #changelist table thead th {
padding: 0;
white-space: nowrap; white-space: nowrap;
vertical-align: middle; vertical-align: middle;
} }
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
#changelist #toolbar { #changelist #toolbar {
padding: 3px; padding: 3px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
color: #666; color: #666;
} }
...@@ -156,7 +157,7 @@ ...@@ -156,7 +157,7 @@
.change-list ul.toplinks { .change-list ul.toplinks {
display: block; display: block;
background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x; background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x;
border-top: 1px solid white; border-top: 1px solid white;
float: left; float: left;
padding: 0 !important; padding: 0 !important;
...@@ -165,11 +166,10 @@ ...@@ -165,11 +166,10 @@
} }
.change-list ul.toplinks li { .change-list ul.toplinks li {
float: left;
width: 9em;
padding: 3px 6px; padding: 3px 6px;
font-weight: bold; font-weight: bold;
list-style-type: none; list-style-type: none;
display: inline-block;
} }
.change-list ul.toplinks .date-back a { .change-list ul.toplinks .date-back a {
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
padding: 3px; padding: 3px;
border-top: 1px solid #fff; border-top: 1px solid #fff;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x; background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x;
} }
#changelist .actions.selected { #changelist .actions.selected {
......
...@@ -140,7 +140,7 @@ fieldset.collapsed h2, fieldset.collapsed { ...@@ -140,7 +140,7 @@ fieldset.collapsed h2, fieldset.collapsed {
} }
fieldset.collapsed h2 { fieldset.collapsed h2 {
background-image: url(../img/admin/nav-bg.gif); background-image: url(../img/nav-bg.gif);
background-position: bottom left; background-position: bottom left;
color: #999; color: #999;
} }
...@@ -161,12 +161,16 @@ fieldset.monospace textarea { ...@@ -161,12 +161,16 @@ fieldset.monospace textarea {
.submit-row { .submit-row {
padding: 5px 7px; padding: 5px 7px;
text-align: right; text-align: right;
background: white url(../img/admin/nav-bg.gif) 0 100% repeat-x; background: white url(../img/nav-bg.gif) 0 100% repeat-x;
border: 1px solid #ccc; border: 1px solid #ccc;
margin: 5px 0; margin: 5px 0;
overflow: hidden; overflow: hidden;
} }
body.popup .submit-row {
overflow: auto;
}
.submit-row input { .submit-row input {
margin: 0 0 0 5px; margin: 0 0 0 5px;
} }
...@@ -180,7 +184,7 @@ fieldset.monospace textarea { ...@@ -180,7 +184,7 @@ fieldset.monospace textarea {
} }
.submit-row .deletelink { .submit-row .deletelink {
background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat; background: url(../img/icon_deletelink.gif) 0 50% no-repeat;
padding-left: 14px; padding-left: 14px;
} }
...@@ -247,7 +251,7 @@ fieldset.monospace textarea { ...@@ -247,7 +251,7 @@ fieldset.monospace textarea {
color: #666; color: #666;
padding: 3px 5px; padding: 3px 5px;
font-size: 11px; font-size: 11px;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
...@@ -332,7 +336,7 @@ fieldset.monospace textarea { ...@@ -332,7 +336,7 @@ fieldset.monospace textarea {
color: #666; color: #666;
padding: 3px 5px; padding: 3px 5px;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
} }
.inline-group .tabular tr.add-row td { .inline-group .tabular tr.add-row td {
...@@ -343,7 +347,7 @@ fieldset.monospace textarea { ...@@ -343,7 +347,7 @@ fieldset.monospace textarea {
.inline-group ul.tools a.add, .inline-group ul.tools a.add,
.inline-group div.add-row a, .inline-group div.add-row a,
.inline-group .tabular tr.add-row td a { .inline-group .tabular tr.add-row td a {
background: url(../img/admin/icon_addlink.gif) 0 50% no-repeat; background: url(../img/icon_addlink.gif) 0 50% no-repeat;
padding-left: 14px; padding-left: 14px;
font-size: 11px; font-size: 11px;
outline: 0; /* Remove dotted border around link */ outline: 0; /* Remove dotted border around link */
...@@ -352,9 +356,3 @@ fieldset.monospace textarea { ...@@ -352,9 +356,3 @@ fieldset.monospace textarea {
.empty-form { .empty-form {
display: none; display: none;
} }
/* IE7 specific bug fixes */
.submit-row input {
float: right;
}
\ No newline at end of file
...@@ -53,5 +53,11 @@ ...@@ -53,5 +53,11 @@
/* IE doesn't know alpha transparency in PNGs */ /* IE doesn't know alpha transparency in PNGs */
.inline-deletelink { .inline-deletelink {
background: transparent url(../img/admin/inline-delete-8bit.png) no-repeat; background: transparent url(../img/inline-delete-8bit.png) no-repeat;
}
/* IE7 doesn't support inline-block */
.change-list ul.toplinks li {
zoom: 1;
*display: inline;
} }
\ No newline at end of file
...@@ -52,3 +52,6 @@ body.login { ...@@ -52,3 +52,6 @@ body.login {
padding: 1em 0 0 9.4em; padding: 1em 0 0 9.4em;
} }
.login .password-reset-link {
text-align: center;
}
...@@ -80,15 +80,8 @@ div.breadcrumbs { ...@@ -80,15 +80,8 @@ div.breadcrumbs {
/* SORTABLE TABLES */ /* SORTABLE TABLES */
table thead th.sorted .sortoptions {
table thead th.sorted a { float: left;
padding-left: 13px;
padding-right: 0px;
}
table thead th.ascending a,
table thead th.descending a {
background-position: left;
} }
/* dashboard styles */ /* dashboard styles */
...@@ -100,12 +93,8 @@ table thead th.descending a { ...@@ -100,12 +93,8 @@ table thead th.descending a {
/* changelists styles */ /* changelists styles */
.change-list ul.toplinks li {
float: right;
}
.change-list .filtered { .change-list .filtered {
background: white url(../img/admin/changelist-bg_rtl.gif) top left repeat-y !important; background: white url(../img/changelist-bg_rtl.gif) top left repeat-y !important;
} }
.change-list .filtered table { .change-list .filtered table {
...@@ -162,7 +151,7 @@ table thead th.descending a { ...@@ -162,7 +151,7 @@ table thead th.descending a {
} }
.submit-row .deletelink { .submit-row .deletelink {
background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat; background: url(../img/icon_deletelink.gif) 0 50% no-repeat;
padding-right: 14px; padding-right: 14px;
} }
...@@ -183,6 +172,7 @@ input[type=submit].default, .submit-row input.default { ...@@ -183,6 +172,7 @@ input[type=submit].default, .submit-row input.default {
fieldset .field-box { fieldset .field-box {
float: right; float: right;
margin-left: 20px; margin-left: 20px;
margin-right: 0;
} }
.errorlist li { .errorlist li {
...@@ -236,9 +226,20 @@ fieldset .field-box { ...@@ -236,9 +226,20 @@ fieldset .field-box {
padding-left: inherit; padding-left: inherit;
left: 10px; left: 10px;
right: inherit; right: inherit;
float:left;
} }
.inline-related h3 span.delete label { .inline-related h3 span.delete label {
margin-left: inherit; margin-left: inherit;
margin-right: 2px; margin-right: 2px;
} }
/* IE7 specific bug fixes */
div.colM {
position: relative;
}
.submit-row input {
float: left;
}
\ No newline at end of file
...@@ -17,12 +17,16 @@ ...@@ -17,12 +17,16 @@
margin-bottom: 5px; margin-bottom: 5px;
} }
.selector-chosen select {
border-top: none;
}
.selector-available h2, .selector-chosen h2 { .selector-available h2, .selector-chosen h2 {
border: 1px solid #ccc; border: 1px solid #ccc;
} }
.selector .selector-available h2 { .selector .selector-available h2 {
background: white url(../img/admin/nav-bg.gif) bottom left repeat-x; background: white url(../img/nav-bg.gif) bottom left repeat-x;
color: #666; color: #666;
} }
...@@ -37,8 +41,10 @@ ...@@ -37,8 +41,10 @@
text-align: left; text-align: left;
} }
.selector .selector-chosen .selector-filter { .selector .selector-filter label,
padding: 4px 5px; .inline-group .aligned .selector .selector-filter label {
width: 16px;
padding: 2px;
} }
.selector .selector-available input { .selector .selector-available input {
...@@ -49,8 +55,8 @@ ...@@ -49,8 +55,8 @@
float: left; float: left;
width: 22px; width: 22px;
height: 50px; height: 50px;
background: url(../img/admin/chooser-bg.gif) top center no-repeat; background: url(../img/chooser-bg.gif) top center no-repeat;
margin: 8em 3px 0 3px; margin: 10em 5px 0 5px;
padding: 0; padding: 0;
} }
...@@ -61,7 +67,7 @@ ...@@ -61,7 +67,7 @@
} }
.selector select { .selector select {
margin-bottom: 5px; margin-bottom: 10px;
margin-top: 0; margin-top: 0;
} }
...@@ -74,38 +80,66 @@ ...@@ -74,38 +80,66 @@
} }
.selector-add { .selector-add {
background: url(../img/admin/selector-add.gif) top center no-repeat; background: url(../img/selector-icons.gif) 0 -161px no-repeat;
cursor: default;
margin-bottom: 2px; margin-bottom: 2px;
} }
.active.selector-add {
background: url(../img/selector-icons.gif) 0 -187px no-repeat;
cursor: pointer;
}
.selector-remove { .selector-remove {
background: url(../img/admin/selector-remove.gif) top center no-repeat; background: url(../img/selector-icons.gif) 0 -109px no-repeat;
cursor: default;
}
.active.selector-remove {
background: url(../img/selector-icons.gif) 0 -135px no-repeat;
cursor: pointer;
} }
a.selector-chooseall, a.selector-clearall { a.selector-chooseall, a.selector-clearall {
display: block; display: inline-block;
width: 6em;
text-align: left; text-align: left;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
font-weight: bold; font-weight: bold;
color: #666; color: #666;
}
a.selector-chooseall {
padding: 3px 18px 3px 0;
}
a.selector-clearall {
padding: 3px 0 3px 18px; padding: 3px 0 3px 18px;
} }
a.selector-chooseall:hover, a.selector-clearall:hover { a.active.selector-chooseall:hover, a.active.selector-clearall:hover {
color: #036; color: #036;
} }
a.selector-chooseall { a.selector-chooseall {
width: 7em; background: url(../img/selector-icons.gif) right -263px no-repeat;
background: url(../img/admin/selector-addall.gif) left center no-repeat; cursor: default;
}
a.active.selector-chooseall {
background: url(../img/selector-icons.gif) right -289px no-repeat;
cursor: pointer;
} }
a.selector-clearall { a.selector-clearall {
background: url(../img/admin/selector-removeall.gif) left center no-repeat; background: url(../img/selector-icons.gif) left -211px no-repeat;
cursor: default;
} }
a.active.selector-clearall {
background: url(../img/selector-icons.gif) left -237px no-repeat;
cursor: pointer;
}
/* STACKED SELECTORS */ /* STACKED SELECTORS */
...@@ -135,7 +169,7 @@ a.selector-clearall { ...@@ -135,7 +169,7 @@ a.selector-clearall {
height: 22px; height: 22px;
width: 50px; width: 50px;
margin: 0 0 3px 40%; margin: 0 0 3px 40%;
background: url(../img/admin/chooser_stacked-bg.gif) top center no-repeat; background: url(../img/chooser_stacked-bg.gif) top center no-repeat;
} }
.stacked .selector-chooser li { .stacked .selector-chooser li {
...@@ -148,13 +182,24 @@ a.selector-clearall { ...@@ -148,13 +182,24 @@ a.selector-clearall {
} }
.stacked .selector-add { .stacked .selector-add {
background-image: url(../img/admin/selector_stacked-add.gif); background: url(../img/selector-icons.gif) 0 -57px no-repeat;
cursor: default;
}
.stacked .active.selector-add {
background: url(../img/selector-icons.gif) 0 -83px no-repeat;
cursor: pointer;
} }
.stacked .selector-remove { .stacked .selector-remove {
background-image: url(../img/admin/selector_stacked-remove.gif); background: url(../img/selector-icons.gif) 0 -5px no-repeat;
cursor: default;
} }
.stacked .active.selector-remove {
background: url(../img/selector-icons.gif) 0 -31px no-repeat;
cursor: pointer;
}
/* DATE AND TIME */ /* DATE AND TIME */
...@@ -231,7 +276,7 @@ span.clearable-file-input label { ...@@ -231,7 +276,7 @@ span.clearable-file-input label {
padding: 0; padding: 0;
border-collapse: collapse; border-collapse: collapse;
background: white; background: white;
width: 99%; width: 100%;
} }
.calendar caption, .calendarbox h2 { .calendar caption, .calendarbox h2 {
...@@ -246,7 +291,7 @@ span.clearable-file-input label { ...@@ -246,7 +291,7 @@ span.clearable-file-input label {
color: #666; color: #666;
padding: 2px 3px; padding: 2px 3px;
text-align: center; text-align: center;
background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x; background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
} }
...@@ -314,7 +359,7 @@ span.clearable-file-input label { ...@@ -314,7 +359,7 @@ span.clearable-file-input label {
position: absolute; position: absolute;
font-weight: bold; font-weight: bold;
font-size: 12px; font-size: 12px;
background: #C9DBED url(../img/admin/default-bg.gif) bottom left repeat-x; background: #C9DBED url(../img/default-bg.gif) bottom left repeat-x;
padding: 1px 4px 2px 4px; padding: 1px 4px 2px 4px;
color: white; color: white;
} }
...@@ -335,15 +380,19 @@ span.clearable-file-input label { ...@@ -335,15 +380,19 @@ span.clearable-file-input label {
.calendar-cancel { .calendar-cancel {
margin: 0 !important; margin: 0 !important;
padding: 0; padding: 0 !important;
font-size: 10px; font-size: 10px;
background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x; background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
} }
.calendar-cancel:hover {
background: #e1e1e1 url(../img/nav-bg-reverse.gif) 0 50% repeat-x;
}
.calendar-cancel a { .calendar-cancel a {
padding: 2px; color: black;
color: #999; display: block;
} }
ul.timelist, .timelist li { ul.timelist, .timelist li {
...@@ -374,7 +423,7 @@ ul.orderer li { ...@@ -374,7 +423,7 @@ ul.orderer li {
border-width: 0 1px 1px 0; border-width: 0 1px 1px 0;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
background: #e2e2e2 url(../img/admin/nav-bg-grabber.gif) repeat-y; background: #e2e2e2 url(../img/nav-bg-grabber.gif) repeat-y;
} }
ul.orderer li:hover { ul.orderer li:hover {
...@@ -406,7 +455,7 @@ ul.orderer li.selected { ...@@ -406,7 +455,7 @@ ul.orderer li.selected {
} }
ul.orderer li.deleted { ul.orderer li.deleted {
background: #bbb url(../img/admin/deleted-overlay.gif); background: #bbb url(../img/deleted-overlay.gif);
} }
ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited { ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited {
...@@ -414,7 +463,7 @@ ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited { ...@@ -414,7 +463,7 @@ ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited {
} }
ul.orderer li.deleted .inline-deletelink { ul.orderer li.deleted .inline-deletelink {
background-image: url(../img/admin/inline-restore.png); background-image: url(../img/inline-restore.png);
} }
ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover { ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
...@@ -426,7 +475,7 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover { ...@@ -426,7 +475,7 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
.inline-deletelink { .inline-deletelink {
float: right; float: right;
text-indent: -9999px; text-indent: -9999px;
background: transparent url(../img/admin/inline-delete.png) no-repeat; background: transparent url(../img/inline-delete.png) no-repeat;
width: 15px; width: 15px;
height: 15px; height: 15px;
border: 0px none; border: 0px none;
...@@ -465,11 +514,11 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover { ...@@ -465,11 +514,11 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
} }
.editinline tr.deleted { .editinline tr.deleted {
background: #ddd url(../img/admin/deleted-overlay.gif); background: #ddd url(../img/deleted-overlay.gif);
} }
.editinline tr.deleted .inline-deletelink { .editinline tr.deleted .inline-deletelink {
background-image: url(../img/admin/inline-restore.png); background-image: url(../img/inline-restore.png);
} }
.editinline tr.deleted td:hover { .editinline tr.deleted td:hover {
...@@ -500,13 +549,13 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover { ...@@ -500,13 +549,13 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
.editinline-stacked .inline-splitter { .editinline-stacked .inline-splitter {
float: left; float: left;
width: 9px; width: 9px;
background: #f8f8f8 url(../img/admin/inline-splitter-bg.gif) 50% 50% no-repeat; background: #f8f8f8 url(../img/inline-splitter-bg.gif) 50% 50% no-repeat;
border-right: 1px solid #ccc; border-right: 1px solid #ccc;
} }
.editinline-stacked .controls { .editinline-stacked .controls {
clear: both; clear: both;
background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
padding: 3px 4px; padding: 3px 4px;
font-size: 11px; font-size: 11px;
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
......
(function(a){a.fn.actions=function(h){var b=a.extend({},a.fn.actions.defaults,h),e=a(this),f=false;checker=function(c){c?showQuestion():reset();a(e).attr("checked",c).parent().parent().toggleClass(b.selectedClass,c)};updateCounter=function(){var c=a(e).filter(":checked").length;a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:_actions_icnt},true));a(b.allToggle).attr("checked",function(){if(c==e.length){value=true;showQuestion()}else{value= (function(a){a.fn.actions=function(g){var b=a.extend({},a.fn.actions.defaults,g),f=a(this),e=!1;checker=function(c){c?showQuestion():reset();a(f).attr("checked",c).parent().parent().toggleClass(b.selectedClass,c)};updateCounter=function(){var c=a(f).filter(":checked").length;a(b.counterContainer).html(interpolate(ngettext("%(sel)s of %(cnt)s selected","%(sel)s of %(cnt)s selected",c),{sel:c,cnt:_actions_icnt},!0));a(b.allToggle).attr("checked",function(){c==f.length?(value=!0,showQuestion()):(value=
false;clearAcross()}return value})};showQuestion=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()};showClear=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()};reset=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()};clearAcross=function(){reset();a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)}; !1,clearAcross());return value})};showQuestion=function(){a(b.acrossClears).hide();a(b.acrossQuestions).show();a(b.allContainer).hide()};showClear=function(){a(b.acrossClears).show();a(b.acrossQuestions).hide();a(b.actionContainer).toggleClass(b.selectedClass);a(b.allContainer).show();a(b.counterContainer).hide()};reset=function(){a(b.acrossClears).hide();a(b.acrossQuestions).hide();a(b.allContainer).hide();a(b.counterContainer).show()};clearAcross=function(){reset();a(b.acrossInput).val(0);a(b.actionContainer).removeClass(b.selectedClass)};
a(b.counterContainer).show();a(this).filter(":checked").each(function(){a(this).parent().parent().toggleClass(b.selectedClass);updateCounter();a(b.acrossInput).val()==1&&showClear()});a(b.allToggle).show().click(function(){checker(a(this).attr("checked"));updateCounter()});a("div.actions span.question a").click(function(c){c.preventDefault();a(b.acrossInput).val(1);showClear()});a("div.actions span.clear a").click(function(c){c.preventDefault();a(b.allToggle).attr("checked",false);clearAcross();checker(0); a(b.counterContainer).show();a(this).filter(":checked").each(function(){a(this).parent().parent().toggleClass(b.selectedClass);updateCounter();1==a(b.acrossInput).val()&&showClear()});a(b.allToggle).show().click(function(){checker(a(this).attr("checked"));updateCounter()});a("div.actions span.question a").click(function(c){c.preventDefault();a(b.acrossInput).val(1);showClear()});a("div.actions span.clear a").click(function(c){c.preventDefault();a(b.allToggle).attr("checked",!1);clearAcross();checker(0);
updateCounter()});lastChecked=null;a(e).click(function(c){if(!c)c=window.event;var d=c.target?c.target:c.srcElement;if(lastChecked&&a.data(lastChecked)!=a.data(d)&&c.shiftKey==true){var g=false;a(lastChecked).attr("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(e).each(function(){if(a.data(this)==a.data(lastChecked)||a.data(this)==a.data(d))g=g?false:true;g&&a(this).attr("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass, updateCounter()});lastChecked=null;a(f).click(function(c){if(!c)c=window.event;var d=c.target?c.target:c.srcElement;if(lastChecked&&a.data(lastChecked)!=a.data(d)&&!0==c.shiftKey){var e=!1;a(lastChecked).attr("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked);a(f).each(function(){if(a.data(this)==a.data(lastChecked)||a.data(this)==a.data(d))e=e?!1:!0;e&&a(this).attr("checked",d.checked).parent().parent().toggleClass(b.selectedClass,d.checked)})}a(d).parent().parent().toggleClass(b.selectedClass,
d.checked);lastChecked=d;updateCounter()});a("form#changelist-form table#result_list tr").find("td:gt(0) :input").change(function(){f=true});a('form#changelist-form button[name="index"]').click(function(){if(f)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});a('form#changelist-form input[name="_save"]').click(function(){var c=false;a("div.actions select option:selected").each(function(){if(a(this).val())c= d.checked);lastChecked=d;updateCounter()});a("form#changelist-form table#result_list tr").find("td:gt(0) :input").change(function(){e=!0});a('form#changelist-form button[name="index"]').click(function(){if(e)return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."))});a('form#changelist-form input[name="_save"]').click(function(){var b=!1;a("div.actions select option:selected").each(function(){a(this).val()&&(b=!0)});
true});if(c)return f?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})};a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across", if(b)return e?confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action.")):confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."))})};a.fn.actions.defaults={actionContainer:"div.actions",counterContainer:"span.action-counter",allContainer:"div.actions span.all",acrossInput:"div.actions input.select-across",
acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"}})(django.jQuery); acrossQuestions:"div.actions span.question",acrossClears:"div.actions span.clear",allToggle:"#action-toggle",selectedClass:"selected"}})(django.jQuery);
...@@ -50,7 +50,7 @@ var DateTimeShortcuts = { ...@@ -50,7 +50,7 @@ var DateTimeShortcuts = {
var clock_link = document.createElement('a'); var clock_link = document.createElement('a');
clock_link.setAttribute('href', 'javascript:DateTimeShortcuts.openClock(' + num + ');'); clock_link.setAttribute('href', 'javascript:DateTimeShortcuts.openClock(' + num + ');');
clock_link.id = DateTimeShortcuts.clockLinkName + num; clock_link.id = DateTimeShortcuts.clockLinkName + num;
quickElement('img', clock_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/admin/icon_clock.gif', 'alt', gettext('Clock')); quickElement('img', clock_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_clock.gif', 'alt', gettext('Clock'));
shortcuts_span.appendChild(document.createTextNode('\240')); shortcuts_span.appendChild(document.createTextNode('\240'));
shortcuts_span.appendChild(now_link); shortcuts_span.appendChild(now_link);
shortcuts_span.appendChild(document.createTextNode('\240|\240')); shortcuts_span.appendChild(document.createTextNode('\240|\240'));
...@@ -79,17 +79,24 @@ var DateTimeShortcuts = { ...@@ -79,17 +79,24 @@ var DateTimeShortcuts = {
addEvent(clock_box, 'click', DateTimeShortcuts.cancelEventPropagation); addEvent(clock_box, 'click', DateTimeShortcuts.cancelEventPropagation);
quickElement('h2', clock_box, gettext('Choose a time')); quickElement('h2', clock_box, gettext('Choose a time'));
time_list = quickElement('ul', clock_box, ''); var time_list = quickElement('ul', clock_box, '');
time_list.className = 'timelist'; time_list.className = 'timelist';
time_format = get_format('TIME_INPUT_FORMATS')[0]; var time_format = get_format('TIME_INPUT_FORMATS')[0];
quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().strftime('" + time_format + "'));"); quickElement("a", quickElement("li", time_list, ""), gettext("Now"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date().strftime('" + time_format + "'));");
quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,0,0,0,0).strftime('" + time_format + "'));"); quickElement("a", quickElement("li", time_list, ""), gettext("Midnight"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,0,0,0,0).strftime('" + time_format + "'));");
quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,6,0,0,0).strftime('" + time_format + "'));"); quickElement("a", quickElement("li", time_list, ""), gettext("6 a.m."), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,6,0,0,0).strftime('" + time_format + "'));");
quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,12,0,0,0).strftime('" + time_format + "'));"); quickElement("a", quickElement("li", time_list, ""), gettext("Noon"), "href", "javascript:DateTimeShortcuts.handleClockQuicklink(" + num + ", new Date(1970,1,1,12,0,0,0).strftime('" + time_format + "'));");
cancel_p = quickElement('p', clock_box, ''); var cancel_p = quickElement('p', clock_box, '');
cancel_p.className = 'calendar-cancel'; cancel_p.className = 'calendar-cancel';
quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissClock(' + num + ');'); quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissClock(' + num + ');');
django.jQuery(document).bind('keyup', function(event) {
if (event.which == 27) {
// ESC key closes popup
DateTimeShortcuts.dismissClock(num);
event.preventDefault();
}
});
}, },
openClock: function(num) { openClock: function(num) {
var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num) var clock_box = document.getElementById(DateTimeShortcuts.clockDivName+num)
...@@ -138,7 +145,7 @@ var DateTimeShortcuts = { ...@@ -138,7 +145,7 @@ var DateTimeShortcuts = {
var cal_link = document.createElement('a'); var cal_link = document.createElement('a');
cal_link.setAttribute('href', 'javascript:DateTimeShortcuts.openCalendar(' + num + ');'); cal_link.setAttribute('href', 'javascript:DateTimeShortcuts.openCalendar(' + num + ');');
cal_link.id = DateTimeShortcuts.calendarLinkName + num; cal_link.id = DateTimeShortcuts.calendarLinkName + num;
quickElement('img', cal_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/admin/icon_calendar.gif', 'alt', gettext('Calendar')); quickElement('img', cal_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_calendar.gif', 'alt', gettext('Calendar'));
shortcuts_span.appendChild(document.createTextNode('\240')); shortcuts_span.appendChild(document.createTextNode('\240'));
shortcuts_span.appendChild(today_link); shortcuts_span.appendChild(today_link);
shortcuts_span.appendChild(document.createTextNode('\240|\240')); shortcuts_span.appendChild(document.createTextNode('\240|\240'));
...@@ -195,6 +202,13 @@ var DateTimeShortcuts = { ...@@ -195,6 +202,13 @@ var DateTimeShortcuts = {
var cancel_p = quickElement('p', cal_box, ''); var cancel_p = quickElement('p', cal_box, '');
cancel_p.className = 'calendar-cancel'; cancel_p.className = 'calendar-cancel';
quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissCalendar(' + num + ');'); quickElement('a', cancel_p, gettext('Cancel'), 'href', 'javascript:DateTimeShortcuts.dismissCalendar(' + num + ');');
django.jQuery(document).bind('keyup', function(event) {
if (event.which == 27) {
// ESC key closes popup
DateTimeShortcuts.dismissCalendar(num);
event.preventDefault();
}
});
}, },
openCalendar: function(num) { openCalendar: function(num) {
var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1+num) var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1+num)
......
...@@ -74,11 +74,12 @@ function dismissAddAnotherPopup(win, newId, newRepr) { ...@@ -74,11 +74,12 @@ function dismissAddAnotherPopup(win, newId, newRepr) {
var name = windowname_to_id(win.name); var name = windowname_to_id(win.name);
var elem = document.getElementById(name); var elem = document.getElementById(name);
if (elem) { if (elem) {
if (elem.nodeName == 'SELECT') { var elemName = elem.nodeName.toUpperCase();
if (elemName == 'SELECT') {
var o = new Option(newRepr, newId); var o = new Option(newRepr, newId);
elem.options[elem.options.length] = o; elem.options[elem.options.length] = o;
o.selected = true; o.selected = true;
} else if (elem.nodeName == 'INPUT') { } else if (elemName == 'INPUT') {
if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) { if (elem.className.indexOf('vManyToManyRawIdAdminField') != -1 && elem.value) {
elem.value += ',' + newId; elem.value += ',' + newId;
} else { } else {
......
...@@ -11,7 +11,7 @@ function reorder_init() { ...@@ -11,7 +11,7 @@ function reorder_init() {
setOrder(input.value.split(',')); setOrder(input.value.split(','));
input.disabled = true; input.disabled = true;
draw(); draw();
// Now initialise the dragging behaviour // Now initialize the dragging behavior
var limit = (lis.length - 1) * height; var limit = (lis.length - 1) * height;
for (var i = 0; i < lis.length; i++) { for (var i = 0; i < lis.length; i++) {
var li = lis[i]; var li = lis[i];
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
// Add anchor tag for Show/Hide link // Add anchor tag for Show/Hide link
$("fieldset.collapse").each(function(i, elem) { $("fieldset.collapse").each(function(i, elem) {
// Don't hide if fields in this fieldset have errors // Don't hide if fields in this fieldset have errors
if ( $(elem).find("div.errors").length == 0 ) { if ($(elem).find("div.errors").length == 0) {
$(elem).addClass("collapsed"); $(elem).addClass("collapsed").find("h2").first().append(' (<a id="fieldsetcollapser' +
$(elem).find("h2").first().append(' (<a id="fieldsetcollapser' +
i +'" class="collapse-toggle" href="#">' + gettext("Show") + i +'" class="collapse-toggle" href="#">' + gettext("Show") +
'</a>)'); '</a>)');
} }
...@@ -13,13 +12,11 @@ ...@@ -13,13 +12,11 @@
// Add toggle to anchor tag // Add toggle to anchor tag
$("fieldset.collapse a.collapse-toggle").toggle( $("fieldset.collapse a.collapse-toggle").toggle(
function() { // Show function() { // Show
$(this).text(gettext("Hide")); $(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset", [$(this).attr("id")]);
$(this).closest("fieldset").removeClass("collapsed");
return false; return false;
}, },
function() { // Hide function() { // Hide
$(this).text(gettext("Show")); $(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset", [$(this).attr("id")]);
$(this).closest("fieldset").addClass("collapsed");
return false; return false;
} }
); );
......
(function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){if(a(b).find("div.errors").length==0){a(b).addClass("collapsed");a(b).find("h2").first().append(' (<a id="fieldsetcollapser'+c+'" class="collapse-toggle" href="#">'+gettext("Show")+"</a>)")}});a("fieldset.collapse a.collapse-toggle").toggle(function(){a(this).text(gettext("Hide"));a(this).closest("fieldset").removeClass("collapsed");return false},function(){a(this).text(gettext("Show"));a(this).closest("fieldset").addClass("collapsed"); (function(a){a(document).ready(function(){a("fieldset.collapse").each(function(c,b){0==a(b).find("div.errors").length&&a(b).addClass("collapsed").find("h2").first().append(' (<a id="fieldsetcollapser'+c+'" class="collapse-toggle" href="#">'+gettext("Show")+"</a>)")});a("fieldset.collapse a.collapse-toggle").toggle(function(){a(this).text(gettext("Hide")).closest("fieldset").removeClass("collapsed").trigger("show.fieldset",[a(this).attr("id")]);return!1},function(){a(this).text(gettext("Show")).closest("fieldset").addClass("collapsed").trigger("hide.fieldset",
return false})})})(django.jQuery); [a(this).attr("id")]);return!1})})})(django.jQuery);
...@@ -108,12 +108,6 @@ function findPosY(obj) { ...@@ -108,12 +108,6 @@ function findPosY(obj) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Date object extensions // Date object extensions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
Date.prototype.getCorrectYear = function() {
// Date.getYear() is unreliable --
// see http://www.quirksmode.org/js/introdate.html#year
var y = this.getYear() % 100;
return (y < 38) ? y + 2000 : y + 1900;
}
Date.prototype.getTwelveHours = function() { Date.prototype.getTwelveHours = function() {
hours = this.getHours(); hours = this.getHours();
...@@ -149,10 +143,6 @@ Date.prototype.getTwoDigitSecond = function() { ...@@ -149,10 +143,6 @@ Date.prototype.getTwoDigitSecond = function() {
return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds();
} }
Date.prototype.getISODate = function() {
return this.getCorrectYear() + '-' + this.getTwoDigitMonth() + '-' + this.getTwoDigitDate();
}
Date.prototype.getHourMinute = function() { Date.prototype.getHourMinute = function() {
return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute();
} }
......
(function(b){b.fn.formset=function(g){var a=b.extend({},b.fn.formset.defaults,g),k=function(c,f,d){var e=new RegExp("("+f+"-(\\d+|__prefix__))");f=f+"-"+d;b(c).attr("for")&&b(c).attr("for",b(c).attr("for").replace(e,f));if(c.id)c.id=c.id.replace(e,f);if(c.name)c.name=c.name.replace(e,f)};g=b("#id_"+a.prefix+"-TOTAL_FORMS").attr("autocomplete","off");var l=parseInt(g.val()),h=b("#id_"+a.prefix+"-MAX_NUM_FORMS").attr("autocomplete","off");g=h.val()==""||h.val()-g.val()>0;b(this).each(function(){b(this).not("."+ (function(b){b.fn.formset=function(c){var a=b.extend({},b.fn.formset.defaults,c),j=function(a,e,d){var i=RegExp("("+e+"-(\\d+|__prefix__))"),e=e+"-"+d;b(a).attr("for")&&b(a).attr("for",b(a).attr("for").replace(i,e));if(a.id)a.id=a.id.replace(i,e);if(a.name)a.name=a.name.replace(i,e)},c=b("#id_"+a.prefix+"-TOTAL_FORMS").attr("autocomplete","off"),g=parseInt(c.val()),f=b("#id_"+a.prefix+"-MAX_NUM_FORMS").attr("autocomplete","off"),c=""==f.val()||0<f.val()-c.val();b(this).each(function(){b(this).not("."+
a.emptyCssClass).addClass(a.formCssClass)});if(b(this).length&&g){var j;if(b(this).attr("tagName")=="TR"){g=this.eq(0).children().length;b(this).parent().append('<tr class="'+a.addCssClass+'"><td colspan="'+g+'"><a href="javascript:void(0)">'+a.addText+"</a></tr>");j=b(this).parent().find("tr:last a")}else{b(this).filter(":last").after('<div class="'+a.addCssClass+'"><a href="javascript:void(0)">'+a.addText+"</a></div>");j=b(this).filter(":last").next().find("a")}j.click(function(){var c=b("#id_"+ a.emptyCssClass).addClass(a.formCssClass)});if(b(this).length&&c){var h;"TR"==b(this).attr("tagName")?(c=this.eq(0).children().length,b(this).parent().append('<tr class="'+a.addCssClass+'"><td colspan="'+c+'"><a href="javascript:void(0)">'+a.addText+"</a></tr>"),h=b(this).parent().find("tr:last a")):(b(this).filter(":last").after('<div class="'+a.addCssClass+'"><a href="javascript:void(0)">'+a.addText+"</a></div>"),h=b(this).filter(":last").next().find("a"));h.click(function(){var c=b("#id_"+a.prefix+
a.prefix+"-TOTAL_FORMS"),f=b("#"+a.prefix+"-empty"),d=f.clone(true);d.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+l);if(d.is("tr"))d.children(":last").append('<div><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></div>");else d.is("ul")||d.is("ol")?d.append('<li><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></li>"):d.children(":first").append('<span><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+ "-TOTAL_FORMS"),e=b("#"+a.prefix+"-empty"),d=e.clone(!0);d.removeClass(a.emptyCssClass).addClass(a.formCssClass).attr("id",a.prefix+"-"+g);d.is("tr")?d.children(":last").append('<div><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></div>"):d.is("ul")||d.is("ol")?d.append('<li><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+"</a></li>"):d.children(":first").append('<span><a class="'+a.deleteCssClass+'" href="javascript:void(0)">'+a.deleteText+
a.deleteText+"</a></span>");d.find("*").each(function(){k(this,a.prefix,c.val())});d.insertBefore(b(f));b(c).val(parseInt(c.val())+1);l+=1;h.val()!=""&&h.val()-c.val()<=0&&j.parent().hide();d.find("a."+a.deleteCssClass).click(function(){var e=b(this).parents("."+a.formCssClass);e.remove();l-=1;a.removed&&a.removed(e);e=b("."+a.formCssClass);b("#id_"+a.prefix+"-TOTAL_FORMS").val(e.length);if(h.val()==""||h.val()-e.length>0)j.parent().show();for(var i=0,m=e.length;i<m;i++){k(b(e).get(i),a.prefix,i); "</a></span>");d.find("*").each(function(){j(this,a.prefix,c.val())});d.insertBefore(b(e));b(c).val(parseInt(c.val())+1);g+=1;""!=f.val()&&0>=f.val()-c.val()&&h.parent().hide();d.find("a."+a.deleteCssClass).click(function(){var c=b(this).parents("."+a.formCssClass);c.remove();g-=1;a.removed&&a.removed(c);c=b("."+a.formCssClass);b("#id_"+a.prefix+"-TOTAL_FORMS").val(c.length);(""==f.val()||0<f.val()-c.length)&&h.parent().show();for(var d=0,e=c.length;d<e;d++)j(b(c).get(d),a.prefix,d),b(c.get(d)).find("*").each(function(){j(this,
b(e.get(i)).find("*").each(function(){k(this,a.prefix,i)})}return false});a.added&&a.added(d);return false})}return this};b.fn.formset.defaults={prefix:"form",addText:"add another",deleteText:"remove",addCssClass:"add-row",deleteCssClass:"delete-row",emptyCssClass:"empty-row",formCssClass:"dynamic-form",added:null,removed:null}})(django.jQuery); a.prefix,d)});return!1});a.added&&a.added(d);return!1})}return this};b.fn.formset.defaults={prefix:"form",addText:"add another",deleteText:"remove",addCssClass:"add-row",deleteCssClass:"delete-row",emptyCssClass:"empty-row",formCssClass:"dynamic-form",added:null,removed:null}})(django.jQuery);
// Puts the included jQuery into our own namespace /* Puts the included jQuery into our own namespace using noConflict and passing
* it 'true'. This ensures that the included jQuery doesn't pollute the global
* namespace (i.e. this preserves pre-existing values for both window.$ and
* window.jQuery).
*/
var django = { var django = {
"jQuery": jQuery.noConflict(true) "jQuery": jQuery.noConflict(true)
}; };
(function(a){a.fn.prepopulate=function(d,g){return this.each(function(){var b=a(this);b.data("_changed",false);b.change(function(){b.data("_changed",true)});var c=function(){if(b.data("_changed")!=true){var e=[];a.each(d,function(h,f){a(f).val().length>0&&e.push(a(f).val())});b.val(URLify(e.join(" "),g))}};a(d.join(",")).keyup(c).change(c).focus(c)})}})(django.jQuery); (function(a){a.fn.prepopulate=function(d,e){return this.each(function(){var b=a(this);b.data("_changed",!1);b.change(function(){b.data("_changed",!0)});var c=function(){if(!0!=b.data("_changed")){var c=[];a.each(d,function(b,d){0<a(d).val().length&&c.push(a(d).val())});b.val(URLify(c.join(" "),e))}};a(d.join(",")).keyup(c).change(c).focus(c)})}})(django.jQuery);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment