Skip to content

MuhammedMomen/TDM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TDM ( Glossary Management Tool ) Manual Guide in English:

This page is your one-stop shop for managing all the important terms and definitions used in your system. Think of it as a digital dictionary specifically tailored to your business needs!

Here's what you can do:

  • Search: Quickly find the term you're looking for by typing it in the search bar. You can search by:

    • Term in Arabic
    • Term in English
    • Explanation in Arabic
    • Explanation in English
    • Notes in Arabic
    • Notes in English
    • Card ID number
  • Filter: Narrow down your search results using the filter options:

    • Approved: Shows terms that have been officially approved.
    • Not Approved: Shows terms that are still pending approval.
    • Approved with Note: Shows terms that have been approved, but with additional comments.
  • View Details: Click on any term card to expand it and see its full details, including:

    • Term in Arabic and English
    • Detailed explanation in both Arabic and English
    • Additional notes in both languages (if available)
    • Approval status
  • Copy Information: Easily copy the Arabic or English explanations to your clipboard using the copy buttons on each card.

  • Add New Terms: Need to define a new term? Simply click the "+" button to open the "Add New Term" form. You can provide:

    • Term in Arabic and English
    • Detailed explanation in both languages
    • Additional notes (optional)
    • Initial approval status
  • Edit Existing Terms: Found a mistake? Need to update a definition? You can edit the Arabic and English explanations and notes directly on each card. Don't forget to save your changes!

  • Delete Terms: If a term is no longer relevant, you can delete it from the glossary. But be careful, deleting a term is permanent!

This page is designed to help you:

  • Maintain consistency: Ensure everyone in your organization is using the same language and understanding of important terms.
  • Improve communication: Facilitate clear and accurate communication by providing a shared repository of definitions.
  • Boost efficiency: Quickly find the information you need, saving you time and effort.

We hope this user-friendly glossary management page helps you effectively manage your business terminology!

Technical Documentation:

  1. Import Statements:

    • Imports necessary classes and modules from flet for UI elements.
    • Imports Header from a file named header.py.
    • Imports elements from palette.py (presumably color definitions).
    • Imports GlossaryManager from controller.py and GlossaryModel and session from model.py.
  2. GlossaryPage Class:

    • Purpose: This class is responsible for creating and managing the glossary page's UI and functionality.

    • Attributes:

      • page: The Flet Page object.
      • manager: An instance of the GlossaryManager class for handling glossary data.
      • cards: A Column widget to hold the individual term cards.
      • search_bar: A TextField widget for searching terms.
      • checkboxes: A list of Checkbox widgets for filtering terms.
      • add_term_button: A FloatingActionButton for adding new terms.
      • header: An instance of the Header class (presumably for the page header).
    • Methods:

      • __init__:

        • Initializes the GlossaryPage object.
        • Sets up basic page properties (scroll, floating_action_button_location, etc.).
        • Creates instances of GlossaryManager, Header, search bar, checkboxes, and the "add term" button.
        • Calls page_setup() to build the UI.
        • Subscribes to the pubsub for updates and loads terms from the database.
      • page_setup:

        • Sets the page title, theme mode, language direction (RTL), and maximizes the window.
        • Sets up custom fonts.
        • Constructs the main layout using SafeArea, Container, Column, and Row widgets to arrange search, filters, cards, and the "add term" button.
      • create_search_bar:

        • Creates and returns the TextField widget for the search bar.
      • create_checkboxes:

        • Creates and returns a list of Checkbox widgets for filtering ("معتمد", "غير معتمد", "معتمد مع ملاحظة").
      • create_add_term_button:

        • Creates and returns the FloatingActionButton for adding new terms.
      • filter_terms:

        • Triggered when the search text or filter checkboxes change.
        • Retrieves the search text and selected filter values.
        • Calls the search_terms method of the GlossaryManager to get filtered terms.
        • Updates the displayed cards using update_cards.
      • update_cards:

        • Clears the existing cards and iterates through the provided terms.
        • For each term, calls create_card to create a card widget and adds it to the cards column.
        • Updates the page to reflect the changes.
      • open_add_term_dialog:

        • Creates and opens a dialog (AlertDialog) for adding new terms.
        • The dialog includes TextField widgets for term title, Arabic description, English description, Arabic notes, English notes, and a Dropdown for approval status.
        • Defines an add_term function (called when the "إضافة" button is pressed) to handle adding the new term to the database and updating the UI.
      • load_terms_from_db:

        • Queries the database using the session object to get all glossary terms.
        • Clears existing cards and creates a new card for each term loaded from the database.
      • create_card:

        • This lengthy method is responsible for creating a detailed card widget for a single glossary term.
        • It includes TextField widgets for displaying and editing term information (Arabic/English descriptions, notes) and a Dropdown for the approval status.
        • It defines several helper functions:
          • on_copy_desc, on_copy_desc_en: Copy the Arabic/English descriptions to the clipboard.
          • on_edit_desc, on_edit_desc_en: Enable/disable editing of the description and notes.
          • on_clear, on_clear_en: Clear the text fields for Arabic/English descriptions and notes.
          • on_delete: Handles deleting the term (shows a confirmation dialog).
          • on_approve_status_change: Updates the term's approval status.
          • on_save_changes: Saves any changes made to the term back to the database.
      • on_update:

        • Listens for updates from other users (likely through the pubsub).
        • If a new term (GlossaryModel) is received, a new card is created.
        • If a term ID (int) is received (indicating deletion), the corresponding card is removed.
      • on_hover:

        • Implements a hover effect on the cards, changing the border color when the mouse hovers over a card.

Releases

No releases published

Packages

No packages published

Languages