Ok, still a little confused. You have 3 {{pass}} statements in the file
but only 2 conditional (for) statements. Is the other {{pass}} ending a
for or if started in the main template, layout.html?
Also, I'm seeing things confusing me further. For example, you have these
2 statements:
<div id="letterhead">
{{for head in head:}}
then, you have
</div><!--id letterhead-->
before you have a {{pass}} which (in my way of thinking) should be before
the /div for letterhead. Seems a bit disorganized to me.
While this may not be the issue, it is hard for me to follow what you're
trying to accomplish with the template file.
-Jim
On Tue, Oct 24, 2017 at 1:39 PM, mostwanted <[email protected]> wrote:
>
>
> *THATS MY VIEW*{{extend 'layout.html'}}
> <style>
> .classes
> {
> float: left;
> padding-left: 15px;
> font-weight: bold;
> }
>
> #container
> {
> display:block;
> overflow:auto;
> margin: 0 auto;
> width: 1200px;
> border: solid 1px #3399FF;
> border-radius: 5px;
> #height: 280px;
> padding: 10px;
> #padding-left: 10px;
> margin-top: 3%;
> box-shadow: 10px 10px 5px #888888;
> background-color: #3399FF;
> color: white;
> }
> #container textarea
> {
> color: black;
> }
>
> .details
> {
> float:left;
> }
>
> #letterhead
> {
> border: solid 1px #3399FF;
> border-radius: 5px;
> height: 220px;
> padding: 10px;
> #box-shadow: 10px 10px 5px #888888;
> background-color: #3399FF;
> color: white;
> }
> #container a
> {
> color:white;
> font-size: small;
> }
> #container a:hover
> {
> background: white;
> color: #3399FF;
> border: solid 1px white;
> border-radius: 5px;
> text-decoration: none;
> }
>
> #container .name
> {
> text-transform: uppercase;
> }
>
> td, th {
> border: 1px solid #dddddd;
> text-align: left;
> padding: 8px;
> }
> th
> {
> font-size: 18px;
> }
> .particulars
> {
> float: left;
> }
> #particulars
> {
> margin-left: 170px;
> }
> </style>
> <script type="text/javascript">
> function getPerc(num1, num2)
> {
> return(num1/num2)*100;
> }
> </script>
>
> <div class="glyphicon glyphicon-print" style="font-weight: bold; float:
> left;"><a href="#">PRINT-REPORT</a></div>
> <div class="glyphicon glyphicon-step-backward" style="float: right;" ><a
> href="javascript:history.back()" style="font-weight: bold;"
> id="back">BACK</a>
> </div>
> <div id="container">
> <div id="letterhead">
> {{for head in head:}}
>
> <div class="details">
> <img width="200px" src="{{=URL('download', args=head.school_logo)}}"
> /><br />
> </div>
> <div class="details" style="padding-left: 10px;">
> <h1>
> {{=head.school_name}}
> </h1><br />
> {{=head.Telephone}}<br />
> {{=head.Fax}}<br/>
> {{=head.Email}}<br />
> <h4>
> COMPILED BY STUDENTS RESULTS MANAGEMENT SYSTEM (SRMS v1)
> </h4>
> </div>
> </div><!--id letterhead-->
>
> <hr />
>
> <div id="report">
>
> <div id="particulars">
> <center><div class="particulars" style="font-size:30px"> ACADEMIC REPORT
> FOR STUDENT:<br /><span style="font-size: 60px;">{{=classes1.surname}} {{=
> classes1.name}}</span></div> <div class="particulars" style="border:solid
> 2px white; border-radius: 5px; height: 120px; margin-left: 20px; padding:
> 5px;"><img width="160px" src="{{=URL('download',
> args=classes1.photo)}}"/><br /></div>
> </center>
> </div>
> </div>
> <div id="reportDetails" style="margin-top:13%;">
> <hr />
> </h1><br />
> <table>
> <tr>
> <th>Term</th>
> <th>Subject</th>
> <th>Mark Acquired</th>
> <th>Total Mark</th>
> <th>(%) Acquired</th>
> <th>Grade</th>
> <th>Teacher's Comment</th>
> </tr>
>
>
> {{for report in form:
> perc=(float(report.marks)/float(report.total))*float(100)
> }}
>
>
> <tr>
> <td>{{=report.term.term}}</td>
> <td>{{=report.subject.subject_name}}</td>
> <td>{{=report.marks}}</td>
> <td>{{=report.total}}</td>
> <td>
> {{=perc}}(%)
> </td>
> <td>
>
> </td>
> <td>{{=report.comments}}</td>
> </tr>
> {{pass}}
> {{pass}}
> </table>
> <br />
> <hr />
> <textarea id = "myTextArea" rows = "10" cols = "90" placeholder="Teacher's
> Overall Comments" style="border: solid 1px white; border-radius:
> 5px;"></textarea><br /><br />
> Teacher: {{=classes1.class_name.teacher.name}}
> {{=classes1.class_name.teacher.surname}}<br
> />
> <br />
> <br />
> Signature:--------------------------------
> {{pass}}
> <br />
> <br />
> </div>
> </div>
> </div>
> </div>
> <br />
>
>
>
> On Tuesday, October 24, 2017 at 8:11:51 PM UTC+2, Jim S wrote:
>>
>> Just the view, the .html file.
>>
>> -Jim
>>
>> On Tuesday, October 24, 2017 at 11:58:33 AM UTC-5, mostwanted wrote:
>>>
>>> By entire file you mean including the models and controllers?
>>>
>>> I am not getting any Traceback error, the results are just not
>>> displaying!
>>>
>>> On Tuesday, October 24, 2017 at 6:40:53 PM UTC+2, Jim S wrote:
>>>>
>>>> Do all of your conditional statements have the appropriate
>>>> corresponding {{pass}} statements?
>>>>
>>>> In the snippet you included I see 3 {{pass}} statements but only 2
>>>> conditional statements. Can you include the entire file? Also, are you
>>>> getting a traceback error?
>>>>
>>>> -Jim
>>>>
>>>> On Tuesday, October 24, 2017 at 11:01:22 AM UTC-5, mostwanted wrote:
>>>>>
>>>>>
>>>>> *Hi guys, I'm faced with a little problem, I'm developing a results
>>>>> management system for a school, in the report preparation page i want
>>>>> there
>>>>> to be displayed the student's percentage pass for a subject as well as
>>>>> their grade for that subject, now the problem is nothing gets when i write
>>>>> down the conditional statement to determine the grade, i don't know what
>>>>> I'm doing wrong, this is part of my code below: PLEASE HELP ME!!!!*
>>>>> {{extend 'layout.html'}}
>>>>> ...........................
>>>>> ..............................
>>>>> ...........................
>>>>> {{for report in form:
>>>>> perc=(float(report.marks)/float(report.total))*float(100)
>>>>>
>>>>> *#WITHOUT THE CONDITIONAL PART BELOW WHICH DETERMINES THE GRADE,
>>>>> EVERYTHING WORKS WELL, THE PERCENTAGE PASS & ALL OTHER RESULTS ARE
>>>>> DISPLAYED BUT WHEN I PUT IT IN NOTHING GETS DISPLAYED!!!*
>>>>> if perc>=80:
>>>>> grade='A'
>>>>> }}
>>>>>
>>>>>
>>>>> <tr>
>>>>> <td>{{=report.term.term}}</td>
>>>>> <td>{{=report.subject.subject_name}}</td>
>>>>> <td>{{=report.marks}}</td>
>>>>> <td>{{=report.total}}</td>
>>>>> <td>
>>>>> {{=perc}}(%)
>>>>> </td>
>>>>> <td>
>>>>> {{=grade}}
>>>>> </td>
>>>>> <td>{{=report.comments}}</td>
>>>>> </tr>
>>>>> {{pass}}
>>>>> {{pass}}
>>>>> </table>
>>>>> <br />
>>>>> <hr />
>>>>> <textarea id = "myTextArea" rows = "10" cols = "90"
>>>>> placeholder="Teacher's Overall Comments" style="border: solid 1px white;
>>>>> border-radius: 5px;"></textarea><br /><br />
>>>>> Teacher: {{=classes1.class_name.teacher.name}}
>>>>> {{=classes1.class_name.teacher.surname}}<br />
>>>>> <br />
>>>>> <br />
>>>>> Signature:--------------------------------
>>>>> {{pass}}
>>>>> <br />
>>>>> <br />
>>>>> </div>
>>>>> </div>
>>>>> </div>
>>>>> </div>
>>>>> <br />
>>>>>
>>>>> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/1YFGgSMTFQM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.