~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/browser/vocabulary.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-09-21 14:30:41 UTC
  • mfrom: (13997.1.3 target-pickers-text-sucks)
  • Revision ID: launchpad@pqm.canonical.com-20110921143041-h0tbqg6jpqm5w1fz
[r=sinzui][bug=853968] Use the expander to reveal the project summary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
            enhanced = bool(getFeatureFlag(
258
258
                'disclosure.target_picker_enhancements.enabled'))
259
259
            if enhanced:
 
260
                picker_entry.details = []
 
261
                summary = picker_entry.description
 
262
                if len(summary) > 45:
 
263
                    index =  summary.rfind(' ', 0, 45)
 
264
                    first_line = summary[0:index + 1]
 
265
                    second_line = summary[index:]
 
266
                else:
 
267
                    first_line = summary
 
268
                    second_line = ''
 
269
 
 
270
                if len(second_line) > 90:
 
271
                    index =  second_line.rfind(' ', 0, 90)
 
272
                    second_line = second_line[0:index+1] 
 
273
                picker_entry.description = first_line
 
274
                picker_entry.details.append(second_line)
260
275
                picker_entry.alt_title = target.name
261
276
                picker_entry.target_type = self.target_type
262
277
                maintainer = self.getMaintainer(target)
263
278
                if maintainer is not None:
264
 
                    picker_entry.details = [
265
 
                        'Maintainer: %s' % self.getMaintainer(target)]
 
279
                    picker_entry.details.append( 
 
280
                        'Maintainer: %s' % self.getMaintainer(target))
266
281
        return entries
267
282
 
268
283