Repos specify their VCS (i.e. Git or Darcs) in the DB

This commit is contained in:
fr33domlover 2016-05-02 23:51:53 +00:00
parent 0b06b72b85
commit d69c5e8abc
5 changed files with 37 additions and 3 deletions

View file

@ -52,9 +52,10 @@ Project
Repo
ident Text --CI
sharer SharerId
project ProjectId Maybe
desc Text Maybe
mainBranch Text default='master'
vcs VersionControlSystem default='VCSGit'
project ProjectId Maybe
desc Text Maybe
mainBranch Text default='master'
UniqueRepo ident sharer

View file

@ -20,11 +20,13 @@ where
import Vervis.Import
import Vervis.Field.Repo
import Vervis.Model.Repo
newRepoAForm :: SharerId -> AForm Handler Repo
newRepoAForm sid = Repo
<$> areq (mkIdentField sid) "Identifier*" Nothing
<*> pure sid
<*> pure VCSGit
<*> pure Nothing
<*> aopt textField "Description" Nothing
<*> pure "master"

View file

@ -23,6 +23,8 @@ import Yesod hiding (Header, parseTime)
import Database.Persist.Quasi
import Yesod.Auth.HashDB (HashDBUser (..))
import Vervis.Model.Repo
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities at:
-- http://www.yesodweb.com/book/persistent/

28
src/Vervis/Model/Repo.hs Normal file
View file

@ -0,0 +1,28 @@
{- This file is part of Vervis.
-
- Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
-
- Copying is an act of love. Please copy, reuse and share.
-
- The author(s) have dedicated all copyright and related and neighboring
- rights to this software to the public domain worldwide. This software is
- distributed without any warranty.
-
- You should have received a copy of the CC0 Public Domain Dedication along
- with this software. If not, see
- <http://creativecommons.org/publicdomain/zero/1.0/>.
-}
module Vervis.Model.Repo
( VersionControlSystem (..)
)
where
import Prelude
import Database.Persist.TH
data VersionControlSystem = VCSGit | VCSDarcs
deriving (Eq, Show, Read)
derivePersistField "VersionControlSystem"

View file

@ -60,6 +60,7 @@ library
Vervis.Import.NoFoundation
Vervis.MediaType
Vervis.Model
Vervis.Model.Repo
Vervis.Readme
Vervis.Render
Vervis.Settings