Simplify snapshot page

This commit is contained in:
Chris Done 2014-08-24 11:42:13 +02:00
parent fa73bad0b1
commit ff4e3457eb
6 changed files with 2445 additions and 36 deletions

View File

@ -93,6 +93,10 @@ instance Yesod App where
, css_bootstrap_css , css_bootstrap_css
, css_bootstrap_responsive_css , css_bootstrap_responsive_css
]) ])
$((combineScripts 'StaticR
[ js_jquery_js
, js_bootstrap_js
]))
$(widgetFile "default-layout") $(widgetFile "default-layout")
mcurr <- getCurrentRoute mcurr <- getCurrentRoute

View File

@ -1,7 +1,7 @@
module Handler.StackageHome where module Handler.StackageHome where
import Import
import Data.BlobStore (storeExists) import Data.BlobStore (storeExists)
import Import
getStackageHomeR :: PackageSetIdent -> Handler Html getStackageHomeR :: PackageSetIdent -> Handler Html
getStackageHomeR ident = do getStackageHomeR ident = do
@ -41,3 +41,5 @@ getStackageMetadataR ident = do
, toPathPiece version , toPathPiece version
, "\n" , "\n"
] ]
yearMonthDay = formatTime defaultTimeLocale "%Y-%m-%d"

2280
static/js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

4
static/js/jquery.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,42 +1,104 @@
$newline never $newline never
<div .container> <div .container>
<hgroup> <h1>
<h1>#{stackageTitle stackage} #{stackageTitle stackage}
<p> <p>
#{userDisplay user} (#{userHandle user}) Published on #{yearMonthDay (stackageUploaded stackage)}
<p .date> <span .separator>
#{stackageDesc stackage} $if True
<p .date> <span>
Uploaded on #{tshow $ stackageUploaded stackage} <a href=@{StackageMetadataR ident} title="View metadata on this snapshot, such as package versions">
<hr> \Metadata
<p>To use, copy the following to your # <span .separator>
<code>~/.cabal/config <span>
\: <a href=@{StackageBundleR ident} title="This is useful for making modifications to an existing snapshot">
\Bundle
<p>
<pre>
remote-repo: stackage:@{StackageHomeR ident}
<h3>
Setup guide #
<small>
(click to expand)
<div class="accordion" id="accordion2">
<pre>remote-repo: stackage:@{StackageHomeR ident} <div class="accordion-group">
<div class="accordion-heading">
<small> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#collapse1">
<em> <span .number>1
Note: Remove or comment out any existing # Copy the
<code>remote-repo <code>remote-repo
\ line. line to your Cabal configuration file
<div id="collapse1" class="accordion-body collapse">
<div class="accordion-inner">
<p>
Your #
<code>config
\ file for Cabal should be in your user home directory. For example:
<ul>
<li>Linux: #
<code>
/home/alonzo/.cabal/config
<li>Windows: #
<code>
C:\Users\alonzo\AppData\Roaming\cabal\config
<p>Once you have this open, find the line that says:
<pre>
remote-repo: hackage.haskell.org:http://hackage.haskell.org/packages/archive
<p>
Replace it with the #
<code>remote-repo
\ code sample above.
<p> <div class="accordion-group">
Run the following to update your packages: <div class="accordion-heading">
<pre> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse2">
<code> <span .number>2
\$ cabal update Remove any existing package config
<div id="collapse2" class="accordion-body collapse">
<div class="accordion-inner">
<p>
If you already have installed some packages from Hackage
\ or elsewhere and you want to start from a fresh package
\ set, you can remove your
<code>ghc/&lt;os&gt;-&lt;ghc-version&gt;
\ directory.
<p> <ul>
For information about clearing your existing package set, or using with sandboxes, <li>
see In Linux, the directory is #
<a href="https://github.com/fpco/stackage/wiki/Stackage-Server-FAQ">the FAQ. <code>~/.ghc
$if hasBundle <li>
<p> On Windows the #
<a href=@{StackageMetadataR ident}>View metadata on this snapshot <code>.ghc
, such as package versions. \ directory, similar to the Cabal
<p> \ configuration, will be under something like: #
<a href=@{StackageBundleR ident}>Download the original bundle file. <code>
\ # C:\Users\alonzo\AppData\Roaming\ghc
<i>This is useful for making modifications to an existing snapshot.
<p>
To clear the GHC 7.2.2. environment, all the
\ user-installed packages, you can remove the directory #
<code>x86_64-linux-7.2.2
.
<em> Be careful
\ that you are sure
\ that you want to clear your package set (re-installing
\ packages takes time!) and that you clear the right one.
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion3" href="#collapse3">
<span .number>3
Run
<code>
cabal update
<div id="collapse3" class="accordion-body collapse">
<div class="accordion-inner">
<p>
This will download the package index from Stackage and
\ update your local one.
<p>
Now you're ready to install packages!

View File

@ -1,5 +1,14 @@
h1 { h1 {
font-size: 30px !important; font-size: 30px !important;
margin-bottom: 0;
}
h1 + p {
margin-top: 0;
}
h2 {
color: #555 !important;
} }
.date { .date {
@ -10,3 +19,51 @@ h1 {
hr { hr {
border: 1px solid #ddd border: 1px solid #ddd
} }
.separator {
width: 1px;
height: 0.5em;
background: #aaa;
display: inline-block;
margin: 0 0.5em;
}
.accordion-group {
border: 0;
.accordion-toggle:hover {
text-decoration: none;
background: #f5f5f5;
border-radius: 0.5em;
}
.accordion-toggle {
margin-left: -0.5em;
padding-left: 0.5em;
color: #555;
code {
font-size: inherit;
border: inherit;
margin: 0.5em;
}
.number {
border-radius: 1em;
background: #0981c3;
color: #fff;
display: inline-block;
padding: 0 0.5em;
margin-right: 0.5em;
text-shadow: none;
}
}
}
h3 {
color: #666 !important;
font-weight: normal
}
h3 > small {
color: #666
}
p + ul {
margin-top: 1em;
}