Noosfero/noosfero

View on GitHub
app/views/features/index.html.erb

Summary

Maintainability
Test Coverage
<h1><%= _('System features') %></h1>

<h2><%= _('Enable/Disable features') %></h2>

<p>
<%=  _('Here you can enable or disable several features of your environment. Each feature represents some funcionality that your environment can use if you enable it.

Check all the features you want to enable for your environment, uncheck all the ones you don\'t want, and use the <em>"Save changes" button</em> to confirm your changes.').html_safe %>
</p>

<%= labelled_form_for(:environment, :url => {:action => 'update'}) do |f| %>

<table>
  <tr>
    <th><%= _('Feature') %></th>
    <th><%= _('Enabled?') %></th>
  </tr>
  <%= hidden_field_tag('environment[enabled_features][]', '') %>
  <% @features.each do |feature, text|   %>
  <tr>
    <td><%= text %></td>
    <td class='feature-checkbox'><%= check_box_tag "environment[enabled_features][]", feature, @environment.enabled?(feature) %></td>
  </tr>
  <% end %>
</table>

<h2><%= _('Configure features') %></h2>

<h3><%= _('Page to redirect after signup') %></h3>
  <%=  select 'environment', 'redirection_after_signup', Environment.signup_redirection_options.map{|key,value|[value,key]} %>
<hr/>
<h3><%= _('Page to redirect after login') %></h3>
  <%=  select 'environment', 'redirection_after_login', Environment.login_redirection_options.map{|key,value|[value,key]} %>
<hr/>

<h3><%= _('Organization Approval Method') %></h3>
  <%= select_organization_approval_method('environment', 'organization_approval_method') %>
<hr/>

<h3><%= _('Members Whitelist') %></h3>
  <div class="option">
    <%= check_box :environment, :members_whitelist_enabled %>
    <label><%= _('Enable whitelist') %></label>
  </div>
  <div class="input">
    <div class="info"><%= _('Allow these people to access this environment:') %></div>
    <% tokenized_members = prepare_to_token_input(environment.people.where(id: environment.members_whitelist)) %>
    <%= token_input_field_tag('environment[members_whitelist]', 'search-members', {:action => 'search_members'}, {:focus => false, :hint_text => _('Type in a search term for a user'), :pre_populate => tokenized_members}) %>
  </div>
<hr/>

<h3><%= _('Feed') %></h3>
  <div class="option">
    <%= check_box :environment, :enable_feed_proxy %>
    <label><%= _('Enable feed proxy') %></label>
  </div>
  <div class="input">
    <div class="info"><%= _('HTTP feed proxy address:') %></div>
    <%= text_field :environment, :http_feed_proxy %>
  </div>
  <div class="input">
    <div class="info"><%= _('HTTPS feed proxy address:') %></div>
    <%= text_field :environment, :https_feed_proxy %>
  </div>
  <div class="option">
    <%= check_box :environment, :disable_feed_ssl %>
    <label><%= _('Disable feed SSL') %></label>
  </div>
<hr/>

<div>
  <%= button_bar do %>
    <%= button :back, _('Back to admin panel'), :controller => 'admin_panel', :action => 'index' %>
    <%= submit_button(:save, _('Save changes')) %>
  <% end %>
</div>

<% end %>