Merge lp:~beuno/wikkid/fixes-on-a-plane into lp:wikkid

Proposed by Martin Albisetti
Status: Merged
Merged at revision: 41
Proposed branch: lp:~beuno/wikkid/fixes-on-a-plane
Merge into: lp:wikkid
Diff against target: 137 lines (+54/-7)
6 files modified
wikkid/skin/default/edit.html (+3/-3)
wikkid/skin/default/static/default.css (+14/-3)
wikkid/tests/views/__init__.py (+1/-0)
wikkid/tests/views/test_edit.py (+29/-0)
wikkid/twistedserver.py (+2/-1)
wikkid/view/edit.py (+5/-0)
To merge this branch: bzr merge lp:~beuno/wikkid/fixes-on-a-plane
Reviewer Review Type Date Requested Status
Tim Penhey Approve
Paul Hummer (community) Approve
Review via email: mp+26445@code.launchpad.net

Description of the change

I did a bunch of stuff on the plane:

* Edit pages now show a better title
* Added a test for the new edit page titles
* A few layout tweaks to the editing page
* Show a clickable URL when starting up

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

These changes look good. I see your comment about setting the host. Yes, in my paste branch, we'll be able to set the host. Unfortunately, I need to fiddle more with it before I'm ready to propose for merge myself (and fiddle with it a lot).

Anyway, back from that tangent, these changes look good to me.

review: Approve
Revision history for this message
Tim Penhey (thumper) wrote :

 review approve

Hi Martin,

My only extra suggestion would be to use the expanded wiki name instead of the
base name for the edit title.

Tim

review: Approve
lp:~beuno/wikkid/fixes-on-a-plane updated
42. By Martin Albisetti

Use expanded wiki name instead of the plain base name, per Tim's suggestion.

Revision history for this message
Martin Albisetti (beuno) wrote :

> My only extra suggestion would be to use the expanded wiki name instead of the
> base name for the edit title.

Great idea, done.

Should I go ahead and land this?

Revision history for this message
Tim Penhey (thumper) wrote :

I've merged it into trunk and fixed your now failing test :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wikkid/skin/default/edit.html'
2--- wikkid/skin/default/edit.html 2010-05-19 10:00:43 +0000
3+++ wikkid/skin/default/edit.html 2010-06-01 05:22:22 +0000
4@@ -6,12 +6,12 @@
5 {% endif %}
6 <form method="post" action="{{ view.request_path }}">
7 <textarea name="content">{{ view.content }}</textarea>
8- Describe the change: <input type="text" name="message" value=""/>
9+ Describe the change: <input type="text" id="message" name="message" value=""/>
10 {% if view.rev_id %}
11 <input type="hidden" name="rev-id" value="{{ view.rev_id }}"/>
12 {% endif %}
13- <div>
14- <input type="Submit" name="action" value="save" />
15+ <div class="save-cancel">
16+ <input type="Submit" name="action" value="Save" />
17 or <a href="{{ view.cancel_url }}">Cancel</a>
18 </div>
19 </form>
20
21=== modified file 'wikkid/skin/default/static/default.css'
22--- wikkid/skin/default/static/default.css 2010-05-25 22:12:26 +0000
23+++ wikkid/skin/default/static/default.css 2010-06-01 05:22:22 +0000
24@@ -59,9 +59,10 @@
25 clear:both;
26 visibility:hidden;
27 }
28-/* -----------------------
29-Page layout
30------------------------ */
31+
32+/*********************************************
33+ * Page layout
34+*********************************************/
35 #container {
36 width:100%;
37 color:#333;
38@@ -98,6 +99,16 @@
39 border-top:1px solid #fff;
40 }
41
42+#message {
43+ width: 76em;
44+}
45+
46+.save-cancel {
47+ margin: 1em 0 2em 0;
48+}
49+.save-cancel input {
50+ font-size: 120%;
51+}
52
53 /***********************************
54 * Fonts
55
56=== modified file 'wikkid/tests/views/__init__.py'
57--- wikkid/tests/views/__init__.py 2010-05-12 10:39:13 +0000
58+++ wikkid/tests/views/__init__.py 2010-06-01 05:22:22 +0000
59@@ -13,6 +13,7 @@
60 names = [
61 'breadcrumbs',
62 'utils',
63+ 'edit',
64 ]
65 module_names = ['wikkid.tests.views.test_' + name for name in names]
66 loader = unittest.TestLoader()
67
68=== added file 'wikkid/tests/views/test_edit.py'
69--- wikkid/tests/views/test_edit.py 1970-01-01 00:00:00 +0000
70+++ wikkid/tests/views/test_edit.py 2010-06-01 05:22:22 +0000
71@@ -0,0 +1,29 @@
72+#
73+# Copyright (C) 2010 Wikkid Developers.
74+#
75+# This software is licensed under the GNU Affero General Public License
76+# version 3 (see the file LICENSE).
77+
78+"""Tests the edit views."""
79+
80+from wikkid.dispatcher import get_view
81+from wikkid.tests.factory import FactoryTestCase
82+from wikkid.tests.fakes import TestRequest, TestUser
83+
84+
85+class TestEdit(FactoryTestCase):
86+ """Test the edit view."""
87+
88+ def setUp(self):
89+ super(TestEdit, self).setUp()
90+ self.user = TestUser('test@example.com', 'Test User')
91+ self.request = TestRequest()
92+
93+ def test_title_nexted(self):
94+ """Test that a nested page returns the expected title"""
95+ factory = self.make_factory([
96+ ('SomePage/SubPage/Nested.txt', 'some text')])
97+ info = factory.get_resource_at_path('/SomePage/SubPage')
98+ view = get_view(info, 'edit', self.request, self.user)
99+ self.assertEqual('Editing "SubPage"', view.title)
100+
101
102=== modified file 'wikkid/twistedserver.py'
103--- wikkid/twistedserver.py 2010-05-12 10:39:13 +0000
104+++ wikkid/twistedserver.py 2010-06-01 05:22:22 +0000
105@@ -78,7 +78,8 @@
106 self.skin = Skin(skin_name)
107
108 def run(self):
109- self.logger.info('Listening on port %d' % self.port)
110+ # Is there anyway to set the host?
111+ self.logger.info('Wiki instance running at http://localhost:%d' % self.port)
112 root = TwistedPage(
113 self.resource_factory, self.logger, self.user_factory, self.skin)
114 if self.skin.favicon is not None:
115
116=== modified file 'wikkid/view/edit.py'
117--- wikkid/view/edit.py 2010-05-19 10:00:43 +0000
118+++ wikkid/view/edit.py 2010-06-01 05:22:22 +0000
119@@ -7,6 +7,7 @@
120 """View base class for editing text pages."""
121
122 from wikkid.view.base import BaseView
123+from wikkid.view.utils import expand_wiki_name
124
125
126 class BaseEditView(BaseView):
127@@ -16,6 +17,10 @@
128 template = 'edit_page'
129
130 @property
131+ def title(self):
132+ return 'Editing "%s"' % expand_wiki_name(self.context.base_name)
133+
134+ @property
135 def cancel_url(self):
136 """The link for the cancel button."""
137 return self.context.preferred_path

Subscribers

People subscribed via source and target branches