Commit 086350c42c88c399758b0eb588320622e8e880f3

Authored by Evandro Jr
1 parent 45d5481f

broken state commit to merge with Victor's code

plugins/stoa/config.yml 0 → 100644
... ... @@ -0,0 +1 @@
  1 +salt: '123456789'
... ...
plugins/virtuoso/controllers/virtuoso_plugin_admin_controller.rb
1 1 class VirtuosoPluginAdminController < AdminController
2 2  
3 3 def index
4   - settings = params[:settings]
  4 + settings = params[:settings]
5 5 settings ||= {}
  6 +
  7 +# raise settings.inspect.to_yaml
  8 +
  9 +# --- ! '{"virtuoso_uri"=>"http://hom.virtuoso.participa.br", "virtuoso_username"=>"dba",
  10 +# "virtuoso_password"=>"dasas", "dspace_uri"=>"http://hom.dspace.participa.br"}#'
  11 +
6 12 @settings = Noosfero::Plugin::Settings.new(environment, VirtuosoPlugin, settings)
7 13 @harvest_running = VirtuosoPlugin::DspaceHarvest.new(environment).find_job.present?
8 14  
... ...
plugins/virtuoso/lib/virtuoso_plugin.rb
1 1 class VirtuosoPlugin < Noosfero::Plugin
2 2  
  3 + @virtuosoServers
  4 +
3 5 def self.plugin_name
4 6 "Virtuoso integration"
5 7 end
... ...
plugins/virtuoso/views/virtuoso_plugin_admin/_server_list_item.html.erb 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +<li>
  2 + <ul class="link-list-row">
  3 + <li>
  4 + <%= text_field_tag 'settings[dspace_servers][][dspace_uri]', dspace_uri[:dspace_uri], :class => 'link-name', :maxlength => 40 %>
  5 + </li>
  6 + <li>
  7 + <%= button_without_text(:delete, _('Delete'), "#" , :class=>"delete-server-list-row") %>
  8 + </li>
  9 + </ul>
  10 +</li>
... ...
plugins/virtuoso/views/virtuoso_plugin_admin/index.html.erb
... ... @@ -8,15 +8,48 @@
8 8 <%= labelled_form_field _('Virtuoso URL:'), f.text_field(:virtuoso_uri) %>
9 9 <%= labelled_form_field _('Virtuoso Username:'), f.text_field(:virtuoso_username) %>
10 10 <%= labelled_form_field _('Virtuoso Password:'), f.password_field(:virtuoso_password) %>
11   - <%= labelled_form_field _('DSpace URL:'), f.text_field(:dspace_uri) %>
  11 + <%#= labelled_form_field _('DSpace URL:'), f.text_field(:dspace_uri) %>
12 12 </strong>
13 13  
  14 +
  15 +<!-- Iníco bloco link original -->
  16 +<% raise @settings[:settings].to_yaml %>
  17 +
  18 +<strong><%= _('Dspace Servers') %></strong>
  19 +<div id='edit-server-list-block'>
  20 + <ul class='link-list-header'>
  21 + <li class='link-list-name'><%= _('DSpace URL') %></li>
  22 + </ul>
  23 + <ul id="dropable-server-list">
  24 + <% for dspace_uri in @settings[:dspace_servers] do %>
  25 + <%= render :partial => 'server_list_item', :locals => {:dspace_uri => dspace_uri} %>
  26 + <% end %>
  27 + </ul>
  28 +
  29 + <div id="new-template">
  30 + <% template_server = {'icon' => 'ok'} %>
  31 + <%= render :partial => 'server_list_item', :locals => {:server => {} } %>
  32 + </div>
  33 +</div>
  34 +
  35 +<%= link_to_function(_('New Dspace Server'), 'add_new_server();', :class => 'button icon-add with-text') %>
  36 +
  37 +
  38 +<!-- FIm bloco link original -->
  39 +
  40 +
  41 +
14 42 <% button_bar do %>
15 43 <%= submit_button(:save, _('Save'), :cancel => {:controller => 'plugins', :action => 'index'}) %>
16 44 <% end %>
17 45  
18 46 <% end %>
19 47  
  48 +
  49 +
  50 +
  51 +
  52 +
20 53 <hr/>
21 54 <div class="harvest">
22 55 <% if @settings.last_harvest %>
... ...