aboutsummaryrefslogtreecommitdiff
path: root/newspipe/web/templates/layout.html
blob: 38ec49eff6b3423cffb08406368f2d1018ddbfa1 (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
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
  <head>
    {% block head %}
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Newspipe is a web news aggregator and reader." />
    <meta name="author" content="" />
    <title>Newspipe{% if head_titles %} - {{ ' - '.join(head_titles) }}{% endif %}</title>
    <link rel="shortcut icon" href="{{ url_for("static", filename="img/favicon.ico") }}" />
    <!-- Bootstrap core CSS -->
    <link href="{{ url_for('static', filename='npm_components/bootstrap/dist/css/bootstrap.min.css') }}" rel="stylesheet" media="screen" />
    <!-- Add custom CSS here -->
    <link rel="stylesheet" href="{{ url_for('static', filename='npm_components/fork-awesome/css/fork-awesome.min.css') }}">
    <link href="{{ url_for("static", filename="css/customized-bootstrap.css") }}" rel="stylesheet" media="screen" />
    <!-- jquery, bootstrap, datatables -->
    <script type="text/javascript" src="{{ url_for('static', filename = 'npm_components/jquery/dist/jquery.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename = 'npm_components/bootstrap/dist/js/bootstrap.min.js') }}"></script>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='npm_components/datatables.net-bs/css/dataTables.bootstrap.min.css') }}">
    <script type="text/javascript" src="{{ url_for('static', filename='npm_components/datatables.net/js/jquery.dataTables.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='npm_components/datatables.net-bs/js/dataTables.bootstrap.min.js') }}"></script>
    {% endblock %}
  </head>
  <body>
    {% block menu %}
    <nav class="navbar navbar-expand-lg navbar-dark bg-newspipe-blue">
        <a class="navbar-brand" href="/"><img src="{{ url_for('static', filename='img/logo.png') }}" width="120px" alt="Newspipe" title="Newspipe" /></a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        {% block menu_links %}
        <div class="collapse navbar-collapse" id="navbarSupportedContent">

            <ul class="navbar-nav mr-auto w-100 justify-content-end">
                {% if current_user.is_authenticated %}
                    {% if current_user.is_admin %}
                        <li class="nav-item">
                            <a class="nav-link" href="/fetch" title="{{  _('Fetch') }}">{{  _('Fetch') }}</a>
                        </li>
                    {% endif %}
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownBookmark" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-bookmark" aria-hidden="true"></i></a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownBookmark">
                            <a class="dropdown-item" href="{{ url_for('bookmarks.list_') }}">{{ _('Your bookmarks') }}</a>
                            <a class="dropdown-item" href="{{ url_for('bookmark.form') }}">{{ _('Add a new bookmark') }}</a>
                        </div>
                    </li>

                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownRSS" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-rss" aria-hidden="true"></i>&nbsp;{{ _('Add a new feed') }}</a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownRSS">

                            <form class="navbar-form  navbar-left px-4 py-3" action="{{ url_for('feed.bookmarklet') }}">
                                <label class="sr-only" for="inlineFormInputGroupAPIKey">{{ _('Add a new feed') }}</label>
                                <div class="input-group input-group-inline">
                                    <div class="input-group-prepend">
                                          <input class="form-control" name="url" type="url" placeholder="{{_('Site or feed url')}}" required="required"/>
                                    </div>
                                    <button type="submit" class="btn btn-primary"><i class="fa fa-plus" aria-hidden="true"></i></button>
                                </div>
                              </form>
                        </div>
                    </li>

                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownCategory" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-tag" aria-hidden="true"></i>&nbsp;{{ _('Add a new category') }}</a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownCategory">

                            <form class="navbar-form navbar-left px-4 py-3" action="{{ url_for('category.form') }}" method="POST" name="category">
                                <label class="sr-only" for="inlineFormInputGroupAPIKey">{{ _('Add a new category') }}</label>
                                <div class="input-group input-group-inline">
                                    <div class="input-group-prepend">
                                          <input class="form-control" name="name" type="text" placeholder="{{_('Category name')}}" required="required"/>
                                    </div>
                                    <button type="submit" class="btn btn-primary"><i class="fa fa-plus" aria-hidden="true"></i></button>
                                </div>
                              </form>
                        </div>
                    </li>

                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownBookmark" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{ _('Feed') }}</a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownBookmark">
                            <a class="dropdown-item" href="{{ url_for('popular') }}">{{ _('Popular') }}</a>
                            <a class="dropdown-item" href="{{ url_for('feeds.inactives') }}">{{ _('Inactive') }}</a>
                            <a class="dropdown-item" href="{{ url_for('articles.history') }}">{{ _('History') }}</a>
                            <a class="dropdown-item" href="{{ url_for('feeds.feeds') }}">{{ _('All') }}</a>
                        </div>
                    </li>

                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownUser" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-user" aria-hidden="true"></i></a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownUser">
                            <a class="dropdown-item" href="{{ url_for('user.profile') }}">{{ _('Profile') }}</a>
                            <a class="dropdown-item" href="{{ url_for('user.management') }}">{{ _('Your data') }}</a>
                            {% if current_user.is_admin %}
                                <div class="dropdown-divider"></div>
                                <a class="dropdown-item" href="{{ url_for('admin.dashboard') }}">{{ _('Dashboard') }}</a>
                                <div class="dropdown-divider"></div>
                            {% endif %}
                            <a class="dropdown-item" href="{{ url_for('about') }}">{{ _('About') }}</a>
                            <a class="dropdown-item" href="{{ url_for('logout') }}" title="{{ _('Logout') }}">Logout</a>
                        </div>
                    </li>
                {% else %}
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('bookmarks.list_') }}" title="{{  _('Recent bookmarks') }}">{{  _('Recent bookmarks') }}</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link" href="{{ url_for('popular') }}" title="{{  _('Popular feeds') }}">{{  _('Popular feeds') }}</a>
                   </li>
                   <li class="nav-item">
                       <a class="nav-link" href="{{ url_for('about') }}" title="{{  _('About') }}">{{  _('About') }}</a>
                   </li>
                {% endif %}
            </ul>
        </div>
        {% endblock %}
    </nav>



    {% endblock %}
    <br />

    <div class="container alert-message not-at-home">
    {% block messages %}
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="alert alert-{{category}}">
                        <button type="button" class="close" data-dismiss="alert">&times;</button>
                        {{ message }}
                    </div>
                {% endfor %}
            {% endif %}
        {% endwith %}
    {% endblock %}
    </div>

    {% block content %}{% endblock %}

    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/javascript" src="{{ url_for('static', filename = 'js/articles.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename = 'js/feed.js') }}"></script>
  </body>
</html>
bgstack15