[Xfce4-commits] <moka:master> Improve error handling in the announcement view.
Jannis Pohlmann
noreply at xfce.org
Mon Jan 17 17:52:01 CET 2011
Updating branch refs/heads/master
to a3ba53b8e9e38134205fe1956855b0323ac26dd4 (commit)
from 8cf240345bc6dcc1d38cf4ba66add25d894d0e93 (commit)
commit a3ba53b8e9e38134205fe1956855b0323ac26dd4
Author: Jannis Pohlmann <jannis at xfce.org>
Date: Mon Jan 17 17:48:53 2011 +0100
Improve error handling in the announcement view.
lib/controllers/announcements.rb | 2 +-
lib/views/announcements.erb | 12 +++++++++---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/lib/controllers/announcements.rb b/lib/controllers/announcements.rb
index e7ce341..032334a 100755
--- a/lib/controllers/announcements.rb
+++ b/lib/controllers/announcements.rb
@@ -14,7 +14,7 @@ module Moka
authentication_required
unless env['identica']
- error_set(:text, 'Posting announcements on identi.ca is not supported.')
+ error_set(:identica, 'Publishing announcements on identi.ca is not supported at the moment.')
end
unless error_set?
diff --git a/lib/views/announcements.erb b/lib/views/announcements.erb
index 92b0c56..83bd0f7 100644
--- a/lib/views/announcements.erb
+++ b/lib/views/announcements.erb
@@ -1,9 +1,15 @@
<%= header :title => "Announcements" %>
-<% if env['identica'] %>
<h2>Publish an announcement on identi.ca</h2>
+<% if error(:identica) %>
+ <p class="error"><%= error(:identica) %></p>
+<% end %>
<form method="post" action="/announcements/identica">
- <p><textarea rows="3" cols="30" name="text"></textarea></p>
+ <fieldset>
+ <p><label for="text">Text:</label></p>
+ <p><textarea rows="3" cols="50" name="text"></textarea></p>
+ <% if error(:text) %>
+ <p class="error"><%= error(:text) %></p>
+ <% end %>
<p><input type="submit" value="Publish"/></p>
</form>
-<% end %>
<%= footer %>
More information about the Xfce4-commits
mailing list