Commit c86c5c31cfc36dd85dc445c72acd2379e66d6c8f

Authored by Renan Teruo + Paulo Meirelles
Committed by Renan Teruo Carneiro
1 parent 1c5141ee

[Mezuro] Now, upon accessing a project that doesn't exist in Kalibro, warns the …

…user and gives the option of deleting it or recreating it. Recreating doesn't work yet, though.
plugins/mezuro/lib/mezuro_plugin/project_content.rb
... ... @@ -50,6 +50,7 @@ class MezuroPlugin::ProjectContent < Article
50 50  
51 51 private
52 52  
  53 + #FIXME
53 54 def validate_kalibro_project_name
54 55 begin
55 56 Kalibro::Client::ProjectClient.project(name)
... ...
plugins/mezuro/views/content_viewer/show_project.rhtml
1 1 <script src="/plugins/mezuro/javascripts/project_content.js" type="text/javascript"></script>
2 2  
3 3 <% @project = @page.project %>
  4 +<% if (@project==nil) %>
  5 + <h3>Warning:</h3>
  6 + <p>This project doesn't exist on the Web Service. Do you want to <a href="/myprofile/<%= @page.profile.name %>/cms/destroy/<%= @page.id%>">delete</a> or <a href="/myprofile/<%= @page.profile.name %>/cms/edit/<%= @page.id%>">save it again</a>?</p>
  7 +<% else %>
  8 +
  9 +
4 10 <table>
5 11 <tr>
6 12 <td><%= _('Name') %></td>
... ... @@ -43,4 +49,5 @@
43 49 <div id="project-tree"></div>
44 50 <div id="module-result">
45 51 </div>
  52 +<% end %>
46 53  
... ...