Hello Web2py , I'm new to web2py can you please help me in this problem
1. I want to use angularJS +Bootstrap+ Web2py
2. I want to separate the web2py from the view ie. angularJS and Bootstrap
3. All Views Should be handle by angularJS + Bootstrap kind of RESTFUL 
SERVICES
4. This is the first problem I encounter

I want to display custom error messages when user is fail to login 
here is my view

{{extend 'custom-layout.html'}}
{{block angular-script}}
    <script src="{{=URL('static/angular-app','default/app.js')}}"></script>
{{end}}
<div class="panel panel-default" style="width:75%">
    <div class="panel-heading">
      <h4 class="panel-title">
      Login
      </h4>
      </div>

      <form role="form" style="padding:10px" enctype="multipart/form-data" 
action="#" method="post">
     
  <div class="form-group" >
  {{if form.errors:}}
  <div class="alert alert-warning fade in" role="alert">
      <button type="button" class="close" data-dismiss="alert"><span 
aria-hidden="true">×</span><span class="sr-only">Close</span></button>
      <strong>{{=form.errors}}</strong> 
    </div>

    {{pass}}
    <label for="exampleInputEmail1">Email address</label>
    <input type="email" name="email" class="form-control"/>
    
  </div>
  <div class="form-group">
    <label for="exampleInputPassword1">Password</label>
    <input type="password" name="password" class="form-control"/>
  </div>
<div style="display:none;">
<input name="_next" type="hidden" value="/SMS/user/index" />
<input name="_formkey" type="hidden" value="{{=form.formkey}}" />
<input name="_formname" type="hidden" value="{{=form.formname}}" />
</div>

   <input name="_next" type="hidden" value="/SMS/department/index" />
  <input type="submit" class="btn btn-success" value="&#xf011; Login">
  <a  href="{{=URL('default','register')}}" class="btn btn-success"><span 
class="glyphicon glyphicon-user"></span><span 
style="padding:2px">Register</span></a>

</form>


      </div>
        

Controllers 
def index():
    if auth.is_logged_in():
        redirect(URL('user','index'))
    form = auth.login()
      
    return dict(form=form)
Enter code here...





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to