Skip to content

Commit

Permalink
add inc_head for account stuff; add confirmation hooks for path alias…
Browse files Browse the repository at this point in the history
…es; fix boolean test
  • Loading branch information
thisisaaronland committed Dec 2, 2011
1 parent dda264a commit 20a209f
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 16 deletions.
18 changes: 13 additions & 5 deletions www/account_path_aliases.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,18 +27,26 @@
$ok = 0; $ok = 0;
} }


if (($ok) && (flickr_users_path_aliases_is_available($new_alias))){ if (($ok) && (! flickr_users_path_aliases_is_available($new_alias))){
$GLOBALS['smarty']->assign("error", "alias taken"); $GLOBALS['smarty']->assign("error", "alias taken");
$ok = 0; $ok = 0;
} }


if ($ok){ if ($ok){


$rsp = flickr_users_path_aliases_create($GLOBALS['cfg']['user'], $new_alias); if (post_str("confirm")){


if (! $rsp['ok']){ $rsp = flickr_users_path_aliases_create($GLOBALS['cfg']['user'], $new_alias);
$GLOBALS['smarty']->assign("error", "db error");
$ok = 0; if (! $rsp['ok']){
$GLOBALS['smarty']->assign("error", "db error");
$ok = 0;
}
}

else {
$GLOBALS['smarty']->assign("step", "confirm");
$GLOBALS['smarty']->assign("path_alias", $new_alias);
} }
} }
} }
Expand Down
14 changes: 14 additions & 0 deletions www/css/main.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -343,3 +343,17 @@ p.message {
list-style-type: none; list-style-type: none;
line-height: 1.5em; line-height: 1.5em;
} }

table {
}

th {
color:#999;
border-bottom: solid thin;
padding-bottom:10px;
}

td {
padding-right: 10px;
padding-top: 10px;
}
1 change: 1 addition & 0 deletions www/templates/inc_account_head.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
{* place-holder *}
1 change: 1 addition & 0 deletions www/templates/page_account_backups.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,6 @@
{capture assign="page_title"}your flickr backups{/capture} {capture assign="page_title"}your flickr backups{/capture}
{include file="inc_head.txt"} {include file="inc_head.txt"}
{include file="inc_account_head.txt"}


<h2>Flickr Backups</h2> <h2>Flickr Backups</h2>


Expand Down
1 change: 1 addition & 0 deletions www/templates/page_account_delete.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,6 @@
{assign var='page_title' value="Delete your account"} {assign var='page_title' value="Delete your account"}
{include file="inc_head.txt"} {include file="inc_head.txt"}
{include file="inc_account_head.txt"}


{if $error_deleting}<p class="error">Something went wrong. Try again later pls.</p>{/if} {if $error_deleting}<p class="error">Something went wrong. Try again later pls.</p>{/if}


Expand Down
1 change: 1 addition & 0 deletions www/templates/page_account_delete_confirm.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,6 @@
{assign var='page_title' value="Delete your account"} {assign var='page_title' value="Delete your account"}
{include file="inc_head.txt"} {include file="inc_head.txt"}
{include file="inc_account_head.txt"}


<p>Are you <strong>really sure</strong> you want to delete your account?</p> <p>Are you <strong>really sure</strong> you want to delete your account?</p>


Expand Down
1 change: 1 addition & 0 deletions www/templates/page_account_password.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,6 @@
{assign var="page_title" value="Change your password"} {assign var="page_title" value="Change your password"}
{include file="inc_head.txt"} {include file="inc_head.txt"}
{include file="inc_account_head.txt"}


{if $error_oldpass_mismatch} <p class="error">Incorrect old password.</p>{/if} {if $error_oldpass_mismatch} <p class="error">Incorrect old password.</p>{/if}
{if $error_newpass_empty} <p class="error">Please choose a new password.</p>{/if} {if $error_newpass_empty} <p class="error">Please choose a new password.</p>{/if}
Expand Down
31 changes: 20 additions & 11 deletions www/templates/page_account_path_aliases.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,36 +1,45 @@
{capture assign="page_title"}your custom URLs{/capture}
{include file="inc_head.txt"} {include file="inc_head.txt"}
{include file="inc_account_head.txt"}


<form method="POST"> <form method="POST">
{$crumb_key|crumb_input} {$crumb_key|crumb_input}


<h3>Create a new URL</h3> <h3>Create a new URL</h3>


<input type="text" name="path_alias" value="" size="30" /> {if $error}
<input type="submit" value="CREATE" /> <p class="error">{$error|escape}</p>

{else}
{if !$aliases|@count}


{if $step=='confirm'}
<p>Are you sure you want all your photos to live at <strong>{$cfg.abs_root_url}photos/{$path_alias|escape}/</strong> ?</p>
<input type="hidden" name="confirm" value="1" />
<input type="hidden" name="path_alias" value="{$path_alias|escape}" />
<input type="submit" value="I AM SURE, YES" />
{else} {else}
<strong>{$cfg.abs_root_url}photos/</strong> <input type="text" name="path_alias" value="" size="30" />
<input type="submit" value="CREATE" />
{/if}

{/if}


<h3>Your URLs</h3> <h3>Your URLs</h3>


<table> <table>
<tr> <tr>
<th>URL</th>
<th>Created</th> <th>Created</th>
<th>Redirects To</th> <th>URL</th>
<th style="border:none;"></th>
</tr> </tr>
{foreach from=$aliases item="row"} {foreach from=$aliases item="row"}
<tr> <tr>
<td><a href="">{$row.path_alias|escape}</a></td> <td>{$row.created|date_format:"%Y-%m-%d"|escape}</td>
<td>{$row.created|escape}</td> <td><a href="{$cfg.abs_root_url}photos/{$row.path_alias|escape}/">{$cfg.abs_root_url}photos/{$row.path_alias|escape}/</a></td>
<td>{if $row.redirect_to}<a href="">{$row.redirect_to|escape}</a>{else}&#8212;{/if}</td> <td style="font-size:small;font-style:italic;">{if $aliases|@count > 1 and !$row.redirect_to}⇽ all your other URLs redirect to this one{/if}</td>
</tr> </tr>
{/foreach} {/foreach}
</table> </table>


{/if}

</form> </form>


{include file="inc_foot.txt"} {include file="inc_foot.txt"}

0 comments on commit 20a209f

Please sign in to comment.