← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~thumper/launchpad/inline-recipe-name-edit into lp:launchpad

 

Tim Penhey has proposed merging lp:~thumper/launchpad/inline-recipe-name-edit into lp:launchpad with lp:~thumper/launchpad/client-cache-sync as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~thumper/launchpad/inline-recipe-name-edit/+merge/51248

Add inline editing of the recipe name.

The question becomes how much testing is really needed for this?  Given that editing the name will cause the window.location to be updated.
-- 
https://code.launchpad.net/~thumper/launchpad/inline-recipe-name-edit/+merge/51248
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~thumper/launchpad/inline-recipe-name-edit into lp:launchpad.
=== modified file 'lib/lp/code/browser/sourcepackagerecipe.py'
--- lib/lp/code/browser/sourcepackagerecipe.py	2011-02-23 23:25:01 +0000
+++ lib/lp/code/browser/sourcepackagerecipe.py	2011-02-25 04:16:19 +0000
@@ -76,6 +76,7 @@
     BooleanChoiceWidget,
     InlineEditPickerWidget,
     TextAreaEditorWidget,
+    TextLineEditorWidget,
     )
 from lp.app.browser.tales import format_link
 from lp.app.widgets.itemswidgets import (
@@ -288,6 +289,12 @@
         return TextAreaEditorWidget(
             self.context, description, title="")
 
+    @property
+    def name_widget(self):
+        name = ISourcePackageRecipe['name']
+        title = "Edit the recipe name"
+        return TextLineEditorWidget(self.context, name, title, 'h1')
+
 
 def builds_for_recipe(recipe):
         """A list of interesting builds.

=== modified file 'lib/lp/code/templates/sourcepackagerecipe-index.pt'
--- lib/lp/code/templates/sourcepackagerecipe-index.pt	2011-02-25 04:16:18 +0000
+++ lib/lp/code/templates/sourcepackagerecipe-index.pt	2011-02-25 04:16:19 +0000
@@ -48,7 +48,7 @@
 </metal:side>
 
 <metal:heading fill-slot="heading">
-  <h1 tal:content="context/name">
+  <h1 tal:replace="structure view/name_widget">
     recipe name
   </h1>
 </metal:heading>