|
309 | 309 | <!-- All edit fields with fields with add=visible -->
|
310 | 310 | <tal:field tal:repeat="field python:view.get_fields_with_visibility('edit')">
|
311 | 311 | <tal:def define="fieldName python:field.getName();
|
312 |
| - required field/required; |
| 312 | + required python:bool(field.required); |
313 | 313 | widget python:field.widget;
|
314 | 314 | errors python:{};
|
315 |
| - mode string:edit;"> |
316 |
| - <tr tal:attributes="fieldName fieldName;"> |
| 315 | + mode python:'edit';"> |
| 316 | + <tr tal:attributes="fieldName python:fieldName;"> |
317 | 317 | <td>
|
318 | 318 | <label class="formQuestion">
|
319 | 319 | <span
|
|
358 | 358 | <tal:columns tal:repeat="arnum python:range(view.ar_count)">
|
359 | 359 | <td tal:define="newFieldName python:view.get_fieldname(field, arnum);
|
360 | 360 | val python:view.fieldvalues.get(newFieldName)"
|
361 |
| - tal:attributes="arnum arnum; fieldName newFieldName"> |
| 361 | + tal:attributes="arnum python:arnum; fieldName python:newFieldName"> |
362 | 362 |
|
363 | 363 | <input type="hidden"
|
364 | 364 | tal:attributes="value val/Title|nothing;
|
365 | 365 | name newFieldName;"/>
|
366 | 366 | <input type="hidden"
|
367 | 367 | tal:attributes="value val/UID|nothing;
|
368 |
| - name string:${newFieldName}_uid;"/> |
| 368 | + name python:'{}_uid'.format(newFieldName);"/> |
369 | 369 | </td>
|
370 | 370 | </tal:columns>
|
371 | 371 | </tr>
|
|
403 | 403 | category_title python:category.Title;">
|
404 | 404 | <tr title="Click to expand this category"
|
405 | 405 | i18n:attributes="title"
|
406 |
| - tal:attributes="data-category category_id; |
407 |
| - poc poc; |
408 |
| - category string:field; |
409 |
| - class string:${poc} category;"> |
| 406 | + tal:attributes="data-category python:category_id; |
| 407 | + poc python:poc; |
| 408 | + category python:'field'; |
| 409 | + class python:'{} category'.format(poc);"> |
410 | 410 | <td class="services-category-header">
|
411 | 411 | <span class="services-category-title"
|
412 | 412 | tal:content="category_title"
|
|
419 | 419 | class="btn btn-default btn-xs service-category-toggle">+</button>
|
420 | 420 | </td>
|
421 | 421 | <!-- span over all sample columns -->
|
422 |
| - <td tal:attributes="colspan ar_count"></td> |
| 422 | + <td tal:attributes="colspan python:ar_count"></td> |
423 | 423 | </tr>
|
424 | 424 |
|
425 | 425 | <tal:services tal:repeat="service python:services[category_title];">
|
426 |
| - <tr tal:define="service_uid service/UID; |
427 |
| - service_id service/getId; |
428 |
| - service_keyword service/getKeyword; |
429 |
| - service_title service/Title;" |
430 |
| - tal:attributes="id string:${service_id}; |
431 |
| - class string:${category_id} ${poc} service; |
432 |
| - poc poc; |
433 |
| - fieldname string:Analyses;"> |
| 426 | + <tr tal:define="service_uid python:service.UID; |
| 427 | + service_id python:service.getId; |
| 428 | + service_keyword python:service.getKeyword; |
| 429 | + service_title python:service.Title;" |
| 430 | + tal:attributes="id python:service_id; |
| 431 | + class python:'{} {} service'.format(category_id, poc); |
| 432 | + poc python:poc; |
| 433 | + fieldname python:'Analyses';"> |
434 | 434 | <td class="service-header">
|
435 | 435 | <div class="service-title small"
|
436 | 436 | i18n:translate=""
|
|
442 | 442 | <img class="copybutton btn-link"
|
443 | 443 | width="16"
|
444 | 444 | tal:condition="python:view.ar_count > 1"
|
445 |
| - tal:attributes="src senaite_theme/icon_url/copy;"/> |
| 445 | + tal:attributes="src python:senaite_theme.icon_url('copy');"/> |
446 | 446 | </td>
|
447 | 447 |
|
448 | 448 | <tal:columns tal:repeat="arnum python:range(ar_count)">
|
449 |
| - <td tal:define="fieldname string:Analyses-${arnum}; |
| 449 | + <td tal:define="fieldname python:'Analyses-{}'.format(arnum); |
450 | 450 | analyses python:view.fieldvalues.get(fieldname) or [];
|
451 | 451 | service_uids python:map(view.get_service_uid_from, analyses);
|
452 | 452 | checked python:service_uid in service_uids;"
|
453 |
| - tal:attributes="fieldname string:Analyses-${arnum}; |
454 |
| - uid service_uid; |
455 |
| - class string:${service_uid}-column service-column; |
456 |
| - arnum arnum;"> |
| 453 | + tal:attributes="fieldname python:'Analyses-{}'.format(arnum); |
| 454 | + uid python:service_uid; |
| 455 | + class python:'{}-column service-column'.format(service_uid); |
| 456 | + arnum python:arnum;"> |
457 | 457 |
|
458 | 458 | <!-- Service locked button -->
|
459 |
| - <div tal:attributes="uid service_uid; |
460 |
| - arnum arnum; |
461 |
| - id string:${service_uid}-${arnum}-lockbtn; |
462 |
| - class string:service-lockbtn ${service_uid}-lockbtn;" |
| 459 | + <div tal:attributes="uid python:service_uid; |
| 460 | + arnum python:arnum; |
| 461 | + id python:'{}-{}-lockbtn'.format(service_uid, arnum); |
| 462 | + class python:'service-lockbtn {}-lockbtn'.format(service_uid);" |
463 | 463 | title="Service cannot be deselected. Please click the info button for further details"
|
464 | 464 | i18n:attributes="title">
|
465 | 465 | 🔒
|
466 | 466 | </div>
|
467 | 467 |
|
468 | 468 | <!-- Service checkbox -->
|
469 |
| - <div tal:attributes="id string:${service_uid}-${arnum}-analysisservice; |
470 |
| - class string:analysisservice ${service_uid}-analysisservice;"> |
| 469 | + <div tal:attributes="id python:'{}-{}-analysisservice'.format(service_uid, arnum); |
| 470 | + class python:'analysisservice {}-analysisservice'.format(service_uid);"> |
471 | 471 | <input type="checkbox"
|
472 | 472 | style="height:auto;"
|
473 |
| - tal:attributes="name string:${fieldname}:list; |
474 |
| - value string:${service_uid}; |
475 |
| - class string:analysisservice-cb analysisservice-cb-${arnum}; |
476 |
| - id string:cb_${arnum}_${service_uid}; |
477 |
| - alt service_title; |
| 473 | + tal:attributes="name python:'{}:list'.format(fieldname); |
| 474 | + value python:service_uid; |
| 475 | + class python:'analysisservice-cb analysisservice-cb-{}'.format(arnum); |
| 476 | + id python:'cb_{}_{}'.format(arnum, service_uid); |
| 477 | + alt python:service_title; |
478 | 478 | checked python:checked and 'checked' or '';"/>
|
479 | 479 | </div>
|
480 | 480 |
|
481 | 481 | <!-- Service info button -->
|
482 |
| - <div tal:attributes="uid service_uid; |
483 |
| - arnum arnum; |
484 |
| - id string:${service_uid}-infobtn; |
485 |
| - class string:service-infobtn ${service_uid}-infobtn;"> |
| 482 | + <div tal:attributes="uid python:service_uid; |
| 483 | + arnum python:arnum; |
| 484 | + id python:'{}-infobtn'.format(service_uid); |
| 485 | + class python:'service-infobtn {}-infobtn'.format(service_uid);"> |
486 | 486 | ⓘ
|
487 | 487 | </div>
|
488 | 488 |
|
489 | 489 | <!-- Service Info Box -->
|
490 |
| - <div tal:attributes="id string:${service_uid}-info; |
491 |
| - class string:${service_uid}-info service-info;"> |
| 490 | + <div tal:attributes="id python:'{}-info'.format(service_uid); |
| 491 | + class python:'{}-info service-info'.format(service_uid);"> |
492 | 492 | </div>
|
493 | 493 |
|
494 | 494 | </td>
|
|
503 | 503 | <!-- /POCs -->
|
504 | 504 |
|
505 | 505 | <!-- Prices -->
|
506 |
| - <tal:prices tal:condition="view/ShowPrices"> |
507 |
| - <tr tal:condition="view/getMemberDiscountApplies"> |
| 506 | + <tal:prices tal:condition="python:view.ShowPrices"> |
| 507 | + <tr tal:condition="python:view.getMemberDiscountApplies()"> |
508 | 508 | <td>
|
509 | 509 | <span class="pricelabel discount" i18n:translate="">Discount</span>
|
510 |
| - <span class="discreet">(<tal:i content="here/bika_setup/getMemberDiscount"/>%)</span> |
| 510 | + <span class="discreet">(<tal:i content="python:context.bika_setup.getMemberDiscount()"/>%)</span> |
511 | 511 | </td>
|
512 | 512 | <td>
|
513 | 513 | <span tal:replace="currency_symbol"/>
|
514 | 514 | </td>
|
515 | 515 | <tal:columns repeat="arnum python:range(view.ar_count)">
|
516 |
| - <td tal:attributes="arnum arnum"> |
| 516 | + <td tal:attributes="arnum python:arnum"> |
517 | 517 | <span class="price discount noborder"
|
518 |
| - tal:attributes="id string:discount-${arnum}">0.00</span> |
| 518 | + tal:attributes="id python:'discount-{}'.format(arnum)">0.00</span> |
519 | 519 | </td>
|
520 | 520 | </tal:columns>
|
521 | 521 | </tr>
|
|
527 | 527 | <span tal:replace="currency_symbol"/>
|
528 | 528 | </td>
|
529 | 529 | <tal:columns repeat="arnum python:range(view.ar_count)">
|
530 |
| - <td tal:attributes="arnum arnum"> |
| 530 | + <td tal:attributes="arnum python:arnum"> |
531 | 531 | <span class="price subtotal noborder"
|
532 |
| - tal:attributes="id string:subtotal-${arnum}">0.00</span> |
| 532 | + tal:attributes="id python:'subtotal-{}'.format(arnum)">0.00</span> |
533 | 533 | </td>
|
534 | 534 | </tal:columns>
|
535 | 535 | </tr>
|
|
543 | 543 | <tal:columns repeat="arnum python:range(view.ar_count)">
|
544 | 544 | <td tal:attributes="arnum arnum">
|
545 | 545 | <span class="price vat noborder"
|
546 |
| - tal:attributes="id string:vat-${arnum}">0.00</span> |
| 546 | + tal:attributes="id python:'vat-{}'.format(arnum)">0.00</span> |
547 | 547 | </td>
|
548 | 548 | </tal:columns>
|
549 | 549 | </tr>
|
|
557 | 557 | <tal:columns repeat="arnum python:range(view.ar_count)">
|
558 | 558 | <td tal:attributes="arnum arnum">
|
559 | 559 | <span class="price total noborder"
|
560 |
| - tal:attributes="id string:total-${arnum}">0.00</span> |
| 560 | + tal:attributes="id python:'total-{}'.format(arnum)">0.00</span> |
561 | 561 | </td>
|
562 | 562 | </tal:columns>
|
563 | 563 | </tr>
|
|
0 commit comments