Skip to content

Commit

Permalink
Change footer=noby => footer=minimal
Browse files Browse the repository at this point in the history
  • Loading branch information
robertkrimen committed Dec 19, 2011
1 parent 7fea034 commit a81b0f3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app.py
Expand Up @@ -55,8 +55,8 @@ def get( self ):
''
# Without footer
'footer=0',
# Footer without "by" mention
'footer=noby',
# Footer without "brought to you by" mention
'footer=minimal',
# Partial file
'slice=3:10',
# First line of file
Expand Down
2 changes: 1 addition & 1 deletion gist_it/__init__.py
Expand Up @@ -19,7 +19,7 @@ def parse_footer( footer_option ):
return '1'
elif footer_option == '0' or footer_option == 'false' or footer_option == 'none' or footer_option == 'no':
return '0'
elif footer_option == 'noby':
elif footer_option == 'minimal':
return footer_option
else:
return '1'
Expand Down
2 changes: 1 addition & 1 deletion jinja2-assets/gist.jinja.html
Expand Up @@ -5,7 +5,7 @@
</div>
{% if footer != '0' %}
<div class="gist-meta">
{% if footer != 'noby' %}
{% if footer != 'minimal' %}
<span><a href="{{ gist.blob_url }}">This Gist</a> brought to you by <a href="{{ base }}">gist-it</a>.</span>
{% endif %}
<span style="float: right; color: #369;"><a href="{{ gist.raw_url }}">view raw</a></span>
Expand Down
4 changes: 2 additions & 2 deletions jinja2-assets/index.jinja.html
Expand Up @@ -74,8 +74,8 @@ <h3>Usage</h3>
<td>Hide the footer</td>
</tr>
<tr>
<td class="code">footer=noby</td>
<td>Show the footer without "<code>This Gist by gist-it</code>"</td>
<td class="code">footer=minimal</td>
<td>Show the footer without "<code>This Gist brought to you by gist-it.</code>"</td>
</tr>
</table>
</blockquote>
Expand Down
2 changes: 1 addition & 1 deletion t/01-basic.t
Expand Up @@ -40,7 +40,7 @@ $test->body_like( qr{\Q<div class="gist-file">\E} );
$test->body_like( qr{\Q<div class="gist-data">\E} );
$test->body_like( qr!\Q<pre class="prettyprint">function Xyzzy() {\n return "Nothing happens";\n}\n</pre>\E! );
$test->body_like( qr{\Q<div class="gist-meta">\E} );
$test->body_like( qr{\Q<span><a href="https://github.com/robertkrimen/gist-it-example/blob/master/example.js">This Gist</a> by <a href="$base">gist-it</a></span>\E} );
$test->body_like( qr{\Q<span><a href="https://github.com/robertkrimen/gist-it-example/blob/master/example.js">This Gist</a> brought to you by <a href="$base">gist-it</a>.</span>\E} );
$test->body_like( qr{\Q<span style="float: right; color: #369;"><a href="https://github.com/robertkrimen/gist-it-example/raw/master/example.js">view raw</a></span>\E} );
$test->body_like( qr{\Q<span style="float: right; margin-right: 8px;">\E\s*\\n\s*\Q<a style="color: rgb(102, 102, 102);" href="https://github.com/robertkrimen/gist-it-example/blob/master/example.js">example.js</a></span\E} );

Expand Down
2 changes: 1 addition & 1 deletion test/test_footer.py
Expand Up @@ -19,7 +19,7 @@ def runTest( self ):
self.assertEqual( gist_it.parse_footer( 'yes ' ), '1' )
self.assertEqual( gist_it.parse_footer( ' no' ), '0' )
self.assertEqual( gist_it.parse_footer( 'none ' ), '0' )
self.assertEqual( gist_it.parse_footer( ' noby ' ), 'noby' )
self.assertEqual( gist_it.parse_footer( ' minimal ' ), 'minimal' )

if __name__ == '__main__':
unittest2.main()

0 comments on commit a81b0f3

Please sign in to comment.