Commit 63ab22bed798ff0823aaa8edb63ac6e1c6a403c7

Authored by Diego Camarinha
Committed by Diego Camarinha
1 parent eca8fdfa

[Mezuro] Refactored new and edit views for repository

plugins/mezuro/views/mezuro_plugin_repository/edit.html.erb
@@ -4,39 +4,29 @@ @@ -4,39 +4,29 @@
4 <%= hidden_field_tag :id, @project_content.id %> 4 <%= hidden_field_tag :id, @project_content.id %>
5 5
6 <%= f.hidden_field :id%> 6 <%= f.hidden_field :id%>
7 - <p>  
8 - <%= f.label :name, "Name:" %>  
9 - <%= f.text_field :name %>  
10 - </p>  
11 - <p>  
12 - <%= f.label :description, "Description:" %>  
13 - <%= f.text_field :description %>  
14 - </p> 7 + <%= required labelled_form_field _('Name:'), f.text_field(:name) %>
15 8
16 - <p>  
17 - <%= required labelled_form_field _('License'),  
18 - f.select(:license, MezuroPlugin::Helpers::ContentViewerHelper.license_options) %><br/>  
19 - </p> 9 + <div class="formfieldline">
  10 + <%= f.label :description, "Description:", :class => 'formlabel' %>
  11 + <div class="formfield type-text">
  12 + <%= f.text_field :description %>
  13 + </div>
  14 + </div>
20 15
21 - <p>  
22 - <%= f.label :process_period, "Process Period:" %>  
23 - <%= f.select(:process_period, MezuroPlugin::Helpers::ContentViewerHelper.periodicity_options, :selected => @repository.process_period.to_i) %>  
24 - </p> 16 + <%= required labelled_form_field _('License'),
  17 + f.select(:license, MezuroPlugin::Helpers::ContentViewerHelper.license_options, :selected => @repository.license) %>
25 18
26 - <p>  
27 - <%= f.label :type, "Type:" %>  
28 - <%= f.select :type, @repository_types%>  
29 - </p> 19 + <%= required labelled_form_field _('Process Period'),
  20 + f.select(:process_period, MezuroPlugin::Helpers::ContentViewerHelper.periodicity_options, :selected => @repository.process_period.to_i) %>
30 21
31 - <p>  
32 - <%= f.label :address, "Address:" %>  
33 - <%= f.text_field :address%>  
34 - </p> 22 + <%= required labelled_form_field _('Type'),
  23 + f.select(:type, @repository_types, :selected => @repository.type) %>
35 24
36 - <p>  
37 - <%= f.label :configuration_id, "Configuration:" %>  
38 - <%= f.select :configuration_id, @configuration_select, :selected => @repository.configuration_id.to_i %>  
39 - </p> 25 + <%= required labelled_form_field _('Address'),
  26 + f.text_field(:address) %>
  27 +
  28 + <%= required labelled_form_field _('Configuration'),
  29 + f.select(:configuration_id, @configuration_select, :selected => @repository.configuration_id.to_i) %>
40 30
41 <p> 31 <p>
42 <%= f.submit "Add" %> 32 <%= f.submit "Add" %>
plugins/mezuro/views/mezuro_plugin_repository/new.html.erb
@@ -3,36 +3,29 @@ @@ -3,36 +3,29 @@
3 <% form_for :repository, :url => {:action =>"create", :controller => "mezuro_plugin_repository"}, :method => :get do |f| %> 3 <% form_for :repository, :url => {:action =>"create", :controller => "mezuro_plugin_repository"}, :method => :get do |f| %>
4 <%= hidden_field_tag :id, @project_content.id %> 4 <%= hidden_field_tag :id, @project_content.id %>
5 5
6 - <p>  
7 - <%= f.label :name, "Name:" %>  
8 - <%= f.text_field :name %>  
9 - </p>  
10 - <p>  
11 - <%= f.label :description, "Description:" %>  
12 - <%= f.text_field :description %>  
13 - </p> 6 + <%= required labelled_form_field _('Name:'), f.text_field(:name) %>
  7 +
  8 + <div class="formfieldline">
  9 + <%= f.label :description, "Description:", :class => 'formlabel' %>
  10 + <div class="formfield type-text">
  11 + <%= f.text_field :description %>
  12 + </div>
  13 + </div>
14 14
15 <%= required labelled_form_field _('License'), 15 <%= required labelled_form_field _('License'),
16 - f.select(:license, MezuroPlugin::Helpers::ContentViewerHelper.license_options) %><br/>  
17 - <p>  
18 -  
19 - <p>  
20 - <%= f.label :process_period, "Process Period:" %>  
21 - <%= f.select(:process_period, MezuroPlugin::Helpers::ContentViewerHelper.periodicity_options ) %>  
22 - </p>  
23 - <%= f.label :type, "Type:" %>  
24 - <%= f.select :type, @repository_types %>  
25 - </p> 16 + f.select(:license, MezuroPlugin::Helpers::ContentViewerHelper.license_options) %>
  17 +
  18 + <%= required labelled_form_field _('Process Period'),
  19 + f.select(:process_period, MezuroPlugin::Helpers::ContentViewerHelper.periodicity_options ) %>
26 20
27 - <p>  
28 - <%= f.label :address, "Address:" %>  
29 - <%= f.text_field :address %>  
30 - </p> 21 + <%= required labelled_form_field _('Type'),
  22 + f.select(:type, @repository_types) %>
31 23
32 - </p>  
33 - <%= f.label :configuration_id, "Configuration:" %>  
34 - <%= f.select :configuration_id, @configuration_select %>  
35 - </p> 24 + <%= required labelled_form_field _('Address'),
  25 + f.text_field(:address) %>
  26 +
  27 + <%= required labelled_form_field _('Configuration'),
  28 + f.select(:configuration_id, @configuration_select) %>
36 29
37 <p> 30 <p>
38 <%= f.submit "Add" %> 31 <%= f.submit "Add" %>