User Tools

Site Tools


leon:documents-manager

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
leon:documents-manager [2018/08/22 10:31]
bartek [CSS structure]
leon:documents-manager [2023/10/18 17:57]
rafal [Main page]
Line 1: Line 1:
 ====== Documents Manager ====== ====== Documents Manager ======
  
-**Documents Manager** panel allows managing and customizing documents availabel in Leon, such as: **Flight Order**, **Trip Sheet**, **General Declaration**, **PAX Information**, **PAX Manifest**, **Flight Brief** & **Charter Agreement**. +**Documents Manager** panel allows managing and customizing documents available in Leon, such as: **Flight Order**, **Trip Sheet**, **General Declaration**, **PAX Information**, **PAX Manifest**, **Flight Brief** & **Charter Agreement**. 
  
-The list of pre-defined documents is constantly expanded to cover all documents in Leon. In the future it will be possible to create completely **new custom document** apart from those pre-defined in Leon.+The list of pre-defined documents is constantly expanded to cover all documents in Leon. It is also possible to create completely **new custom document** apart from those pre-defined in Leon.
  
 ===== Main page ===== ===== Main page =====
  
-[{{ :leon:documents-manager:main screen 2.jpg?200|Documents Manager main screen}}]+[{{ :leon:documents-manager:dm_-_main_view_updated.png?200|Documents Manager main screen}}]
  
-The main page shows **3** filtering options: by **document type**, **language** and **publishing status**, as well as **5** columns: +The main page shows **3** filtering options: by **document type**, **language** and **publishing status**, as well as **7** columns: 
  
-  * **Documents** - saved versions of Flight Order or Flight Brief.  +  * **Name** - name and the saved versions of the document 
-  * **Language** +  * **Type** - type of the document  
-  * **Published** - the status of the documents, whether they have been published, or not. Click on the white dot if you want to publish saved version - the dot will become green.+  * **Published** - the status of the documents, whether they have been published, or not. Click on the white dot if you want to publish the saved version - the dot will become green 
 +  * **Visible in Crew App** - allows indicating which version(s) of the document will be available to Crew on a flight in the Crew App > tab 'Flight'The dots indicate the status: 'White' - not available to the Crew; 'Grey' - not applicable - document is not published; 'Green' - available to the crew 
 +  * **Language** - the language of the document indicated within the edit in the SETTINGS tab
   * **Last modified** - the date of the latest modification.   * **Last modified** - the date of the latest modification.
   * **Action** - once the document has been uploaded you can hover the mouse to see available options:   * **Action** - once the document has been uploaded you can hover the mouse to see available options:
   -{{:leon:documents-manager:icon 2.jpg|}} - the edition of the document   -{{:leon:documents-manager:icon 2.jpg|}} - the edition of the document
   -{{:leon:documents-manager:icon 3.jpg|}} - saving the copy of the modified document   -{{:leon:documents-manager:icon 3.jpg|}} - saving the copy of the modified document
-  -{{:leon:documents-manager:icon 4.jpg|}} - deleting saved document+  -{{:leon:documents-manager:icon 4.jpg|}} - deleting saved document, only available on not published documents
   -{{:leon:documents-manager:icon 5.jpg|}} - viewing of the document   -{{:leon:documents-manager:icon 5.jpg|}} - viewing of the document
  
Line 29: Line 31:
 ==== Creating documents ==== ==== Creating documents ====
  
-In order to create a new document click {{:leon:documents-manager:icon 1.jpg|}} button. In a pop-up window select the desired document type, then select one of the available templates from which a new document will be created. Some documents have more than just one template prepared by Leon based on operators experiences - choose the most suitable template for your needs. To preview a selected template click on the document icon next to the template field bar. Finally, enter the version name - it will help to recognize the document in the Schedule section, if more than one document of the same type is published. Saving data will create a new document based on the selected template.+In order to create a new document click {{:leon:documents-manager:icon 1.jpg|}} button. In a pop-up window select the desired document type, then select one of the available templates from which a new document will be created. Some documents have more than just one template prepared by Leon based on operators experiences - choose the most suitable template for your needs. To preview a selected template click on the document icon next to the template field bar. Finally, enter the version name - it will help to recognize the document in the OPS section, if more than one document of the same type is published. Saving data will create a new document based on the selected template.
  
  
Line 37: Line 39:
  
 Click on the icon to view which version you prefer. Click on the icon to view which version you prefer.
- 
- 
- 
- 
  
  
Line 51: Line 49:
 To publish a document which has been re-arranged you just need to click on the white dot  {{:leon:documents-manager:white dot.png|}} which will turn green  {{:leon:documents-manager:green dot.png|}} when a document is successfully published.  To publish a document which has been re-arranged you just need to click on the white dot  {{:leon:documents-manager:white dot.png|}} which will turn green  {{:leon:documents-manager:green dot.png|}} when a document is successfully published. 
  
-Such a published document can be used in a section **Schedule** (right-click with the mouse over the trip).+Such a published document can be used in a section **OPS** (right-click with the mouse over the trip).
  
 Unpublishing documents works exactly in the same way - the green dot turns white and Leon shows a message in top-right corner: "Template successfully unpublished!". Unpublishing documents works exactly in the same way - the green dot turns white and Leon shows a message in top-right corner: "Template successfully unpublished!".
  
-It is possible to publish **multiple versions** of the same document type. All of them will appear in the main Documents Manager page as well as in Schedule documents list and can be recognized by the revision name.+It is possible to publish **multiple versions** of the same document type. All of them will appear in the main Documents Manager page as well as in OPS documents list and can be recognized by the revision name.
  
 **DELETING DOCUMENTS** **DELETING DOCUMENTS**
  
-<box>**Deleting documents will __permanently__ remove the selected document. __Restoring deleted document is not possible__. In order delete a document you need to unpublish it in first place, then click {{:leon:documents-manager:icon 4.jpg|}} icon and confirm the action.**</box>+<box>**Deleting documents will __permanently__ remove the selected document. __Restoring deleted document is not possible__. In order to delete a document you need to unpublish it in first place, then click {{:leon:documents-manager:icon 4.jpg|}} icon and confirm the action.**</box>
  
  
Line 66: Line 64:
 ---- ----
  
-===== Customizing documents =====+====== Customizing documents ======
  
 [{{ :leon:documents-manager:doc edition.jpg?200|Documents Manager - Body of the document}}] [{{ :leon:documents-manager:doc edition.jpg?200|Documents Manager - Body of the document}}]
Line 122: Line 120:
 ---- ----
  
-==== HTML structure ====+===== Adding aircraft pictures to documents ===== 
 + 
 +If you want to add pictures of your aircraft on a particular document, you need to first **upload pictures** to particular tail in a section SALES > FLEET (edit the aircraft and use 'EDIT PICTURES' button), name them and SAVE (click also SAVE at the bottom of the page). Once it's done, edit a particular document and use below HTML and CSS entries in Documents Manager panel. 
 + 
 +The example below shows how to add 2 pictures of the aircraft: the outside look and the inside one, plus a command that pictures should always appear on the next page and be separated from each other. 
 + 
 +**__BODY__** 
 + 
 +{{:leon:documents-manager:adding pics 1.png|}} 
 + 
 +**__CSS__** 
 + 
 +{{:leon:documents-manager:adding pics 2.png|}} 
 + 
 +---- 
 + 
 +===== Attaching extra pages to documents ===== 
 + 
 +It is possible to attach **extra pdfs** to existing documents in Leon. If, for example, Flight Order needs to have attached an extra page for pilots with towing instructions, you can attach it by uploading pdf file into Documents Manager panel (edit the document and use right-hand filter, tab FILES) and by adding below HTML code at the bottom of the 'BODY' HTML code: 
 + 
 +<code Twig>{% pdf 'towing_instructions.pdf' %}</code> 
 + 
 +where 'towing_instructions' is the name of the pdf document. 
 + 
 +---- 
 +===== Attaching pdf documents from the checklist items to Crew Tripsheet ===== 
 + 
 +It is possible to attach pdf files uploaded to some of the elements of the checklist to the Crew Tripsheet document. 
 + 
 +This can be achieved by using the function {{:leon:documents-manager:Show files.png?nolink|}}. 
 + 
 +This is only possible in the Crew tripsheet for the elements that contain 'file' link in the 'Available data', e.g. tripsheet.activities.checklist.catering.files 
 + 
 +An example of how to embed the code in the tripsheet can be seen below, where the 'leg' element pulls out the details from single legs and 'trip' element pulls out the details from the whole trip. 
 + 
 +<code Twig [enable_line_numbers="true"]> 
 +{% set files  = [] %} 
 +  {% for leg in tripsheet.activities %} 
 +  {% if leg.checklist.catering and leg.checklist.catering.files %} 
 +  {% set files = files|merge(leg.checklist.catering.files) %} 
 +  {% endif %} 
 +{% endfor %} 
 +{% for trip in tripsheet.trips %} 
 +  {% if trip.checklistTrip.CATBriefsRequired and trip.checklistTrip.CATBriefsRequired.files %} 
 +  {% set files = files|merge(trip.checklistTrip.CATBriefsRequired.files) %} 
 +  {% endif %} 
 +{% endfor %} 
 +{{ showFiles(files) }}</code> 
 +The PDF file(s) will be embedded at the **end of the document**. 
 +----- 
 +===== Showing a map in documents ===== 
 + 
 +[{{ :leon:documents-manager:map on docs.png?150|Showing a map in documents}}] 
 + 
 +It is also possible to **show a map** in particular documents.  In order to do that you need to insert the below code: 
 + 
 +{{:leon:documents-manager:map code.png|}} 
 + 
 +You can define **width** and **height** as you wish, as well as the** colour of lines** on the map (see screenshot). 
 + 
 +The parameters set by default: “c_width=2” and “markers_icon_url” which have a format of “red_markers.png” can also be changed. Markers are visible by default, if you want to remove them, set a parameter as “none”. They are red circles that look like: 
 + 
 +{{:leon:documents-manager:map red_markers.png|}} 
 + 
 +---- 
 + 
 +===== Adding header/footer as a picture ===== 
 + 
 +To add either a **header** or a **footer** as a picture you need to use appropriate tabs in Documents Manager panel. 
 + 
 + 
 +First of all a file should be uploaded to the right-hand filter, tab **FILES**.  
 + 
 +{{:leon:documents-manager:footers 1.png?nolink|}} 
 + 
 +Once it's done, a **code** needs to be inserted in a tab HEADER: 
 + 
 +{{:leon:documents-manager:footers 2.png?nolink|}} 
 + 
 +Then, in a **CSS** tab you can set up, that i.e. the footer should appear only on the 1st page, or that the footer should appear only at the bottom of the last page: 
 + 
 +{{:leon:documents-manager:footers.png?nolink|}} 
 + 
 + 
 + 
 +---- 
 +===== Changes history ===== 
 +[{{ :leon:documents-manager:dm_-_history_of_changes_icon.png?250|Changes history icon}}] 
 +It is also possible to see the history of changes of the document as well as to preview the past versions of the code. 
 + 
 +To access the history of changes, simply click on the {{:leon:icons:notes-history.png?nolink|}} icon available just above the document preview section (as per the screenshot on the right). 
 + 
 +Len will display the changes history information such as time and date (in UTC) and the name of the user who made changes (as per below): 
 + 
 +{{:leon:documents-manager:dm_-_history_of_changes.png?nolink|}} 
 + 
 +Clicking on the {{:leon:documents-manager:dm_-_history_of_changes_download_icon.png?nolink|}} icon within the changes history link allows saving the selected version of the document (code) to a text file.  
 + 
 +This will allow retrieving any past version of the document by pasting the code from the document to the relevant section of the Document Manager. 
 + 
 +----------------- 
 + 
 +------------- 
 +===== HTML structure =====
  
 **HTML** is a markup language that allows defining structure of web pages. Pages written in HTML can be further styled by CSS. In Documents manager user only writes HTML placed inside <body> tags. HTML headers are added automatically outside of the editor. Be aware that header, body and footer are treated as separated HTML documents but they share single CSS file. **HTML** is a markup language that allows defining structure of web pages. Pages written in HTML can be further styled by CSS. In Documents manager user only writes HTML placed inside <body> tags. HTML headers are added automatically outside of the editor. Be aware that header, body and footer are treated as separated HTML documents but they share single CSS file.
Line 149: Line 250:
 ---- ----
  
-==== CSS structure ====+===== CSS structure =====
  
 CSS is used to add **style** to document's structure. CSS capabilities can be compared to advanced text editor. For example, user can change: elements of the **font**, **font size**, **colour** of the text or the **background**, can add **margins**, **padding** and **borders**, can align **content**. There are a lot more CSS options to apply to a document's elements.  CSS is used to add **style** to document's structure. CSS capabilities can be compared to advanced text editor. For example, user can change: elements of the **font**, **font size**, **colour** of the text or the **background**, can add **margins**, **padding** and **borders**, can align **content**. There are a lot more CSS options to apply to a document's elements. 
Line 169: Line 270:
 ---- ----
  
-==== Using Twig ====+===== Using Twig =====
  
 **Twig** is a template engine that can insert **dynamic data** from LEON into document’s HTML structure. Before using Twig you should familiarize yourself with data structure of a document you are customizing.  **Twig** is a template engine that can insert **dynamic data** from LEON into document’s HTML structure. Before using Twig you should familiarize yourself with data structure of a document you are customizing. 
Line 181: Line 282:
 Knowing the structure is important because placing the data tag with Twig requires **setting path** to the desired element. Path should be analyzed carefully taking into account optional fields and arrays. If on the path of data you want to show is array you should iterate over this array as it can have different number of elements or have no elements. Knowing the structure is important because placing the data tag with Twig requires **setting path** to the desired element. Path should be analyzed carefully taking into account optional fields and arrays. If on the path of data you want to show is array you should iterate over this array as it can have different number of elements or have no elements.
  
 +Twig has **2** kind of tags: **data tags** and **control tags**. Data tags allow displaying data. For example simple tag to show a trip number from flight brief structure looks like this: 
  
 +{{:leon:documents-manager:twig 1.png|}}
  
 +If you put this tag in a document's template then, after the preview, in this place Manager will show a trip number from a selected trip.
  
 +**Control tags** give an advanced **control** to an user over the **template**. Most common control tags are **conditions** and **loops**. Conditions allow to show certain parts of templates based on condition. Example of checking if trip client is set is:
 +
 +{{:leon:documents-manager:control tag.png|}}
 +
 +The above code will show trip client name only if the trip have a client selected in Leon, otherwise document will show an information that the trip has no client. Usage of condition alternative is optional, you can add alternative block only when needed.
 +
 +**Loops** allow iterating over arrays. For example, iterating over flights (available in path trip.flights) can look like this:
 +
 +{{:leon:documents-manager:loop.png|}}
 +
 +The above construction will add to a  document <div> tag with the flight number for every flight in a trip. If there will be no flights - no <div> will be generated. As you can see, the structure named 'flight' represents every iterated value from trip.flights array.
 +
 +----
 +
 +**TWIG FILTERS**
 +
 +Data placed in a document by Twig tags can be modified using **Twig filters**. There are many filters at your disposal, provided by Twig and added by LEON team for special cases. Using the filter is simple. For example, adding date filter to format **UNIX timestamp** (number of seconds from 1.01.1970) looks as follows:
 +
 +{{:leon:documents-manager:twig 2.png|}}
 +
 +Date filter takes the date format as a parameter. Filters can take any number of parameters (including none) depending on their specification. It is possible to chain filters, next filter works on an input provided by the output of the previous filter. See the full list of available filters in Twig specification below.
 +
 +----
 +
 +**CUSTOM TWIG FILTERS**
 +
 +LEON team prepared **custom filters** to simplify operations on the available data. Be aware that custom filter are dedicated to specific data types and **cannot** be used on other data. Here is a list of all custom filters:
 +
 +* defaultLicenseNumber – returns pilot license number from array of all license objects. If a pilot has no license in array - an empty word is returned and nothing is shown on document.
 +
 +example usage
 +
 +{{:leon:documents-manager:custom twig filter 1.png|}}
 +
 +example output: 123456789
 +
 +  * exchangeOrderInCrewsByPositionName – changes the order of crew positions array replacing crew member order from one position to another.
 +
 +example usage
 +
 +{{:leon:documents-manager:custom twig filter 2.png|}}
 +
 +example output: returns the same crew members list with replaced order of FO and CPT2 positions.
 +
 +  * formatTimePeriod – formats time period in seconds to hours and minutes format HH(H):mm. Filter is most commonly used to show time difference between two timestamps or aggregated trip times.
 +
 +example usage
 +
 +{{:leon:documents-manager:custom twig filter 3.png|}}
 +
 +example output: 124:59
 +
 +  * firstFlightWithAircraft – returns first flight in array that have specific aircraft selected. In special cases some flights have no aircraft selected. Using this filter you can get first flight with an aircraft for further processing.
 +
 +example usage
 +
 +{{:leon:documents-manager:custom twig filter 4.png|}}
 +
 +example output: flight number of first flight with aircraft.
 +
 +  * firstProperFlightActivity – return first flight activity (not positionings). 
 +
 +example usage
 +
 +{{:leon:documents-manager:custom twig filter 5.png|}}
 +
 +example output: start date of first flight not positioning.
 +
 +example usage
 +
 +**{% if FDPs|sameFDPs %}**
 +
 +example output: checks if all FDP elements are the same (duty start, duty end, duty lenght, next EOBT).
 +
 +
 +
 +----
 +
 +**PAGE NUMBERING**
 +
 +Sometime there is a need for **page numeration**. Twig allows page numbering in header and footers. In order to add the page number use following control tags in header or footer:
 +
 +{{:leon:documents-manager:custom twig filter 6.png|}}
 +
 +----
  
 +For more information regarding Twig see:
  
 +[[http://twig.symfony.com/doc/2.x/templates.html|Twig documentation]]
  
 +[[http://twig.symfony.com/doc/2.x/filters/index.html|Twig filters]]
  
  
  
leon/documents-manager.txt · Last modified: 2023/11/15 11:53 by marek