<%= form_for @mobile_app, as: :mobile_app, url: (@mobile_app.persisted? ? CartoDB.url(self, 'mobile_app', params: { id: @mobile_app.id }, user: current_user) : CartoDB.url(self, 'mobile_apps', user: current_user)), html: { class: "js-MobileAppForm" } do |f| %> <%= csrf_meta_tags %>
<%= f.file_field :icon_url, :class => "FormAccount-fileAvatar js-fileIcon", :value => "Change image", :required => "true" %>

Recommended images should be 128x128 pixels of size

<%= f.text_field :name, :placeholder => "Application name", :class => "CDB-InputText CDB-Text FormAccount-input FormAccount-input--med", :required => "true" %>
<%= f.text_area :description, :placeholder => "Application description", :class => "CDB-Textarea CDB-Text FormAccount-textarea FormAccount-input FormAccount-input--totalwidth" %>

<%- mobile_platforms = @mobile_app.data(current_user, fetch_mobile_platforms: true)[:mobile_platforms] %> <%- if @mobile_app.persisted? %> <%- platform = mobile_platforms[@mobile_app.platform.to_sym] %>
<% else %> <%- mobile_platforms.each do |platform, values| %> <%- is_disabled = values[:available] === true ? '' : 'disabled' %> <%- is_checked = values[:selected] === true ? 'checked' : '' %>
<%= is_checked %> required>
<% end %> <% end %>
<%= f.text_field :app_id, :placeholder => "com.example.my.app", :class => "CDB-InputText CDB-Text FormAccount-input FormAccount-input--med #{ 'has-error' if @mobile_app.errors[:app_id].present? } #{'is-disabled' if @mobile_app.persisted?}", :required => "true", :readonly => @mobile_app.persisted? %>

<%- app_types = @mobile_app.data(current_user, fetch_app_types: true)[:app_types] %> <%- if @mobile_app.persisted? %> <%- app_type = app_types[@mobile_app.app_type.to_sym] %>

<%= app_type[:text].html_safe %>

<% else %> <%- app_types.each do |type, values| %> <%- is_disabled = values[:available] === true ? '' : 'disabled' %> <%- is_checked = values[:selected] === true ? 'checked' : '' %>
<%= is_disabled %> required>

<%= values[:text].html_safe %>

<% end %> <% end %>
<%- if @mobile_app.persisted? %>

License key

Application quota

<%= number_with_delimiter(@mobile_app.monthly_users, delimiter: ",") %> monthly users
<% end %> <%- if @mobile_app.persisted? %>

Delete application

Delete this application
<% end %> <% end %>