adding delete functionality and some licenses
authorToby Elliott <telliott@mozilla.com>
Fri, 24 Apr 2009 11:16:53 -0700
changeset 867 04cb55609e36cb5b50554f7163d73a4b79ff0437
parent 862 d1d4de948f134d71e0e784a2a917b83b76c80c1f
child 868 4b73ae97da0f87bf56ed60df071ff05bed0dcf1c
push id524
push usertelliott@mozilla.com
push dateFri, 24 Apr 2009 18:17:15 +0000
adding delete functionality and some licenses
server/admin/editing.php
server/delete_persona.php
server/lib/personas_functions.php
server/lib/storage.php
server/personadetail.php
server/templates/delete_persona_success_tmpl.php
server/templates/delete_persona_tmpl.php
server/templates/persona_detail.php
server/viewpersonas.php
--- a/server/admin/editing.php
+++ b/server/admin/editing.php
@@ -8,17 +8,17 @@
 # the License. You may obtain a copy of the License at
 # http://www.mozilla.org/MPL/
 #
 # Software distributed under the License is distributed on an "AS IS" basis,
 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 # for the specific language governing rights and limitations under the
 # License.
 #
-# The Original Code is Weave Basic Object Server
+# The Original Code is Personas Server
 #
 # The Initial Developer of the Original Code is
 # Mozilla Labs.
 # Portions created by the Initial Developer are Copyright (C) 2008
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #	Toby Elliott (telliott@mozilla.com)
new file mode 100644
--- /dev/null
+++ b/server/delete_persona.php
@@ -0,0 +1,86 @@
+<?php
+
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Personas Server
+#
+# The Initial Developer of the Original Code is
+# Mozilla Labs.
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#	Toby Elliott (telliott@mozilla.com)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+	
+	require_once 'lib/personas_constants.php';
+	require_once 'lib/personas_functions.php';
+	require_once 'lib/storage.php';
+	require_once 'lib/user.php';
+
+	
+	$path = array_key_exists('PATH_INFO', $_SERVER) ? $_SERVER['PATH_INFO'] : '/';
+	$path = substr($path, 1); #chop the lead slash
+	list($id) = explode('/', $path);
+	
+	$user = new PersonaUser();
+
+	$auth_user = $user->authenticate();
+	$user->force_signin();
+
+	$db = new PersonaStorage();
+	$persona = $db->get_persona_by_id($id);
+	
+error_log($persona['status']);
+	if(!$persona || $persona['status'] != 1)
+	{
+		echo "We were unable to locate this persona";
+		exit;
+	}
+	
+	if (!($user->has_admin_privs() || $persona['author'] == $auth_user))
+	{
+		echo "You don't have permission to edit that";
+		exit;
+	}
+	
+	if (array_key_exists('confirm', $_POST))
+	{
+		rename (make_persona_storage_path($persona['id']), make_persona_pending_path($persona['id']));
+		$db->reject_persona($persona['id']);
+		include 'templates/delete_persona_success_tmpl.php';
+	}
+	else
+	{
+		$persona['json'] = htmlentities(json_encode(extract_record_data($persona)));
+		include 'templates/delete_persona_tmpl.php';
+	}
+	
+	
+
+?>
+
--- a/server/lib/personas_functions.php
+++ b/server/lib/personas_functions.php
@@ -1,9 +1,46 @@
 <?php 
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Personas Server
+#
+# The Initial Developer of the Original Code is
+# Mozilla Labs.
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#	Toby Elliott (telliott@mozilla.com)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
 	require_once 'personas_constants.php';	
 	require_once 'storage.php';
 	
 	function url_prefix($id)
 	{
 		$second_folder = $id%10;
 		$first_folder = ($id%100 - $second_folder)/10;
 		return  $first_folder . '/' . $second_folder .  '/'. $id ;
--- a/server/lib/storage.php
+++ b/server/lib/storage.php
@@ -124,16 +124,29 @@ class PersonaStorage
 			$sth->bindParam(':id', $id);
 			$sth->execute();
 		}
 		catch( PDOException $exception )
 		{
 			error_log($exception->getMessage());
 			throw new Exception("Database unavailable", 503);
 		}
+
+		if ($this->_memcache)
+		{
+			$this->_memcache->delete("p$id");
+			$persona = $this->get_persona_by_id($id);
+			
+			$this->_memcache->delete('ca0' . $persona['category']); #category first all page. Rest will rebuild soon
+			$this->_memcache->delete('cr0' . $persona['category']); #category recent page
+			$this->_memcache->delete('crAll'); #All recent page			
+			$this->_memcache->delete('apcAll'); #All persona count			
+			$this->_memcache->delete('apc' . $persona['category']); #Category persona count			
+		}
+
 		return 1;
 	}
 
 	function pull_persona($id)
 	{
 		$this->reject_persona($id);
 		if ($this->_memcache)
 		{
--- a/server/personadetail.php
+++ b/server/personadetail.php
@@ -1,9 +1,46 @@
 <?php
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Personas Server
+#
+# The Initial Developer of the Original Code is
+# Mozilla Labs.
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#	Toby Elliott (telliott@mozilla.com)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
 	require_once 'lib/personas_constants.php';	
 	require_once 'lib/personas_functions.php';	
 	require_once 'lib/storage.php';
 	require_once 'lib/user.php';
 
 	$db = new PersonaStorage();
 	$user = new PersonaUser();
 	
@@ -17,20 +54,20 @@
 	list($persona_id) = explode('/', $path);
 	$page_header = 'View Personas';
 	
 	if (!is_numeric($persona_id))
 		$persona_id = null;
 	else
 	{
 		$persona_id = intval($persona_id);
-		$persona_data = $db->get_persona_by_id($persona_id);
-		$page_header = $persona_data['name'] . ' by ' . $persona_data['author'];
-		$category = $persona_data['category'];
-		$persona_json = htmlentities(json_encode(extract_record_data($persona_data)));
+		$persona = $db->get_persona_by_id($persona_id);
+		$page_header = $persona['name'] . ' by ' . $persona['author'];
+		$category = $persona['category'];
+		$persona['json'] = htmlentities(json_encode(extract_record_data($persona)));
 	}
 
 	$url_prefix = '/gallery';
 	$tabs = null;
 	
 	$title = "Persona Detail"; 
 	include 'templates/header.php'; 
 ?>
@@ -40,50 +77,18 @@
 <?php include 'templates/nav.php'; ?>
             <div id="header">
                 <h2><?= $page_header ?></h2>
                 <h3>Your browser, your style! Dress it up with easy-to-change "skins" for your
                 Firefox.</h3>
             </div>
             <div id="maincontent">
                 <p id="breadcrumbs"><a href="http://www.getpersonas.com">Personas Home</a> : View Personas</p>
-<?php
-	if ($persona_data['id'])
-	{
-?>
-				<h2><?= $persona_data['name'] ?></h2>
-                <h3>created by <?= $persona_data['author'] ?></h3>
-                <img class="detailed-view"  alt="<?= $persona_data['name'] ?>" persona="<?= $persona_json ?>" src="<?= PERSONAS_LIVE_PREFIX . '/' . url_prefix($persona_id) ?>/preview_large.jpg" >
-                
-<?php
-		if ($persona_data['description'])
-		{
-			$desc = preg_replace('/(https?:\/\/[^ ]+[A-Za-z0-9])/', '<a href="$1">$1</a>', $persona_data['description']);
-?>
-				<p class="description"><strong>Description:</strong> <?= $desc ?></p>
-<?php
-		}
-?>
-                <p id="buttons">
-                    <a href="#" class="button" id="try-button" persona="<?= $persona_json ?>"><span>try it now</span><span>&nbsp;</span></a>
-                </p>
-                
-<?php
-		if ($persona_data['popularity'])
-			print '<p class="numb-users">' . number_format($persona_data['popularity']) . ' active daily users</p>';
-	?>
-	<p><script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=df86b16e-195c-4917-ae28-61a1382ba281&amp;type=website&amp;send_services=&amp;post_services=facebook%2Cdigg%2Cdelicious%2Cybuzz%2Ctwitter%2Cstumbleupon%2Creddit%2Ctechnorati%2Cmixx%2Cblogger%2Ctypepad%2Cwordpress%2Cgoogle_bmarks%2Cwindows_live%2Cmyspace%2Cfark%2Cbus_exchange%2Cpropeller%2Cnewsvine%2Clinkedin"></script></p>
-	<?php
-	} else {
-?>            
-                <p class="description">We are unable to find this persona. Please return to the gallery and try again.</p>
-<?php
-	}
-?>
-            </div>
+<?php include 'templates/persona_detail.php' ?>
+			</div>
 <?php include 'templates/category_nav.php'; ?>
             
         </div>
     </div>
     
 <?php include 'templates/footer.php'; ?>
     <script type="text/javascript" charset="utf-8">
         $(document).ready(function () {
new file mode 100644
--- /dev/null
+++ b/server/templates/delete_persona_success_tmpl.php
@@ -0,0 +1,42 @@
+<?php $title = "Delete your Persona"; include 'header.php'; ?>
+<body>
+    <div id="outer-wrapper">
+        <div id="inner-wrapper">
+<?php include 'nav.php'; ?>
+            <div id="header">
+                <h2>Delete Your Persona</h2>
+                <h3>Thanks for sharing your persona with us.</h3>
+            </div>
+            <div id="maincontent">
+                <p id="breadcrumbs"><a href="http://www.getpersonas.com">Personas Home</a> : Delete Your Persona</p>
+				Thank you for leting us host your persona. We'll look forward to seeing your future efforts!
+            </div>
+            <div id="secondary-content">
+              <ol id="upload-steps">
+                <li>
+                    <h3>Step 1:</h3>
+                    <h4><?= $title ?></h4>
+                </li>
+                <li class="current">
+                    <div class="wrapper">
+                   		<h3>Step 2:</h3>
+                    	<h4>Finish</h4>
+                    </div>
+                </li>
+              </ol>
+            </div>
+        </div>
+    </div>
+<?php include 'footer.php'; ?>
+    <script type="text/javascript" charset="utf-8">
+        $(document).ready(function () {
+            $("#header").ie6Warning({"message":'<div id="ie6">Upgrade your browser to get the most out of this website. <a href="%LINK%">Download Firefox for free</a>.</div>'});
+            $("#try-button").personasButton({
+                                        'hasPersonas':'<span>wear this</span><span>&nbsp;</span>',
+                                        'hasFirefox':'<span>get personas now!</span><span>&nbsp;</span>',
+                                        'noFirefox':'<span>get personas with firefox</span><span>&nbsp;</span>'
+                                        });
+        });
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/server/templates/delete_persona_tmpl.php
@@ -0,0 +1,48 @@
+<?php $title = "Delete your Persona"; include 'header.php'; ?>
+<body>
+    <div id="outer-wrapper">
+        <div id="inner-wrapper">
+<?php include 'nav.php'; ?>
+            <div id="header">
+                <h2>Delete Your Persona</h2>
+                <h3>Thanks for sharing your persona with us.</h3>
+            </div>
+            <div id="maincontent">
+                <p id="breadcrumbs"><a href="http://www.getpersonas.com">Personas Home</a> : Delete Your Persona</p>
+                
+                <form method="POST" action="/delete/<?= $persona['id'] ?>" enctype='multipart/form-data'>
+					<input type="hidden" name="id" value="<?= htmlspecialchars($persona['id']) ?>">
+					<input type="hidden" name="confirm" value="1">
+<?php include 'persona_detail.php' ?>
+                	<p class="continue"><button type="submit" class="button"><span>confirm deletion</span><span class="arrow">&nbsp;</span></button></p>
+            	</form>
+            </div>
+            <div id="secondary-content">
+              <ol id="upload-steps">
+                <li class="current">
+                    <div class="wrapper">
+                        <h3>Step 1:</h3>
+                        <h4><?= $title ?></h4>
+                    </div>
+                </li>
+                <li>
+                    <h3>Step 2:</h3>
+                    <h4>Finish</h4>
+                </li>
+              </ol>
+            </div>
+        </div>
+    </div>
+<?php include 'footer.php'; ?>
+    <script type="text/javascript" charset="utf-8">
+        $(document).ready(function () {
+            $("#header").ie6Warning({"message":'<div id="ie6">Upgrade your browser to get the most out of this website. <a href="%LINK%">Download Firefox for free</a>.</div>'});
+            $("#try-button").personasButton({
+                                        'hasPersonas':'<span>wear this</span><span>&nbsp;</span>',
+                                        'hasFirefox':'<span>get personas now!</span><span>&nbsp;</span>',
+                                        'noFirefox':'<span>get personas with firefox</span><span>&nbsp;</span>'
+                                        });
+        });
+    </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/server/templates/persona_detail.php
@@ -0,0 +1,33 @@
+ <?php
+	if ($persona['id'])
+	{
+?>
+				<h2><?= $persona['name'] ?></h2>
+                <h3>created by <?= $persona['author'] ?></h3>
+                <img class="detailed-view"  alt="<?= $persona['name'] ?>" persona="<?= $persona['json'] ?>" src="<?= PERSONAS_LIVE_PREFIX . '/' . url_prefix($persona['id']) ?>/preview_large.jpg" >
+                
+<?php
+		if ($persona['description'])
+		{
+			$desc = preg_replace('/(https?:\/\/[^ ]+[A-Za-z0-9])/', '<a href="$1">$1</a>', $persona['description']);
+?>
+				<p class="description"><strong>Description:</strong> <?= $desc ?></p>
+<?php
+		}
+?>
+                <p id="buttons">
+                    <a href="#" class="button" id="try-button" persona="<?= $persona['json'] ?>"><span>try it now</span><span>&nbsp;</span></a>
+                </p>
+                
+<?php
+		if ($persona['popularity'])
+			print '<p class="numb-users">' . number_format($persona['popularity']) . ' active daily users</p>';
+	?>
+	<p><script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=df86b16e-195c-4917-ae28-61a1382ba281&amp;type=website&amp;send_services=&amp;post_services=facebook%2Cdigg%2Cdelicious%2Cybuzz%2Ctwitter%2Cstumbleupon%2Creddit%2Ctechnorati%2Cmixx%2Cblogger%2Ctypepad%2Cwordpress%2Cgoogle_bmarks%2Cwindows_live%2Cmyspace%2Cfark%2Cbus_exchange%2Cpropeller%2Cnewsvine%2Clinkedin"></script></p>
+	<?php
+	} else {
+?>            
+                <p class="description">We are unable to find this persona. Please return to the gallery and try again.</p>
+<?php
+	}
+?>
--- a/server/viewpersonas.php
+++ b/server/viewpersonas.php
@@ -1,9 +1,46 @@
 <?php 
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Personas Server
+#
+# The Initial Developer of the Original Code is
+# Mozilla Labs.
+# Portions created by the Initial Developer are Copyright (C) 2008
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#	Toby Elliott (telliott@mozilla.com)
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
 	require_once 'lib/personas_constants.php';	
 	require_once 'lib/personas_functions.php';	
 	require_once 'lib/storage.php';
 	require_once 'lib/user.php';
 	
 	$db = new PersonaStorage();
 	$user = new PersonaUser();
 	$user->authenticate();
@@ -77,17 +114,16 @@
 <?php include 'templates/nav.php'; ?>
             <div id="header">
                 <h2><?= $page_header ?></h2>
                 <h3>Your browser, your style! Dress it up with easy-to-change "skins" for your Firefox.</h3>
             </div>
             <div id="maincontent">
                 <p id="breadcrumbs"><a href="http://www.getpersonas.com">Personas Home</a> : <a href="http://www.getpersonas.com/gallery/All/Popular">Gallery</a> : <?= $category ?><?php if ($tab != "All") { echo " : $tab"; } ?></p>
                 <div id="gallery">
-                    <ul>
 <?php
 			
 			if ($tab == 'Search')
 			{
 ?>
 				<form action="" method=GET>
 				<input type=text name=p value='<?= array_key_exists('p', $_GET) ? $_GET['p'] : '' ?>'><input type=submit value="Search"><p>
 				</form>
@@ -98,37 +134,40 @@
 				}
 			}
 			elseif (count($list) == 0)
 			{
 				echo "<p>There are no personas available here. Please use the navigation on the left to choose another category.</p>";
 			}
 			
 			include 'templates/pagination.php';
+?>
+					<ul>
+<?php
 			foreach ($list as $persona)
 			{
 				$preview_url = PERSONAS_LIVE_PREFIX . '/' . url_prefix($persona['id']) . '/' . "preview.jpg";
-				$persona_json = htmlentities(json_encode(extract_record_data($persona)));
-				$persona_date = date("n/j/Y", strtotime($persona['approve']));
-				$persona_description = $persona['description'];
-				if (strlen($persona_description) > $description_max)
+				$persona['json'] = htmlentities(json_encode(extract_record_data($persona)));
+				$persona['date'] = date("n/j/Y", strtotime($persona['approve']));
+				$persona['short_description'] = $persona['description'];
+				if (strlen($persona['short_description']) > $description_max)
 				{
-					$persona_description = substr($persona_description, 0, $description_max);
-					$persona_description = preg_replace('/ [^ ]+$/', '', $persona_description) . '...';
+					$persona['short_description'] = substr($persona['short_description'], 0, $description_max);
+					$persona['short_description'] = preg_replace('/ [^ ]+$/', '', $persona['short_description']) . '...';
 				}
 ?>
                         <li class="gallery-item">
                             <div>
                                 <h3><?= $persona['name'] ?></h3>
                                 <div class="preview">
-                                    <img src="<?= $preview_url ?>" alt="<?= $persona['name'] ?>" persona="<?= $persona_json ?>"/>
+                                    <img src="<?= $preview_url ?>" alt="<?= $persona['name'] ?>" persona="<?= $persona['json'] ?>"/>
                                 </div>
                                 <p class="designer"><strong>Designer:</strong> <a href="/gallery/Designer/<?= $persona['author'] ?>"><?= $persona['author'] ?></a></p>
-                                <p class="added"><strong>Added:</strong> <?= $persona_date ?></p>
-                                <p><?= $persona_description ?></p>
+                                <p class="added"><strong>Added:</strong> <?= $persona['date'] ?></p>
+                                <p><?= $persona['short_description'] ?></p>
                                 <p><?= number_format($persona['popularity']) ?> active daily users</p>
                                 <p><a href="<?= "/persona/" . ($persona['id'] < 10 ? "0" : "") . $persona['id'] ?>" class="view">view details ยป</a></p>
 <?php
 				if ($tab == 'My' || $user->has_admin_privs())
 				{
 					echo '<p><a href="/upload?id=' . $persona['id'] . '" target="_blank">Edit</a>';
 					if ($user->has_admin_privs())
 						echo ' | <a href="/admin/pending.php?verdict=pull&id=' . $persona['id'] . '" target="_blank" onClick="return confirm(\'Confirm Deletion\');">Pull</a>';