Giter Site home page Giter Site logo

kotti / deform_bootstrap Goto Github PK

View Code? Open in Web Editor NEW
34.0 7.0 30.0 684 KB

Bootstrap compatible templates for the deform form library. (Merged into deform 2.)

Home Page: http://pypi.python.org/pypi/deform_bootstrap

Python 16.13% CSS 41.69% JavaScript 42.18%

deform_bootstrap's Issues

images are missing from deform's copy of bootstrap

bootstrap iconglyphs are not included in the deforms version of bootstrap

Also, because bootstrap.css and .js is not in their respective .js and .css folders dropping the folder in does not help.

deform_bootstrap.css:1782:  background-image: url("../img/glyphicons-halflings.png");
deform_bootstrap.css:1793:  background-image: url("../img/glyphicons-halflings-white.png");

Solution 1:
Adjust image paths in deform_bootstrap.css

Solution 2:
Possible solution included moving bootstrap css/js into proper subfolders, and using symlinks to keep backward compatability

Update to bootstrap 3

As bootstrap3 was released long back, i think it will be good if this project is updated to bs3.

Placeholder Support

Hi would be nice if we can configure a placeholder for the widgets

        widget=TypeaheadInputWidget(
            size=60,
            min_length=3,
            placeholder="Agent",
            values='/agents/list.json'),
        description='Provide the AgentID or Agent Name')

fix resource registry, again

It looks like set_*_resources expects each resource as a new positional argument. To fix, change all the .resources.default_resources to sequences and use * as below.

http://deform.readthedocs.org/en/latest/api.html#deform.widget.ResourceRegistry.set_css_resources

deform_bootstrap.init:

def add_resources_to_registry():
"""
Register deform_bootstrap widget specific requirements to deform's
default resource registry
"""
registry = Form.default_resource_registry
for rqrt, versions in default_resources.items():
for version, resources in versions.items():
registry.set_js_resources(rqrt, version, *resources.get('js'))
registry.set_css_resources(rqrt, version, *resources.get('css'))

404 Not Found !! The resource could not be found. /img/glyphicons-halflings.png

hi guys,

great afford for such beautiful app. Recently i have come across to this error

404 Not Found !! The resource could not be found. /img/glyphicons-halflings.png

What i found is that there no resource included in deform_boostrap package so i resolved my including these img files manually by placing this glyphicons-halflings.png & glyphicons-halflings-white.png files into static dir of deform_boostap and changed the path in deform_bootstrap.css.

So it will be great if you guys fix this so that everyone will not face the same problem.
screenshot from 2013-08-01 15 00 12

form.pt error

The following error happens when running a form in production environement which includes deform_bootstrap. This login form and all other forms work fine on my development machine with deform_bootstrap.
I tried using development form.pt from development partition and tried commenting out things in form.pt I do not understand enough to figure out. Thanks for any help,
Clemens Herschel

[cherschel@web39 phr]$ more pyramid.log
Starting server in PID 28077.
serving on http://0.0.0.0:42467
2014-02-25 21:50:20,863 ERROR [waitress][Dummy-1] Exception when serving /login
Traceback (most recent call last):
File "/home/cherschel/webapps/phr/lib/python2.7/waitress/channel.py", line 329
, in service
task.service()
File "/home/cherschel/webapps/phr/lib/python2.7/waitress/task.py", line 173, i
n service
self.execute()
File "/home/cherschel/webapps/phr/lib/python2.7/waitress/task.py", line 380, i
n execute
app_iter = self.channel.server.application(env, start_response)
File "/home/cherschel/webapps/phr/lib/python2.7/pyramid/router.py", line 187,
in call
response = self.handle_request(request)
File "/home/cherschel/webapps/phr/lib/python2.7/pyramid/tweens.py", line 20, i
n excview_tween
response = handler(request)
File "/home/cherschel/webapps/phr/lib/python2.7/site-packages/pyramid_tm-0.4-p
y2.7.egg/pyramid_tm/init.py", line 95, in tm_tween
response = handler(request)
File "/home/cherschel/webapps/phr/lib/python2.7/pyramid/router.py", line 164,
in handle_request
response = view_callable(context, request)
File "/home/cherschel/webapps/phr/lib/python2.7/pyramid/config/views.py", line
333, in rendered_view
result = view(context, request)
File "/home/cherschel/webapps/phr/lib/python2.7/pyramid/config/views.py", line
471, in _requestonly_view
response = view(request)
File "/home/cherschel/webapps/phr/Phr-0.0/phr/views/login.py", line 97, in log
in_view
return {'form':login_form.render(),"heading": 'Login'}
File "/home/cherschel/lib/python2.7/deform/field.py", line 433, in render
return self.serialize(cstruct, readonly=readonly)
File "/home/cherschel/lib/python2.7/deform/field.py", line 408, in serialize
return self.widget.serialize(self, cstruct=cstruct, readonly=readonly)
File "/home/cherschel/lib/python2.7/deform/widget.py", line 982, in serialize
null=null)
File "/home/cherschel/lib/python2.7/deform/template.py", line 117, in call
return self.load(template_name)(**kw)
File "/home/cherschel/lib/python2.7/chameleon/template.py", line 125, in cal
l

return self.render(**kwargs)
File "/home/cherschel/lib/python2.7/chameleon/zpt/template.py", line 257, in r
ender
return super(PageTemplate, self).render(*vars)
File "/home/cherschel/lib/python2.7/chameleon/template.py", line 169, in rende
r
self.cook_check()
File "/home/cherschel/lib/python2.7/chameleon/template.py", line 293, in cook

check
self.cook(body)
File "/home/cherschel/lib/python2.7/chameleon/template.py", line 147, in cook
program = self._cook(body, digest, names)
File "/home/cherschel/lib/python2.7/chameleon/template.py", line 218, in _cook
source = self.make(body, builtins)
File "/home/cherschel/lib/python2.7/chameleon/template.py", line 249, in make
program = self.parse(body)
File "/home/cherschel/lib/python2.7/chameleon/zpt/template.py", line 202, in p
arse
trim_attribute_space=self.trim_attribute_space,
File "/home/cherschel/lib/python2.7/chameleon/zpt/program.py", line 145, in __
init

super(MacroProgram, self).init(_args, **kwargs)
File "/home/cherschel/lib/python2.7/chameleon/program.py", line 31, in _init
_
for kind, args in parser:
File "/home/cherschel/lib/python2.7/chameleon/parser.py", line 182, in _iter
_
item = self.parse(token)
File "/home/cherschel/lib/python2.7/chameleon/parser.py", line 190, in parse
return visitor(kind, token)
File "/home/cherschel/lib/python2.7/chameleon/parser.py", line 231, in visit_e
nd_tag
raise ParseError("Unexpected end tag.", token)
ParseError: Unexpected end tag.

  • String: ""
  • Filename: /home/cherschel/lib/python2.7/deform_bootstrap-0.2.9-py2.7.egg/de
    form_bootstrap/templates/form.pt
    .7.egg/deform_bootstrap/templates/form.pt

vmware partition-development
Ubuntu
python 2.7
pyramid 1.4
deform_bootstrap .2.1
deform .9.5
Mako .5

webfaction production
centos
python 2.75
pyramid 1.3
Mako .7
deform_bootstrap .2.1

readonly elements

There could be some bootstrap modifications made to the readonly templates. For example the readonly textinput could look like this:

<span id="${field.oid}" class="uneditable-input">${cstruct}</span>

Are you open to a pull request related to this? What are other people's thoughts on doing this?

Missing clausing div in template

In the mapping.pt template :

<div tal:condition="field.description">
    ${field.description}

is missing the clausing div.
Example of consequence :
If I introduce the mappingSchema in a sequenceSchema, the appendsequence button is not working.

DateParts not working well with row-fluid

When some parent (or ancestor) has "row-fluid" class, the Date Parts widget gets its width messed up.
Changing from row to row-fluid in dateparts.pt worked, but only partially.

widget requirements causes errors in form rendering since they are not registered

The following

https://github.com/Kotti/deform_bootstrap/commit/45de9ca8738aabb7314cbfe8ef7f53668edeb0ff

introduced requirements on deform_bootstrap widgets causing the following error

  File "/.../lib/python2.7/site-packages/deform-0.9.5-py2.7.egg/deform/widget.py", line 1549, in __call__
    'Cannot resolve widget requirement %r' % requirement)
ValueError: Cannot resolve widget requirement 'chosen'

The requirements should be registered in the default_resource_registry.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.