summaryrefslogtreecommitdiffstats
path: root/templates/part.settings.php
blob: 00b7b79aad5f792648e5963e07996e331bd27009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<div id="app-settings-header">
<button name="app settings"
    class="settings-button"
    data-apps-slide-toggle="#app-settings-content"></button>
</div>

<div id="app-settings-content">
    <h3><?php p($l->t('Settings')); ?></h3>

    <p>
        <a href="#/shortcuts"><?php p($l->t('Keyboard shortcuts')); ?></a>
    </p>

    <p ng-click="Settings.toggleSetting('compact')">
        <label for="compact">
            <input type="checkbox" ng-checked="Settings.getSetting('compact')"
                   name="compact">
            <?php p($l->t('Compact view')); ?>
        </label>
    </p>

    <p ng-click="Settings.toggleSetting('showAll')">
        <label for="showAll">
            <input type="checkbox" ng-checked="Settings.getSetting('showAll')"
                   name="showAll">
            <?php p($l->t('Show all articles')); ?>
        </label>
    </p>

    <p ng-click="Settings.toggleSetting('oldestFirst')">
        <label for="oldestFirst">
            <input type="checkbox"
                    ng-checked="Settings.getSetting('oldestFirst')"
                   name="oldestFirst">
            <?php p($l->t('Reverse ordering')); ?>
        </label>
    </p>

    <p ng-click="Settings.toggleSetting('preventReadOnScroll')">
        <label for="preventReadOnScroll">
            <input type="checkbox"
                   ng-checked="Settings.getSetting('preventReadOnScroll')"
                   name="preventReadOnScroll">
            <?php p($l->t('Disable mark read through scrolling')); ?>
        </label>
    </p>

    <div class="import-export">
        <h3><?php p($l->t('Subscriptions (OPML)')); ?></h3>

        <input type="file"
            id="opml-upload"
            name="import"
            news-read-file="Settings.importOPML($fileContent)"/>

        <button title="<?php p($l->t('Import')); ?>"
            class="icon-upload svg button-icon-label"
            news-trigger-click="#opml-upload"
            ng-class="{'entry-loading': Settings.isOPMLImporting}"
            ng-disabled=
                "Settings.isOPMLImporting || Settings.isArticlesImporting">
        </button>

        <a title="<?php p($l->t('Export')); ?>"
            class="button icon-download svg button-icon-label"
            href="<?php p(\OCP\Util::linkToRoute('news.export.opml')); ?>"
            target="_blank"
            ng-hide="App.isFirstRun()">
        </a>

        <button
            class="icon-download svg button-icon-label"
            title="<?php p($l->t('Export')); ?>"
            ng-show="App.isFirstRun()"
            disabled>
        </button>

        <p class="error" ng-show="Settings.opmlImportError">
            <?php p(
                $l->t('Error when importing: file does not contain valid OPML')
            ); ?>
        </p>


        <h3><?php p($l->t('Unread/Starred Articles')); ?></h3>

        <input
            type="file"
            id="article-upload"
            name="importarticle"
            news-read-file="Settings.importArticles($fileContent)"/>

        <button title="<?php p($l->t('Import')); ?>"
            class="icon-upload svg button-icon-label"
            ng-class="{'entry-loading': Settings.isArticlesImporting}"
            ng-disabled=
                "Settings.isOPMLImporting || Settings.isArticlesImporting"
            news-trigger-click="#article-upload">
        </button>

        <a title="<?php p($l->t('Export')); ?>"
            class="button icon-download svg button-icon-label"
            href="<?php p(\OCP\Util::linkToRoute('news.export.articles')); ?>"
            target="_blank"
            ng-hide="App.isFirstRun()">
        </a>
        <button
            class="icon-download svg button-icon-label"
            title="<?php p($l->t('Export')); ?>"
            ng-show="App.isFirstRun()"
            disabled>
        </button>

        <p class="error" ng-show="Settings.articleImportError">
            <?php p(
                $l->t('Error when importing: file does not contain valid JSON')
            ); ?>
        </p>

    </div>
</div>