aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-03-20 22:46:03 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-03-20 22:47:41 +0100
commit2b43df61e8ab7ded55f565eb7f43528ece3d66f3 (patch)
treec45ac8c139e9ef2dc783fe5aafa70e1f4060550e /sonar-server/src/main/webapp/WEB-INF
parent69515943c83b24c8dbefefe7420bab6d5de4c81f (diff)
downloadsonarqube-2b43df61e8ab7ded55f565eb7f43528ece3d66f3.tar.gz
sonarqube-2b43df61e8ab7ded55f565eb7f43528ece3d66f3.zip
SONAR-3344 Display metadata of SonarSource licenses
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_FLOAT.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_INTEGER.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_LICENSE.html.erb45
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_METRIC.html.erb27
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PASSWORD.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb2
10 files changed, 86 insertions, 10 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
index 2508e29c272..97fe97b7f60 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb
@@ -38,10 +38,14 @@
value = Property.value(property.getKey(), (@project ? @project.id : nil), '') unless value
# for backward-compatibility with properties that do not define the type TEXT
- property_type = value.include?("\n") ? 'TEXT' : property.getType()
+ property_type = property.getType()
+ if property_type.to_s=='STRING' && value.include?("\n")
+ property_type = 'TEXT'
+ end
+
%>
<tr class="<%= cycle('even', 'odd', :name => 'properties') -%>">
- <td style="padding: 10px" id="foo_<%= property.getKey() -%>">
+ <td style="padding: 10px" id="block_<%= property.getKey() -%>">
<h3>
<%= message("property.#{property.key()}.name", :default => property.name()) -%>
<br/><span class="note"><%= property.getKey() -%></span>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb
index 55e4fc408f3..9271bbd0c92 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb
@@ -1,4 +1,4 @@
-<select name="<%= h property.key -%>" id="input_<%= h property.key-%>">
+<select name="<%= h property.getKey() -%>" id="input_<%= h property.getKey() -%>">
<option value="" <%= 'selected' if value.blank? -%>><%= message('default') -%></option>
<option value="true" <%= 'selected' if value=='true' -%>><%= message('true') -%></option>
<option value="false" <%= 'selected' if value=='false' -%>><%= message('false') -%></option>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_FLOAT.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_FLOAT.html.erb
index 6706e88ecb2..163677b4478 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_FLOAT.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_FLOAT.html.erb
@@ -1 +1 @@
-<input type="text" name="<%= h property.key -%>" value="<%= h value if value -%>" size="50" id="input_<%= h property.key-%>"/> \ No newline at end of file
+<input type="text" name="<%= h property.getKey() -%>" value="<%= h value if value -%>" size="50" id="input_<%= h property.getKey() -%>"/> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_INTEGER.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_INTEGER.html.erb
index 6706e88ecb2..5603dfe4a75 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_INTEGER.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_INTEGER.html.erb
@@ -1 +1 @@
-<input type="text" name="<%= h property.key -%>" value="<%= h value if value -%>" size="50" id="input_<%= h property.key-%>"/> \ No newline at end of file
+<input type="text" name="<%= h property.getKey() -%>" value="<%= h value if value -%>" size="50" id="input_<%= h property.getKey()-%>"/> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_LICENSE.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_LICENSE.html.erb
new file mode 100644
index 00000000000..69996fa4419
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_LICENSE.html.erb
@@ -0,0 +1,45 @@
+<% if !value || value.blank? %>
+ <textarea rows="5" cols="80" class="width100" name="<%= h property.getKey() -%>" id="input_<%= h property.getKey() -%>"></textarea>
+<%
+ else
+ license = controller.java_facade.parseLicense(value)
+ date = license.getExpirationDateAsString()
+%>
+ <div class="width100">
+ <textarea rows="6" name="<%= h property.getKey() -%>" id="input_<%= h property.getKey() -%>" style="float: left;width: 390px"><%= h value -%></textarea>
+
+ <div style="margin-left: 400px">
+ <table>
+ <tr>
+ <td class="form-key-cell">Product:</td>
+ <td class="form-val-cell"><%= license.getProduct() || '-' -%></td>
+ </tr>
+ <tr>
+ <td class="form-key-cell">Organization:</td>
+ <td><%= license.getOrganization() || '-' -%></td>
+ </tr>
+ <tr>
+ <td class="form-key-cell">Expiration:</td>
+ <td>
+ <% if license.getExpirationDateAsString()
+ formatted_date = l(Date.parse(license.getExpirationDateAsString()))
+ %>
+ <%= license.isExpired() ? "<span class='error'>#{formatted_date}</span>" : formatted_date -%>
+ <% else %>
+ -
+ <% end %>
+
+ </td>
+ </tr>
+ <tr>
+ <td class="form-key-cell">Type:</td>
+ <td><%= license.getType() || '-' -%></td>
+ </tr>
+ <tr>
+ <td class="form-key-cell">Server:</td>
+ <td><%= license.getServer() || '-' -%></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+<% end %> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_METRIC.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_METRIC.html.erb
new file mode 100644
index 00000000000..45ed790ecf6
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_METRIC.html.erb
@@ -0,0 +1,27 @@
+<select name="<%= h property.getKey() -%>" id="input_<%= h property.getKey() -%>">
+ <option value=""><%= message('default') -%></option>
+ <%
+ metrics_per_domain={}
+ Metric.all.select { |m| m.display? }.sort_by { |m| m.short_name }.each do |metric|
+ domain=metric.domain || ''
+ metrics_per_domain[domain]||=[]
+ metrics_per_domain[domain]<<metric
+ end
+
+ metrics_per_domain.keys.sort.each do |domain|
+%>
+
+ <optgroup label="<%= h domain -%>">
+<%
+ metrics_per_domain[domain].each do |m|
+ selected_attr = (m.key==value || m.id==value) ? " selected='selected'" : ''
+%>
+ <option value="<%= m.key -%>" <%= selected_attr -%>><%= m.short_name -%></option>
+<%
+ end
+%>
+ </optgroup>
+<%
+ end
+%>
+</select> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PASSWORD.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PASSWORD.html.erb
index 3b6d49854b7..e8b70971e02 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PASSWORD.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PASSWORD.html.erb
@@ -1 +1 @@
-<input type="password" name="<%= h property.key -%>" value="<%= h value if value -%>" size="50" id="input_<%= h property.key-%>"/> \ No newline at end of file
+<input type="password" name="<%= h property.getKey() -%>" value="<%= h value if value -%>" size="50" id="input_<%= h property.getKey() -%>"/> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb
index a317e48ef38..ac0e0d3d867 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb
@@ -1,4 +1,4 @@
-<select name="<%= h property.key -%>" id="input_<%= h property.key-%>">
+<select name="<%= h property.getKey() -%>" id="input_<%= h property.key-%>">
<option value=""><%= message('default') -%></option>
<% property.options.each do |option| %>
<option value="<%= h option -%>" <%= 'selected' if value && value==option -%>><%= h option -%></option>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb
index 0dc07f7c872..b4c3b451f4d 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_STRING.html.erb
@@ -1,2 +1,2 @@
-<input type="text" name="<%= h property.key -%>" value="<%= h value if value -%>" size="50" id="input_<%= h property.key-%>"/>
-<%= link_to_function(image_tag('zoom.png'), "enlargeTextInput('#{property.key}')", :class => 'nolink') -%> \ No newline at end of file
+<input type="text" name="<%= h property.getKey() -%>" value="<%= h value if value -%>" size="50" id="input_<%= h property.getKey() -%>"/>
+<%= link_to_function(image_tag('zoom.png'), "enlargeTextInput('#{property.getKey()}')", :class => 'nolink') -%> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb
index c557137557e..dfefb03af9f 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_TEXT.html.erb
@@ -1 +1 @@
-<textarea rows="5" cols="80" class="width100" name="<%= h property.key -%>" id="input_<%= h property.key-%>"><%= h value if value -%></textarea> \ No newline at end of file
+<textarea rows="5" cols="80" class="width100" name="<%= h property.getKey() -%>" id="input_<%= h property.getKey() -%>"><%= h value if value -%></textarea> \ No newline at end of file