### codetube
    Copyright (C) 2011 payload payload@lavabit.com
    Copyright (C) 2011 dodo dodo.the.last@gmail.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>
###

unless @static
    coffeescript ->
        do require './commits'

table class: 'commits', ->
    tr class: 'headline', ->
        th ->
            if @static
                '&nbsp;'
            else
                partial 'inc/loadingbar'
        th '&nbsp;'
        th '&nbsp;'
        th '&nbsp;'
        th class: 'commits', ->
            span class: 'counter', ->
                if @commits? then ''+@commits.length else '?'
            text @_("commits")
    tr class: 'spaceline'
    text @lift 'commit', compile ->
        tr class: 'commit', ->
            td class: 'avatar' , -> "&#8203;"
            td class: 'name'   , ->
                if @author.id
                    a href: @author.uri, -> h @author.id
                else
                    h @author.name
            td class: 'time format-date ago', strftime:"%d.%m.%Y", strftitle:"%d.%m.%Y %a %H:%M:%S", -> @author.date
            td class: 'message' , -> h @short_message
            td class: 'sha last', ->
                if @uri then a href: @uri, (-> @short_sha) else @short_sha
    tr class: 'tail more-commits', ->
        td '&nbsp;'
        td '&nbsp;'
        td '&nbsp;'
        td ->
            a href:"#", -> @_("more")
            partial 'inc/loadingspin'
        td '&nbsp;'
