<commit_before>// ekke (<NAME>) @ekkescorner
import QtQuick 2.6
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
import QtGraphicalEffects 1.0
import org.ekkescorner.data 1.0
import "../common"

Page {
    id: dayListPage
    focus: true
    property string name: "dayListPage"
    property Day conferenceDay
    bottomPadding: 24
    topPadding: 16

    // SECTION HEADER
    Component {
        id: sectionHeading
        ColumnLayout {
            width: parent.width
            RowLayout {
                Layout.topMargin: 6
                spacing: 20
                IconColored {
                    Layout.leftMargin: 16
                    imageSize: 36
                    imageName: "time.png"
                }
                LabelTitle {
                    text: section.substr(section.length - 5) // TODO .toLocaleTimeString("HH:mm")
                    anchors.verticalCenter: parent.verticalCenter
                    color: primaryColor
                    font.bold: true
                }
            } // row layout
            HorizontalListDivider{}
        } // col layout
    }


    // LIST ROW DELEGTE
    Component {
        id: sessionRowComponent
        ColumnLayout {
            id: sessionRow
            // without this divider not over total width
            implicitWidth: appWindow.width
            RowLayout {
                spacing: 20
                Layout.leftMargin: 16+12
                Layout.rightMargin: 6
                Layout.topMargin: 6
                ColumnLayout {
                    CharCircle {
                        size: 24
                        text: sessionRow.ListView.view.characterForButton(model.modelData)
                    }
                } // left column
                ColumnLayout {
                    Layout.fillWidth: true
                    // without setting a maximum width, word wrap not working
                    Layout.maximumWidth: appWindow.width-150
                    Layout.minimumWidth: appWindow.width-150
                    spacing: 0
                    LabelSubheading {
                        rightPadding: 12
                        text: model.modelData.title
                        font.bold: true
                        wrapMode: Label.WordWrap
                        maximumLineCount: 2
                        elide: Label.ElideRight
                    } // label

                    LabelBody {
                        visible: model.modelData.subtitle.length
                        rightPadding: 12
                        text: model.modelData.subtitle
                        wrapMode: Label.WordWrap
                        maximumLineCount: 2
                        elide: Label.ElideRight
                    }
                } // middle column
                ListRowButton {
                    onClicked: {
                        navPane.pushSessionDetail(model.modelData.sessionId)
                    }
                }
                ColumnLayout {
                    Layout.rightMargin: 8
                    IconActive {
                        transform: Translate { x: -36 }
                        imageSize: 48
                        imageName: "stars.png"
                        opacity: model.modelData.isFavorite? opacityToggleActive : opacityToggleInactive
                        ListRowButton {
                            onClicked: {
                                model.modelData.isFavorite = !model.modelData.isFavorite
                            }
                        }
                    } // favoritesIcon
                } // right column
            } // end Row Layout
            HorizontalListDivider{}
        } // end Col Layout speaker row
    } // sessionRowComponent

    // LIST VIEW
    ListView {
        id: listView
        focus: true
        clip: true
        // highlight: Rectangle {color: Material.listHighlightColor }
        currentIndex: -1
        anchors.fill: parent
        // setting the margin to be able to scroll the list above the FAB to use the Switch on last row
        // bottomMargin: 40
        // QList<Session*>
        //model: dataManager.sessionPropertyList

        delegate: sessionRowComponent

        section.property: "sortKey"
        section.criteria: ViewSection.FullString
        section.delegate: sectionHeading

        ScrollIndicator.vertical: ScrollIndicator { }

        function characterForButton(session) {
            if(session.isTraining) {
                return "T"
            }
            if(session.isLightning) {
                return "L"<commit_msg>work on schedule<commit_after>// ekke (<NAME>) @ekkescorner
import QtQuick 2.6
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
import QtGraphicalEffects 1.0
import org.ekkescorner.data 1.0
import "../common"

Page {
    id: dayListPage
    focus: true
    property string name: "dayListPage"
    property Day conferenceDay
    bottomPadding: 24
    topPadding: 16

    // SECTION HEADER
    Component {
        id: sectionHeading
        ColumnLayout {
            width: parent.width
            RowLayout {
                Layout.topMargin: 6
                spacing: 20
                IconColored {
                    Layout.leftMargin: 16
                    imageSize: 36
                    imageName: "time.png"
                }
                LabelTitle {
                    text: section.substr(section.length - 5) // TODO .toLocaleTimeString("HH:mm")
                    anchors.verticalCenter: parent.verticalCenter
                    color: primaryColor
                    font.bold: true
                }
            } // row layout
            HorizontalListDivider{}
        } // col layout
    }




    // LIST VIEW
    ListView {
        id: listView
        focus: true
        clip: true
        // highlight: Rectangle {color: Material.listHighlightColor }
        currentIndex: -1
        anchors.fill: parent
        // setting the margin to be able to scroll the list above the FAB to use the Switch on last row
        // bottomMargin: 40
        // QList<Session*>
        //model: dataManager.sessionPropertyList

        delegate:

            Loader {
            id: sessionLoader
            // define Components inside Loader to enable direct access to ListView functions and modelData
            sourceComponent: hasScheduleItem()? scheduleRowComponent : sessionRowComponent

            // LIST ROW DELEGATES
            Component {
                id: scheduleRowComponent

                ColumnLayout {
                    Label {
                        text: model.modelData.title
                    }
                    Label {
                        visible: model.modelData.scheduleItemAsDataObject.isBreak
                        text: "BREAK"
                    }
                }

            } // scheduleRowComponent

            Component {
                id: sessionRowComponent
                ColumnLayout {
                    id: sessionRow
                    // without this divider not over total width
                    implicitWidth: appWindow.width
                    RowLayout {
                        spacing: 20
                        Layout.leftMargin: 16+12
                        Layout.rightMargin: 6
                        Layout.topMargin: 6
                        ColumnLayout {
                            CharCircle {
                                size: 24
                                text: listView.characterForButton(model.modelData)
                            }
                        } // left column
                        ColumnLayout {
                            Layout.fillWidth: true
                            // without setting a maximum width, word wrap not working
                            Layout.maximumWidth: appWindow.width-150
                            Layout.minimumWidth: appWindow.width-150
                            spacing: 0
                            LabelSubheading {
                                rightPadding: 12
                                text: model.modelData.title
                                font.bold: true
                                wrapMode: Label.WordWrap
                                maximumLineCount: 2
                                elide: Label.ElideRight
                            } // label

                            LabelBody {
                                visible: model.modelData.subtitle.length
                                rightPadding: 12
                                text: model.modelData.subtitle
                                wrapMode: Label.WordWrap
                                maximumLineCount: 2
                                elide: Label.ElideRight
                            }
                        } // middle column
                        ListRowButton {
                            onClicked: {
                                navPane.pushSessionDetail(model.modelData.sessionId)
                            }
                        }
                        ColumnLayout {
                            Layout.rightMargin: 8
                            IconActive {
                                transform: Translate { x: -36 }
                                imageSize: 48
                                imageName: "stars.png"
                                opacity: model.modelData.isFavorite? opacityToggleActive : opacityToggleInactive
                                ListRowButton {
                                    onClicked: {
                                        model.modelData.isFavorite = !model.modelData.isFavorite
                                    }
                                }
                            } // favoritesIcon
                        } // right column
                    } // end Row Layout
                    HorizontalListDivider{}
                } // end Col Layout speaker row
            } // sessionRowComponent

        }

        section.property: "sortKey"
        section.criteria: ViewSection.FullString
        section.delegate: sectionHeading

        ScrollIndicator.vertical: ScrollIndicator { }

        function characterForButton(session) {
            if(session.isTraining) {
                return "T"
            }
            if(session.isLightning) {
                return "L"
{'fraction_non_alphanumeric': 0.05730412321821487, 'fraction_numerical': 0.010523294747919257, 'mean_word_length': 0.9776768823306848, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5356925', 'n_tokens_mistral': 2433, 'n_tokens_neox': 2173, 'n_words': 543}