app/views/help_popups/topics/index.html.erb in help_popups-0.1.1 vs app/views/help_popups/topics/index.html.erb in help_popups-1.0.0

- old
+ new

@@ -1,21 +1,31 @@ -<% if @topics.count == 0 %> - <b>No Help Topics Defined!<b><br/> - Please click the link below to add one...<br/> +<% if !(session[:help_popups_clearance].nil?) %> + <% if @topics.count == 0 %> + <b>No Help Topics Defined!<b><br/> + Please click the link below to add one...<br/> + <% else %> + <table cellpadding=0 cellspacing=0 width="600"> + <thead> + <td>Code</td> + <td>Title</td> + </thead> + <% trClass = "odd" %> + <% @topics.each do |topic| %> + <% if (trClass == "even") then trClass = "odd" else trClass = "even" end %> + <tr class="<%= trClass %>"> + <td><%= link_to topic.code, edit_topic_path(topic) %></td> + <td><%= topic.title %></td> + </tr> + <% end %> + </table> + <% end %> + <br/> + <%= link_to "Add New Help Topic", new_topic_path %> <% else %> - <table cellpadding=0 cellspacing=0 width="600"> - <thead> - <td>Code</td> - <td>Title</td> - </thead> - <% trClass = "odd" %> - <% @topics.each do |topic| %> - <% if (trClass == "even") then trClass = "odd" else trClass = "even" end %> - <tr class="<%= trClass %>"> - <td><%= link_to topic.code, edit_topic_path(topic) %></td> - <td><%= topic.title %></td> - </tr> - <% end %> - </table> -<% end %> -<br/> -<%= link_to "Add New Help Topic", new_topic_path %> + You must login before you can access the Help Popups administration.<br/> + Please enter the password you defined for <b>config.help_popups_password</b>: <br/> + <br/> + <% flash.each do |key, value| %> + <%= content_tag(:div, value, :class => "flash #{key}") %> + <% end %> + <form action='/help_popups/login' method='post'><input type='text' size='20' id='help_popups_password' name='help_popups_password'> &nbsp; &nbsp; <input type='submit' value='Submit'></form> +<% end %> \ No newline at end of file