# Copyright (C) 2004 Scott W. Dunlop <swdunlop at users.sourceforge.net>
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
@export mt-diffs
@import load-node
.page_title = node_title + ' Changes'
.user_flag = wiki.shouldMentionUsers()
@import html-head
@import node-cmds
@import content-head
.changes = list( node.getChanges() )
.if changes:
    .list_open = False
    .last_time = None
    .last_user = None

    .for time, idx, op, line, user in changes:
        .time = int( time )

        .if( last_time != time )or( last_user != user ):
            .if list_open:
                </ul><ul class="changes">
            .else:
                <ul class="changes">
                .list_open = True

            <li class="top">
            .if user_flag:
                .user = htmlquote( user )
                <a href="<< base_url >>/<< user >>"><< user >></a>,
            
            << ago( time ) >>
            </li>
            
            .last_time = time
            .last_user = user

        .if op == "+":
            <li class="add">
        .else:
            <li class="del">
        
        << htmlquote( line ) >></li>

    </ul>
.else:
    <i>There have been no changes in the past three days.</i>
@import content-tail
@import html-tail

