Login.purs 8.65 KB
Newer Older
Abinaya Sudhir's avatar
Abinaya Sudhir committed
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
module Login where

import Network.HTTP.Affjax (AJAX)
import Control.Monad.Eff.Console (CONSOLE)
import DOM (DOM)
import Prelude hiding (div)
import React.DOM (a, div, footer, h1, h3, hr, i, img, li, p, span, text, ul)
import React.DOM.Props (_data, _id, aria, className, href, role, src, tabIndex, target, title)
import Thermite (PerformAction, Render, Spec, simpleSpec)
import Thermite as T

newtype State = State
  { userName :: String
  , password :: String
  }


initialState :: State
initialState = State
  {userName : ""
 , password : ""
  }

data Action
  = NoOp
  | Documentation
  | Login
  | SignUp


performAction :: forall eff props.PerformAction (console :: CONSOLE, ajax :: AJAX,dom::DOM | eff) State props Action
performAction NoOp _ _ = void do
  T.modifyState \state -> state

performAction Documentation _ _ = void do
  T.modifyState \state -> state

performAction Login _ _ = void do
  T.modifyState \state -> state

performAction SignUp _ _ = void do
  T.modifyState \state -> state



loginSpec :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
loginSpec = simpleSpec performAction render
  where
    render :: Render State props Action
    render dispatch _ state _ =
      [
        div [ _id "dafixedtop", className "navbar navbar-inverse navbar-fixed-top", role "navigation"]
        [ div [className "container"]
          [
            div [ className "navbar-inner" ]
            [ a [ className "navbar-brand logoSmall", href "/" ]
57
              [ img [ src "dist/images/logoSmall.png", title "Back to home." ]
Abinaya Sudhir's avatar
Abinaya Sudhir committed
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
                []
              ]
            ]
          ,  div [className "navbar-collapse collapse"]
             [

             ul [className "nav navbar-nav"]
               [
                 li [className "dropdown"]
                 [
                   a [ className "dropdown-toggle navbar-text", _data {toggle: "dropdown"}, href "#", role "button", title "Informations about Gargantext" ]
                   [ span [ aria {hidden : true}, className "glyphicon glyphicon-info-sign" ]
                     []
                   , text "Info"
                   , i [ className "caret" ]
                     []
                   ]
                 ]
               , ul [className "dropdown-menu"]
                 [ li []
                   [ a [tabIndex (-1),  target "blank", title "Documentation and tutorials", href "https://iscpif.fr/gargantext/your-first-map/"]
                     [text "Documentation"]
                   ]
                 , li [className "divider"] []
                 , li []
                   [
                     a [ tabIndex (-1), target "blank", title "About", href "/about/", title "More informations about the project, its sponsors and its authors"]
                     [ text "About"]

                   ]
                 ]
               ]
             , ul [className "nav navbar-nav pull-right"]
               [
                 li [className "dropdown"]
                 [
                   a [href "#", role "button", className"dropdown-toggle navbar-text", _data {toggle : "dropdown"}, title "That is your username"]
                   [ i [className "icon-user"] []

                  ]
                 ]
               ]
             ]

          ]
        ]


      , div [className "container"]
        [
          div [className "jumbotron"]
          [
            div [className "row"]
            [
              div [className "col-md-8 content"]
              [
                h1 []
                [ text "Gargantext" ]
              , p []
                [ text "A web platform to explore text-mining" ]
              , p []
                [ a [ className "btn btn-primary btn-lg", href "/projects", title "Click and test by yourself" ]
                  [ span [ aria {hidden : true}, className "glyphicon glyphicon-hand-right" ]
                    []
                  , text "Log in"
                  ]
                , a [ className "btn btn-warning btn-lg", href "https://iscpif.fr/services/applyforourservices/", target "blank", title "Fill the form to sign up" ]
                  [ span [ aria {hidden : true}, className "glyphicon glyphicon-hand-right" ]
                    []
                  , text "Sign Up"
                  ]
                , a [ className "btn btn-success btn-lg", href "https://iscpif.fr/gargantext/your-first-map/", target "blank", title "Fill the form to sign up" ]
                  [ span [ aria {hidden : true}, className "glyphicon glyphicon-hand-right" ]
                    []
                  , text "Documentation"
                  ]
                ]
              , span [ aria {hidden : true}, className "glyphicon glyphicon-warning-sign" ]
                []
              , i []
                [ text "Some features may not work without a javascript optimized browser (Chromium for instance).                        " ]

              ]
            , div [className "col-md-2 content"]
              [
                p [ className "right" ]
144 145
                [ div [_id "logo-designed" ]
                  [ img [ src "dist/images/logo.png", title "Logo designed by dacha and anoe" ]
Abinaya Sudhir's avatar
Abinaya Sudhir committed
146 147 148 149 150 151 152 153
                    []
                  ]
                ]
              ]
            ]
          ]
        ]

154 155 156 157 158 159 160
      , div [className "container"]
        [ div [className "row"]
          [ div [className "col-md-offset-5 col-md-6 content"]
            [ img [ src "dist/images/Gargantextuel-212x300.jpg", title "Gargantextuel drawn by Cecile Meadel", _id "funnyimg"] []
            ]
          ]
        ]
Abinaya Sudhir's avatar
Abinaya Sudhir committed
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193


      , div [ className "container" ]
        [ div [ className "row" ]
          [ div [ className "col-md-4 content" ]
            [ h3 []
              [ a [ href "#", title "Random sentences in Gargantua's Books chapters, historically true" ]
                [ text "Historic" ]
              ]
            , p []
              [ text "Chapter 1.XV. How Gargantua was put under other schoolmasters. Chapter 2.XXII. How Panurge served a Parisian lady a trick that pleased her not very well. Chapter 3.XXXVII. How Pantagruel persuaded Panurge to take counsel of a fool. Chapter 4.LXI. How Gaster invented means to get and preserve corn. Chapter 5.XXXVIII. Of the temple's admirable pavement." ]
            ]
          , div [ className "col-md-4 content" ]
            [ h3 []
              [ a [ href "#", title "Randomized words, semantically and syntaxically falses." ]
                [ text "Presentation" ]
              ]
            , p []
              [ text "Autem nascetur iaculis, sedfusce enimsed cursus posuere consectetuer eu justo aliquammauris. Phasellus vero nisi porttitor elit quod, leo feliscras ultricies non tempor sagittis. Liberoduis facilisinam erat dapibusnam, lacus dui duis tristique volutpatut quis vestibulum magna. Nobis faucibusvestibulum dolores minim. Bibendumin malesuada adipiscing ante, mattis fames nequeetiam lorem. No diam id. Litora quisaenean commodo lobortisetiam neque, libero mollis scelerisque inceptos ullamcorper sea congue delenit possim.            " ]
            ]
          , div [ className "col-md-4 content" ]
            [ h3 []
              [ a [ href "#", title "Randomized letters, true or false ?" ]
                [ text "Tutoreil" ]
              ]
            , p []
              [ text "Il paraît que l'rdore des lettres dans un mot n'a pas d'imtraopnce. La première et la dernière lettre doeivnt être à la bonne place. Le reste peut être dans un désordre total et on peut touojurs lire sans prolèbme. On ne lit donc pas chaque lettre en ellêem-me, mais le mot comme un tout. Un chaegmnent de référentiel et nous tranpossons ce résultat au texte luimê-me: l'rdore des mots est failbement important copamré au contexte du texte qui, lui, est copmté: comptexter avec Gargantext.                "
              , text " "
              , text ""
              ]
            ]
          ]
        ]
194 195 196 197

      , div [className "container"]
        [
           hr [] []
Abinaya Sudhir's avatar
Abinaya Sudhir committed
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
      , footer []
        [ p []
          [ text "Gargantext"
          , span [ aria {hidden : true}, className "glyphicon glyphicon-registration-mark" ]
            []
          , text ", version 3.0.6.9.4,"
          , a [ href "http://www.cnrs.fr", target "blank", title "Institution that enables this project." ]
            [ text "Copyrights"
            , span [ aria {hidden : true}, className "glyphicon glyphicon-copyright-mark" ]
              []
            , text "CNRS 2017"
            ]
          , a [ href "http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE", target "blank", title "Legal instructions of the project." ]
            [ text ", Licences aGPLV3 and CECILL variant Affero compliant" ]
          , text "."
          ]
        ]
215 216
        ]

Abinaya Sudhir's avatar
Abinaya Sudhir committed
217
      ]