philomena/lib/philomena_web/templates/layout/_header.html.slime

120 lines
5.8 KiB
Text
Raw Normal View History

2019-08-18 02:43:44 +02:00
header.header
.flex.flex--centered.flex--start-bunched.flex--maybe-wrap
.flex.flex--centered
#js-burger-toggle.hide-desktop
a.header__link href='#'
i.fa.fa-bars
a.header__link href='/'
i.fa.fw.favicon-home
span.fa__text.hide-limited-desktop.hide-mobile
' Philomena
a.header__link.hide-mobile href="/images/new" title="Upload"
i.fa.fa-upload
= form_for @conn, Routes.search_path(@conn, :index), [method: "get", class: "header__search flex flex--no-wrap flex--centered"], fn f ->
input.input.header__input.header__input--search#q name="q" title="For terms all required, separate with ',' or 'AND'; also supports 'OR' for optional terms and '-' or 'NOT' for negation. Search with a blank query for more options or click the ? for syntax help." value=@conn.params["q"] placeholder="Search" autocapitalize="none"
2019-08-18 02:43:44 +02:00
= if present?(@conn.params["sf"]) do
input type="hidden" name="sf" value=@conn.params["sf"]
= if present?(@conn.params["sd"]) do
input type="hidden" name="sd" value=@conn.params["sd"]
= if hides_images?(@conn) do
= select f, :del, [{"-D", ""}, {"+D", 1}, {"*D", "deleted"}, {"DO", "only"}], name: "del", class: "input header__input", autocomplete: "off"
button.header__search__button type="submit" title="Search"
2019-08-18 02:43:44 +02:00
i.fa-embedded--search
a.header__search__button href="/search/reverse" title="Search using an image"
i.fa-embedded--camera
a.header__search__button href="/pages/search_syntax" title="Search syntax help"
2019-08-18 02:43:44 +02:00
i.fa-embedded--help
.flex.flex--centered.flex--no-wrap.header__force-right
= if @current_user do
a.header__link href="/notifications" title="Notifications"
i.fa-embedded--notification>
2019-11-17 23:51:14 +01:00
span.js-notification-ticker.fa__text.header__counter data-notification-count=@notification_count = @notification_count
2019-08-18 02:43:44 +02:00
a.header__link href="/conversations" title="Conversations"
= if @conversation_count > 0 do
2019-11-17 19:57:28 +01:00
i.fa-embedded--unread-message>
span.fa-embedded__text.header__counter
= @conversation_count
- else
i.fa-embedded--message>
span.fa-embedded__text.header__counter.hidden
| 0
2019-08-18 02:43:44 +02:00
a.header__link.hide-mobile href="/filters" title="Filters"
i.fa.fa-filter
span.hide-limited-desktop< Filters
2019-11-17 20:47:01 +01:00
2019-11-17 23:51:14 +01:00
= form_for @user_changeset, Routes.filter_current_path(@conn, :update), [class: "header__filter-form", id: "filter-quick-form"], fn f ->
= select f, :current_filter_id, @available_filters, name: "id", id: "filter-quick-menu", class: "input header__input", data: [change_submit: "#filter-quick-form"], autocomplete: "off"
2019-11-17 20:47:01 +01:00
2019-11-17 23:51:14 +01:00
= form_for @user_changeset, Routes.filter_spoiler_type_path(@conn, :update), [class: "header__filter-form hide-mobile hide-limited-desktop", id: "spoiler-quick-form"], fn f ->
= select f, :spoiler_type, @spoiler_types, id: "spoiler-quick-menu", class: "input header__input", data: [change_submit: "#spoiler-quick-form"], autocomplete: "off"
2019-11-17 20:47:01 +01:00
2019-08-18 02:43:44 +02:00
.dropdown.header__dropdown
2019-11-30 03:36:16 +01:00
a.header__link.header__link-user href=Routes.profile_path(@conn, :show, @current_user)
2019-11-13 06:28:02 +01:00
= render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @current_user}, class: "avatar--28px"
2019-08-18 02:43:44 +02:00
span.header__link-user__dropdown-arrow.hide-mobile data-click-preventdefault="true"
nav.dropdown__content.dropdown__content-right.hide-mobile.js-burger-links
2019-11-30 03:36:16 +01:00
a.header__link href=Routes.profile_path(@conn, :show, @current_user)
2019-08-18 02:43:44 +02:00
= @current_user.name
a.header__link href='/search?q=my:watched'
i.fa.fa-fw.fa-eye>
| Watched
a.header__link href='/search?q=my:faves'
i.fa.fa-fw.fa-star>
| Faves
a.header__link href='/search?q=my:upvotes'
i.fa.fa-fw.fa-arrow-up>
| Upvotes
2019-12-05 05:35:43 +01:00
a.header__link href=Routes.gallery_path(@conn, :index, gallery: [creator: @current_user.name])
i.fa.fa-fw.fa-image>
| Galleries
2019-08-18 02:43:44 +02:00
a.header__link href='/search?q=my:uploads'
i.fa.fa-fw.fa-upload>
| Uploads
2019-12-01 02:06:08 +01:00
a.header__link href='/comments?cq=my:comments'
2019-08-18 02:43:44 +02:00
i.fa.fa-fw.fa-comments>
| Comments
2019-12-05 05:53:56 +01:00
a.header__link href="/posts?pq=my:posts"
2019-12-06 22:38:36 +01:00
i.fas.fa-fw.fa-pen-square>
2019-08-18 02:43:44 +02:00
| Posts
2019-12-10 02:21:49 +01:00
a.header__link href=Routes.profile_user_link_path(@conn, :index, @current_user)
2019-08-18 02:43:44 +02:00
i.fa.fa-fw.fa-link>
| Links
a.header__link href='/settings/edit'
i.fa.fa-fw.fa-cogs>
| Settings
a.header__link href="/conversations"
i.fa.fa-fw.fa-envelope>
| Messages
2019-11-15 16:32:26 +01:00
a.header__link href=Routes.pow_registration_path(@conn, :edit)
i.fa.fa-fw.fa-user>
| Account
2019-08-18 02:43:44 +02:00
a.header__link href="/session" data-method='delete'
2019-12-06 22:38:36 +01:00
i.fa.fa-fw.fa-sign-out-alt>
2019-08-18 02:43:44 +02:00
| Logout
- else
a.header__link.hide-mobile href="/filters"
2019-10-09 02:45:04 +02:00
| Filters (
= @current_filter.name
| )
2019-08-18 02:43:44 +02:00
span.js-burger-links.hide-mobile
a.header__link href='/settings/edit'
i.fa.fa-fw.fa-cogs.hide-desktop>
| Settings
a.header__link href="/registration/new"
| Register
a.header__link href="/session/new"
| Login
nav.header.header--secondary
.flex.flex--centered.flex--spaced-out.flex--wrap
= render PhilomenaWeb.LayoutView, "_header_navigation.html", assigns
2019-12-06 23:59:39 +01:00
= if !is_nil(@current_user) and @current_user.role != "user" do
2019-12-04 23:28:53 +01:00
= render PhilomenaWeb.LayoutView, "_header_staff_links.html", assigns