[cig-commits] r11613 - in cs/portal/trunk/magportal: . MagWebPortal MagWebPortal/site MagWebPortal/static/css MagWebPortal/templates MagWebPortal/templates/MagWebPortal MagWebPortal/templates/registration

wei at geodynamics.org wei at geodynamics.org
Thu Mar 27 16:25:08 PDT 2008


Author: wei
Date: 2008-03-27 16:25:08 -0700 (Thu, 27 Mar 2008)
New Revision: 11613

Modified:
   cs/portal/trunk/magportal/MagWebPortal/forms.py
   cs/portal/trunk/magportal/MagWebPortal/models.py
   cs/portal/trunk/magportal/MagWebPortal/notifications.py
   cs/portal/trunk/magportal/MagWebPortal/site/settings.py
   cs/portal/trunk/magportal/MagWebPortal/static/css/style.css
   cs/portal/trunk/magportal/MagWebPortal/templates/404.html
   cs/portal/trunk/magportal/MagWebPortal/templates/500.html
   cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/base.html
   cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/home.html
   cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/inputdatafile_confirm_delete.html
   cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/inputdatafile_form.html
   cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/root.html
   cs/portal/trunk/magportal/MagWebPortal/templates/registration/pwreset_email.txt
   cs/portal/trunk/magportal/MagWebPortal/urls.py
   cs/portal/trunk/magportal/MagWebPortal/views.py
   cs/portal/trunk/magportal/daemon.py
Log:
Various code clean up, and templets and home page update

Modified: cs/portal/trunk/magportal/MagWebPortal/forms.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/forms.py	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/forms.py	2008-03-27 23:25:08 UTC (rev 11613)
@@ -242,38 +242,50 @@
         self.fields.extend([
             forms.HiddenField(field_name='user', is_required=True),
             ])
-        #self.fields.extend([forms.TextField('name', maxlength=100,  is_required=True),])
-        #self.fields.extend([forms.TextField('outfile', maxlength=100,  is_required=True),])
-        #self.fields.extend([forms.TextField('runid', maxlength=100,  is_required=True),])
-        #self.fields.extend([forms.TextField('init', maxlength=100,  is_required=True),])
-        #self.fields.extend([forms.TextField('treset', maxlength=100,  is_required=True),])
-        #self.fields.extend([forms.TextField('samp', maxlength=100,  is_required=True),])
-        #outfile = models.CharField(maxlength=10) # 
-        # runid = models.CharField(maxlength=100)
-		  # init = models.IntegerField(choices=INIT_STATUS, default=1)
-		  #  treset = models.BooleanField(core=True)
-		  #  samp = models.FloatField(max_digits=10, decimal_places=10,default=0.1000)
-		  #  nstep = models.IntegerField(default=200)
-		  #  nprnt = models.IntegerField(default=8)
-		  #  nstor = models.IntegerField(default=04)
-		  #  nplog = models.IntegerField(default=0)
-		  #  nlogstep = models.IntegerField(default=100)
-		  #  ngform = models.IntegerField(default=1)
-		  #  ngrad = models.IntegerField(default=01)
-		  #  ngcolat = models.IntegerField(default=1)
-		  #  nglon = models.IntegerField(default=1)
         return
 
-    def save(self, new_data, user):
-        from datetime import datetime
+    def save(self, new_data):
+        name = str(new_data['name'])
+        outfile = str(new_data['outfile'])
+        infile = " "
+        runid = str(new_data['runid'])
+        init = int(new_data['init'])
+        treset = new_data.has_key('treset')
+        samp = float(new_data['samp'])
+        nstep = int(new_data['nstep'])
+        nprnt = int(new_data['nprnt'])
+        nstor = int(new_data['nstor'])
+        nplog = int(new_data['nplog'])
+        nlogstep = int(new_data['nlogstep'])
+        ngform = int(new_data['ngform'])
+        ngrad = int(new_data['ngrad'])
+        ngcolat = int(new_data['ngcolat'])                           
+        nglon = int(new_data['nglon'])
+        ifbfrz = new_data.has_key('ifbfrz')
+        dtmax = float(new_data['dtmax'])
+        courfac = float(new_data['courfac'])
+        alffac = float(new_data['alffac'])
+        radratio = float(new_data['radratio'])
+        ra = float(new_data['ra']) 
+        ek = float(new_data['ek'])
+        prmag = float(new_data['prmag'])
+        bpeak = float(new_data['bpeak'])
+        epsc0 = float(new_data['epsc0'])
+        imagcon = int(new_data['imagcon'])
+        ktops = int(new_data['ktops'])
+        kbots = int(new_data['kbots'])
+        ktopv = int(new_data['ktopv'])
+        kbotv = int(new_data['kbotv'])
+        difamp = int(new_data['difamp'])
+        imovopt = int(new_data['imovopt'])
+        tmovstart = float(new_data['tmovstart'])
+        tmovstep = float(new_data['tmovstep'])
+        iframes = float(new_data['iframes'])
+        # icour = int(d['icour'])
         
-        # Create the new InputdataFile.
-        inputdatafile = InputdataFile.objects.create(user = user,
-                                     name = new_data['name'])
+        return super(InputdataFileAddManipulator, self).save(new_data)    
 
-        return inputdatafile
 
-
 class InputdataFileChangeManipulator(InputdataFile.ChangeManipulator):
 
     def __init__(self, inputdatafile):
@@ -282,16 +294,8 @@
         object_id = inputdatafile.id
         super(InputdataFileChangeManipulator, self).__init__(object_id)
         
-        # replace generic fields with custom fields
-        #del self['inputdatafile']
-        #self.fields.extend([forms.TextField('name',        maxlength=100,  is_required=True),])
         return
-
-    def flatten_data(self):
-        new_data =  super(InputdataFileChangeManipulator, self).flatten_data()
-        new_data['name'] = self.inputdatafile.name
-        return new_data
-
+        
     def save(self, new_data, user):
         
         # Save inputdatafile info.
@@ -301,9 +305,7 @@
 
         # Save the Inputdata.
         new_data['inputdatafile'] = inputdatafile.id
-        super(InputdataFileChangeManipulator, self).save(new_data)
-        
-        return inputdatafile
+        return super(InputdataFileChangeManipulator, self).save(new_data)
 
 
 class UploadInputdataFileManipulator(forms.Manipulator):
@@ -314,16 +316,20 @@
             forms.TextField('name', maxlength=100, is_required=True),
             forms.FileUploadField(field_name='parfile', is_required=True),
             ]
+        self.fields.extend([
+            forms.HiddenField(field_name='user', is_required=True),
+            ])
+        return
 
     #def get_validation_errors(self, new_data):
     #    errors = super(UploadInputdataFileManipulator, self).get_validation_errors(new_data)
         
-    #    if not errors.get('cmtsolution'):
+    #    if not errors.get('inputformat'):
     #        try:
-    #            cmtSolution = new_data['cmtsolution']['content']
-    #            CMTSolution.parse(cmtSolution)
+    #            inputFormat = new_data['inputformat']['content']
+    #            InputFormat.parse()
     #        except Exception, e:
-    #            errors['cmtsolution'] = ['Please select a file in CMTSOLUTION format.']
+    #            errors['inputfomat'] = ['Please select a file in inputdatat format.']
 
     #    return errors
 
@@ -331,6 +337,7 @@
 
         # Parse the uploaded InputdataFile.
         parFile = new_data['parfile']['content']
+        # name = new_data['name']
         stream = StringIO(parFile)
         stream.readline() # skip &contrl
 
@@ -391,7 +398,8 @@
                                          tmovstep = float(d['tmovstep']),
                                           iframes = int(d['iframes']),
                                           # icour = int(d['icour']),
-                                             name = new_data['name'])
+                                           infile = str(""),
+                                             name = new_data['name'])                                   
 
 
         return inputdatafile

Modified: cs/portal/trunk/magportal/MagWebPortal/models.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/models.py	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/models.py	2008-03-27 23:25:08 UTC (rev 11613)
@@ -27,15 +27,16 @@
     # each user has a list of their own inputdatafiles
     user = models.ForeignKey(User)
     
-    name = models.CharField(maxlength=100)
+    name = models.CharField(maxlength=100, core=True)
+    #restart = models.IntegerField(choices=INIT_STATUS, default=1)
     
     #input, output, stepping control, initialization of the run
-    outfile = models.CharField(maxlength=10) # 
+    outfile = models.CharField(maxlength=20) # 
     runid = models.CharField(maxlength=100)
     init = models.IntegerField(default=404)
-    infile = models.CharField(maxlength=20)
+    infile = models.CharField(maxlength=20, blank=True, null=True)
     treset = models.BooleanField(core=True, default=False)
-    samp = models.FloatField(max_digits=10, decimal_places=10, default=0.1000)
+    samp = models.FloatField(max_digits=19, decimal_places=10, default=0.1000)
     nstep = models.IntegerField(default=200)
     nprnt = models.IntegerField(default=8)
     nstor = models.IntegerField(default=04)
@@ -51,7 +52,7 @@
     dtmax = models.FloatField(max_digits=19, decimal_places=10, default=1.5E-4)
     courfac = models.FloatField(max_digits=19, decimal_places=10, default=5.0)
     alffac = models.FloatField(max_digits=19, decimal_places=10, default=0.1)
-    icour = models.IntegerField(default=4)
+    icour = models.IntegerField(default=4, blank=True)
     
     # Physical control parameters
     radratio = models.FloatField(max_digits=19, decimal_places=10, default=0.35)
@@ -74,7 +75,7 @@
     
     # parameters for generationg movie files
     imovopt = models.IntegerField(default=000)
-    tmovstart = models.FloatField(max_digits=5, decimal_places=10, default=0.0)
+    tmovstart = models.FloatField(max_digits=19, decimal_places=10, default=0.0)
     tmovstep = models.FloatField(max_digits=19, decimal_places=10, default=0.E-3)
     iframes = models.IntegerField(default=000)
 
@@ -251,7 +252,7 @@
         obj = copy(self)
         obj.id = None
         obj.user = objMap[User][self.user.id]
-        obj.inputdatafiles = objMap[InputdataFile][self.inputdatafiles.id]
+        obj.InputdataFile = objMap[InputdataFile][self.InputdataFile.id]
         super(Simulation, obj).save()
         return obj
 

Modified: cs/portal/trunk/magportal/MagWebPortal/notifications.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/notifications.py	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/notifications.py	2008-03-27 23:25:08 UTC (rev 11613)
@@ -12,10 +12,10 @@
                "",
                "To download the output, visit the following web page:",
                "",
-               "http://dynamo.geodynamics.org:8000%s/simulations/%d/" % (URL_ROOT, sim.id),
+               "http://dynamo.geodynamics.org%s/simulations/%d/" % (URL_ROOT, sim.id),
                "",
                "Sincerely,",
-               "The Web Portal",
+               "The CIG MAG Web Portal",
                ]
     message = "\n".join(message)
     
@@ -23,7 +23,26 @@
     
     return
 
+def notify_admins_of_successful_simulation(sim):
 
+    user = sim.user
+
+    subject = 'The simulation "%s" has finished running.' % sim.name
+    message = ['The simulation "%s" for ("%s") has finished running.' % (sim.name, user),
+               "",
+               "To download the output, visit the following web page:",
+               "",
+               "http://dynamo.geodynamics.org%s/simulations/%d/" % (URL_ROOT, sim.id),
+               "",
+               "Sincerely,",
+               "The CIG MAG Web Portal",
+               ]
+    message = "\n".join(message)
+    
+    mail_admins(subject, message, fail_silently=True)
+    
+    return
+
 def notify_admins_of_failed_simulation(sim):
 
     subject = 'simumlation %d failed' % sim.id

Modified: cs/portal/trunk/magportal/MagWebPortal/site/settings.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/site/settings.py	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/site/settings.py	2008-03-27 23:25:08 UTC (rev 11613)
@@ -2,12 +2,17 @@
 
 import os
 
-DEBUG = True
+DEBUG = os.environ.has_key("WEBPORTAL_DEBUG") 
 TEMPLATE_DEBUG = DEBUG
 
-ADMINS = (
-     ('Wei', 'wei at geodynamics.org'),
-)
+if DEBUG:
+    ADMINS = (
+        ('Wei', 'wei at geodynamics.org'),
+    )
+else:
+    ADMINS = (
+        ('Wei', 'wei at geodynamics.org'),
+    )
 
 MANAGERS = ADMINS
 

Modified: cs/portal/trunk/magportal/MagWebPortal/static/css/style.css
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/static/css/style.css	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/static/css/style.css	2008-03-27 23:25:08 UTC (rev 11613)
@@ -379,11 +379,11 @@
 }
 
 span.True:before {
-    content: url(/specfem3dglobe/pics/icon-yes.gif) " ";
+    content: url(/magwebportal/images/icon-yes.gif) " ";
 }
 
 span.False:before {
-    content: url(/specfem3dglobe/pics/icon-no.gif) " ";
+    content: url(/magwebportal/images/icon-no.gif) " ";
 }
 
 .float {

Modified: cs/portal/trunk/magportal/MagWebPortal/templates/404.html
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/templates/404.html	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/templates/404.html	2008-03-27 23:25:08 UTC (rev 11613)
@@ -1,9 +1,9 @@
 
-{% extends "hello/root.html" %}
+{% extends "MagWebrPortal/root.html" %}
 
 {% block body %}
 
-<p><a href="/hello/"><img id=logo src="/hello/static/cig.gif" width=78 height=75>Home</a>
+<p><a href="/magwebportal/"><img id=logo src="/mabwebportal/static/cig.gif" width=78 height=75>Home</a>
 
 <h1>Not Found</h1>
 

Modified: cs/portal/trunk/magportal/MagWebPortal/templates/500.html
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/templates/500.html	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/templates/500.html	2008-03-27 23:25:08 UTC (rev 11613)
@@ -1,9 +1,9 @@
 
-{% extends "hello/root.html" %}
+{% extends "MagWebPortal/root.html" %}
 
 {% block body %}
 
-<p><a href="/hello/"><img id=logo src="/hello/static/cig.gif" width=78 height=75>Home</a>
+<p><a href="/magwebportal/"><img id=logo src="/magwebportal/static/cig.gif" width=78 height=75>Home</a>
 
 <h1>Internal Server Error</h1>
 

Modified: cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/base.html
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/base.html	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/base.html	2008-03-27 23:25:08 UTC (rev 11613)
@@ -15,6 +15,11 @@
     <h2>Web Portal</h2>
 </div>
 
+<div class=messages>
+    <h3></h3>
+</div>
+
+
 {% if messages %}<span class=messages>{{ messages|join:" " }}</span>{% endif %}
 
 {% block desktop %}

Modified: cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/home.html
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/home.html	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/home.html	2008-03-27 23:25:08 UTC (rev 11613)
@@ -16,15 +16,47 @@
 
 <h3>quick start</h3>
 
-<p>To set-up a new simulation, proceed as follows:
+<p>To set up a new simulation, proceed as follows:
 
+
+<p>A. Using pre-loaded input parameter files:</p>
 <ol>
-    <li>Click "Simulations".
-    <li>Click "New...".
-    <li>Enter the parameters for the simulation.
-    <li>Click "Run".
+    <li>On the top toolbar, click the <b>simulations</b> tab
+    <li>Click the <b>New...</b> button
+    <li>Name the simulation, e.g., MagTest1
+    <li>Enter the parameters "Longitudinal Symmetry" and "Spherical Truncation Order" for the simulation. For the pre-loaded files, "Longitudinal Symmetry" is 4 and "Spherical Truncation Order" is 32.
+    <li>Select input file from the list
+    <li>Click <b>Save</b> or <b>Save and Run</b>
+<ul><li>If you Save it and decide to run it later, click the <b>simulations</b> tab, then the job name, and click the <b>Run</b> button</ul>
 </ol>
 
+<p>B. Composing an input parameter file:</p>
+<ol>
+    <li>On the top toolbar, click the <b>input files</b> tab
+    <li>Click the <b>New...</b> button
+    <li>Fill out the resulting form
+<ol type=a><li>Name the input file, e.g., InputTest1
+<li>Enter the parameters for the simulation. Note: the input parameters are populated with values from benchmark case 1; please see <a href="/magwebportal/static/doc/mag_book.pdf">
+   MAG User Manual</a> for references. For help on each parameter, click the <b>Show Help</b> button
+    <li>Click <b>Save</b>
+</ol>
+    <li>Click the <b>simulations</b> tab follow the steps in section A above, "Using pre-loaded input parameter files" to create a simulation using your input file.
+
+</ol>
+
+<p>C. Uploading an input parameter file from your file system:</p>
+<ol>
+    <li>On the top toolbar, click the <b>input files</b> tab
+    <ul><li>The uploaded file must be in the MAG input file format; please see Appendix B of the <a href="/magwebportal/static/doc/mag_book.pdf">
+   MAG User Manual</a></ul>
+    <li>Click the <B>Upload...</b> button
+    <li>Enter the name for your input file
+    <li>Click <b>browse</b> to find the local file you want to upload
+    <li>Click the <b>Upload</b> button
+    <li>Click the <b>simulations</b> tab and follow the steps in section A above, "Using pre-loaded input parameter files"
+</ol>
+
+
 <h3>contact</h3>
 
 <p>Please send bug reports and suggestions to <a href="mailto:portal at geodynamics.org">portal at geodynamics.org</a>.

Modified: cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/inputdatafile_confirm_delete.html
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/inputdatafile_confirm_delete.html	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/inputdatafile_confirm_delete.html	2008-03-27 23:25:08 UTC (rev 11613)
@@ -3,10 +3,10 @@
 
 {% block content %}
 
-<h2 class=titlebar>delete inputdatafile</h2>
+<h2 class=titlebar>delete input data file</h2>
 
 <form method="post" action="/magwebportal/inputdatafiles/{{ object.id }}/delete/">
-    <p>Are you sure you want to delete the inputdatafile "{{ object }}"?
+    <p>Are you sure you want to delete the input data file "{{ object }}"?
     <p><input type="submit" value="Delete" />
 </form>
 

Modified: cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/inputdatafile_form.html
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/inputdatafile_form.html	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/inputdatafile_form.html	2008-03-27 23:25:08 UTC (rev 11613)
@@ -48,7 +48,13 @@
         {{ form.name }}
         {% if form.name.errors %}<span class=error>{{ form.name.errors|join:", " }}</span>{% endif %}
     </div>
-
+    
+<!--    <div>
+        <label for="id_restart" class=before>start from restart file?</label>
+        {{ form.restart }}
+        {% if form.restart.errors %}<span class=error>{{ form.restart.errors|join:", " }}</span>{% endif %}
+    </div>
+-->
     <fieldset><legend>MAG Run Parameters</legend>
 
     {% block mag_run_params %}
@@ -65,18 +71,19 @@
         {% if help_visible %}<span class=help>Set 1 to start from scratch (random noise initial condition)
         set 0 to start from a previous result obtained on the same
         grid and has been written into a file named d[0-9].<name>
-        set to a value >= 100 to start from an initial temperature
+        set to a value >= 100 to start from an initial temperatrue
         perturbation of one given mode l,m. Here, m is given by the two
         last digits of init and l by the preceding digits; for example
-        init=606 means that a temperature perturbation of l=6 and m=6
+        init=606 means that a temperatrue perturbation of l=6 and m=6
         is imposed.</span>{% endif %}
     </div>
-    <div>
-        <label for="id_treset" class=before>treset</label>
+    <div class=checkbox>
         {{ form.treset }}
+        <label for="id_treset" class=after>treset</label>
         {% if form.treset.errors %}<span class=error>{{ form.treset.errors|join:", " }}</span>{% endif %}
-        {% if help_visible %}<span class=help>If ture(checked), reset time and step counter to zero when starting from a stored dataset. The default is: False.</span>{% endif %}
+        {% if help_visible %}<span class=help>If true(checked), reset time and step counter to zero when starting from a stored dataset. The default is: False.</span>{% endif %}
     </div>
+    
     <div>
         <label for="id_runid" class=before>runid</label>
         {{ form.runid }}
@@ -158,11 +165,11 @@
         {% if form.nglon.errors %}<span class=error>{{ form.nglon.errors|join:", " }}</span>{% endif %}
         {% if help_visible %}<span class=help>Output on graphics file every nglon'th point in longitude.</span>{% endif %}
     </div>
-    <div>
-        <label for="id_ifbfrz" class=before>ifbfrz</label>
+    <div class=checkbox>
+        <label for="id_ifbfrz" class=after>ifbfrz</label>
         {{ form.ifbfrz }}
         {% if form.ifbfrz.errors %}<span class=error>{{ form.ifbfrz.errors|join:", " }}</span>{% endif %}
-        {% if help_visible %}<span class=help>If ture(checked), do not update magnetic filed during iteration. The default is: False.</span>{% endif %}
+        {% if help_visible %}<span class=help>If true(checked), do not update magnetic field during iteration. The default is: False.</span>{% endif %}
     </div>
 
     {% endblock %}
@@ -254,8 +261,23 @@
 
     </fieldset>
     
+    <fieldset><legend>Hyperdiffusivities</legend>
+
+    {% block hyper_control %}
     
+    <div>
+        <label for="id_difamp" class=before>difamp</label>
+        {{ form.difamp }}
+        {% if form.difamp.errors %}<span class=error>{{ form.difamp.errors|join:", " }}</span>{% endif %}
+        {% if help_visible %}<span class=help>Amplidtude of hyperdiffusivities. </span>{% endif %}
+    </div>
     
+    {% endblock %}
+
+    </fieldset>
+    
+    
+    
     <fieldset><legend>Boundary Conditions at inner and outer Radii</legend>
     
     {% block boundar_conditions_script %}

Modified: cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/root.html
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/root.html	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/templates/MagWebPortal/root.html	2008-03-27 23:25:08 UTC (rev 11613)
@@ -2,8 +2,8 @@
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
-    <LINK REL="SHORTCUT ICON"
-       HREF="magwebportal/static/images/cig-logo_small-initials.ico">
+    <LINK REL="SHORTCUT ICON"
+       HREF="https://dyanmo.geodynamics.org/magwebportal/ciglogo.ico">
     <link href="/magwebportal/static/css/style.css" type="text/css" rel="stylesheet" media="all" />
     <script type="text/javascript" language="javascript" src="/magwebportal/static/jss/main.js"></script>
     <title>{% block title %}MAG PORTAL{% endblock %}</title>

Modified: cs/portal/trunk/magportal/MagWebPortal/templates/registration/pwreset_email.txt
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/templates/registration/pwreset_email.txt	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/templates/registration/pwreset_email.txt	2008-03-27 23:25:08 UTC (rev 11613)
@@ -14,5 +14,6 @@
 Thanks for using our site!
 
 --
+Your Mag Portal Administrator
 Computational Infrastructure for Geodynamics
 http://www.geodynamics.org/

Modified: cs/portal/trunk/magportal/MagWebPortal/urls.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/urls.py	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/urls.py	2008-03-27 23:25:08 UTC (rev 11613)
@@ -60,20 +60,15 @@
     'post_delete_redirect': '/magwebportal/inputdatafiles/',
 }
 
-#inputdatafile_detail_args = {
-#    'queryset': InputdataFile.objects.all(),
-#    }
+inputdatafile_detail_args = {
+    'queryset': InputdataFile.objects.all(),
+    }
 
-#inputdatafile_create_update_args = {
-#    'model': InputdataFile,
-#    'post_save_redirect': '/magwebportal/inputdatafiles/',
-#    }
-
-#inputdata_delete_args = {
-#    'model': Inputdata,
-#    'post_delete_redirect': '/magwebportal/inputdatafiles/',
-#    }
-
+inputdatafile_create_update_args = {
+    'model': InputdataFile,
+    'post_save_redirect': '/magwebportal/inputdatafiles/',
+    }
+    
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # Runs, Jobs, Output
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -137,13 +132,9 @@
     (r'^inputdatafiles/upload/$', 'MagWebPortal.views.upload_inputdatafile'),
     (r'^inputdatafiles/(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', inputdatafile_detail_args),
     (r'^inputdatafiles/(?P<object_id>\d+)/edit/$', 'MagWebPortal.views.manipulate_inputdatafile', dict(action='edit')),
+    #(r'^inputdatafiles/(?P<object_id>\d+)/edit/$', 'MagWebPortal.views.manipulate_inputdatafile', inputdatafile_create_update_args),
     (r'^inputdatafiles/(?P<object_id>\d+)/delete/$', 'django.views.generic.create_update.delete_object', inputdatafile_delete_args),
     (r'^inputdatafiles/(?P<object_id>\d+)/edit/delete/$', 'django.views.generic.create_update.delete_object', inputdatafile_delete_args),
-    #(r'^inputdatafiles/inputdatas/(?P<object_id>\d+)/CMTSOLUTION\.txt$', 'MagWebPortal.views.cmtsolution_txt'),
-    #(r'^inputdatafiles/(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', inputdatafile_detail_args),
-    #(r'^inputdatafiles/(?P<object_id>\d+)/edit/$', 'MagWebPortal.views.manipulate_inputdatafile', dict(action='edit')),
-    #(r'^inputdatafiles/(?P<object_id>\d+)/delete/$', 'django.views.generic.create_update.delete_object', inputdatafile_delete_args),
-    #(r'^inputdatafiles/(?P<object_id>\d+)/ParFile\.txt$','MagWebPortal.views.inputdatafile_detail_parfile_txt'),
     (r'^inputdatafiles/(?P<object_id>\d+)/ParFile\.txt$','MagWebPortal.views.input_parameters_txt'),
     
     # runs

Modified: cs/portal/trunk/magportal/MagWebPortal/views.py
===================================================================
--- cs/portal/trunk/magportal/MagWebPortal/views.py	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/MagWebPortal/views.py	2008-03-27 23:25:08 UTC (rev 11613)
@@ -321,9 +321,10 @@
 
 
     if action == "create":
-        manipulator = InputdataFileAddManipulator()
+        manipulator = InputdataFile.AddManipulator()
         inputdatafile = None
     elif action == "edit":
+        #inputdatafile = get_object_or_404(InputdataFile, id=object_id, user__exact=request.user)
         inputdatafile = get_object_or_404(InputdataFile, id=object_id, user__exact=request.user)
         if not inputdatafile:
             return update_object(
@@ -333,7 +334,7 @@
                 post_save_redirect = '/magwebportal/inputdatafiles/',
                 follow = { 'user': False },
                 )
-        manipulator = InputdataFileChangeManipulator(inputdatafile)
+        manipulator = InputdataFile.ChangeManipulator(inputdatafile.id)
     else:
         raise Http404
     
@@ -341,7 +342,8 @@
     
     if request.method == 'POST':
         new_data = request.POST.copy()
-        errors = {}
+        errors = manipulator.get_validation_errors(new_data)
+        #errors = {}
         if new_data.has_key('show_help'):
             help_visible = True
             request.session['help_visible'] = help_visible
@@ -349,12 +351,16 @@
             help_visible = False
             request.session['help_visible'] = help_visible
         else:
-            errors = manipulator.get_validation_errors(new_data)            
+            new_data['user'] = request.user.id
+            new_data['infile'] = ""
+            new_data['icour'] = "4"
+            errors = manipulator.get_validation_errors(new_data)
             if not errors:
-				manipulator.do_html2python(new_data)
-            new_inputdatafile = manipulator.save(new_data, request.user)
-            url = "/magwebportal/inputdatafiles/%i/" % new_inputdatafile.id
-            return HttpResponseRedirect(url)
+                manipulator.do_html2python(new_data)
+                #new_inputdatafile = manipulator.save(new_data, request.user)
+                new_inputdatafile = manipulator.save(new_data)
+                url = "/magwebportal/inputdatafiles/%i/" % new_inputdatafile.id
+                return HttpResponseRedirect(url)
     else:
         new_data = manipulator.flatten_data()
         errors = {}
@@ -389,9 +395,13 @@
             request.session['help_visible'] = help_visible
         else:
             new_data.update(request.FILES)
+            new_data['user'] = request.user.id
+            #new_data['infile'] = ""
+            new_data['icour'] = "4"
             errors = manipulator.get_validation_errors(new_data)
             if not errors:
                 manipulator.do_html2python(new_data)
+                #new_inputdatafile = manipulator.save(new_data, request.user)
                 new_inputdatafile = manipulator.save(new_data, request.user)
                 url = "%s/%i/" % (dirname(dirname(request.path)), new_inputdatafile.id)
                 return HttpResponseRedirect(url)
@@ -588,8 +598,10 @@
             if not errors:
                 if isNewUser:
                     request.session.delete_test_cookie()
+                    help_login_hook(request, user)
+                    set_up_user_defaults(user)
                     notifications.notify_managers_of_new_user(request, user)
-                    user.message_set.create(message="Welcome to the CIG web portal!")
+                    user.message_set.create(message="Welcome to the CIG MAG web portal!")
                 else:
                     user.message_set.create(message="Your contact information has been saved.")
                 return HttpResponseRedirect(HOME)
@@ -609,7 +621,7 @@
 #~~~~~~~~~~~~~~~~~need to setup user template~~~~~~~~~~~~~~~~~
 def set_up_user_defaults(newUser):
     from django.contrib.auth.models import User
-    from models import InputparamFile, Simulation
+    from models import InputdataFile, Simulation
 
     if newUser.username == 'template':
         return
@@ -627,7 +639,7 @@
     # The order of model classes is significant: Simulations must be
     # copied last.
     
-    for ModelClass in [InputparamFile, Simulation]:
+    for ModelClass in [InputdataFile, Simulation]:
 
         queryset = ModelClass.objects.filter(user = templateUser)
         
@@ -775,6 +787,7 @@
                     notifications.notify_admins_of_failed_simulation(run.simulation)
                 else:
                     notifications.notify_user_of_successful_simulation(run.simulation)
+                    notifications.notify_admins_of_successful_simulation(run.simulation)
             run.save()
             response.write(repr('OK'))
         return response
@@ -814,6 +827,7 @@
                     notifications.notify_admins_of_failed_simulation(simulation)
                 else:
                     notifications.notify_user_of_successful_simulation(simulation)
+                    notifications.notify_admins_of_successful_simulation(simulation)
             simulation.save()
             response.write(repr('OK'))
         return response

Modified: cs/portal/trunk/magportal/daemon.py
===================================================================
--- cs/portal/trunk/magportal/daemon.py	2008-03-27 23:23:56 UTC (rev 11612)
+++ cs/portal/trunk/magportal/daemon.py	2008-03-27 23:25:08 UTC (rev 11613)
@@ -432,7 +432,7 @@
             jobType = "single",
             count = 1,
             queue= "serial",
-            maxWallTime="720",
+            maxWallTime="120",
             executable = MAG_DIR + "release/runMag-arg.sh",
             arguments = args + [self.simulation.parfile]
             )



More information about the cig-commits mailing list