### 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/>
###

{ owner, id, source } = @project
unless @static
    coffeescript ->
        do require './blobs'

link rel: 'stylesheet', href: "/.static/css/highlight/zenburn.css"
section class: 'blob', ->
    div class: 'small-headline', ->
        span ->
            if @static
                '&nbsp;'
            else
                partial 'inc/loadingbar'
        span ->
            a href: "/#{owner.id}/#{id}/blob/#{source.branch}/#{@blob.path}", ->
                text @blob.path
    pre -> code ->
        div class:'text-blob', ->
            div class:'numbers', ->
                text @lift 'blob-index', compile ->
                    a class:'number', id:"I#{@index}", href:"#L#{@index}",@index
            div class:'content', ->
                text @lift 'blob-content', compile ->
                    div class:'line', id:"L#{@index}", (@line or "\n")


#         if @blob.lines.length > 0+(@blob.path.indexOf('README') isnt -1)
#             pre -> code -> @blob.lines.join '\n'
#         else
#             div class: "image info corners", id:"writeme", ->  "&nbsp;"
#             text "this project has no readme"

