<commit_before>/*
 * Copyright (C) 2016 kimmoli <<EMAIL>>
 * All rights reserved.
 *
 * This file is part of Maira
 *
 * You may use this file under the terms of BSD license
 */

import QtQuick 2.0
import Sailfish.Silica 1.0

Page
{
    id: page

    SilicaFlickable
    {
        id: flick
        anchors.fill: parent

        PullDownMenu
        {
            MenuItem
            {
                text: "Refresh"
                onClicked: activitystream.reload()
            }
        }

        VerticalScrollDecorator { flickable: flick }

        contentHeight: column.height + Theme.paddingLarge

        Column
        {
            id: column
            width: parent.width

            PageHeader
            {
                id: pageHeader
                title: "Activity Stream"
            }

            Repeater
            {
                model: activitystream
                delegate: BackgroundItem
                {
                    width: parent.width
                    clip: true
                    height: col.height + Theme.paddingLarge
                    Column
                    {
                        id: col
                        width: parent.width - 2* Theme.paddingLarge
                        x: Theme.paddingLarge
                        spacing: 0
                        anchors.verticalCenter: parent.verticalCenter
                        Label
                        {
                            text: Qt.formatDateTime(new Date(published), "hh:mm dd.MM.yyyy")
                            width: parent.width
                            font.pixelSize: Theme.fontSizeExtraSmall
                            font.bold: true
                            color: Theme.highlightColor
                        }
                        Label
                        {
                            text: title.replace(/<(?:.|\n)*?>/gm, '').replace(/[\n\r]/g, ' ').replace(/\s+/g, ' ')
                            width: parent.width
                            wrapMode: Text.Wrap
                            textFormat: Text.PlainText
                            font.pixelSize: Theme.fontSizeSmall
                        }
                        Row
                        {
                            width: parent.width
                            visible: content.length > 0
                            spacing: 0
                            Label
                            {
                                id: contentlabel
                                text: content.replace(/<(?:.|\n)*?>/gm, '').replace(/[\n\r]/g, ' ').replace(/\s+/g, ' ')
                                width: parent.width - Theme.paddingLarge
                                clip: true
                                textFormat: Text.RichText
                                font.italic: true
                                font.pixelSize: Theme.fontSizeSmall
                            }
                            Label
                            {
                                visible: contentlabel.paintedWidth > contentlabel.width
                                text: "..."
                                font.italic: true
                                font.pixelSize: Theme.fontSizeSmall
                            }
                        }
                        Image
                        {
                            source: content.match(new RegExp("<img.*src=\\\"(" + Qt.atob(accounts.current.host) + ".*?)\\\""))[1]
                        }
                    }
                    onClicked:
                    {
                        var key

                        if (objecttitle.match(/^[A-Z]+-\d+$/))
                            key = objecttitle
                        else if (targettitle.match(/^[A-Z]+-\d+$/))
                            key = targettitle

                        if (key != undefined)
                        {
                            fetchissue(key)
                            pageStack.push(Qt.resolvedUrl("IssueView.qml"), {key: key})
                        }
                    }
                }
            }
        }
    }
}

<commit_msg>[activitystream] fix description when opening issue from stream<commit_after>/*
 * Copyright (C) 2016 kimmoli <<EMAIL>>
 * All rights reserved.
 *
 * This file is part of Maira
 *
 * You may use this file under the terms of BSD license
 */

import QtQuick 2.0
import Sailfish.Silica 1.0

Page
{
    id: page

    SilicaFlickable
    {
        id: flick
        anchors.fill: parent

        PullDownMenu
        {
            MenuItem
            {
                text: "Refresh"
                onClicked: activitystream.reload()
            }
        }

        VerticalScrollDecorator { flickable: flick }

        contentHeight: column.height + Theme.paddingLarge

        Column
        {
            id: column
            width: parent.width

            PageHeader
            {
                id: pageHeader
                title: "Activity Stream"
            }

            Repeater
            {
                model: activitystream
                delegate: BackgroundItem
                {
                    width: parent.width
                    clip: true
                    height: col.height + Theme.paddingLarge
                    Column
                    {
                        id: col
                        width: parent.width - 2* Theme.paddingLarge
                        x: Theme.paddingLarge
                        spacing: 0
                        anchors.verticalCenter: parent.verticalCenter
                        Label
                        {
                            text: Qt.formatDateTime(new Date(published), "hh:mm dd.MM.yyyy")
                            width: parent.width
                            font.pixelSize: Theme.fontSizeExtraSmall
                            font.bold: true
                            color: Theme.highlightColor
                        }
                        Label
                        {
                            text: title.replace(/<(?:.|\n)*?>/gm, '').replace(/[\n\r]/g, ' ').replace(/\s+/g, ' ')
                            width: parent.width
                            wrapMode: Text.Wrap
                            textFormat: Text.PlainText
                            font.pixelSize: Theme.fontSizeSmall
                        }
                        Row
                        {
                            width: parent.width
                            visible: content.length > 0
                            spacing: 0
                            Label
                            {
                                id: contentlabel
                                text: content.replace(/<(?:.|\n)*?>/gm, '').replace(/[\n\r]/g, ' ').replace(/\s+/g, ' ')
                                width: parent.width - Theme.paddingLarge
                                clip: true
                                textFormat: Text.RichText
                                font.italic: true
                                font.pixelSize: Theme.fontSizeSmall
                            }
                            Label
                            {
                                visible: contentlabel.paintedWidth > contentlabel.width
                                text: "..."
                                font.italic: true
                                font.pixelSize: Theme.fontSizeSmall
                            }
                        }
                        Image
                        {
                            source: content.match(new RegExp("<img.*src=\\\"(" + Qt.atob(accounts.current.host) + ".*?)\\\""))[1]
                        }
                    }
                    onClicked:
                    {
                        var key

                        if (objecttitle.match(/^[A-Z]+-\d+$/))
                            key = objecttitle
                        else if (targettitle.match(/^[A-Z]+-\d+$/))
                            key = targettitle

                        if (key != undefined)
                        {
                            fetchissue(key, function()
                            {
                                pageStack.push(Qt.resolvedUrl("IssueView.qml"), {key: key})
                            } )
                        }
                    }
                }
            }
        }
    }
}


{'fraction_non_alphanumeric': 0.08152881315820613, 'fraction_numerical': 0.003076558987102118, 'mean_word_length': 0.6850079744816587, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1181066', 'n_tokens_mistral': 1925, 'n_tokens_neox': 1753, 'n_words': 358}