Apply basic style to make commit diffs look a bit less very ugly
This commit is contained in:
parent
3086209b3b
commit
ca1e83f504
5 changed files with 56 additions and 11 deletions
|
@ -38,6 +38,7 @@ import Vervis.Foundation
|
|||
import Vervis.Model.Ident
|
||||
import Vervis.Patch (Hunk (..))
|
||||
import Vervis.Settings (widgetFile, appDiffContextLines)
|
||||
import Vervis.Style
|
||||
|
||||
refSelectW :: ShrIdent -> RpIdent -> Set Text -> Set Text -> Widget
|
||||
refSelectW shar repo branches tags = $(widgetFile "repo/widget/ref-select")
|
||||
|
|
17
templates/repo/patch.cassius
Normal file
17
templates/repo/patch.cassius
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* This file is part of Vervis.
|
||||
*
|
||||
* Written in 2018 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/>.
|
||||
*/
|
||||
|
||||
.lines
|
||||
font-family: monospace
|
|
@ -38,7 +38,7 @@ $if null parents
|
|||
$case edit
|
||||
$of AddTextFile path mode lines
|
||||
<p>Add file #{path} #{mode}
|
||||
<table>
|
||||
<table .lines>
|
||||
$forall (n, t) <- number lines
|
||||
<tr>
|
||||
<td>+
|
||||
|
@ -48,7 +48,7 @@ $if null parents
|
|||
<p>Add binary file #{path} #{mode} #{size}
|
||||
$of RemoveTextFile path mode lines
|
||||
<p>Remove file #{path} #{mode}
|
||||
<table>
|
||||
<table .lines>
|
||||
$forall (n, t) <- number lines
|
||||
<tr>
|
||||
<td>-
|
||||
|
@ -69,7 +69,7 @@ $if null parents
|
|||
#{newSize} #{newMode}
|
||||
$of TextToBinary path lines oldMode newSize newMode
|
||||
<p>Edit file #{path} #{oldMode} → #{newSize} #{newMode}
|
||||
<table>
|
||||
<table .lines>
|
||||
$forall (n, t) <- number lines
|
||||
<tr>
|
||||
<td>-
|
||||
|
@ -77,7 +77,7 @@ $if null parents
|
|||
<td>#{t}
|
||||
$of BinaryToText path oldSize oldMode lines newMode
|
||||
<p>Edit file #{path} #{oldMode} #{oldSize} → #{newMode}
|
||||
<table>
|
||||
<table .lines>
|
||||
$forall (n, t) <- number lines
|
||||
<tr>
|
||||
<td>+
|
||||
|
|
25
templates/repo/widget/inline-diff.cassius
Normal file
25
templates/repo/widget/inline-diff.cassius
Normal file
|
@ -0,0 +1,25 @@
|
|||
/* This file is part of Vervis.
|
||||
*
|
||||
* Written in 2018 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/>.
|
||||
*/
|
||||
|
||||
.lines
|
||||
font-family: monospace
|
||||
|
||||
.remove
|
||||
background: #{light red}
|
||||
color: #{dark red}
|
||||
|
||||
.add
|
||||
background: #{light green}
|
||||
color: #{dark green}
|
|
@ -12,24 +12,26 @@ $# 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/>.
|
||||
|
||||
<table>
|
||||
<table .lines>
|
||||
$forall lines <- diffs
|
||||
$forall (ln, t) <- lines
|
||||
<tr>
|
||||
$case ln
|
||||
$of Old n
|
||||
$case ln
|
||||
$of Old n
|
||||
<tr .remove>
|
||||
<td>-
|
||||
<td>#{n}
|
||||
<td>
|
||||
$of New n
|
||||
$of New n
|
||||
<tr .add>
|
||||
<td>+
|
||||
<td>
|
||||
<td>#{n}
|
||||
$of Both o n
|
||||
$of Both o n
|
||||
<tr>
|
||||
<td>
|
||||
<td>#{o}
|
||||
<td>#{n}
|
||||
<td>#{t}
|
||||
<td>#{t}
|
||||
<tr>
|
||||
<td>…
|
||||
<td>…
|
||||
|
|
Loading…
Reference in a new issue