From 68ae08b75a9cb674eac622a2b8875c3cfb701f33 Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Fri, 7 Dec 2012 11:23:08 +0100 Subject: [PATCH] [gen] Simplified management and rendering of phases. --- gen/mixins/__init__.py | 4 ++-- gen/ui/appy.css | 8 +++----- gen/ui/nextPhase.png | Bin 211 -> 0 bytes gen/ui/page.pt | 2 +- gen/ui/portlet.pt | 9 +-------- gen/ui/template.pt | 2 +- gen/utils.py | 14 ++------------ 7 files changed, 10 insertions(+), 29 deletions(-) delete mode 100644 gen/ui/nextPhase.png diff --git a/gen/mixins/__init__.py b/gen/mixins/__init__.py index 0578bea..b47ec26 100644 --- a/gen/mixins/__init__.py +++ b/gen/mixins/__init__.py @@ -795,9 +795,9 @@ class BaseMixin: if not res[i]['pages']: del phases[res[i]['name']] del res[i] - # Then, compute status of phases + # Compute next/previous phases of every phase for ph in phases.itervalues(): - ph.computeStatus(res) + ph.computeNextPrevious(res) ph.totalNbOfPhases = len(res) # Restrict the result to the current phase if required if currentOnly: diff --git a/gen/ui/appy.css b/gen/ui/appy.css index c248ea1..f7fc001 100644 --- a/gen/ui/appy.css +++ b/gen/ui/appy.css @@ -80,12 +80,10 @@ img { border: 0; vertical-align: middle} .portletTitle { font-weight: bold; font-size: 110%; margin-bottom: 4px;} .portletCurrent { font-weight: bold; } .portletSep { border-top: 1px solid #5F7983; margin-top: 2px;} -.portletPage { font-style: italic; } -.portletGroup { font-variant: small-caps; font-weight: bold; font-style: normal; - margin-top: 0.1em } +.portletPage { font-style: italic } +.portletGroup { font-variant: small-caps; font-weight: bold; font-size: 105%; + margin: 0.1em 0 0.3em ; border-bottom: 1px dashed grey} .portletSearch { font-size: 90%; font-style: italic } -.phase { border-style: dashed; border-width: thin; padding: 4px 0.6em 5px 1em;} -.phaseSelected { background-color: #F4F5F6; } .content { padding: 14px 14px 9px 15px; background-color: #f1f1f1 } .grey { display: none; position: absolute; left: 0px; top: 0px; background:grey; opacity:0.5; -moz-opacity:0.5; -khtml-opacity:0.5; diff --git a/gen/ui/nextPhase.png b/gen/ui/nextPhase.png deleted file mode 100644 index 4dcc14587547ee53c24e75b6be47e9a1e9e92980..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 211 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRS!VDz&cWKWCQjEnx?oJHr&dIz4a)bhWLR|mf zSoMEPsD}ze4g-S+1H=Ctp&>D+r-PK11o;IsI6S+N2I3@nySp%Su*w3JFmM)lL>4nJ za0`PlBg3pY5H=O_S;-+ybMZgewW*TLb{$Vjv*Y^lM@cG#>B`pELpsONr+RV vuuz1>%YuuG$x^4ONy(s)O-yiunSwCGmI7A8fQoOqK#dHZu6{1-oD!M
- +
diff --git a/gen/ui/portlet.pt b/gen/ui/portlet.pt index bec1410..024267b 100644 --- a/gen/ui/portlet.pt +++ b/gen/ui/portlet.pt @@ -119,10 +119,7 @@ The box containing phase-related information - + The title of the phase
@@ -149,9 +146,5 @@ - The down arrow pointing to the next phase (if any) - -    - diff --git a/gen/ui/template.pt b/gen/ui/template.pt index 10f3921..0abb5b3 100644 --- a/gen/ui/template.pt +++ b/gen/ui/template.pt @@ -72,7 +72,7 @@ The message strip - +
diff --git a/gen/utils.py b/gen/utils.py index 42bb73e..ba0506c 100644 --- a/gen/utils.py +++ b/gen/utils.py @@ -121,7 +121,6 @@ class PhaseDescr(Descr): def __init__(self, name, obj): self.name = name self.obj = obj - self.phaseStatus = None # The list of names of pages in this phase self.pages = [] # The list of hidden pages in this phase @@ -164,17 +163,9 @@ class PhaseDescr(Descr): else: self.hiddenPages.append(appyType.page.name) - def computeStatus(self, allPhases): - '''Compute status of this phase, which depends on the page currently - shown. This method also fills fields "previousPhase" and "nextPhase" + def computeNextPrevious(self, allPhases): + '''This method also fills fields "previousPhase" and "nextPhase" if relevant, based on list of p_allPhases.''' - res = 'Current' - # Compute status based on current page - page = self.obj.REQUEST.get('page', 'main') - if page in self.pages: - res = 'Current' - else: - res = 'Deselected' # Identify previous and next phases for phaseInfo in allPhases: if phaseInfo['name'] == self.name: @@ -183,7 +174,6 @@ class PhaseDescr(Descr): self.previousPhase = allPhases[i-1] if i < (len(allPhases)-1): self.nextPhase = allPhases[i+1] - self.phaseStatus = res class SearchDescr(Descr): '''Describes a Search.'''