git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Move create-user form and clean up more templates

parent 6de40db9
......@@ -21,9 +21,7 @@ import Model.User
import View.User (renderUser, createUserForm)
getWelcomeR :: Handler Html
getWelcomeR = defaultLayoutNew "homepage" $ do
setTitle "Snowdrift.coop — Free the Commons"
$(widgetFile "homepage")
getWelcomeR = $(widget "page/welcome" "Snowdrift.coop — Free the Commons")
getSearchR :: Handler Html
getSearchR = do
......@@ -79,11 +77,8 @@ getHomeR,
-- the dashboard for logged-in viewers.
getHomeR = do
u <- maybeAuth
maybe (defaultLayoutNew "homepage" $ do
setTitle "Snowdrift.coop — Free the Commons"
$(widgetFile "homepage"))
(\user ->
$(widget "page/dashboard/overview" "Dashboard"))
maybe getWelcomeR
(\user -> $(widget "page/dashboard/overview" "Dashboard"))
u
getUDashboardR = do
......
......@@ -41,7 +41,7 @@ createUserForm ident extra = do
(avatarRes, avatarView) <- mopt textField "" Nothing
(nickRes, nickView) <- mopt textField "" Nothing
let view = $(widgetFile "auth/create-user-form")
let view = $(widgetFile "form/create-user")
passphRes = case (passph1Res, passph2Res) of
(FormSuccess a, FormSuccess b)
| a == b -> FormSuccess a
......
.other-share-value
text-align: center
width: 4em
margin-left: .5em
<fieldset>
$forall (shareNumber, centView) <- pledgeOptions
<input .radio-inline :req:required *{attrs}
type=radio
id=#{ident}-#{shareNumber}
name=#{name}
value=#{shareNumber}
:shareNumber == value:checked>
#{centView}
<div>
<input .radio-inline *{attrs}
type=radio
id=#{ident}-other
name=#{name}
value=#{name}-other
:req:required :not hasValue:checked>
other (in tenths of a cent):
<input .form-inline .other-share-value *{attrs} step=1 min=0
type=number
id=#{ident}-other-val
name=#{name}-other
value=#{otherValue}>
(function () {
var button = document.getElementById("#{rawJS ident}-other");
var field = document.getElementById("#{rawJS ident}-other-val");
function setup_other_field() {
if(button.checked) {
field.disabled = false;
field.required = true;
} else {
field.disabled = true;
field.required = false;
field.value = "";
}
}
var buttons = document.getElementsByName("#{rawJS name}");
for(var i = 0; i < buttons.length; i++) {
buttons[i].onchange = setup_other_field;
}
setup_other_field();
})();
@media (min-width: 992px)
.project-stats
position: absolute
right: 0
.p-blurb
max-width: 80%
font-size: smaller
border-bottom: 1px solid #3981B3
margin: 0 auto
.pledge-form
background: #DDECE3
margin: 1em
padding: 1em
border-radius: 1em
text-align: center
.testing-notice
border: 2px solid red
font-style: italic
text-align: center
.pledge-form h2, .pledge-form h3, .pledge-form h4
margin: 0.5em
.pledge-form ul
padding: 0
.pledge-form li
line-height: 0.5em
<nav .snowdrift-sidebar>
<a href=@{ProjectR $ projectHandle project}>
<figure .project-logo>
$maybe logo <- projectLogo project
<img src=@{ImageR logo}>
$nothing
<img src=@{StaticR img_default_project_logo_png}>
$maybe _ <- mviewer_id
$maybe project_id <- maybe_project_id
<div .text-center>
$if is_watching
<form method=POST action=@{UnwatchProjectR project_id}>
<input type=submit value="unwatch">
$else
<form method=POST action=@{WatchProjectR project_id}>
<input type=submit value="watch">
<ul .project-nav>
$if userIsAdmin
<li .snowdrift-sidebar-item>
<a href=@{EditProjectR $ projectHandle project}>
<span .glyphicon .glyphicon-cog>
Edit Project
<li .snowdrift-sidebar-item>
<a href=@{InviteR $ projectHandle project}>
<span .glyphicon .glyphicon-link>
Invite
<hr>
<li .snowdrift-sidebar-item>
<a href=@{ProjectBlogR $ projectHandle project}>
<span .glyphicon .glyphicon-edit>
Blog
<li .snowdrift-sidebar-item>
<a href=@{ProjectContactR $ projectHandle project}>
<span .glyphicon .glyphicon-envelope>
Contact
<li .snowdrift-sidebar-item>
<a href=@{ProjectDiscussionR $ projectHandle project}>
<span .glyphicon .glyphicon-comment>
Discussion Board
<li .snowdrift-sidebar-item>
<a href=@{ProjectFeedR $ projectHandle project}>
<span .glyphicon .glyphicon-th-list>
Project Feed
<li .snowdrift-sidebar-item>
<a href=@{WhoR $ projectHandle project}>
<span .glyphicon .glyphicon-user>
Team Members
<li .snowdrift-sidebar-item>
<a href=@{TicketsR $ projectHandle project}>
<span .glyphicon .glyphicon-tag>
Tickets
<li .snowdrift-sidebar-item>
<a href=@{ProjectTransactionsR $ projectHandle project}>
<span .glyphicon .glyphicon-stats>
Transactions
<li .snowdrift-sidebar-item>
<a href=@{VolunteerR $ projectHandle project}>
<span .glyphicon .glyphicon-check>
Volunteer
<li .snowdrift-sidebar-item>
<a href=@{WikiPagesR $ projectHandle project}>
<span .glyphicon .glyphicon-book>
Wiki
<div .row>
<div .col-md-7 .col-sm-8 .col-xs-12>
<h1 .text-center> #{projectName project}
<section .p-blurb>
<p>#{projectBlurb project}
<section .p-description>
^{description}
<section .pledge-form>
$maybe _ <- maybe_project_id
<form method=GET
action=@{UpdatePledgeR $ projectHandle project}>
^{update_pledge}
$maybe _ <- mechUser
<input disabled .pledge type=submit value="update pledge">
$nothing
<input disabled .pledge type=submit value="enter pledge">
$nothing
^{update_pledge}
<div .testing-notice>
2015/11/05: Pledging temporarily disabled pending new code.
<div .project-stats .col-md-3 .col-xs-12>
<div .testing-notice>
<div .testing-notice>
2015/11/05: All mechanism statistics temporarily removed pending
new code.
<table>
<tr>
<th>Current patrons
<tr>
<td>
<a href=@{ProjectPatronsR $ projectHandle project}>
FIXME: Number of patrons goes here.
<tr>
<td>
<span .pledge-stat>FIXME: Project value
<table>
<tr>
<th>Next new patron
<tr>
<td>
minimum new pledge:
<span .pledge-stat>FIXME: Share value
per month
<tr>
<td>
matching from others:
<span .pledge-stat>FIXME: matching amount
per month
<table>
<tr>
<th>History
$maybe (last, year, total) <- amounts
<tr>
<td>
#{last} on the last payday
<tr>
<td>
#{year} in the past year
<tr>
<td>
#{total} total
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment