Skip to content
Myr

Templates using haml.js instead of haml-js

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 4f532f8 · Browse files · 16 files+27 added−124 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

16 files+27 added−124 removed

  • tests:+15 added−14 removed
  • other:+12 added−110 removed

16 files+27 added−124 removed

modified:examples/chat/views/chat.html.haml+1 added-1 removed
1%h1 Chat2%img.bubble{ src: '/public/images/bubble.png' }3%ul#messages4 = this.partial('message.haml.html', { collection: messages })4 != this.partial('message.haml.html', { collection: messages })5%form{ method: 'post' }6 %input{ type: 'hidden', name: '_method', value: 'put' }7 %input{ type: 'text', name: 'name', value: name || 'guest' }8 %input{ type: 'text', name: 'message' }
1 unmodified line
modified:examples/chat/views/layout.html.haml+3 added-2 removed
3 unmodified lines
4 %script{ src: '/public/javascripts/jquery.js' }5 %script{ src: '/public/javascripts/app.js' }6 %link{ rel: 'stylesheet', href: '/style.css' }7 %body8 #wrapper= body9 #online 8 #wrapper9 != body10 #online11 Online:12 %strong= usersOnline
deleted:examples/coffee-upload/views/layout.html.haml-14 removed
1%html2 %head3 %title Upload4 %script{ src: '/public/javascripts/jquery.js' }5 %script{ src: '/public/javascripts/app.js' }6 %link{ rel: 'stylesheet', href: '/style.css' }7 %body8 #wrapper9 %h1 Upload10 :if flashes11 %ul.messages.info12 :each msg in flashes13 %li= msg14 .body= body
deleted:examples/coffee-upload/views/style.css.sass-68 removed
1body2 :font-family "Helvetica Neue", "Lucida Grande", "Arial"3 :font-size 13px4 :text-align center5 :-webkit-text-stroke 1px rgba(255, 255, 255, 0.1)6 :color #5557 8h1, h29 :margin 0 0 15px 010 :font-size 22px11 :color #34343412h113 :text-shadow 1px 2px 2px #ddd14 :font-size 60px15h216 :margin-top 15px17 18#wrapper19 :position relative20 :margin 100px auto21 :width 500px22 :text-align left2324input[type=file]25 :padding 5px26 :border 1px solid #ddd27 :outline none28 :-webkit-border-radius 2px29 :-moz-border-radius 2px30input[type=file]:focus31 :border-color #00C3FF3233input[type=submit]34 :-webkit-border-radius 2px35 :-moz-border-radius 2px36 :-webkit-box-shadow 0 1px 2px #ddd37 :-moz-box-shadow 0 1px 2px #ddd38 :padding 6px 10px39 :border solid 1px #99940 :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#ddd))41 :color #33342 :text-decoration none43 :cursor pointer44 :display inline-block45 :text-align center46 :text-shadow 0px 1px 1px #fff47 :line-height 148input[type=submit]:hover49 :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#E6E4E4))50input[type=submit]:active51 :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#c7c7c7))52input[name=name]53 :width 80px54 55form56 .panel57 :float left58 :width 100%59 :margin-bottom 15px60 61.messages62 :margin 063 :padding 064 :border 1px solid #eee65 =box-shadow 2px 2px 5px #eee66 li67 :padding 5px 10px68 :list-style none
deleted:examples/coffee-upload/views/upload.html.haml-18 removed
1:if typeof images !== 'undefined'2 .images3 :each img in images4 %img{ src: img }56%h2 Singles7%form{ method: 'post', enctype: 'multipart/form-data' }8 %input{ type: 'file', name: 'images[0]' }9 %input{ type: 'file', name: 'images[1]' }10 %input{ type: 'file', name: 'images[2]' }11 .panel12 %input{ type: 'submit', value: 'Upload' }13 14%h2 Multiple15%form{ method: 'post', enctype: 'multipart/form-data' }16 %input{ type: 'file', name: 'images[]', multiple: 'multiple' }17 .panel18 %input{ type: 'submit', value: 'Upload' }
modified:examples/coffee-upload/app.coffee+1 added
10 unmodified lines
11 use Flash12 use Logger13 use Static14 set 'root', __dirname15 set 'views', __dirname + '/../upload/views'1617get '/', ->18 @redirect('/upload')19
17 unmodified lines
modified:examples/upload/views/layout.html.haml+3 added-3 removed
5 unmodified lines
6 %link{ rel: 'stylesheet', href: '/style.css' }7 %body8 #wrapper9 %h1 Upload10 :if flashes10 - if (flashes)11 %ul.messages.info12 :each msg in flashes12 - each msg in flashes13 %li= msg14 .body= body14 .body!= body
modified:examples/upload/views/upload.html.haml+4 added-4 removed
1:if typeof images !== 'undefined'1- if (typeof images !== 'undefined')2 .images3 :each img in images3 - each img in images4 %img{ src: img }56%h2 Singles7%form{ method: 'post', enctype: 'multipart/form-data' }8 %input{ type: 'file', name: 'images[0]' }9 %input{ type: 'file', name: 'images[1]' }10 %input{ type: 'file', name: 'images[2]' }11 .panel11 %div.panel12 %input{ type: 'submit', value: 'Upload' }13 14%h2 Multiple15%form{ method: 'post', enctype: 'multipart/form-data' }16 %input{ type: 'file', name: 'images[]', multiple: 'multiple' }17 .panel17 %div.panel18 %input{ type: 'submit', value: 'Upload' }
modified:lib/support/hamlnot shown

Its text is not shown, modified.

modified:spec/fixtures/partials/article.html.haml+7 added-6 removed
1:if __isFirst__2 %li.first= article3:if __isLast__4 %li.last= article5:if !__isLast__ && !__isFirst__6 %li{ class: __index__ }= article1%ul2 - if (__isFirst__)3 %li.first= article4 - if (__isLast__)5 %li.last= article6 - if (!__isLast__ && !__isFirst__)7 %li{ class: __index__ }= article
modified:spec/fixtures/article.html.haml+1 added-1 removed
1%h2= this.name1%h2!= this.name
modified:spec/fixtures/layout.html.haml+1 added-1 removed
1%html2 %body= body2 %body!= body
modified:spec/fixtures/layout.user.html.haml+1 added-1 removed
1%title= "Viewing " + name2%body= body2%body!= body
modified:spec/fixtures/list.html.haml+2 added-2 removed
1%ul2 :each item in items3 = this.partial('item.html.haml', { locals: { item: item }})2 - each item in items3 != this.partial('item.html.haml', { locals: { item: item }})
modified:spec/fixtures/page.html.haml+1 added-1 removed
1%title= this.title2%body= body2%body!= body
modified:spec/spec.plugins.view.js+2 added-2 removed
82 unmodified lines
83 if (err) this.error(err)84 else this.halt(203, content)85 })86 })87 get('/').body.should.include '<html><body>'87 get('/').body.should.include '<html>\n<body>'88 get('/').status.should.eql 20389 end90 end91
2 unmodified lines
94 it 'should render the layout and view'95 get('/', function(){96 this.render('hello.html.haml')97 })98 get('/').body.should.include '<html><body>'98 get('/').body.should.include '<html>\n<body>'99 get('/').body.should.include '<h2>Hello'100 end101 102 it 'should default context to the current request'
102 unmodified lines