Pārlūkot izejas kodu

[Print Format] Align labels to right (#4068)

version-14
Faris Ansari pirms 7 gadiem
committed by Nabin Hait
vecāks
revīzija
3df0659c87
3 mainītis faili ar 7 papildinājumiem un 5 dzēšanām
  1. +3
    -3
      frappe/printing/doctype/print_format/print_format.json
  2. +3
    -1
      frappe/templates/print_formats/standard_macros.html
  3. +1
    -1
      frappe/www/printview.py

+ 3
- 3
frappe/printing/doctype/print_format/print_format.json Parādīt failu

@@ -327,7 +327,7 @@
"collapsible": 0,
"columns": 0,
"default": "0",
"fieldname": "align_labels_left",
"fieldname": "align_labels_right",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -336,7 +336,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Align Labels to the Left",
"label": "Align Labels to the Right",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -698,7 +698,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-05-03 05:58:47.408164",
"modified": "2017-09-05 14:01:05.658719",
"modified_by": "Administrator",
"module": "Printing",
"name": "Print Format",


+ 3
- 1
frappe/templates/print_formats/standard_macros.html Parādīt failu

@@ -61,7 +61,9 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"

{%- macro render_field_with_label(df, doc) -%}
<div class="row {% if df.bold %}important{% endif %} data-field" {{ fieldmeta(df) }}>
<div class="col-xs-{{ "9" if df.fieldtype=="Check" else "5" }}">
<div class="col-xs-{{ "9" if df.fieldtype=="Check" else "5" }}
{%- if doc._align_labels_right %} text-right{%- endif -%}">

{% if df.fieldtype not in ("Image","HTML","Check") and
doc.get(df.fieldname) != None %}
<label>{{ _(df.label) }}</label>


+ 1
- 1
frappe/www/printview.py Parādīt failu

@@ -98,7 +98,7 @@ def get_html(doc, name=None, print_format=None, meta=None,
if print_format:
doc._show_section_headings = print_format.show_section_headings
doc._line_breaks = print_format.line_breaks
doc._align_labels_left = print_format.align_labels_left
doc._align_labels_right = print_format.align_labels_right

def get_template_from_string():
return jenv.from_string(get_print_format(doc.doctype,


Notiek ielāde…
Atcelt
Saglabāt