r252486 - Products.EasyNewsletter/branches/bpi-rouet-2011-09/Products/EasyNewsletter/browser

"R??gis Rouet" <svn-changes-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.collective.cvs
Message-ID <[email protected]>
Author: regisrouet
Date: Wed Jul 10 16:49:42 2013
New Revision: 252486

Added:
   Products.EasyNewsletter/branches/bpi-rouet-2011-09/Products/EasyNewsletter/browser/delete_csv.pt
Log:
new feature : delete subscribers from csv

Added: Products.EasyNewsletter/branches/bpi-rouet-2011-09/Products/EasyNewsletter/browser/delete_csv.pt
==============================================================================
--- (empty file)
+++ Products.EasyNewsletter/branches/bpi-rouet-2011-09/Products/EasyNewsletter/browser/delete_csv.pt	Wed Jul 10 16:49:42 2013
@@ -0,0 +1,119 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+      xmlns:tal="http://xml.zope.org/namespaces/tal"
+      xmlns:metal="http://xml.zope.org/namespaces/metal"
+      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+      lang="en"
+      metal:use-macro="here/main_template/macros/master"
+      i18n:domain="EasyNewsletter">
+<body>
+
+<metal:main fill-slot="main">
+    <tal:main-macro metal:define-macro="main"
+           tal:define="kssClassesView context/@@kss_field_decorator_view;
+                       getKssClasses nocall:kssClassesView/getKssClassesInlineEditable;
+                       templateId template/getId;
+                       text here/getText;">
+
+        <div tal:replace="structure provider:plone.abovecontenttitle" />
+
+        <h1 class="documentFirstHeading">
+            <span tal:omit-tag=""
+                  i18n:translate="easynewsletter_subcribers_label">Subscribers</span>
+        </h1>
+
+        <form method="POST" action="#"  enctype="multipart/form-data"
+                tal:attributes="action request/URL0">
+
+           <fieldset>
+              <legend i18n:translate="">
+                Mass Delete
+              </legend>
+
+              <p i18n:translate="">The CSV file must contain the header and follow this format</p>
+              <table class="listing">
+                  <thead>
+                    <tr>
+                      <th i18n:translate="">salutation</th>
+                      <th i18n:translate="">fullname</th>
+                      <th i18n:translate="">email</th>
+                      <th i18n:translate="">organization</th>
+                    </tr>
+                  </thead>
+                  <tbody>
+                  <tr>
+                      <td>Dear Mr.</td>
+                      <td>John Doe</td>
+                      <td>jd-9IKiO1iGCm/[email protected]</td>
+                      <td>ACME Corp.</td>
+                  </tr>
+                  </tbody>
+              </table>
+
+              <div class="field">
+                <label i18n:translate="">Csv file</label>
+                <div class="formHelp" i18n:translate="">
+                  Select your CSV file here.
+                </div>
+                <input type="file" name="csv_upload" />
+              </div>
+              
+              <div class="formControls"
+                   i18n:domain="plone">
+
+                <input class="standalone"
+                       type="submit"
+                       value="Mass Delete"
+                       name="form.button.Delete"
+                       i18n:attributes="value;"
+                       />
+
+              </div>
+
+            </fieldset>
+        </form>
+        <div tal:define="subscribers view/delete_subscribers;
+                         fail subscribers/fail | nothing;
+                         success subscribers/success | nothing;"
+                         tal:condition="python: fail or success">
+
+            <h3 i18n:translate="not_deleted_subscribers"
+                tal:condition="fail">Not deleted subscribers</h3>
+            <table class="listing" tal:condition="fail">
+                <thead>
+                    <tr>
+                        <th i18n:translate="">Salutation</th>
+                        <th i18n:translate="">Fullname</th>
+                        <th i18n:translate="">Email</th>
+                        <th i18n:translate="">Organization</th>
+                        <th i18n:translate="">Reason for failure</th>
+                    </tr>
+                </thead>
+                <tbody tal:repeat="item fail">
+                    <tr>
+                        <td tal:content="item/salutation | nothing" />
+                        <td tal:content="item/fullname | nothing" />
+                        <td tal:content="item/email | nothing" />
+                        <td tal:content="item/organization | nothing" />
+                        <td tal:content="item/failure" />
+                    </tr>
+                </tbody>
+            </table>             
+            <p tal:condition="fail"
+               i18n:translate="">            
+               <span tal:define="count python:len(fail)"
+                     tal:content="string: ${count}"
+                     i18n:name="count">Number</span> delete(s) failed. 
+            </p>            
+            <p tal:condition="success"
+               i18n:translate="">            
+               <span tal:define="count success"
+                     tal:content="string: ${count}"
+                     i18n:name="count">Number</span> delete(s) successful. 
+            </p>
+        </div>
+
+    </tal:main-macro>
+</metal:main>
+
+</body>
+</html>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.