Merge lp:~thumper/launchpad/recipe-inline-edit-description into lp:launchpad

Proposed by Tim Penhey
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 12403
Proposed branch: lp:~thumper/launchpad/recipe-inline-edit-description
Merge into: lp:launchpad
Prerequisite: lp:~thumper/launchpad/recipe-inline-edit-recipe-text
Diff against target: 61 lines (+14/-6)
3 files modified
lib/lp/code/browser/sourcepackagerecipe.py (+7/-0)
lib/lp/code/interfaces/sourcepackagerecipe.py (+4/-3)
lib/lp/code/templates/sourcepackagerecipe-index.pt (+3/-3)
To merge this branch: bzr merge lp:~thumper/launchpad/recipe-inline-edit-description
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+49757@code.launchpad.net

Commit message

[r=gmb][bug=673530] Allow editing of the description using the multiline editor widget.

Description of the change

This branch enables the inline editing of the recipe description.

I talked with Deryck about the need to have the same widget tested
in all the places it is used and he reckons that it is a bit of
overkill. Hence no specific test here for the adding of the widget.

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/sourcepackagerecipe.py'
2--- lib/lp/code/browser/sourcepackagerecipe.py 2011-02-17 22:53:34 +0000
3+++ lib/lp/code/browser/sourcepackagerecipe.py 2011-02-17 22:53:35 +0000
4@@ -279,6 +279,13 @@
5 true_text='Built daily',
6 header='Change build schedule')
7
8+ @property
9+ def description_widget(self):
10+ """The description as a widget."""
11+ description = ISourcePackageRecipe['description']
12+ return TextAreaEditorWidget(
13+ self.context, description, title="")
14+
15
16 class SourcePackageRecipeRequestBuildsView(LaunchpadFormView):
17 """A view for requesting builds of a SourcePackageRecipe."""
18
19=== modified file 'lib/lp/code/interfaces/sourcepackagerecipe.py'
20--- lib/lp/code/interfaces/sourcepackagerecipe.py 2011-02-17 22:53:34 +0000
21+++ lib/lp/code/interfaces/sourcepackagerecipe.py 2011-02-17 22:53:35 +0000
22@@ -187,11 +187,12 @@
23 constraint=name_validator,
24 description=_("The name of this recipe.")))
25
26- description = Description(
27+ description = exported(Description(
28 title=_('Description'), required=True,
29- description=_('A short description of the recipe.'))
30+ description=_('A short description of the recipe.')))
31
32- date_last_modified = Datetime(required=True, readonly=True)
33+ date_last_modified = exported(
34+ Datetime(required=True, readonly=True))
35
36 is_stale = Bool(title=_('Recipe is stale.'))
37
38
39=== modified file 'lib/lp/code/templates/sourcepackagerecipe-index.pt'
40--- lib/lp/code/templates/sourcepackagerecipe-index.pt 2011-02-17 22:53:34 +0000
41+++ lib/lp/code/templates/sourcepackagerecipe-index.pt 2011-02-17 22:53:35 +0000
42@@ -12,7 +12,7 @@
43 .binary-build .indent {
44 padding-left: 2em;
45 }
46- #edit-recipe_text {
47+ div#edit-recipe_text, div#edit-description {
48 font-family: "UbuntuBeta Mono","Ubuntu Mono",monospace;
49 margin-top: -15px;
50 }
51@@ -39,8 +39,8 @@
52 <div class="yui-g first">
53 <div class="yui-u first">
54 <div class="portlet">
55- <h2>Description</h2>
56- <tal:description replace="context/description" />
57+ <h2 class="lazr-multiline-edit-header">Description</h2>
58+ <tal:description replace="structure view/description_widget"/>
59 </div>
60 </div>
61 <div class="yui-u">