introducing parallelism template in admin interface

This commit is contained in:
nek0 2015-01-11 17:59:02 +01:00
parent 23ceabc253
commit 3b2d37e057
7 changed files with 67 additions and 46 deletions

View file

@ -70,7 +70,7 @@ getAdminProfileSettingsR ownerId = do
tempUserId <- lookupSession "userId" tempUserId <- lookupSession "userId"
userId <- return $ getUserIdFromText $ fromJust tempUserId userId <- return $ getUserIdFromText $ fromJust tempUserId
(adminProfileSetWidget, enctype) <- generateFormPost $ adminProfileForm owner (adminProfileSetWidget, enctype) <- generateFormPost $ adminProfileForm owner
defaultLayout $ do formLayout $ do
setTitle "Administration: Profile settings" setTitle "Administration: Profile settings"
$(widgetFile "adminProfileSettings") $(widgetFile "adminProfileSettings")
Nothing -> do Nothing -> do

View file

@ -133,6 +133,7 @@ var parallelism = (function($) { var _ = {
// Window. // Window.
_.objects.window._parallelism_update = function() { _.objects.window._parallelism_update = function() {
var i, j, x, y, t; var i, j, x, y, t;
console.log(itemsWidth,itemHeight)
// Calculate number of rows we can fit on the screen. // Calculate number of rows we can fit on the screen.
rows = Math.min(Math.max(Math.floor(windowHeight / itemHeight) - 1, 1), _.settings.maxRows); rows = Math.min(Math.max(Math.floor(windowHeight / itemHeight) - 1, 1), _.settings.maxRows);

View file

@ -1,15 +1,27 @@
$newline always $newline always
<h3>Admin interface <div id="header" class="item" data-width="400">
<div class="inner">
<h1>Admin interface
<p>
Be careful with your actions here, every click will perform directly the advertised action.
<p>
Be careful with your actions here, every click will perform directly the advertised action.
<ul> <div id="header" class="item" data-width="400">
<li> <div class="inner">
<a href=@{AdminProfilesR}>User profiles <p>
<li> <a href=@{AdminProfilesR}>User profiles
<a href=@{AdminAlbumsR}>Albums
<li> <div id="header" class="item" data-width="400">
<a href=@{AdminMediaR}>Media <div class="inner">
<li> <p>
<a href=@{AdminCommentR}>Comments <a href=@{AdminAlbumsR}>Albums
<div id="header" class="item" data-width="400">
<div class="inner">
<p>
<a href=@{AdminMediaR}>Media
<div id="header" class="item" data-width="400">
<div class="inner">
<p>
<a href=@{AdminCommentR}>Comments

View file

@ -1,17 +1,17 @@
$newline always $newline always
<h3>Profile settings <div id="header" class="item" data-width="400">
<form class="inner" method="post" enctype=#{enctype}>
<div class="left"> <h1>Profile Settings
<form method="post" enctype=#{enctype}>
^{adminProfileSetWidget} ^{adminProfileSetWidget}
<div> <div>
<input type=submit value="Change settings"> <input type=submit value="Change settings">
<a href=@{AdminProfileDeleteR userId}>Delete user <a href=@{AdminProfileDeleteR userId}>Delete user
<div class="right"> <div id="header" class="item" data-width="200">
<ul> <div class="inner">
<li> <ul>
<a href=@{AdminUserAlbumsR ownerId}>Albums of this user <li>
<li> <a href=@{AdminUserAlbumsR ownerId}>Albums of this user
<a href=@{AdminUserMediaR ownerId}>Media of this user <li>
<a href=@{AdminUserMediaR ownerId}>Media of this user

View file

@ -1,10 +1,12 @@
$newline always $newline always
<h3>User profiles <div id="header" class="item" data-width="400">
<div class="inner">
<h1>User profiles
$if null profiles
<p>
There are no profiles yet (How can you even see this?)
$if null profiles $forall (Entity uId u) <- profiles
There are no profiles yet (How can you even see this?) <div id="header" class="item" data-width="200">
$else <div class="inner">
<ul>
$forall (Entity uId u) <- profiles
<li>
<a href=@{AdminProfileSettingsR uId}>#{userSlug u} <a href=@{AdminProfileSettingsR uId}>#{userSlug u}

View file

@ -1,10 +1,13 @@
$newline always $newline always
<h3>Albums of #{userSlug owner} <div id="header" class="item" data-width="400">
<div class="inner">
<h1>Albums of #{userSlug owner}
<p>
$if null albums
#{userSlug owner} has no albums yet
$if null albums $forall (Entity aId a) <- albums
#{userSlug owner} has no albums yet <div id="header" class="item" data-width="200">
$else <div class="inner">
<ul> <p>
$forall (Entity aId a) <- albums <a href=@{AdminAlbumSettingsR aId}>#{albumTitle a}
<li>
<a href=@{AdminAlbumSettingsR aId}>#{albumTitle a}

View file

@ -1,10 +1,13 @@
$newline always $newline always
<h3>Media of #{userSlug owner} <div id="header" class="item" data-width="400">
<div class="inner">
<h1>Media of #{userSlug owner}
$if null media
<p>
#{userSlug owner} has no media yet
$if null media $forall (Entity mId m) <- media
#{userSlug owner} has no media yet <div id="header" class="item" data-width="200">
$else <div class="inner">
<ul> <p>
$forall (Entity mId m) <- media <a href=@{AdminMediumSettingsR mId}>#{mediumTitle m}
<li>
<a href=@{AdminMediumSettingsR mId}>#{mediumTitle m}