diff options
author | Godin <mandrikov@gmail.com> | 2010-10-27 14:19:51 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-10-27 14:19:51 +0000 |
commit | 4321c5607b08c56e6b20543f00744aa53b1dc116 (patch) | |
tree | d73ce347414f60613be37e351a3ef12002b081d1 | |
parent | 0d5a93e1c3d0415ba17b57be0cf0abad816b51be (diff) | |
download | sonarqube-4321c5607b08c56e6b20543f00744aa53b1dc116.tar.gz sonarqube-4321c5607b08c56e6b20543f00744aa53b1dc116.zip |
SONAR-1563: Display installed plugins
SONAR-1889: Display new available plugins
5 files changed, 116 insertions, 146 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_common.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_common.html.erb new file mode 100644 index 00000000000..c6784e025dc --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_common.html.erb @@ -0,0 +1,10 @@ +<script type="text/javascript"> + function showPlugin(key) { + if ($('detail-' + key).visible()) { + $('detail-' + key).hide(); + } else { + $('detail-' + key).show(); + } + return false; + } +</script> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_downloads.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_downloads.html.erb index 8f9d1e8a836..ee23bea2b3c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_downloads.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_downloads.html.erb @@ -1,9 +1,6 @@ +<%= render :partial => 'updatecenter/common' %> + <script> - function showPlugin(key) { - $('show-' + key).hide(); - $('detail-' + key).show(); - return false; - } function checkTermsConditions(key) { var tc=$('tc-' + key) if (tc!=null && !tc.checked) { @@ -14,15 +11,14 @@ } </script> - -<% if @downloads.size>0 %> -<form action="<%= ApplicationController.root_context -%>/plugins/cancel" method="post" class="warning"> +<% if @downloads.size > 0 %> +<form action="<%= ApplicationController.root_context -%>/updatecenter/cancel" method="post" class="warning"> <p>Sonar needs to be restarted in order to install the following plugins: <ul> - <% @downloads.each do |download| -%> + <% @downloads.each do |download| %> <li><%= download -%></li> <% end %> </ul> <input type="submit" value="Cancel downloads"></input> </p> </form> -<% end %>
\ No newline at end of file +<% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb index 01179af82e8..a6defc2d88b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb @@ -4,4 +4,4 @@ <% else %> Updated on <%= @center.getDate() %>. <%= link_to 'Refresh', :action => action, :reload => true %> <% end %> -</p>
\ No newline at end of file +</p> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb index f7cafd53e42..fcdfa93b3d6 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb @@ -13,77 +13,77 @@ <%= render :partial => 'updatecenter/downloads' %> +<table class="data width100"> + <thead> + </thead> + <tbody> <% if @center %> <% @updates_by_category.keys.sort_by{|c| c.downcase }.each do |category| updates=@updates_by_category[category] %> - <table class="data width100" id="category-<%= u category -%>"> - <thead> - <tr> - <th colspan="2"><h2><%= category -%></h2></th> - </tr> - </thead> - <tbody> - <% updates.each do |update| - plugin=update.getPlugin() - %> - <tr class="<%= cycle('even','odd', :name => category) -%>"> - <td width="10%" nowrap> - <b><%= h(plugin.getName()) -%></b> - </td> - <td> - <%= plugin.getDescription() %> <a href="#" onClick="showPlugin('<%= plugin.getKey() -%>');" id="show-<%= plugin.getKey() -%>">More</a> - <div id="detail-<%= plugin.getKey() -%>" style="display:none"> - <% if plugin.getLicense() %> - <p> - License: <%= h(plugin.getLicense()) %> - </p> - <% end %> - <% if plugin.getOrganization() %> - <p> - By: <%= link_to_if plugin.getOrganizationUrl(), plugin.getOrganization(), plugin.getOrganizationUrl(), :class=>'external' %> - </p> - <% end %> - <% if plugin.getHomepageUrl() || plugin.getIssueTrackerUrl() %> + <tr> + <td colspan="2"><h2><%= category -%></td> + </tr> + <% updates.sort_by{|c| c.getPlugin().getName()}.each do |update| + plugin=update.getPlugin() + %> + <tr class="<%= cycle('even','odd', :name => category) -%>"> + <td width="10%" nowrap> + <b><a href="#plugin" onClick="showPlugin('<%= plugin.getKey() -%>');"><%= h(plugin.getName()) -%></a></b> + </td> + <td> + <%= plugin.getDescription() %> + <div id="detail-<%= plugin.getKey() -%>" style="display:none"> + <% if plugin.getLicense() %> <p> - <% if plugin.getHomepageUrl() %> - <%= link_to 'Plugin details', plugin.getHomepageUrl(), :class=>'external' %> | - <% end %> - <% if plugin.getIssueTrackerUrl() %> - <%= link_to "Issue Tracker", plugin.getIssueTrackerUrl(), :class=>'external' %> - <% end %> + License: <%= h(plugin.getLicense()) %> </p> - <% - end - if update.isCompatible() - %> + <% end %> + <% if plugin.getOrganization() %> <p> - Version: <%= update.getRelease().getVersion() -%> + By: <%= link_to_if plugin.getOrganizationUrl(), plugin.getOrganization(), plugin.getOrganizationUrl(), :class=>'external' %> </p> - <div> - <% if plugin.getTermsConditionsUrl() %> - <input type="checkbox" id="tc-<%= plugin.getKey() -%>"></input> I accept the <%= link_to 'Terms and Conditions', plugin.getTermsConditionsUrl(), :class => 'external' %> - <% end %> - <form method="post" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=available&key=<%= plugin.getKey() -%>&version=<%= update.getRelease().getVersion() -%>" style="display: inline-block"> - <input type="submit" value="Install" onClick="return checkTermsConditions('<%= plugin.getKey() -%>')"></input> - </form> - - </div> - <% elsif update.requiresSonarUpgrade - %> - <p> - Version: <%= update.getRelease().getVersion() -%> (not compatible, needs Sonar upgrade) - </p> - <% - end - %> + <% end %> + <% if plugin.getHomepageUrl() || plugin.getIssueTrackerUrl() %> + <p> + <% if plugin.getHomepageUrl() %> + <%= link_to 'Plugin details', plugin.getHomepageUrl(), :class=>'external' %> | + <% end %> + <% if plugin.getIssueTrackerUrl() %> + <%= link_to "Issue Tracker", plugin.getIssueTrackerUrl(), :class=>'external' %> + <% end %> + </p> + <% + end + if update.isCompatible() + %> + <p> + Version: <%= update.getRelease().getVersion() -%> + </p> + <div> + <% if plugin.getTermsConditionsUrl() %> + <input type="checkbox" id="tc-<%= plugin.getKey() -%>"></input> I accept the <%= link_to 'Terms and Conditions', plugin.getTermsConditionsUrl(), :class => 'external' %> + <% end %> + <form method="post" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=available&key=<%= plugin.getKey() -%>&version=<%= update.getRelease().getVersion() -%>" style="display: inline-block"> + <input type="submit" value="Install" onClick="return checkTermsConditions('<%= plugin.getKey() -%>')"></input> + </form> </div> - </td> - </tr> - <% end %> - </tbody> - </table><br/> + <% elsif update.requiresSonarUpgrade + %> + <p> + Version: <%= update.getRelease().getVersion() -%> (not compatible, needs Sonar upgrade) + </p> + <% + end + %> + </div> + </td> + </tr> + <% end %> <% end %> <% end %> +</tbody> +</table><br/> + <%= render :partial => 'updatecenter/status', :locals => {:action => 'available' } %> -</div>
\ No newline at end of file +</div> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb index 1363d9060ee..79c813a2e52 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb @@ -1,19 +1,3 @@ -<style type="text/css"> -.plugin { - margin-top: 22px; - padding: 5px; - border: 1px solid #ddd; -} - -.plugin h3 { - margin-left: 5px; -} - -.plugin p { - padding: 5px; -} -</style> - <ul class="tabs"> <li> <a href="<%= url_for :action => 'index' -%>" class="selected">Installed</a> @@ -28,52 +12,45 @@ <div class="tabs-panel"> +<%= render :partial => 'updatecenter/common' %> + <h2>User-installed plugins</h2> -<table class="width100" id="user-plugins"> - <tr> - <td width="1%" nowrap class="column first"> - <table class="data"> - <thead> - <tr> - <th>Plugin</th> - <th>Version</th> - <th>Description</th> - </tr> - </thead> - <tbody> - <% if @user_plugins.empty? %> - <tr class="even"><td colspan="5">No plugins</td></tr> - <% else - @user_plugins.each do |plugin| - %> - <tr class="select <%= cycle('even', 'odd', :name => 'user') -%>" id="select_<%= plugin.plugin_key -%>"> - <td><a href="#" onclick="showPlugin('<%= plugin.plugin_key -%>')"><%= h(plugin.name) -%></a></td> - <td><%= plugin.version || '-' -%></td> - <td><%= plugin.description -%></td> - </tr> - <% end %> - <% end %> - </tbody> - </table> - </td> - <td class="column"> - <% @user_plugins.each do |plugin| %> - <div class="plugin" id="plugin_<%= plugin.plugin_key -%>" style="display: none;"> - <h3><%= h(plugin.name) -%> <%= plugin.version || '-' -%></h3> - <p><%= plugin.description -%></p> +<table class="data"> + <thead> + <tr> + <th>Plugin</th> + <th>Version</th> + <th>Description</th> + </tr> + </thead> + <tbody> + <% if @user_plugins.empty? %> + <tr class="even"><td colspan="5">No plugins</td></tr> + <% else + @user_plugins.each do |plugin| + %> + <tr class="select <%= cycle('even', 'odd', :name => 'user') -%>" id="select_<%= plugin.plugin_key -%>"> + <td><b><a href="#" onclick="showPlugin('<%= plugin.plugin_key -%>')"><%= h(plugin.name) -%></a></b></td> + <td><%= plugin.version || '-' -%></td> + <td> + <%= plugin.description -%> + + <div id="detail-<%= plugin.plugin_key -%>" style="display:none"> <p> - <% if plugin.homepage %> - <%= link_to 'Homepage', plugin.homepage, :class => 'external' -%><br/> - <% end %> - License: <%= plugin.license -%><br/> - <% if plugin.organization %> - Author: <%= link_to_if plugin.organization_url, plugin.organization, plugin.organization_url, :class=>'external' -%><br/> - <% end %> - </p> - </div> + License: <%= plugin.license -%><br/> + <% if plugin.organization %> + By: <%= link_to_if plugin.organization_url, plugin.organization, plugin.organization_url, :class=>'external' -%><br/> + <% end %> + <% if plugin.homepage %> + <%= link_to 'Details', plugin.homepage, :class => 'external' -%><br/> + <% end %> + </p> + </div> + </td> + </tr> <% end %> - </td> - </tr> + <% end %> + </tbody> </table> <div class="break30"> </div> @@ -89,7 +66,7 @@ @core_plugins.each do |plugin| %> <tr class="<%= cycle('even','odd', :name => 'core') -%>" id="<%= u plugin.plugin_key -%>"> - <td width="1%" nowrap><b><%= plugin.name -%></b></td> + <td width="1%" nowrap><b><%= plugin.name -%></b></td> <td><%= plugin.description %></td> </tr> <% end %> @@ -98,16 +75,3 @@ </div> -<script type="text/javascript"> - function showPlugin(id) { - $$('.plugin').each(function(element) { - element.hide(); - }); - $$('.select').each(function(element) { - element.removeClassName('selected'); - }); - $('plugin_' + id).show(); - $('select_' + id).addClassName('selected'); - return false; - } -</script> |