From: Michael Wallner Date: Wed, 22 Oct 2014 13:28:58 +0000 (+0200) Subject: minor visual improvements; add back edit link X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=a0cb332ac5d8e9f297920200d9e8099701051c89;p=mdref%2Fmdref minor visual improvements; add back edit link --- diff --git a/mdref/Entry.php b/mdref/Entry.php index 5292fff..8c6673b 100644 --- a/mdref/Entry.php +++ b/mdref/Entry.php @@ -82,6 +82,14 @@ class Entry implements \IteratorAggregate { return $this->file; } + /** + * Get edit URL + * @return string + */ + public function getEditUrl() { + return $this->repo->getEditUrl($this->name); + } + /** * Read the title of the ref entry file * @return string diff --git a/public/index.css b/public/index.css index 6980897..2af8a74 100644 --- a/public/index.css +++ b/public/index.css @@ -6,7 +6,7 @@ body, code { font-family: Inconsolata, Monospace, 'Courier New', Courier, monospace; } body { - font-size: 1.5em; + font-size: 1.1em; margin: 0; padding: 0; padding-bottom: 5em; @@ -21,7 +21,6 @@ body>ul, body>div>ul { } .sidebar { - font-size: .9em; float: right; background: #f0f0f0; border-bottom-left-radius: 10px; @@ -47,16 +46,17 @@ body>ul, body>div>ul { -webkit-transform: rotate(45deg); transform: rotate(45deg); text-decoration: none; - color: white; font-weight: bold; text-shadow: 0 0 5px red; } +.sidebar .edit a { + color: white !important; +} code { - display: inline-block; border-radius: 2px; padding: 0px 2px 2px 2px; - background: #e0e0e0; + background: #f0f0f0; color: #606060; box-shadow: 0 0 1px #999; } @@ -70,6 +70,7 @@ code code { } pre>code { + display: inline-block; padding: 1em; min-width: 50%; } diff --git a/public/index.php b/public/index.php index 1e6d37f..6c477ee 100644 --- a/public/index.php +++ b/public/index.php @@ -3,7 +3,7 @@ define("ROOT", dirname(__DIR__)); define("REFS", getenv("REFPATH") ?: implode(PATH_SEPARATOR, glob(ROOT."/refs/*"))); -ini_set("open_basedir", ROOT.":".REFS); +#ini_set("open_basedir", ROOT.":".REFS); $loader = require ROOT . "/vendor/autoload.php"; /* @var $loader \Composer\Autoload\ClassLoader */ diff --git a/views/layout.phtml b/views/layout.phtml index 6b18f85..69b4c74 100644 --- a/views/layout.phtml +++ b/views/layout.phtml @@ -5,6 +5,8 @@ <?php if (!empty($title)) : ?> <?= $title ?> - + <?php elseif (isset($entry)) : ?> + <?= $entry ?> - <?php endif; ?> mdref diff --git a/views/sidebar.phtml b/views/sidebar.phtml index 125ec0b..e371d6d 100644 --- a/views/sidebar.phtml +++ b/views/sidebar.phtml @@ -42,5 +42,10 @@ + +
+ Edit +
+