Commit 3536e441bc48fdc022ec116ee79168d7376403f7

Authored by Pedro Paulo Vezza Campos
Committed by fllsouto
1 parent 9358b4e0

Adding tooltips on the repositories view form.

signed-off-by: Fellipe Souto Sampaio <fllsouto@gmail.com>
app/assets/stylesheets/form_with_tooltip.css
... ... @@ -40,4 +40,9 @@
40 40 .text-area {
41 41 width: 95% !important;
42 42 margin: 0;
43   -}
44 43 \ No newline at end of file
  44 +}
  45 +
  46 +.field-container select {
  47 + width: 99% !important;
  48 + margin: 0;
  49 +}
... ...
app/views/projects/_form.html.erb
... ... @@ -10,7 +10,7 @@
10 10 </div>
11 11 <div class="help-container">
12 12 <p>
13   - Your new project name!
  13 + Your project name!
14 14 </p>
15 15 </div>
16 16 </div>
... ...
app/views/repositories/_form.html.erb
1 1 <%= render :partial => 'shared/form_errors', :locals => {:object => @repository} %>
2 2  
3   -<div class="form-group">
4   - <%= f.label :name, class: 'control-label' %>
5   - <%= f.text_field :name, class: 'form-control' %>
6   -</div></br>
7   -
8   -<div class="form-group">
9   - <%= f.label :description, class: 'control-label' %>
10   - <%= f.text_area :description, class: 'form-control' %>
11   -</div></br>
12   -
13   -<div class="form-group">
14   - <%= f.label :license, 'License', class: 'control-label' %>
15   - <%= f.select( :license, license_options, {class: 'form-control'} ) %>
16   -</div></br>
17   -
18   -<div class="form-group">
19   - <%= f.label :type, class: 'control-label' %>
20   - <%= f.select( :type, @repository_types, {class: 'form-control'} ) %>
21   -</div></br>
22   -
23   -<div class="form-group">
24   - <%= f.label :address, class: 'control-label' %>
25   - <%= f.text_field :address, class: 'form-control' %>
26   -</div></br>
27   -
28   -<div class="form-group">
29   - <%= f.label :process_period, 'Process Period', class: 'control-label' %>
30   - <%= f.select( :process_period, periodicity_options, {class: 'form-control'} ) %>
31   -</div></br>
32   -
33   -<div class="form-group">
34   - <%= f.label :configuration, class: 'control-label' %>
35   - <% configuration_list = KalibroGatekeeperClient::Entities::Configuration.all.map { |conf| [conf.name, conf.id] } %>
36   - <%= f.select( :configuration_id, configuration_list, {class: 'form-control'} ) %>
37   -</div></br>
38   -
39   -<%= f.submit 'Save', class: 'btn btn-primary' %>
40 3 \ No newline at end of file
  4 +
  5 +<div class="row margin-left-none">
  6 + <div class="form-table span9">
  7 +
  8 +<!-- ############################################## -->
  9 + <div class="form-row">
  10 + <div class="field-container">
  11 + <%= f.label :name, class: 'control-label' %>
  12 + <%= f.text_field :name, class: 'text-field' %>
  13 + </div>
  14 + <div class="help-container">
  15 + <p>
  16 + Your repository name!
  17 + </p>
  18 + </div>
  19 + </div>
  20 +<!-- ############################################## -->
  21 +
  22 +<!-- ############################################## -->
  23 + <div class="form-row">
  24 + <div class="field-container">
  25 + <%= f.label :description, class: 'control-label' %>
  26 + <%= f.text_area :description, class: 'text-area' %>
  27 + </div>
  28 + <div class="help-container">
  29 + <p>
  30 + Tell us what this repository contains!
  31 + </p>
  32 + </div>
  33 + </div>
  34 +<!-- ############################################## -->
  35 +
  36 +
  37 +<!-- ############################################## -->
  38 + <div class="form-row">
  39 + <div class="field-container">
  40 + <%= f.label :license, 'License', class: 'control-label' %>
  41 + <%= f.select( :license, license_options, class: 'text-area' ) %>
  42 + </div>
  43 + <div class="help-container">
  44 + <p>
  45 + How is this software licensed?
  46 + </p>
  47 + </div>
  48 + </div>
  49 +<!-- ############################################## -->
  50 +
  51 +<!-- ############################################## -->
  52 + <div class="form-row">
  53 + <div class="field-container">
  54 + <%= f.label :type, class: 'control-label' %>
  55 + <%= f.select( :type, @repository_types, class: 'tooltip-control' ) %>
  56 + </div>
  57 + <div class="help-container">
  58 + <p>
  59 + Which version control system does the software use?
  60 + </p>
  61 + </div>
  62 + </div>
  63 +<!-- ############################################## -->
  64 +
  65 +<!-- ############################################## -->
  66 + <div class="form-row">
  67 + <div class="field-container">
  68 + <%= f.label :address, class: 'control-label' %>
  69 + <%= f.text_field :address, class: 'text-field' %>
  70 + </div>
  71 + <div class="help-container">
  72 + <p>
  73 + Tell us the URL where the repository can be found.
  74 + </p>
  75 + </div>
  76 + </div>
  77 +<!-- ############################################## -->
  78 +
  79 +<!-- ############################################## -->
  80 + <div class="form-row">
  81 + <div class="field-container">
  82 + <%= f.label :process_period, 'Process Period', class: 'control-label' %>
  83 + <%= f.select( :process_period, periodicity_options, class: 'tooltip-control' ) %>
  84 + </div>
  85 + <div class="help-container">
  86 + <p>
  87 + Select how often the project will be reanalyzed.
  88 + </p>
  89 + </div>
  90 + </div>
  91 +<!-- ############################################## -->
  92 +
  93 +<!-- ############################################## -->
  94 + <div class="form-row">
  95 + <div class="field-container">
  96 + <%= f.label :configuration, class: 'control-label' %>
  97 + <% configuration_list = KalibroGatekeeperClient::Entities::Configuration.all.map { |conf| [conf.name, conf.id] } %>
  98 + <%= f.select( :configuration_id, configuration_list, class: 'tooltip-control' ) %>
  99 + </div>
  100 + <div class="help-container">
  101 + <p>
  102 + A configuration defines all the metrics to be analyzed in the source code. Choose your weapon.
  103 + </p>
  104 + </div>
  105 + </div>
  106 +<!-- ############################################## -->
  107 + </div>
  108 +</div>
  109 +<div class="row margin-left-none" style="margin-top: 20px">
  110 + <%= f.submit 'Save', class: 'btn btn-primary' %>
  111 + <%= link_to 'Back', project_path(@project_id), class: 'btn btn-default' %>
  112 +</div>
41 113 \ No newline at end of file
... ...
app/views/repositories/edit.html.erb
... ... @@ -4,5 +4,4 @@
4 4  
5 5 <%= form_for(@repository, :url => project_repository_update_url(@project_id, @repository.id), method: :put) do |f| %>
6 6 <%= render partial: 'form', locals: {f: f} %>
7   - <%= link_to 'Back', project_path(@project_id), class: 'btn btn-default' %>
8 7 <% end %>
... ...
app/views/repositories/new.html.erb
... ... @@ -4,6 +4,5 @@
4 4  
5 5 <%= form_for(@repository, :url => project_repositories_url(@project_id)) do |f| %>
6 6 <%= render partial: 'form', locals: {f: f} %>
7   - <%= link_to 'Back', project_path(@project_id), class: 'btn btn-default' %>
8 7 <% end %>
9 8  
... ...