Gusets Comment Reply impl

This commit is contained in:
斟酌 鵬兄 2016-10-25 19:31:01 +08:00
parent fa50c2e90a
commit 8ef1df3c94
5 changed files with 76 additions and 8 deletions

View File

@ -11,7 +11,7 @@ SiteRoot = os.path.abspath( "." )
config["Paths"]["SiteRoot"] = SiteRoot;
# Create the lock folder for celery
lockDir = os.path.join( SiteRoot, "env", "var", "run" "celery" )
lockDir = os.path.join( SiteRoot, "env", "var", "run", "celery" )
os.makedirs( lockDir, exist_ok=True )
@ -31,7 +31,7 @@ if __name__ == "__main__":
[
"celery", "multi", "restart", nodeName
, "-A", jwork, "worker"
, "--pidfile=" + lockDir + jwork + ".pid"
, "--pidfile=" + os.path.join( lockDir, jwork + ".pid" )
, "--logfile=" + os.path.join( config["Paths"]["Log"], jwork + ".log" )
, "--workdir=" + config["Paths"]["Runtime"]
, "beat", "-l", "info"

View File

@ -555,7 +555,7 @@
// Validation
, fields = loggedIn ? ["content"] : ["content", "name", "email", "website"]
, fields = loggedIn ? ["content"] : [ "content", "name", "email", "website", "email_notify" ]
, _getFieldsValidated = function (obj)
{
var name, field, falsefield, f;
@ -567,7 +567,8 @@
falsefield = "false_" + name;
f = Dand.id( falsefield );
f.style.height = 0;
if( f ) f.style.height = 0;
switch(name)
{
case "name":
@ -587,7 +588,7 @@
else
{
if(obj[name] == true)
delete obj[name]
delete obj[ name ];
}
break;
case "email":
@ -598,14 +599,29 @@
}
else
{
if(obj[name] == true)
delete obj[name]
if( obj[ name ] == true )
delete obj[ name ];
}
break;
case "email_notify":
if( obj[ name ] = Dand.id( field ).checked )
{
if( obj[ "email" ] == undefined )
{
obj[ name ] = false;
Cycle.delay( function() { this.style.height = elmH; }.bind(f), 500 );
}
}
else
{
delete obj[ name ];
}
break;
}
}
for(var i in obj) if(!obj[i]) return false;
for( var i in obj )
if( !obj[i] ) return false;
return true;
}

View File

@ -0,0 +1,14 @@
.ban-btn { color: red; }
.subs-type { margin: 1em; }
.subs-item {
position: relative;
margin: .5em 2.5em .5em .5em;
border-left: 0.5em solid royalblue;
background-color: white;
}
.subs-item > p a {
color: orangered;
margin: 0.5em;
}

View File

@ -0,0 +1,35 @@
(function(){
var ns = __namespace( "Astro.Blog.Layout.Subs.Manage" );
/** @type {Components.MessageBox} */
var MessageBox = __import( "Components.MessageBox" );
/** @type {Dandelion} */
var Dand = __import( "Dandelion" );
/** @type {Astro.Bootstrap} */
var Bootstrap = __import( "Astro.Bootstrap" );
/** @type {Dandelion.IDOMElement} */
var IDOMElement = __import( "Dandelion.IDOMElement" );
var init = function ()
{
/** @type {Dandelion.IDOMElement} */
var banbtn = Dand.id( "action-ban", true );
if( banbtn )
{
banbtn.addEventListener( "Click", function( e ) {
e.preventDefault();
var msgBox = new MessageBox(
"Ban this address"
, "This action cannot be undone, confirm?"
, "Yes", "No"
, function( _confirm ) {
if( !_confirm ) return;
window.location = banbtn.getDAttribute( "href" );
} ).show();
} );
}
};
Bootstrap.regInit( init );
})();

View File

@ -0,0 +1,3 @@
(function(){
var ns = __namespace( "Astro.Blog.Layout.Subs" );
})();