Ticket #2889: cal_prev_and_next_year.2.diff

File cal_prev_and_next_year.2.diff, 5.0 KB (added by Robert Bunting, 9 years ago)

Provides a last/next year link in the popup calendar (second version of patch rooted in proper django root dir; please ignore the first version)

  • django/contrib/admin/media/css/widgets.css

     
    5858.calendarnav { font-size:10px; text-align: center; color:#ccc; margin:0; padding:1px 3px; }
    5959.calendarnav a:link, #calendarnav a:visited, #calendarnav a:hover { color: #999; }
    6060.calendar-shortcuts { background:white; font-size:10px; line-height:11px; border-top:1px solid #eee; padding:3px 0 4px; color:#ccc; }
    61 .calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { display:block; position:absolute; font-weight:bold; font-size:12px; background:#C9DBED url(../img/admin/default-bg.gif) bottom left repeat-x; padding:1px 4px 2px 4px; color:white; }
    62 .calendarnav-previous:hover, .calendarnav-next:hover { background:#036; }
    63 .calendarnav-previous { top:0; left:0; }
    64 .calendarnav-next { top:0; right:0; }
     61.calendarbox .calendarnav-previous-year, .calendarbox .calendarnav-next-year, .calendarbox .calendarnav-previous-month, .calendarbox .calendarnav-next-month { display:block; position:absolute; font-weight:bold; font-size:9px; background:#C9DBED url(../img/admin/default-bg.gif) bottom left repeat-x; padding:3px 2px 4px 2px; color:white; }
     62.calendarnav-previous-year:hover, .calendarnav-next-year:hover, .calendarnav-previous-month:hover, .calendarnav-next-month:hover { background:#036; }
     63.calendarnav-previous-year { top:0; left:0; }
     64.calendarnav-previous-month { top:0; left:20px; }
     65.calendarnav-next-month { top:0; right:20px; }
     66.calendarnav-next-year { top:0; right:0; }
    6567.calendar-cancel { margin:0 !important; padding:0; font-size:10px; background:#e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x;  border-top:1px solid #ddd; }
    6668.calendar-cancel a { padding:2px; color:#999; }
    6769ul.timelist, .timelist li { list-style-type:none; margin:0; padding:0; }
     
    98100.editinline-stacked .inline-object { margin-left:210px; background:white; }
    99101.editinline-stacked .inline-source { float:left; width:200px; background:#f8f8f8;  }
    100102.editinline-stacked .inline-splitter { float:left; width:9px; background:#f8f8f8 url(../img/admin/inline-splitter-bg.gif) 50% 50% no-repeat; border-right:1px solid #ccc; }
    101 .editinline-stacked .controls { clear:both; background:#e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; padding:3px 4px; font-size:11px; border-top:1px solid #ddd; }
    102  No newline at end of file
     103.editinline-stacked .controls { clear:both; background:#e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x; padding:3px 4px; font-size:11px; border-top:1px solid #ddd; }
  • django/contrib/admin/media/js/admin/DateTimeShortcuts.js

     
    167167
    168168        // next-prev links
    169169        var cal_nav = quickElement('div', cal_box, '');
    170         var cal_nav_prev = quickElement('a', cal_nav, '<', 'href', 'javascript:DateTimeShortcuts.drawPrev('+num+');');
    171         cal_nav_prev.className = 'calendarnav-previous';
    172         var cal_nav_next = quickElement('a', cal_nav, '>', 'href', 'javascript:DateTimeShortcuts.drawNext('+num+');');
    173         cal_nav_next.className = 'calendarnav-next';
     170        var cal_nav_prev_year = quickElement('a', cal_nav, '<<', 'href', 'javascript:DateTimeShortcuts.drawPrevYear('+num+');');
     171        cal_nav_prev_year.className = 'calendarnav-previous-year';
     172        var cal_nav_prev_month = quickElement('a', cal_nav, '<', 'href', 'javascript:DateTimeShortcuts.drawPrevMonth('+num+');');
     173        cal_nav_prev_month.className = 'calendarnav-previous-month';
     174        var cal_nav_next_month = quickElement('a', cal_nav, '>', 'href', 'javascript:DateTimeShortcuts.drawNextMonth('+num+');');
     175        cal_nav_next_month.className = 'calendarnav-next-month';
     176        var cal_nav_next_year = quickElement('a', cal_nav, '>>', 'href', 'javascript:DateTimeShortcuts.drawNextYear('+num+');');
     177        cal_nav_next_year.className = 'calendarnav-next-year';
    174178        cal_box.appendChild(cal_nav);
    175179
    176180        // main box
     
    217221    dismissCalendar: function(num) {
    218222        document.getElementById(DateTimeShortcuts.calendarDivName1+num).style.display = 'none';
    219223    },
    220     drawPrev: function(num) {
     224    drawPrevMonth: function(num) {
    221225        DateTimeShortcuts.calendars[num].drawPreviousMonth();
    222226    },
    223     drawNext: function(num) {
     227    drawNextMonth: function(num) {
    224228        DateTimeShortcuts.calendars[num].drawNextMonth();
    225229    },
     230    drawPrevYear: function(num) {
     231        DateTimeShortcuts.calendars[num].drawPreviousYear();
     232    },
     233    drawNextYear: function(num) {
     234        DateTimeShortcuts.calendars[num].drawNextYear();
     235    },
    226236    handleCalendarCallback: function(num) {
    227237        return "function(y, m, d) { DateTimeShortcuts.calendarInputs["+num+"].value = y+'-'+m+'-'+d; document.getElementById(DateTimeShortcuts.calendarDivName1+"+num+").style.display='none';}";
    228238    },
Back to Top