-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
delegate footer and header to components, implemented notification pa…
…ge, invoices page, offers page, delegate boiler code to the components
- Loading branch information
1 parent
4a93368
commit 41ca969
Showing
26 changed files
with
844 additions
and
1,073 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<% if english? %> | ||
<span class="o-io-icon auction_platform"></span><span class="u-hidden">IO</span> | ||
<% else %> | ||
<span class="o-po-icon auction_platform"></span><span class="u-hidden">PO</span> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module Common | ||
module AuctionTypeIcon | ||
class Component < ApplicationViewComponent | ||
attr_reader :auction | ||
|
||
def initialize(auction:) | ||
@auction = auction | ||
|
||
super | ||
end | ||
|
||
def english? | ||
auction.english? | ||
end | ||
end | ||
end | ||
end |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Common | ||
module Footer | ||
class Component < ApplicationViewComponent; end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
<header class="c-header"> | ||
<div class="c-header__menu"> | ||
<button class="c-header__toggle u-bg-blue-gradient js-nav-toggle hamburger hamburger--collapse"> | ||
<span class="hamburger-box"> | ||
<span class="hamburger-inner"></span> | ||
</span> | ||
<span>Avalik portaal</span> | ||
</button> | ||
</div> | ||
<div class="c-toolbar js-toolbar"> | ||
<div class="c-toolbar__grid"> | ||
<div class="c-toolbar__nav"> | ||
<ul class="s-toolbar-nav"> | ||
<li> | ||
<a href="#">Avalik portaal</a> | ||
<span class="o-arrow js-submenu-toggle"></span> | ||
<ul class="submenu"> | ||
<li> | ||
<a href="#">Info</a> | ||
<span class="o-arrow o-arrow--visible-on-desktop js-submenu-toggle"></span> | ||
<ul class="submenu"> | ||
<li> | ||
<a href="#">hell</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li class="is-active"> | ||
<a href="#">Oksjonikeskkond</a> | ||
<span class="o-arrow js-submenu-toggle"></span> | ||
|
||
<ul class="submenu"> | ||
<li> | ||
<%= link_to 'OKSJONID', root_path %> | ||
</li> | ||
<li> | ||
<a href="#">KASUTAJA KONTO</a> | ||
</li> | ||
<li> | ||
<%= link_to 'MINU ARVED', invoices_path %> | ||
</li> | ||
<li> | ||
<%= link_to 'MINU PAKKUMISED', offers_path %> | ||
</li> | ||
<li> | ||
<a href="#">Minu SOOVIDE NIMEKIRI</a> | ||
</li> | ||
<li class="c-toolbar__search js-search-toolbar"> | ||
<%= link_to notifications_path, class: 'c-toolbar__notice' do %> | ||
<svg width="12" height="16" viewBox="0 0 12 16" fill="white" | ||
xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M5.99986 15.3333C6.35348 15.3333 6.69262 15.1928 6.94267 14.9428C7.19272 14.6927 7.33319 14.3536 7.33319 14H4.66652C4.66652 14.3536 4.807 14.6927 5.05705 14.9428C5.3071 15.1928 5.64624 15.3333 5.99986 15.3333ZM0.666525 12.6666H11.3332C11.465 12.6666 11.5939 12.6275 11.7035 12.5542C11.8131 12.481 11.8985 12.3769 11.949 12.2551C11.9994 12.1333 12.0126 11.9992 11.9869 11.8699C11.9612 11.7406 11.8977 11.6219 11.8045 11.5286L10.6665 10.3906V6.66663C10.6644 5.54563 10.2591 4.46279 9.52477 3.61582C8.7904 2.76885 7.77591 2.21426 6.66652 2.05329V1.33329C6.66652 1.15648 6.59629 0.986912 6.47126 0.861888C6.34624 0.736864 6.17667 0.666626 5.99986 0.666626C5.82305 0.666626 5.65348 0.736864 5.52845 0.861888C5.40343 0.986912 5.33319 1.15648 5.33319 1.33329V2.05329C4.2238 2.21426 3.20932 2.76885 2.47495 3.61582C1.74059 4.46279 1.33534 5.54563 1.33319 6.66663V10.3906L0.195191 11.5286C0.101985 11.6219 0.038514 11.7406 0.0128023 11.8699C-0.0129094 11.9992 0.000292634 12.1333 0.0507393 12.2551C0.101186 12.3769 0.186612 12.481 0.296219 12.5542C0.405825 12.6275 0.534691 12.6666 0.666525 12.6666ZM2.47119 11.138C2.59622 11.013 2.66649 10.8434 2.66652 10.6666V6.66663C2.66652 5.78257 3.01771 4.93472 3.64284 4.3096C4.26796 3.68448 5.1158 3.33329 5.99986 3.33329C6.88391 3.33329 7.73176 3.68448 8.35688 4.3096C8.982 4.93472 9.33319 5.78257 9.33319 6.66663V10.6666C9.33323 10.8434 9.40349 11.013 9.52852 11.138L9.72386 11.3333H2.27586L2.47119 11.138Z"/> | ||
</svg> | ||
<span> | ||
Teavitused<sup>(2)</sup> | ||
</span> | ||
<% end %> | ||
</li> | ||
</ul> | ||
|
||
</li> | ||
<li> | ||
<a href="#">Registripidaja portaal</a> | ||
<span class="o-arrow js-submenu-toggle"></span> | ||
<ul class="submenu"> | ||
<li> | ||
<ul class="submenu"> | ||
<li> | ||
<a href="#">Hello</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li> | ||
<a href="#">Registreerija portaal</a> | ||
<span class="o-arrow js-submenu-toggle"></span> | ||
<ul class="submenu"> | ||
<li> | ||
<ul class="submenu"> | ||
<li> | ||
<a href="#">Submenu</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li> | ||
<a href="#">eeIDc-hero</a> | ||
<span class="o-arrow js-submenu-toggle"></span> | ||
<ul class="submenu"> | ||
<li> | ||
<ul class="submenu"> | ||
<li> | ||
<a href="#">Submenu</a> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="c-toolbar__socials"> | ||
<% if user_signed_in? %> | ||
<%= link_to destroy_user_session_path, class: "c-header__user", method: :delete, data: { 'turbo-method': 'delete' } do %> | ||
<svg width="10" height="12" viewBox="0 0 10 12" fill="white" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M6.85524 6.35494C7.34544 5.96927 7.70324 5.4404 7.87886 4.84191C8.05449 4.24342 8.0392 3.60507 7.83514 3.01567C7.63107 2.42628 7.24837 1.91514 6.74028 1.55337C6.23219 1.1916 5.62397 0.997192 5.00024 0.997192C4.37652 0.997192 3.7683 1.1916 3.26021 1.55337C2.75212 1.91514 2.36941 2.42628 2.16535 3.01567C1.96128 3.60507 1.946 4.24342 2.12162 4.84191C2.29725 5.4404 2.65505 5.96927 3.14524 6.35494C2.30528 6.69146 1.57239 7.24961 1.02469 7.9699C0.476991 8.69018 0.135024 9.54559 0.0352425 10.4449C0.0280198 10.5106 0.0338008 10.577 0.0522552 10.6405C0.0707096 10.7039 0.101476 10.7631 0.142798 10.8146C0.226252 10.9187 0.347634 10.9854 0.480243 10.9999C0.612851 11.0145 0.745822 10.9758 0.849905 10.8924C0.953988 10.8089 1.02066 10.6875 1.03524 10.5549C1.14503 9.57754 1.61109 8.67485 2.34435 8.01934C3.07762 7.36383 4.02669 7.00145 5.01024 7.00145C5.99379 7.00145 6.94287 7.36383 7.67613 8.01934C8.4094 8.67485 8.87545 9.57754 8.98524 10.5549C8.99884 10.6778 9.05746 10.7913 9.1498 10.8734C9.24213 10.9556 9.36163 11.0007 9.48524 10.9999H9.54024C9.67131 10.9849 9.79111 10.9186 9.87352 10.8156C9.95594 10.7125 9.9943 10.5811 9.98024 10.4499C9.87999 9.54804 9.53618 8.69043 8.98567 7.96904C8.43515 7.24765 7.6987 6.68968 6.85524 6.35494ZM5.00024 5.99994C4.60468 5.99994 4.218 5.88264 3.8891 5.66288C3.5602 5.44312 3.30386 5.13076 3.15248 4.76531C3.00111 4.39986 2.9615 3.99772 3.03867 3.60976C3.11584 3.2218 3.30632 2.86543 3.58603 2.58573C3.86573 2.30602 4.2221 2.11554 4.61006 2.03837C4.99802 1.9612 5.40016 2.00081 5.76561 2.15218C6.13106 2.30356 6.44342 2.5599 6.66318 2.8888C6.88294 3.2177 7.00024 3.60438 7.00024 3.99994C7.00024 4.53037 6.78953 5.03908 6.41446 5.41415C6.03938 5.78923 5.53068 5.99994 5.00024 5.99994Z"/> | ||
</svg> | ||
<%= t(:sign_out) %> | ||
<% end %> | ||
<% else %> | ||
<%= link_to new_user_session_path, class: "c-header__user" do %> | ||
<svg width="10" height="12" viewBox="0 0 10 12" fill="white" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M6.85524 6.35494C7.34544 5.96927 7.70324 5.4404 7.87886 4.84191C8.05449 4.24342 8.0392 3.60507 7.83514 3.01567C7.63107 2.42628 7.24837 1.91514 6.74028 1.55337C6.23219 1.1916 5.62397 0.997192 5.00024 0.997192C4.37652 0.997192 3.7683 1.1916 3.26021 1.55337C2.75212 1.91514 2.36941 2.42628 2.16535 3.01567C1.96128 3.60507 1.946 4.24342 2.12162 4.84191C2.29725 5.4404 2.65505 5.96927 3.14524 6.35494C2.30528 6.69146 1.57239 7.24961 1.02469 7.9699C0.476991 8.69018 0.135024 9.54559 0.0352425 10.4449C0.0280198 10.5106 0.0338008 10.577 0.0522552 10.6405C0.0707096 10.7039 0.101476 10.7631 0.142798 10.8146C0.226252 10.9187 0.347634 10.9854 0.480243 10.9999C0.612851 11.0145 0.745822 10.9758 0.849905 10.8924C0.953988 10.8089 1.02066 10.6875 1.03524 10.5549C1.14503 9.57754 1.61109 8.67485 2.34435 8.01934C3.07762 7.36383 4.02669 7.00145 5.01024 7.00145C5.99379 7.00145 6.94287 7.36383 7.67613 8.01934C8.4094 8.67485 8.87545 9.57754 8.98524 10.5549C8.99884 10.6778 9.05746 10.7913 9.1498 10.8734C9.24213 10.9556 9.36163 11.0007 9.48524 10.9999H9.54024C9.67131 10.9849 9.79111 10.9186 9.87352 10.8156C9.95594 10.7125 9.9943 10.5811 9.98024 10.4499C9.87999 9.54804 9.53618 8.69043 8.98567 7.96904C8.43515 7.24765 7.6987 6.68968 6.85524 6.35494ZM5.00024 5.99994C4.60468 5.99994 4.218 5.88264 3.8891 5.66288C3.5602 5.44312 3.30386 5.13076 3.15248 4.76531C3.00111 4.39986 2.9615 3.99772 3.03867 3.60976C3.11584 3.2218 3.30632 2.86543 3.58603 2.58573C3.86573 2.30602 4.2221 2.11554 4.61006 2.03837C4.99802 1.9612 5.40016 2.00081 5.76561 2.15218C6.13106 2.30356 6.44342 2.5599 6.66318 2.8888C6.88294 3.2177 7.00024 3.60438 7.00024 3.99994C7.00024 4.53037 6.78953 5.03908 6.41446 5.41415C6.03938 5.78923 5.53068 5.99994 5.00024 5.99994Z"/> | ||
</svg> | ||
<%= t(:sign_in) %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
<div class="c-toolbar__lang"> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="c-header__lang"> | ||
<div class="c-dropdown"> | ||
<span class="c-dropdown__label" onclick="this.parentNode.classList.toggle('is-open')"> | ||
<span class="c-dropdown__label__lang"> | ||
EST | ||
</span> | ||
<svg width="10" height="7" viewBox="0 0 10 7" fill="white" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M4.50581 5.82828L0.505807 1.82828C0.232439 1.55491 0.232439 1.11169 0.505807 0.838326C0.779174 0.564959 1.22239 0.564959 1.49576 0.838326L5.00078 4.34335L8.50581 0.838326C8.77917 0.564959 9.22239 0.564959 9.49576 0.838326C9.76912 1.11169 9.76912 1.55491 9.49576 1.82828L5.49576 5.82828C5.22239 6.10164 4.77917 6.10164 4.50581 5.82828Z"/> | ||
</svg> | ||
</span> | ||
<ul class="c-dropdown__list s-dropdown-list"> | ||
<%= languages %> | ||
</ul> | ||
</div> | ||
</div> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module Common | ||
module Header | ||
class Component < ApplicationViewComponent | ||
include Devise::Controllers::Helpers | ||
|
||
def languages | ||
l = %w[Est Eng].map do |lang| | ||
content_tag('li') do | ||
content_tag('a', lang, href: '#') | ||
end | ||
end | ||
|
||
safe_join(l) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="u-text-center u-mt-40"> | ||
<% if @pagy.pages > 1 %> | ||
<div class="dataTables_filter"> | ||
<%== pagy_nav(@pagy) %> | ||
</div> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Common | ||
module Pagy | ||
class Component < ApplicationViewComponent | ||
include PagyHelper | ||
|
||
attr_reader :pagy | ||
|
||
def initialize(pagy:) | ||
@pagy = pagy | ||
|
||
super | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<table class="js-table-dt dataTable no-footer"> | ||
<%= tag.table **@options do %> | ||
<thead> | ||
<tr> | ||
<%= table_header_generator %> | ||
</tr> | ||
</thead> | ||
|
||
<%= content %> | ||
</table> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
class NotificationsController < ApplicationController | ||
def index | ||
@notifications = current_user&.notifications&.limit(6) | ||
@notifications = current_user&.notifications | ||
|
||
@unread_notifications = @notifications&.unread | ||
@read_notifications = @notifications&.read | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.