-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
600 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
name: ejstand | ||
version: 0.3.0 | ||
homepage: https://apathism.net/git/apathism/ejstand | ||
bug-reports: https://apathism.net/git/apathism/ejstand/issues | ||
license: AGPL-3 | ||
license-file: LICENSE | ||
author: Ivan Koryabkin | ||
maintainer: Ivan Koryabkin <[email protected]> | ||
synopsis: Ejudge Configurable Web Standings Daemon for Multiple Contests | ||
category: Web | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
name: ejstand | ||
version: 0.3.0 | ||
synopsis: Ejudge Configurable Web Standings Daemon for Multiple Contests | ||
homepage: https://apathism.net/git/apathism/ejstand | ||
bug-reports: https://apathism.net/git/apathism/ejstand/issues | ||
license: AGPL-3 | ||
license-file: LICENSE | ||
author: Ivan Koryabkin <[email protected]> | ||
maintainer: Ivan Koryabkin <[email protected]> | ||
copyright: (c) 2018 Ivan Koryabkin | ||
category: Web | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
|
||
source-repository head | ||
type: git | ||
location: https://apathism.net/git/apathism/ejstand.git | ||
|
||
executable ejstand | ||
main-is: Main.hs | ||
|
@@ -19,7 +24,7 @@ executable ejstand | |
-- Time measuring | ||
clock, time, | ||
-- Filesystem & Network tools | ||
directory, http-types, wai, warp, | ||
directory, file-embed, http-types, wai, warp, | ||
-- Parsers & Template Engines | ||
blaze-html, shakespeare, xml-conduit, | ||
-- Other | ||
|
@@ -32,7 +37,9 @@ executable ejstand | |
EjStand.DataParser | ||
EjStand.HtmlRenderer | ||
EjStand.InternalsCore | ||
EjStand.LegalCredits | ||
EjStand.StandingBuilder | ||
EjStand.StandingModels | ||
EjStand.WebApplication | ||
Paths_ejstand | ||
default-language: Haskell2010 |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{-# LANGUAGE OverloadedStrings #-} | ||
{-# LANGUAGE RecordWildCards #-} | ||
{-# LANGUAGE TemplateHaskell #-} | ||
module EjStand.LegalCredits | ||
( renderLegalCredits | ||
) | ||
where | ||
|
||
import Data.ByteString (ByteString) | ||
import Data.FileEmbed (embedDir) | ||
import Data.Map.Strict (Map) | ||
import qualified Data.Map.Strict as Map | ||
import Data.Maybe (catMaybes) | ||
import Data.String (IsString) | ||
import Data.Text (Text, pack) | ||
import Data.Text.Encoding (decodeUtf8) | ||
import qualified Data.Text.Lazy as LT | ||
import EjStand.StandingModels (GlobalConfiguration (..)) | ||
import Text.Blaze.Html.Renderer.Text (renderHtml) | ||
import Text.Hamlet (shamletFile) | ||
|
||
data CabalPackage = CabalPackage { packageName :: !Text | ||
, packageLicenseText :: !Text | ||
} deriving (Show) | ||
|
||
getDependenciesStringList :: IsString s => [s] | ||
getDependenciesStringList = | ||
[ "base" | ||
, "bytestring" | ||
, "containers" | ||
, "safe" | ||
, "text" | ||
, "clock" | ||
, "time" | ||
, "directory" | ||
, "file-embed" | ||
, "http-types" | ||
, "wai" | ||
, "warp" | ||
, "blaze-html" | ||
, "shakespeare" | ||
, "xml-conduit" | ||
, "binary" | ||
, "mtl" | ||
] | ||
|
||
getDependenciesLicenses :: Map Text ByteString | ||
getDependenciesLicenses = Map.fromList $ (\(a, b) -> (pack a, b)) <$> $(embedDir "third-party/licenses") | ||
|
||
getCabalPackages :: [CabalPackage] | ||
getCabalPackages = | ||
catMaybes | ||
$ toMaybePackage | ||
<$> (\dep -> (dep :: Text, Map.lookup (dep <> ".txt") getDependenciesLicenses)) | ||
<$> getDependenciesStringList | ||
where | ||
toMaybePackage :: (Text, Maybe ByteString) -> Maybe CabalPackage | ||
toMaybePackage (name, Nothing ) = Nothing | ||
toMaybePackage (name, (Just license)) = Just $ CabalPackage name $ decodeUtf8 license | ||
|
||
renderLegalCredits :: GlobalConfiguration -> LT.Text | ||
renderLegalCredits GlobalConfiguration {..} = renderHtml ($(shamletFile "templates/credits.hamlet")) |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
$doctype 5 | ||
<html lang="ru"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<title>Лицензии вспомогательных библиотек | ||
<link rel="stylesheet" href="#{webRoot}ejstand.css"> | ||
<body> | ||
<h1> | ||
Лицензии вспомогательных библиотек | ||
В данном разделе представлена информация о лицензиях вспомогательных библиотек, | ||
использованных при создании EjStand. Более подробную информацию можно найти по | ||
ссылкам в Hackage. | ||
$forall package <- getCabalPackages | ||
<h2> | ||
<a href="https://hackage.haskell.org/package/#{packageName package}" target="_blank"> | ||
#{packageName package} | ||
<pre> | ||
#{packageLicenseText package} |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
The Glasgow Haskell Compiler License | ||
|
||
Copyright 2002, The University Court of the University of Glasgow. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
- Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
|
||
- Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
- Neither name of the University nor the names of its contributors may be | ||
used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF | ||
GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, | ||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH | ||
DAMAGE. |
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,30 @@ | ||
Copyright Jasper Van der Jeugt 2010 | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
|
||
* Neither the name of Jasper Van der Jeugt nor the names of other | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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,30 @@ | ||
Copyright (c) Don Stewart 2005-2009 | ||
(c) Duncan Coutts 2006-2015 | ||
(c) David Roundy 2003-2005 | ||
(c) Simon Meier 2010-2011 | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
2. Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
3. Neither the name of the author nor the names of his contributors | ||
may be used to endorse or promote products derived from this software | ||
without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
SUCH DAMAGE. |
Oops, something went wrong.