~cedric/newspipe

ref: 0cd84bb3758d1500f8282f2dc28e38bc25e9fef5 newspipe/newspipe/templates/layout.html -rw-r--r-- 10.6 KiB
0cd84bb3Cédric Bonhomme chg: [ui] improved forms in navbar. 9 months ago
                                                                                
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
148
149
150
151
152
153
154
155
156
157
158
159
<!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 - A web news 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") }}" />
    <!-- CSS -->
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='npm_components/bootstrap/dist/css/bootstrap.min.css') }}" media="screen" />
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='npm_components/fork-awesome/css/fork-awesome.min.css') }}" />
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/custom.css') }}" />
    <!-- JavaScript -->
    <script type="text/javascript" src="{{ url_for('static', filename='npm_components/popper.js/dist/umd/popper.min.js') }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='npm_components/bootstrap/dist/js/bootstrap.min.js') }}"></script>
    {% endblock %}
  </head>
  <body>
    {% block menu %}
    <nav class="navbar navbar-expand-lg navbar-dark bg-newspipe-blue">
       <div class="container-fluid">
        <a class="navbar-brand" href="/">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="{{ url_for('fetch') }}" title="{{  _('Fetch') }}"><i class="fa fa-download" aria-hidden="true"></i>&nbsp;{{  _('Fetch') }}</a>
                        </li>
                    {% endif %}
                    <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;{{ _('Feeds') }}</a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownRSS" style="min-width: 300px;">
                              <a class="dropdown-item" href="{{ url_for('feeds.feeds') }}">{{ _('Feeds') }}</a>
                              <a class="dropdown-item" href="{{ url_for('feeds.inactives') }}">{{ _('Inactive') }}</a>
                              <a class="dropdown-item" href="{{ url_for('popular') }}">{{ _('Popular') }}</a>
                              <a class="dropdown-item" href="{{ url_for('articles.history') }}">{{ _('History') }}</a>
                              <div class="dropdown-divider"></div>
                              <a class="dropdown-item" href="{{ url_for('feed.form') }}">{{ _('Add a new feed') }}</a>
                              <form class="px-4 py-3" action="{{ url_for('feed.bookmarklet') }}">
                                <div class="input-group">
                                      <label class="sr-only" for="inlineFormInputGroupAPIKey">{{ _('Add a new feed') }}</label>
                                      <input class="form-control" name="url" type="url" placeholder="{{_('Site or feed url')}}" required="required"/>
                                      <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;{{ _('Categories') }}</a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownCategory" style="min-width: 250px;">
                            <a class="dropdown-item" href="{{ url_for('categories.list_') }}">{{ _('Categories') }}</a>
                            <div class="dropdown-divider"></div>
                            <a class="dropdown-item" href="{{ url_for('category.form') }}">{{ _('Add a new category') }}</a>
                            <form class="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 class="form-control" name="name" type="text" placeholder="{{_('Category name')}}" required="required"/>
                                    <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"><i class="fa fa-bookmark" aria-hidden="true"></i>&nbsp;{{ _('Bookmarks') }}</a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownBookmark">
                            <a class="dropdown-item" href="{{ url_for('bookmarks.list_') }}">{{ _('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="navbarDropdownSearch" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-search" aria-hidden="true"></i></i>&nbsp;{{ _('Search') }}</a>
                        <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownSearch" style="min-width: 300px;">
                            <form class="px-4 py-3" action="{{ url_for('home') }}" method="GET">
                                <div class="mb-3">
                                    <input class="form-control" name="query" type="text" placeholder="{{_('Query')}}" required="required"/>
                                </div>
                                <div class="mb-3">
                                    <input type="checkbox" class="form-check-input" id="checkTitle" name="search_title" checked>
                                    <label class="form-check-label" for="checkTitle">Search in title</label>
                                </div>
                                <div class="mb-3">
                                    <input type="checkbox" class="form-check-input" id="checkContent" name="search_content">
                                    <label class="form-check-label" for="checkContent">Search in content</label>
                                </div>
                                <button type="submit" class="btn btn-primary">OK</button>
                            </form>
                        </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 %}
      </div>
    </nav>
    {% endblock %}
    <br />

    <div class="container alert-message not-at-home">
    {% block messages %}
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                <div class="row justify-content-center">
                    <div class="col-md-6">
                        {% for category, message in messages %}
                            <div class="alert alert-{{category}}">
                                <button type="button" class="close" data-dismiss="alert">&times;</button>
                                {{ message }}
                            </div>
                        {% endfor %}
                    </div>
                </div>
            {% 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>