summaryrefslogtreecommitdiffstats
path: root/templates/part.settings.php
blob: 8970ee33fd3fb4bd282c8c9a74d111a5b5ae5ac9 (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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<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>
        <label>
            <input type="checkbox"
                   ng-click="Settings.toggleSetting('preventReadOnScroll')"
                   ng-checked="Settings.getSetting('preventReadOnScroll')"
                   name="preventReadOnScroll">
            <?php p($l->t('Disable mark read through scrolling')); ?>
        </label>
    </p>

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

    <p ng-class="{disabled: !Settings.getSetting('compact')}">
        <label>
            <input type="checkbox"
                   ng-click="Settings.toggleSetting('compactExpand')"
                   ng-disabled="!Settings.getSetting('compact')"
                   ng-checked="Settings.getSetting('compactExpand')"
                   name="compactExpand">
            <?php p($l->t('Expand articles on key navigation')); ?>
        </label>
    </p>

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

    <p>
        <label>
            <input type="checkbox"
                   ng-click="Settings.toggleSetting('oldestFirst')"
                   ng-checked="Settings.getSetting('oldestFirst')"
                   name="oldestFirst">
            <?php p($l->t('Reverse ordering (oldest on top)')); ?>
        </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>