Commit 13fdc40a authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FOREST][DESIGN] Icons/Box.

parent 5874a9d6
...@@ -35,7 +35,7 @@ plus :: R2.Setter Boolean -> R.Element ...@@ -35,7 +35,7 @@ plus :: R2.Setter Boolean -> R.Element
plus showLogin = plus showLogin =
H.button {on: {click}} H.button {on: {click}}
[ H.div { "type": "" [ H.div { "type": ""
, className: "fa fa-plus-circle fa-2x" , className: "fa fa-plus-circle fa-lg"
--, className: "glyphicon glyphicon-plus" --, className: "glyphicon glyphicon-plus"
} [H.text "Login"] ] } [H.text "Login"] ]
-- TODO same as the one in the Login Modal (same CSS) -- TODO same as the one in the Login Modal (same CSS)
......
...@@ -5,6 +5,7 @@ import Effect.Aff (Aff, launchAff, runAff) ...@@ -5,6 +5,7 @@ import Effect.Aff (Aff, launchAff, runAff)
import Effect.Uncurried (mkEffectFn1) import Effect.Uncurried (mkEffectFn1)
import FFI.Simple ((..)) import FFI.Simple ((..))
import Gargantext.Components.Forest.Tree.Node.Action import Gargantext.Components.Forest.Tree.Node.Action
import Gargantext.Types (NodeType(..))
import Prelude hiding (div) import Prelude hiding (div)
import Reactix as R import Reactix as R
import Reactix.DOM.HTML as H import Reactix.DOM.HTML as H
...@@ -12,13 +13,14 @@ import Reactix.DOM.HTML as H ...@@ -12,13 +13,14 @@ import Reactix.DOM.HTML as H
-- | START Rename Box -- | START Rename Box
type RenameBoxProps = type RenameBoxProps =
( id :: ID ( id :: ID
, name :: Name) , name :: Name
, nodeType :: NodeType)
renameBox :: (Action -> Aff Unit) -> Record RenameBoxProps -> R.State Boolean -> R.Element renameBox :: (Action -> Aff Unit) -> Record RenameBoxProps -> R.State Boolean -> R.Element
renameBox d p (true /\ setRenameBoxOpen) = R.createElement el p [] renameBox d p (true /\ setRenameBoxOpen) = R.createElement el p []
where where
el = R.hooksComponent "RenameBox" cpt el = R.hooksComponent "RenameBox" cpt
cpt {id, name} _ = do cpt {id, name, nodeType} _ = do
renameNodeName <- R.useState' name renameNodeName <- R.useState' name
pure $ H.div {className: "from-group row-no-padding"} pure $ H.div {className: "from-group row-no-padding"}
[ renameInput renameNodeName [ renameInput renameNodeName
......
...@@ -20,7 +20,7 @@ import Gargantext.Ends (Frontends, url) ...@@ -20,7 +20,7 @@ import Gargantext.Ends (Frontends, url)
import Gargantext.Routes (AppRoute, SessionRoute(..)) import Gargantext.Routes (AppRoute, SessionRoute(..))
import Gargantext.Routes as Routes import Gargantext.Routes as Routes
import Gargantext.Sessions (Session, sessionId, get, put, post, postWwwUrlencoded, delete) import Gargantext.Sessions (Session, sessionId, get, put, post, postWwwUrlencoded, delete)
import Gargantext.Types (class ToQuery, toQuery, NodeType(..), NodePath(..), readNodeType) import Gargantext.Types (class ToQuery, toQuery, NodeType(..), NodePath(..), readNodeType, fldr)
import Gargantext.Utils (id, glyphicon, glyphiconActive) import Gargantext.Utils (id, glyphicon, glyphiconActive)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
import Partial.Unsafe (unsafePartial) import Partial.Unsafe (unsafePartial)
...@@ -125,30 +125,6 @@ nodeMainSpan d p folderOpen session frontends = R.createElement el p [] ...@@ -125,30 +125,6 @@ nodeMainSpan d p folderOpen session frontends = R.createElement el p []
setIsDragOver $ const true setIsDragOver $ const true
onDragLeave (_ /\ setIsDragOver) _ = setIsDragOver $ const false onDragLeave (_ /\ setIsDragOver) _ = setIsDragOver $ const false
fldr :: NodeType -> Boolean -> String
fldr NodeUser false = "fa fa-user-circle"
fldr NodeUser true = "fa fa-user-circle-o"
fldr FolderPrivate true = "fa fa-lock"
fldr FolderPrivate false = "fa fa-expeditedssl"
fldr FolderShared true = "fa fa-users" -- "fa fa-share-alt"
fldr FolderShared false = "fa fa-share-alt-square"
fldr FolderPublic _ = "fa fa-globe"
fldr Corpus true = "fa fa-sun-o" -- "fa fa-snowflake-o"
fldr Corpus false = "fa fa-sun" -- "fa fa-snowflake-o"
fldr Graph _ = "fa fa-hubzilla"
fldr Texts _ = "fa fa-newspaper-o"
fldr Dashboard _ = "fa fa-signal"
fldr NodeList _ = "fa fa-list"
fldr _ false = "fa fa-folder"
fldr _ true = "fa fa-folder-o"
{- {-
fldr nt open = if open fldr nt open = if open
then "fa fa-globe" -- <> color nt then "fa fa-globe" -- <> color nt
...@@ -213,7 +189,13 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [ ...@@ -213,7 +189,13 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [
, boxShadow : "0 2px 5px rgba(0,0,0,0.2)" , boxShadow : "0 2px 5px rgba(0,0,0,0.2)"
} }
} }
[ panelHeading renameBoxOpen [ H.div {className: ""}
[ H.div { className : "col-md-11"}
[ H.h3 { className: fldr nodeType true}
[ H.text $ show nodeType]
]
]
, panelHeading renameBoxOpen
, panelBody nodePopupState d , panelBody nodePopupState d
, if isJust nodePopup.action , if isJust nodePopup.action
then H.div { className: glyphicon "remove-circle" then H.div { className: glyphicon "remove-circle"
...@@ -237,7 +219,8 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [ ...@@ -237,7 +219,8 @@ nodePopupView d p mPop@(Just NodePopup /\ setPopupOpen) = R.createElement el p [
H.div {className: "panel-heading"} H.div {className: "panel-heading"}
[ -- H.h1 {className : "col-md-12"} [H.text "Settings Box"] [ -- H.h1 {className : "col-md-12"} [H.text "Settings Box"]
H.div {className: "row" } H.div {className: "row" }
[ H.div {className: "col-md-8"} [ renameBox d {id, name} renameBoxOpen ] [
H.div {className: "col-md-8"} [ renameBox d {id, name, nodeType} renameBoxOpen ]
, if edit then editIcon renameBoxOpen else H.div {} [] , if edit then editIcon renameBoxOpen else H.div {} []
, H.div {className: "col-md-1"} , H.div {className: "col-md-1"}
[ H.a { "type" : "button" [ H.a { "type" : "button"
......
...@@ -347,7 +347,8 @@ docViewSpec = simpleSpec performAction render ...@@ -347,7 +347,8 @@ docViewSpec = simpleSpec performAction render
docViewClass :: ReactClass { children :: Children docViewClass :: ReactClass { children :: Children
, loaded :: LoadedData , loaded :: LoadedData
, path :: DocPath } , path :: DocPath
}
docViewClass = createClass "DocumentView" docViewSpec initialState docViewClass = createClass "DocumentView" docViewSpec initialState
type LayoutProps = ( session :: Session, nodeId :: Int, listId :: Int, corpusId :: Maybe Int ) type LayoutProps = ( session :: Session, nodeId :: Int, listId :: Int, corpusId :: Maybe Int )
......
...@@ -40,15 +40,15 @@ instance showLangs :: Show Langs where ...@@ -40,15 +40,15 @@ instance showLangs :: Show Langs where
show EN = "EN" show EN = "EN"
instance showDatabase :: Show Database where instance showDatabase :: Show Database where
show All = "All" show All = "In Gargantext"
show PubMed = "PubMed" show PubMed = "PubMed"
show HAL_EN = "HAL_" <> show EN show HAL_EN = "HAL_" <> show EN
show HAL_FR = "HAL_" <> show FR show HAL_FR = "HAL_" <> show FR
show IsTex_EN = "IsTex_" <> show EN show IsTex_EN = "IsTex_" <> show EN
show IsTex_FR = "IsTex_" <> show FR show IsTex_FR = "IsTex_" <> show FR
show Isidore_EN = "Isidore_" <> show EN show Isidore_EN = "Isidore_" <> show EN
show Isidore_FR = "Isidore_" <> show FR show Isidore_FR = "Isidore_" <> show FR
......
...@@ -189,6 +189,42 @@ readNodeType "Team" = Team ...@@ -189,6 +189,42 @@ readNodeType "Team" = Team
readNodeType "NodeList" = NodeList readNodeType "NodeList" = NodeList
readNodeType "NodeTexts" = Texts readNodeType "NodeTexts" = Texts
readNodeType _ = Error readNodeType _ = Error
fldr :: NodeType -> Boolean -> String
fldr NodeUser false = "fa fa-user-circle"
fldr NodeUser true = "fa fa-user-circle-o"
fldr FolderPrivate true = "fa fa-lock"
fldr FolderPrivate false = "fa fa-expeditedssl"
fldr FolderShared true = "fa fa-users" -- "fa fa-share-alt"
fldr FolderShared false = "fa fa-share-alt-square"
fldr FolderPublic _ = "fa fa-globe"
fldr Corpus _ = "fa fa-book" -- "fa fa-snowflake-o"
fldr Phylo _ = "fa fa-code-fork"
fldr Graph _ = "fa fa-hubzilla"
fldr Texts _ = "fa fa-newspaper-o"
fldr Dashboard _ = "fa fa-signal"
fldr NodeList _ = "fa fa-list"
fldr Annuaire true = "fa fa-address-book-o"
fldr Annuaire false = "fa fa-address-book"
fldr NodeContact true = "fa fa-address-card-o"
fldr NodeContact false = "fa fa-address-card"
fldr _ false = "fa fa-folder"
fldr _ true = "fa fa-folder-o"
{- {-
------------------------------------------------------------ ------------------------------------------------------------
instance ordNodeType :: Ord NodeType where instance ordNodeType :: Ord NodeType where
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<title>CNRS GarganText</title> <title>CNRS GarganText</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--<link href="https://use.fontawesome.com/releases/v5.0.8/styles/all.css" rel="stylesheet">--> <!--<link href="https://use.fontawesome.com/releases/v5.0.8/styles/all.css" rel="stylesheet">-->
<link rel="stylesheet" href="icons/fork-awesome/css/fork-awesome.css"> <!--<link rel="stylesheet" href="icons/fork-awesome/css/fork-awesome.css">-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/fork-awesome@1.1.7/css/fork-awesome.min.css" integrity="sha256-gsmEoJAws/Kd3CjuOQzLie5Q3yshhvmo7YNtBG7aaEY=" crossorigin="anonymous">
<link href="styles/login.min.css" rel="stylesheet"> <link href="styles/login.min.css" rel="stylesheet">
<link href="styles/bootstrap.min.css" rel="stylesheet"> <link href="styles/bootstrap.min.css" rel="stylesheet">
<!-- <link href="styles/lavish-bootstrap.css" rel="stylesheet"> --> <!-- <link href="styles/lavish-bootstrap.css" rel="stylesheet"> -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment