aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-07-26 23:47:33 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-07-27 00:38:04 +0400
commitea0fb362a7dd6188973c0cb27291720ae71c29ca (patch)
tree9391c3ce63de4e618be1cbebec2f5b3927ad5206 /sonar-server/src
parentb508728dc8d993a5b4ad5839b9553228b3ef4b47 (diff)
downloadsonarqube-ea0fb362a7dd6188973c0cb27291720ae71c29ca.tar.gz
sonarqube-ea0fb362a7dd6188973c0cb27291720ae71c29ca.zip
SONAR-2596,SONAR-2601 Improve UI for email notifications
* Replace 'Send Test Email' by 'Test Configuration' * Replace 'Send' by 'Send test email' * Apply CSS styles
Diffstat (limited to 'sonar-server/src')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/account/index.html.erb74
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb121
3 files changed, 65 insertions, 132 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb
index 3d877da0921..df4ec44b9a8 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/email_configuration_controller.rb
@@ -48,7 +48,7 @@ class EmailConfigurationController < ApplicationController
subject = params[:subject]
message = params[:message]
if to_address.blank?
- flash[:notice] = message('email_configuration.test.to_address_required')
+ flash[:error] = message('email_configuration.test.to_address_required')
else
begin
java_facade.getComponentByClassname('emailnotifications', 'org.sonar.plugins.emailnotifications.EmailNotificationChannel').sendTestEmail(to_address, subject, message)
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/account/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/account/index.html.erb
index f91269107bf..317922eeadc 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/account/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/account/index.html.erb
@@ -1,88 +1,70 @@
<h1>My profile</h1>
-<br/>
-
-<table>
+<div class="admin">
+<table class="form">
<tr>
<td><b>Login:</b></td>
- <td class="sep"> </td>
<td id="login"><%= current_user.login %></td>
</tr>
<tr>
<td><b>Name:</b></td>
- <td class="sep"> </td>
<td id="name"><%= current_user.name %></td>
</tr>
<tr>
<td><b>Email:</b></td>
- <td class="sep"> </td>
<td id="name"><%= current_user.email %></td>
</tr>
<tr>
<td><b>Groups:</b></td>
- <td class="sep"> </td>
<td id="groups"><%= current_user.groups.sort.map(&:name).join(', ') %></td>
</tr>
</table>
-<br/>
+</div>
<% if User.editable_password? %>
<h1>Change password</h1>
-<br/>
+<div class="admin">
<% form_tag( {:action => 'change_password' }, :id => 'pass_form_tag', :name => 'pass_form_tag') do -%>
- <table>
+ <table class="form">
<tr>
- <td nowrap>
- <label for="old_password"><b>Old value:</b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= password_field_tag 'old_password' %>
- </td>
+ <td class="keyCell"><label for="old_password"><b>Old value:</b></label></td>
+ <td><%= password_field_tag 'old_password' %></td>
</tr>
<tr>
- <td nowrap>
- <label for="password"><b>New value:</b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= password_field_tag 'password' %>
- </td>
- </tr>
- <tr>
- <td nowrap>
- <label for="password_confirmation"><b>Confirm new value:</b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= password_field_tag 'password_confirmation' %>
- </td>
- </tr>
-
+ <td class="keyCell"><label for="password"><b>New value:</b></label></td>
+ <td><%= password_field_tag 'password' %></td>
+ </tr>
+ <tr>
+ <td class="keyCell"><label for="password_confirmation"><b>Confirm new value:</b></label></td>
+ <td><%= password_field_tag 'password_confirmation' %></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><%= submit_tag 'Change password' %></td>
+ </tr>
</table>
- <br/>
- <%= submit_tag 'Change password' %>
<% end %>
+
<script type="text/javascript">
//<![CDATA[
$('pass_form_tag').focusFirstElement();
//]]>
</script>
+</div>
<% end -%>
-<br/>
<h1>Notifications</h1>
-<br/>
+<div class="admin">
<% form_tag({:action => 'update_notifications'}, {:method => 'post'}) do %>
- <table>
+ <table class="form">
<tr>
<td></td>
<% for channel in @channels %>
- <td><%= message('notification.channel.' + channel.getKey()) -%></td>
+ <td><b><%= message('notification.channel.' + channel.getKey()) -%></b></td>
<% end %>
</tr>
<% for dispatcher in @dispatchers %>
<tr>
- <td><%= message('notification.dispatcher.' + dispatcher.getKey()) -%></td>
+ <td><b><%= message('notification.dispatcher.' + dispatcher.getKey()) -%></b></td>
<td>
<%
for channel in @channels
@@ -95,8 +77,10 @@
</td>
</tr>
<% end %>
+ <tr>
+ <td></td>
+ <td><%= submit_tag %></td>
+ </tr>
</table>
- <br/>
- <%= submit_tag %>
<% end %>
-<br/>
+</div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb
index a0f53d63264..07518fe44f4 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb
@@ -1,114 +1,63 @@
<h1><%= message('email_configuration.page') -%></h1>
-<br/>
+<div class="admin">
<% form_tag({:action => 'save'}) do -%>
- <table>
+ <table class="form">
<tr>
- <td nowrap>
- <label for="smtp_host"><b><%= message('email_configuration.smtp_host') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= text_field_tag 'smtp_host', @smtp_host %>
- </td>
+ <td class="keyCell"><label for="smtp_host"><%= message('email_configuration.smtp_host') -%>:</label></td>
+ <td align="left"><%= text_field_tag 'smtp_host', @smtp_host %></td>
</tr>
-
<tr>
- <td nowrap>
- <label for="smtp_port"><b><%= message('email_configuration.smtp_port') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= text_field_tag 'smtp_port', @smtp_port %>
- </td>
+ <td class="keyCell"><label for="smtp_port"><%= message('email_configuration.smtp_port') -%>:</label></td>
+ <td align="left"><%= text_field_tag 'smtp_port', @smtp_port %></td>
</tr>
-
<tr>
- <td nowrap>
- <label for="smtp_port"><b><%= message('email_configuration.use_tls') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= check_box_tag 'smtp_use_tls', 'true', @smtp_use_tls %>
- </td>
+ <td class="keyCell"><label for="smtp_port"><%= message('email_configuration.use_tls') -%>:</label></td>
+ <td align="left"><%= check_box_tag 'smtp_use_tls', 'true', @smtp_use_tls %></td>
</tr>
-
<tr>
- <td nowrap>
- <label for="smtp_username"><b><%= message('email_configuration.smtp_username') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= text_field_tag 'smtp_username', @smtp_username %>
- </td>
+ <td class="keyCell"><label for="smtp_username"><%= message('email_configuration.smtp_username') -%>:</label></td>
+ <td align="left"><%= text_field_tag 'smtp_username', @smtp_username %></td>
</tr>
-
<tr>
- <td nowrap>
- <label for="smtp_password"><b><%= message('email_configuration.smtp_password') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= password_field_tag 'smtp_password', @smtp_password %>
- </td>
+ <td class="keyCell"><label for="smtp_password"><%= message('email_configuration.smtp_password') -%>:</label></td>
+ <td align="left"><%= password_field_tag 'smtp_password', @smtp_password %></td>
</tr>
-
<tr>
- <td nowrap>
- <label for="email_from"><b><%= message('email_configuration.from_address') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= text_field_tag 'email_from', @email_from %>
- </td>
+ <td class="keyCell"><label for="email_from"><%= message('email_configuration.from_address') -%>:</label></td>
+ <td><%= text_field_tag 'email_from', @email_from %></td>
</tr>
-
<tr>
- <td nowrap>
- <label for="email_prefix"><b><%= message('email_configuration.email_prefix') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= text_field_tag 'email_prefix', @email_prefix %>
- </td>
+ <td class="keyCell"><label for="email_prefix"><%= message('email_configuration.email_prefix') -%>:</label></td>
+ <td><%= text_field_tag 'email_prefix', @email_prefix %></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><%= submit_tag message('save') %></td>
</tr>
</table>
- <br/>
- <%= submit_tag message('save') %>
<% end -%>
-<br/>
+</div>
<h1><%= message('email_configuration.test.title') -%></h1>
-<br/>
+<div class="admin">
<% form_tag({:action => 'send_test_email'}) do -%>
- <table>
+ <table class="form">
<tr>
- <td nowrap>
- <label for="to_address"><b><%= message('email_configuration.test.to_address') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= text_field_tag 'to_address', current_user.email %>
- </td>
+ <td class="keyCell"><label for="to_address"><%= message('email_configuration.test.to_address') -%>:</label></td>
+ <td><%= text_field_tag 'to_address', current_user.email %></td>
</tr>
<tr>
- <td nowrap>
- <label for="subject"><b><%= message('email_configuration.test.subject') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= text_field_tag 'subject', message('email_configuration.test.subject_text') %>
- </td>
+ <td class="keyCell"><label for="subject"><%= message('email_configuration.test.subject') -%>:</label></td>
+ <td><%= text_field_tag 'subject', message('email_configuration.test.subject_text') %></td>
</tr>
<tr>
- <td nowrap>
- <label for="message"><b><%= message('email_configuration.test.message') -%></b></label>
- </td>
- <td class="sep"> </td>
- <td align="left">
- <%= text_area_tag 'message', message('email_configuration.test.message_text') %>
- </td>
+ <td class="keyCell"><label for="message"><%= message('email_configuration.test.message') -%>:</label></td>
+ <td><%= text_area_tag 'message', message('email_configuration.test.message_text') %></td>
</tr>
- <table>
- <br/>
- <%= submit_tag message('email_configuration.test.send') %>
+ <tr>
+ <td></td>
+ <td><%= submit_tag message('email_configuration.test.send') %></td>
+ </tr>
+ </table>
<% end -%>
+</div>