Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

Commit

Permalink
Particularly applied Twitter Bootstrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Sep 6, 2011
1 parent 0ff5598 commit 244b199
Show file tree
Hide file tree
Showing 19 changed files with 2,317 additions and 190 deletions.
1 change: 1 addition & 0 deletions langdev/web/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def app(app):
app.after_request_funcs.setdefault(None, []).extend(after_request_funcs)
app.error_handlers.update(error_handlers)
app.jinja_env.globals['method_for'] = method_for
app.jinja_env.globals['require'] = werkzeug.utils.import_string
app.jinja_env.filters.update(template_filters)
app.mail = flaskext.mail.Mail(app)
middlewares = list(wsgi_middlewares)
Expand Down
13 changes: 8 additions & 5 deletions langdev/web/forum.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_post(post_id):
def posts():
"""Show a list of posts.
:query view: one of ``summary`` or ``board``. default is ``summary``.
:query view: one of ``summary`` or ``table``. default is ``table``
:query next: id of the next post what you want to fetch.
It can be useful for calling API, or infinite scroll.
:query offset: offset from a latest post.
Expand All @@ -42,7 +42,7 @@ def posts():
posts = g.session.query(Post) \
.order_by(Post.sticky.desc(), Post.created_at.desc())
cnt = posts.count()
view = request.args.get('view', 'summary')
view = request.args.get('view', 'table')
next_id = request.args.get('next')
offset = int(request.args.get('offset', 0))
limit = min(int(request.args.get('limit', 20)), 100)
Expand Down Expand Up @@ -73,9 +73,12 @@ def atom():

class PostForm(Form):

title = TextField('Title', validators=[Required()])
body = TextAreaField('Body', validators=[Required()])
sticky = BooleanField('Sticky')
title = TextField('Title', validators=[Required()],
description='This will be shown on the list.')
body = TextAreaField('Body', validators=[Required()],
description='Markdown format enabled.')
sticky = BooleanField('Sticky',
description='Show this post always on top.')
submit = SubmitField('Submit')


Expand Down
57 changes: 57 additions & 0 deletions langdev/web/static/bootstrap/adaptive.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* Responsive.less
* Adjusted grid styles to handle some common screen sizes
* ------------------------------------------------------- */


// MOBILE PORTRAIT & LANDSCAPE
// ---------------------------
// For devices narrower than 480px
@media only screen and (max-width: 480px) {

// Remove fixed width of containers
.container {
width: auto;
padding: 0 10px;
}

// Undo the floating of columns
.row {
margin-left: 0;
}
.row [class^="span"] {
float: none;
width: 100%;
display: block;
margin-left: 0;
}

// Stack form elements instead of floating them
fieldset legend {
margin-left: 0;
}
label {
float: none;
width: auto;
text-align: left;
}
div.input {
margin-left: 0;
width: 100%;
}
.input-xxlarge,
input.xxlarge,
textarea.xxlarge,
select.xxlarge {
width: 80%;
}

// Adjust modal
.modal-backdrop {
padding: 10px;
}
.modal {
width: 100%;
margin: 0;
left: auto;
}
}
23 changes: 23 additions & 0 deletions langdev/web/static/bootstrap/bootstrap.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*!
* Bootstrap v1.2.0
*
* Copyright 2011 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Date: @DATE
*/

// CSS Reset
@import "reset.less";

// Core
@import "preboot.less";
@import "scaffolding.less";

// Styled patterns and elements
@import "type.less";
@import "forms.less";
@import "tables.less";
@import "patterns.less";
Loading

0 comments on commit 244b199

Please sign in to comment.