From c6a82ab5ce59b97b84da15d0377faeb0a6a8f2ca Mon Sep 17 00:00:00 2001 From: ciukstar Date: Sun, 1 Oct 2023 02:45:20 +0300 Subject: [PATCH] Filter by assignee --- messages/en.msg | 1 + messages/fr.msg | 1 + messages/ro.msg | 5 +- messages/ru.msg | 9 +- src/Demo/DemoDataEN.hs | 47 +++++---- src/Handler/Requests.hs | 121 ++++++++++++++++-------- src/Menu.hs | 2 +- src/Model.hs | 3 + templates/login.cassius | 2 + templates/login.hamlet | 10 +- templates/menu.hamlet | 3 +- templates/requests/request.hamlet | 17 ++-- templates/requests/requests.cassius | 2 + templates/requests/requests.hamlet | 34 ++++--- templates/requests/search/search.hamlet | 29 ++++-- 15 files changed, 189 insertions(+), 97 deletions(-) diff --git a/messages/en.msg b/messages/en.msg index 285dbf9..c379f18 100644 --- a/messages/en.msg +++ b/messages/en.msg @@ -1,3 +1,4 @@ +FromCoworkers: From coworkers DemoUserAccounts: Demo user accounts WithoutAssignee: Without assignee AssignedToMe: Assigned to me diff --git a/messages/fr.msg b/messages/fr.msg index 37c2673..38f2099 100644 --- a/messages/fr.msg +++ b/messages/fr.msg @@ -1,3 +1,4 @@ +FromCoworkers: Des collègues DemoUserAccounts: Comptes utilisateurs démo WithoutAssignee: Sans exécuteur AssignedToMe: Assigné à moi diff --git a/messages/ro.msg b/messages/ro.msg index a71cde9..1d2b52e 100644 --- a/messages/ro.msg +++ b/messages/ro.msg @@ -1,10 +1,11 @@ +FromCoworkers: De la colegi DemoUserAccounts: Conturi de utilizator Demo WithoutAssignee: Fără executor AssignedToMe: Atribuite mie Assignee: Desemnatul ShowAll: Arată tot Approve: Aprobă -Request: Solicitare +Request: Solicitare de programare LoginToSeeTheRequests: Vă rugăm să vă conectați pentru a vedea solicitările NoRequestsFound: Nu s-au găsit solicitări NoPendingRequestsYet: Nu există încă cereri de aprobare @@ -29,7 +30,7 @@ Nullify: Anulează Reschedule: Reprogramează Calendar: Calendar BookingCalendar: Calendar de rezervari -Requests: Solicitări +Requests: Solicitări de programare BookingRequests: Cereri de rezervare NoOffersYet: Nu există încă oferte ChoosePhoto: Alege foto diff --git a/messages/ru.msg b/messages/ru.msg index 27f1ca1..4d843db 100644 --- a/messages/ru.msg +++ b/messages/ru.msg @@ -1,10 +1,11 @@ +FromCoworkers: От коллег DemoUserAccounts: Демо-аккаунты WithoutAssignee: Без исполнителя AssignedToMe: Назначенные мне Assignee: Исполнитель ShowAll: Показать всё Approve: Утвердить -Request: Запрос +Request: Запрос на приём LoginToSeeTheRequests: Пожалуйста, войдите, чтобы увидеть запросы NoRequestsFound: Запросы не найдены NoPendingRequestsYet: Запросов на одобрение пока нет @@ -29,7 +30,7 @@ Nullify: Аннулировать Reschedule: Перенести Calendar: Календарь BookingCalendar: Календарь бронирования -Requests: Запросы +Requests: Запросы на приём BookingRequests: Запросы на бронирование NoOffersYet: Предложений пока нет ChoosePhoto: Выбрать фото @@ -61,7 +62,7 @@ CancelAppointment: Аннулировать Appointment: Запись NoAppointmentsYet: У вас еще нет записей LoginToSeeYourAppointments: Пожалуйста, войдите, чтобы увидеть ваши записи -MyAppointments: Мои записи +MyAppointments: Мои записи на приём Time: Время Day: День NotYourAccount: Не ваша учетная запись @@ -135,7 +136,7 @@ Ratings: Рейтинги Rating: Рейтинг AddRole: Добавить роль NoRolesYes: Ролей пока нет -BookAppointment: Записаться на прием +BookAppointment: Записаться на приём EmployeeAlreadyInTheList: Сотрудник уже в списке Mobile: Мобильный Phone: Телефон diff --git a/src/Demo/DemoDataEN.hs b/src/Demo/DemoDataEN.hs index 8336280..ac099b5 100644 --- a/src/Demo/DemoDataEN.hs +++ b/src/Demo/DemoDataEN.hs @@ -363,18 +363,18 @@ We will continue to offer the latest treatments, the most innovative techniques } insert_ $ Role { roleStaff = e1 - , roleService = s11 - , roleName = "Makeup artist" - , roleRating = Just 5 - } + , roleService = s11 + , roleName = "Makeup artist" + , roleRating = Just 5 + } - insert_ $ Offer { offerService = s11 - , offerName = "Price" - , offerPrice = 26 - , offerPrefix = Just "$" - , offerSuffix = Nothing - , offerDescr = Nothing - } + o111 <- insert $ Offer { offerService = s11 + , offerName = "Price" + , offerPrice = 26 + , offerPrefix = Just "$" + , offerSuffix = Nothing + , offerDescr = Nothing + } insert_ $ Thumbnail { thumbnailService = s11 , thumbnailPhoto = $(embedFile "static/img/men-haircuts.avif") @@ -452,13 +452,13 @@ We will continue to offer the latest treatments, the most innovative techniques , serviceGroup = Just s1 } - insert_ $ Offer { offerService = s14 - , offerName = "Price" - , offerPrice = 16 - , offerPrefix = Just "$" - , offerSuffix = Just "-$20 (depending on the length of their hair)" - , offerDescr = Nothing - } + o141 <- insert $ Offer { offerService = s14 + , offerName = "Price" + , offerPrice = 16 + , offerPrefix = Just "$" + , offerSuffix = Just "-$20 (depending on the length of their hair)" + , offerDescr = Nothing + } insert_ $ Thumbnail { thumbnailService = s14 , thumbnailPhoto = $(embedFile "static/img/children-hair-cuts.avif") @@ -1001,7 +1001,7 @@ We will continue to offer the latest treatments, the most innovative techniques , bookStatus = BookStatusRequest } - insert_ $ Book { bookOffer = o121 + insert_ $ Book { bookOffer = o111 , bookRole = Just r51511 , bookUser = u2 , bookDay = addDays 2 today @@ -1010,6 +1010,15 @@ We will continue to offer the latest treatments, the most innovative techniques , bookStatus = BookStatusRequest } + insert_ $ Book { bookOffer = o141 + , bookRole = Nothing + , bookUser = u2 + , bookDay = addDays 3 today + , bookTime = time + , bookTz = utc + , bookStatus = BookStatusRequest + } + return () where duration :: String -> Maybe DiffTime diff --git a/src/Handler/Requests.hs b/src/Handler/Requests.hs index ce8abd3..5b5b818 100644 --- a/src/Handler/Requests.hs +++ b/src/Handler/Requests.hs @@ -22,9 +22,10 @@ import Yesod.Core ) import Yesod.Core.Widget (setTitleI) import Yesod.Auth ( Route(LoginR, LogoutR), maybeAuth ) -import Yesod.Form.Fields (Textarea(unTextarea, Textarea), searchField) +import Yesod.Form.Fields (Textarea(unTextarea, Textarea), searchField, intField) import Yesod.Form.Types (MForm, FormResult (FormSuccess)) import Yesod.Form.Functions (generateFormPost) +import Yesod.Form.Input (runInputGet, iopt) import Settings (widgetFile) import Foundation @@ -44,15 +45,17 @@ import Foundation , MsgService, MsgMeetingTime, MsgAcquaintance, MsgAppoinmentStatus , MsgDuration, MsgApprove, MsgNoPendingRequestsYet, MsgShowAll , MsgAssignedToMe, MsgWithoutAssignee, MsgSearch, MsgNoRequestsFound + , MsgFromCoworkers ) ) import Database.Persist (Entity (Entity)) +import Database.Persist.Sql (fromSqlKey, toSqlKey) import Yesod.Persist.Core (YesodPersist(runDB)) import Database.Esqueleto.Experimental ( select, from, table, innerJoin, leftJoin, on, where_, val - , (:&)((:&)), (==.), (^.), (?.), (%), (++.), (||.) - , orderBy, desc, just, selectOne, valList, in_, upper_, like + , (:&)((:&)), (==.), (^.), (?.), (%), (++.), (||.), (&&.) + , orderBy, desc, just, selectOne, valList, in_, upper_, like, isNothing_, not_ ) import Model @@ -62,24 +65,23 @@ import Model ( BookStatusRequest, BookStatusApproved, BookStatusCancelled , BookStatusPaid ) + , Assignees (AssigneesMe, AssigneesNone, AssigneesOthers) , EntityField ( BookOffer, OfferId, OfferService, ServiceId, BookDay, BookTime , BookRole, RoleId, RoleStaff, StaffId, StaffUser, ContentsSection, BookId , ThumbnailService, BookUser, UserId, BookStatus, ServiceName, ServiceDescr , ServiceOverview, RoleName, OfferName, OfferPrefix, OfferSuffix, OfferDescr - , StaffName, StaffPhone, StaffMobile, StaffEmail, UserName, UserFullName, UserEmail + , StaffName, StaffPhone, StaffMobile, StaffEmail, UserName, UserFullName + , UserEmail ) ) import Menu (menu) import Handler.Contacts (section) -import Yesod.Form.Input (runInputGet, iopt) getRequestsSearchR :: Handler Html getRequestsSearchR = do - q <- runInputGet $ iopt (searchField True) "q" - stati <- filter ((== "status") . fst) . reqGetParams <$> getRequest user <- maybeAuth setUltDestCurrent msgs <- getMessages @@ -90,41 +92,57 @@ getRequestsSearchR = do Just (Entity uid _) -> do formSearch <- newIdent dlgStatusList <- newIdent - let statusList = [ (BookStatusRequest, MsgRequest) - , (BookStatusApproved, MsgApproved) - , (BookStatusCancelled, MsgCancelled) - , (BookStatusPaid, MsgPaid) - ] + q <- runInputGet $ iopt (searchField True) "q" + stati <- filter ((== "status") . fst) . reqGetParams <$> getRequest let states = mapMaybe (readMaybe . unpack . snd) stati + owners <- filter ((== "assignee") . fst) . reqGetParams <$> getRequest + let assignees = mapMaybe (readMaybe . unpack . snd) owners dlgAssignee <- newIdent requests <- runDB $ select $ do x :& o :& s :& r :& e :& c <- from $ table @Book `innerJoin` table @Offer `on` (\(x :& o) -> x ^. BookOffer ==. o ^. OfferId) `innerJoin` table @Service `on` (\(_ :& o :& s) -> o ^. OfferService ==. s ^. ServiceId) - `innerJoin` table @Role `on` (\(x :& _ :& _ :& r) -> x ^. BookRole ==. just (r ^. RoleId)) - `innerJoin` table @Staff `on` (\(_ :& _ :& _ :& r :& e) -> r ^. RoleStaff ==. e ^. StaffId) - `innerJoin` table @User `on` (\(_ :& _ :& _ :& _ :& e :& c) -> e ^. StaffUser ==. just (c ^. UserId)) - where_ $ e ^. StaffUser ==. just (val uid) + `leftJoin` table @Role `on` (\(x :& _ :& _ :& r) -> x ^. BookRole ==. r ?. RoleId) + `leftJoin` table @Staff `on` (\(_ :& _ :& _ :& r :& e) -> r ?. RoleStaff ==. e ?. StaffId) + `leftJoin` table @User `on` (\(_ :& _ :& _ :& _ :& e :& c) -> e ?. StaffUser ==. just (c ?. UserId)) + case q of Just query -> where_ $ (upper_ (s ^. ServiceName) `like` ((%) ++. upper_ (val query) ++. (%))) ||. (upper_ (s ^. ServiceOverview) `like` ((%) ++. upper_ (just (val query)) ++. (%))) ||. (upper_ (s ^. ServiceDescr) `like` ((%) ++. upper_ (just (val (Textarea query))) ++. (%))) - ||. (upper_ (r ^. RoleName) `like` ((%) ++. upper_ (val query) ++. (%))) + ||. (upper_ (r ?. RoleName) `like` ((%) ++. upper_ (just (val query)) ++. (%))) ||. (upper_ (o ^. OfferName) `like` ((%) ++. upper_ (val query) ++. (%))) ||. (upper_ (o ^. OfferPrefix) `like` ((%) ++. upper_ (just (val query)) ++. (%))) ||. (upper_ (o ^. OfferSuffix) `like` ((%) ++. upper_ (just (val query)) ++. (%))) ||. (upper_ (o ^. OfferDescr) `like` ((%) ++. upper_ (just (val (Textarea query))) ++. (%))) - ||. (upper_ (e ^. StaffName) `like` ((%) ++. upper_ (val query) ++. (%))) - ||. (upper_ (e ^. StaffPhone) `like` ((%) ++. upper_ (just (val query)) ++. (%))) - ||. (upper_ (e ^. StaffMobile) `like` ((%) ++. upper_ (just (val query)) ++. (%))) - ||. (upper_ (e ^. StaffEmail) `like` ((%) ++. upper_ (just (val query)) ++. (%))) - ||. (upper_ (c ^. UserName) `like` ((%) ++. upper_ (val query) ++. (%))) - ||. (upper_ (c ^. UserFullName) `like` ((%) ++. upper_ (just (val query)) ++. (%))) - ||. (upper_ (c ^. UserEmail) `like` ((%) ++. upper_ (just (val query)) ++. (%))) + ||. (upper_ (e ?. StaffName) `like` ((%) ++. upper_ (just (val query)) ++. (%))) + ||. (upper_ (e ?. StaffPhone) `like` ((%) ++. upper_ (just (just (val query))) ++. (%))) + ||. (upper_ (e ?. StaffMobile) `like` ((%) ++. upper_ (just (just (val query))) ++. (%))) + ||. (upper_ (e ?. StaffEmail) `like` ((%) ++. upper_ (just (just (val query))) ++. (%))) + ||. (upper_ (c ?. UserName) `like` ((%) ++. upper_ (just (val query)) ++. (%))) + ||. (upper_ (c ?. UserFullName) `like` ((%) ++. upper_ (just (just (val query))) ++. (%))) + ||. (upper_ (c ?. UserEmail) `like` ((%) ++. upper_ (just (just (val query))) ++. (%))) Nothing -> return () + case states of [] -> return () xs -> where_ $ x ^. BookStatus `in_` valList xs + + let ors = [ ( AssigneesMe `elem` assignees + , e ?. StaffUser ==. just (just (val uid)) + ) + , ( AssigneesNone `elem` assignees + , isNothing_ $ e ?. StaffUser + ) + , ( AssigneesOthers `elem` assignees + , not_ (isNothing_ $ e ?. StaffUser) &&. not_ (e ?. StaffUser ==. just (just (val uid))) + ) + ] + + case snd <$> filter fst ors of + [] -> return () + xs -> where_ $ foldr (||.) (val False) xs + orderBy [desc (x ^. BookDay), desc (x ^. BookTime)] return (x,s) defaultLayout $ do @@ -134,10 +152,9 @@ getRequestsSearchR = do getRequestR :: BookId -> Handler Html getRequestR bid = do - stati <- filter ((== "status") . fst) . reqGetParams <$> getRequest + stati <- reqGetParams <$> getRequest app <- getYesod langs <- languages - user <- maybeAuth location <- runDB $ selectOne $ do x <- from $ table @Contents where_ $ x ^. ContentsSection ==. val section @@ -147,13 +164,10 @@ getRequestR bid = do `innerJoin` table @Offer `on` (\(x :& o) -> x ^. BookOffer ==. o ^. OfferId) `innerJoin` table @Service `on` (\(_ :& o :& s) -> o ^. OfferService ==. s ^. ServiceId) `leftJoin` table @Thumbnail `on` (\(_ :& _ :& s :& t) -> just (s ^. ServiceId) ==. t ?. ThumbnailService) - `innerJoin` table @Role `on` (\(x :& _ :& _ :& _ :& r) -> x ^. BookRole ==. just (r ^. RoleId)) - `innerJoin` table @Staff `on` (\(_ :& _ :& _ :& _ :& r :& e) -> r ^. RoleStaff ==. e ^. StaffId) + `leftJoin` table @Role `on` (\(x :& _ :& _ :& _ :& r) -> x ^. BookRole ==. r ?. RoleId) + `leftJoin` table @Staff `on` (\(_ :& _ :& _ :& _ :& r :& e) -> r ?. RoleStaff ==. e ?. StaffId) `innerJoin` table @User `on` (\(x :& _ :& _ :& _ :& _ :& _ :& c) -> x ^. BookUser ==. c ^. UserId) where_ $ x ^. BookId ==. val bid - case user of - Just (Entity uid _) -> where_ $ e ^. StaffUser ==. just (val uid) - Nothing -> where_ $ val False return (x,o,s,t,r,e,c) msgs <- getMessages (fw,et) <- generateFormPost formCancel @@ -168,6 +182,7 @@ formCancel extra = return (FormSuccess (),[whamlet|#{extra}|]) getRequestsR :: Handler Html getRequestsR = do + mbid <- (toSqlKey <$>) <$> runInputGet (iopt intField "bid") stati <- filter ((== "status") . fst) . reqGetParams <$> getRequest user <- maybeAuth setUltDestCurrent @@ -177,24 +192,38 @@ getRequestsR = do setTitleI MsgLogin $(widgetFile "requests/login") Just (Entity uid _) -> do + formSearch <- newIdent dlgStatusList <- newIdent - let statusList = [ (BookStatusRequest, MsgRequest) - , (BookStatusApproved, MsgApproved) - , (BookStatusCancelled, MsgCancelled) - , (BookStatusPaid, MsgPaid) - ] let states = mapMaybe (readMaybe . unpack . snd) stati + owners <- filter ((== "assignee") . fst) . reqGetParams <$> getRequest + let assignees = mapMaybe (readMaybe . unpack . snd) owners dlgAssignee <- newIdent requests <- runDB $ select $ do x :& _ :& s :& _ :& e <- from $ table @Book `innerJoin` table @Offer `on` (\(x :& o) -> x ^. BookOffer ==. o ^. OfferId) `innerJoin` table @Service `on` (\(_ :& o :& s) -> o ^. OfferService ==. s ^. ServiceId) - `innerJoin` table @Role `on` (\(x :& _ :& _ :& r) -> x ^. BookRole ==. just (r ^. RoleId)) - `innerJoin` table @Staff `on` (\(_ :& _ :& _ :& r :& e) -> r ^. RoleStaff ==. e ^. StaffId) - where_ $ e ^. StaffUser ==. just (val uid) + `leftJoin` table @Role `on` (\(x :& _ :& _ :& r) -> x ^. BookRole ==. r ?. RoleId) + `leftJoin` table @Staff `on` (\(_ :& _ :& _ :& r :& e) -> r ?. RoleStaff ==. e ?. StaffId) + case states of [] -> return () xs -> where_ $ x ^. BookStatus `in_` valList xs + + let ors = [ ( AssigneesMe `elem` assignees + , e ?. StaffUser ==. just (just (val uid)) + ) + , ( AssigneesNone `elem` assignees + , isNothing_ $ e ?. StaffUser + ) + , ( AssigneesOthers `elem` assignees + , not_ (isNothing_ $ e ?. StaffUser) &&. not_ (e ?. StaffUser ==. just (just (val uid))) + ) + ] + + case snd <$> filter fst ors of + [] -> return () + xs -> where_ $ foldr (||.) (val False) xs + orderBy [desc (x ^. BookDay), desc (x ^. BookTime)] return (x,s) defaultLayout $ do @@ -202,6 +231,20 @@ getRequestsR = do $(widgetFile "requests/requests") +statusList :: [(BookStatus, AppMessage)] +statusList = [ (BookStatusRequest, MsgRequest) + , (BookStatusApproved, MsgApproved) + , (BookStatusCancelled, MsgCancelled) + , (BookStatusPaid, MsgPaid) + ] + +assigneeList :: [(Assignees, AppMessage)] +assigneeList = [ (AssigneesMe,MsgAssignedToMe) + , (AssigneesNone,MsgWithoutAssignee) + , (AssigneesOthers,MsgFromCoworkers) + ] + + resolve :: BookStatus -> (Text, Text, AppMessage) resolve BookStatusRequest = ("orange", "hourglass_top", MsgAwaitingApproval) resolve BookStatusApproved = ("green", "verified", MsgApproved) diff --git a/src/Menu.hs b/src/Menu.hs index 6365af3..605f828 100644 --- a/src/Menu.hs +++ b/src/Menu.hs @@ -23,7 +23,7 @@ import Foundation ) ) -import Model (BookStatus (BookStatusRequest), Services (Services)) +import Model (BookStatus (BookStatusRequest), Services (Services), Assignees (AssigneesMe)) import Settings (widgetFile) import Settings.StaticFiles (img_salon_svg) diff --git a/src/Model.hs b/src/Model.hs index 02cd077..021952f 100644 --- a/src/Model.hs +++ b/src/Model.hs @@ -56,6 +56,9 @@ import Database.Persist.Sql (fromSqlKey, toSqlKey, PersistFieldSql, sqlType) data ServiceStatus = ServiceStatusPulished | ServiceStatusUnpublished deriving (Show, Read, Eq) +data Assignees = AssigneesMe | AssigneesNone | AssigneesOthers + deriving (Show, Read, Eq) + data BookStatus = BookStatusRequest | BookStatusApproved | BookStatusCancelled diff --git a/templates/login.cassius b/templates/login.cassius index 5c6e01c..10bf6b2 100644 --- a/templates/login.cassius +++ b/templates/login.cassius @@ -13,6 +13,8 @@ main .mdc-text-field input.mdc-text-field__input caret-color: var(--mdc-theme-text-primary-on-background) + #btnLogin + margin: 1rem 0 #createAccount margin-top: 2rem diff --git a/templates/login.hamlet b/templates/login.hamlet index bfe4d67..808c7ac 100644 --- a/templates/login.hamlet +++ b/templates/login.hamlet @@ -35,13 +35,19 @@ demography - + _{MsgPassword} + + + + demography - + _{MsgLogin} diff --git a/templates/menu.hamlet b/templates/menu.hamlet index 3bf519c..34491b1 100644 --- a/templates/menu.hamlet +++ b/templates/menu.hamlet @@ -45,7 +45,8 @@ pending_actions _{MsgMyAppointments} - diff --git a/templates/requests/request.hamlet b/templates/requests/request.hamlet index b440b0b..6fc4239 100644 --- a/templates/requests/request.hamlet +++ b/templates/requests/request.hamlet @@ -1,12 +1,13 @@ - - - - arrow_back - - _{MsgRequest} + $with stati <- stati ++ [("bid",pack $ show $ fromSqlKey bid)] + + + + arrow_back + + _{MsgRequest} @@ -94,7 +95,7 @@ #{show date} #{show time} - $with Entity eid (Staff ename _ _ _ _ _) <- staff + $maybe Entity eid (Staff ename _ _ _ _ _) <- staff @@ -113,7 +114,7 @@ style="clip-path:circle(50%)">
#{ename} - $with Entity _ (Role _ _ rname _) <- role + $maybe Entity _ (Role _ _ rname _) <- role
(#{rname}) diff --git a/templates/requests/requests.cassius b/templates/requests/requests.cassius index 2db94f2..769b146 100644 --- a/templates/requests/requests.cassius +++ b/templates/requests/requests.cassius @@ -13,6 +13,8 @@ main white-space: nowrap overflow: hidden text-overflow: ellipsis + .mdc-list-item--activated .mdc-list-item__primary-text + color: var(--theme-accent) div.mdc-dialog div.mdc-dialog__content diff --git a/templates/requests/requests.hamlet b/templates/requests/requests.hamlet index ffe677c..815b9a8 100644 --- a/templates/requests/requests.hamlet +++ b/templates/requests/requests.hamlet @@ -1,3 +1,5 @@ +
+ ^{menu} @@ -10,7 +12,7 @@ _{MsgRequests} - + search @@ -30,25 +32,34 @@
_{MsgStatus} - arrow_drop_down + $if null states + arrow_drop_down + $else + counter_#{show (length states)} _{MsgAssignee} - arrow_drop_down + $if null assignees + arrow_drop_down + $else + counter_#{show (length assignees)} $if null requests

_{MsgNoPendingRequestsYet}. - + _{MsgShowAll} @@ -56,7 +67,8 @@ $forall (Entity bid (Book _ _ _ date time _ status),Entity _ (Service sname _ _ _ _ _)) <- requests $with (color,icon,msg) <- resolve status - @@ -97,7 +109,7 @@ $forall (_,msg) <- msgs + name=status value=#{ident} form=#{formSearch} :elem status states:checked> @@ -112,7 +124,7 @@ $forall (_,msg) <- msgs _{MsgCancel} - + _{MsgSelect} @@ -129,12 +141,12 @@ $forall (_,msg) <- msgs close - $forall (assignee,label) <- [("me",MsgAssignedToMe),("none",MsgWithoutAssignee)] - $with ident <- pack assignee + $forall (assignee,label) <- assigneeList + $with ident <- pack (show assignee) + name=assignee value=#{ident} form=#{formSearch} :elem assignee assignees:checked> @@ -149,7 +161,7 @@ $forall (_,msg) <- msgs _{MsgCancel} - + _{MsgSelect} diff --git a/templates/requests/search/search.hamlet b/templates/requests/search/search.hamlet index 9a98f09..0a111b7 100644 --- a/templates/requests/search/search.hamlet +++ b/templates/requests/search/search.hamlet @@ -6,7 +6,8 @@ .mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon #labelSearch> - + arrow_back @@ -27,18 +28,26 @@

_{MsgStatus} - arrow_drop_down + $if null states + arrow_drop_down + $else + counter_#{show (length states)} _{MsgAssignee} - arrow_drop_down + $if null assignees + arrow_drop_down + $else + counter_#{show (length assignees)} $if null requests
@@ -53,7 +62,7 @@ $forall (Entity bid (Book _ _ _ date time _ status),Entity _ (Service sname _ _ _ _ _)) <- requests $with (color,icon,msg) <- resolve status - @@ -94,7 +103,7 @@ $forall (_,msg) <- msgs + name=status value=#{ident} form=#{formSearch} :elem status states:checked> @@ -109,7 +118,7 @@ $forall (_,msg) <- msgs _{MsgCancel} - + _{MsgSelect} @@ -126,12 +135,12 @@ $forall (_,msg) <- msgs close - $forall (assignee,label) <- [("me",MsgAssignedToMe),("none",MsgWithoutAssignee)] - $with ident <- pack assignee + $forall (assignee,label) <- assigneeList + $with ident <- pack (show assignee) + name=assignee value=#{ident} form=#{formSearch} :elem assignee assignees:checked> @@ -146,7 +155,7 @@ $forall (_,msg) <- msgs _{MsgCancel} - + _{MsgSelect}