new_software.html.erb 2.71 KB
<%= stylesheet_link_tag('plugins/mpog_software/mpog-software') %>

<div class="software-step-info">
  <h3><%= _("Step 1/2 - Software Creation")%></h3>
</div>

<h1><%= _('Creating new software') %></h1>

<% if environment.enabled?('admin_must_approve_new_communities') %>
  <div class='explanation'>
    <%= _("Note that the creation of communities in this environment is restricted. Your request to create this new community will be sent to %{environment} administrators and will be approved or rejected according to their methods and criteria.") % { :environment => environment.name }%>
  </div>
<%end %>

<% unless @errors.blank? %>
<div class="errorExplanation" id="errorExplanation">
  <h2> <%= _("Can`t create new software: #{@errors.length} errors") %> </h2>
  <ul>
  <% @errors.each do |error| %>
    <li> <%= error %> </li>
  <% end %>
  </ul>
</div>
<% end %>

<div>
  <%= labelled_form_for :community, :html => { :multipart => true } do |f| %>

    <%= required_fields_message %>

    <%= label("name", _('Name'), {:class => 'formlabel mandatory'}) %>

    <div id='software-name-field' class='formfield'>
      <span id='software-hostname'><%= environment.default_hostname %>/</span>
      <%= required text_field(:community, :name, :size => 30, :maxlength => 100) %>
    </div>

    <%= fields_for @software_info do |swf| %>
      <div class="formfield type-text">
        <%= swf.label("finality" ,_("Finality"), :class=>"formlabel") %>
        <%= required swf.text_area(:finality, :placeholder => _("It is a software of..."), :cols => 40, :rows => 5, :maxlength => 140) %>
      </div>
    <% end %>

  <%=  fields_for @license_info do |lcv| %>
    <div class="formfieldline">
      <h4> <%= lcv.label _("License Version: ") %> </h4>
        <%= lcv.select(:version, LicenseInfo.all.map {|l| [l.version, l.version]}, {:selected=>1}, :onchange => "get_license_link('license_info_version')") %>

      <h4> <%= _("License link") %> </h4>
      <% LicenseHelper.getListLicenses.each do | license |  %>
        <input type="hidden" id = "version_<%=license.id %>" value = "<%=license.link%>">
      <% end %>
      <a id = "version_link" href="<%= LicenseInfo.first.link %>" target="_BLANK"> <%=LicenseInfo.first.link %> </a>

    </div>
  <% end %>


    <%= fields_for @software_info do |swf| %>
      <div class="formfieldline formfield type-text">
        <%= swf.label "repository_url", _("Link to Repository: "), :class => "formlabel"%>
        <%= swf.text_field :repository_link, :class => "improve_input_size" %>
      </div>
    <% end %>

    <%= hidden_field_tag('back_to', @back_to) %>

    <% button_bar do %>
      <%= submit_button(:save, _('Create')) %>
      <%= button(:cancel, _('Cancel'), @back_to ) %>
    <% end %>

  <% end %>

</div>