{"action":"created","comment":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments/64180573","id":64180573,"diff_hunk":"@@ -0,0 +1,152 @@\n+<%= form_for @mobile_app, url: (@mobile_app.persisted? ? CartoDB.url(self, 'mobile_app', { id: @mobile_app.id }) : CartoDB.url(self, 'mobile_apps')), :html => { :class => \"js-MobileAppForm\" } do |f| %>\n+  <%= csrf_meta_tags %>\n+\n+  <span class=\"FormAccount-separator\"></span>\n+\n+  <div class=\"FormAccount-row js-iconSelector\">\n+    <div class=\"FormAccount-rowLabel\">\n+      <label class=\"FormAccount-label\">App icon</label>\n+    </div>\n+    <div class=\"FormAccount-rowData FormAccount-avatar\">\n+      <div class=\"FormAccount-avatarPreview\">\n+        <img src=\"\" class=\"FormAccount-avatarPreviewImage\" />\n+      </div>\n+      <div class=\"FormAccount-avatar--input\">\n+        <%= f.file_field :icon_url, :class => \"FormAccount-fileAvatar js-fileIcon\", :value => \"Change image\", :required => \"true\" %>\n+        <div class=\"FormAccount-rowInfo FormAccount-rowInfo--marginLeft\">\n+          <p class=\"FormAccount-rowInfoText FormAccount-rowInfoText--smaller\">Recommended images should be 128x128 pixels of size</p>\n+        </div>\n+      </div>\n+    </div>\n+  </div>\n+\n+  <div class=\"FormAccount-row\">\n+    <div class=\"FormAccount-rowLabel\">\n+      <label class=\"FormAccount-label\">Name</label>\n+    </div>\n+    <div class=\"FormAccount-rowData\">\n+      <%= f.text_field :name, :placeholder => \"Application name\", :class => \"FormAccount-input FormAccount-input--med\", :required => \"true\" %>\n+    </div>\n+  </div>\n+\n+  <div class=\"FormAccount-row\">\n+    <div class=\"FormAccount-rowLabel\">\n+      <label class=\"FormAccount-label\">Description</label>\n+    </div>\n+    <div class=\"FormAccount-rowData\">\n+      <%= f.text_area :description, :placeholder => \"Application description\", :class => \"FormAccount-textarea FormAccount-input FormAccount-input--totalwidth\" %>\n+    </div>\n+    <div class=\"FormAccount-rowInfo\">\n+      <p class=\"FormAccount-rowInfoText\"></p>\n+    </div>\n+  </div>\n+\n+   <div class=\"FormAccount-row\">\n+    <div class=\"FormAccount-rowLabel\">\n+      <label class=\"FormAccount-label\">Platform</label>\n+    </div>\n+\n+    <div class=\"FormAccount-rowData\">\n+      <%- @mobile_app.data(current_user, mobile_platforms: true)[:mobile_platforms].each do |platform, values| %>\n+        <%- is_disabled = values[:available] === true ? '' : 'disabled' %>\n+        <%- is_checked = values[:selected] === true ? 'checked' : '' %>\n+\n+        <div class=\"RadioButton u-rspace--20\">\n+          <input class=\"RadioButtonInput js-appPlatformsLegendOption\" type=\"radio\" name=\"mobile_app[platform]\" value=\"<%= platform %>\" <%= is_disabled %> <%= is_checked %> required>\n+          <span class=\"RadioButtonInput-face\"></span>\n+          <label class=\"RadioButton-label <%= values[:available] === true ? 'dark-color' : '' %>\"><%= values[:text] %></label>\n+        </div>\n+      <% end %>\n+    </div>\n+  </div>\n+\n+  <div class=\"FormAccount-row\">\n+    <div class=\"FormAccount-rowLabel\">\n+      <label class=\"FormAccount-label\">Aplication ID</label>\n+    </div>\n+    <div class=\"FormAccount-rowData\">\n+      <%= f.text_field :app_id, :placeholder => \"com.example.my.app\", :class => \"FormAccount-input FormAccount-input--med #{ 'FormAccount-input--error' if @mobile_app.errors[:app_id].present? } #{'is-disabled' if @mobile_app.persisted?}\", :required => \"true\", :readonly => @mobile_app.persisted? %>\n+\n+      <div class=\"FormAccount-rowInfo FormAccount-rowInfo--marginLeft\">\n+        <p class=\"FormAccount-rowInfoText js-appPlatformsLegend\"></p>\n+      </div>\n+    </div>\n+  </div>\n+\n+   <div class=\"FormAccount-row\">\n+    <div class=\"FormAccount-rowLabel\">\n+      <label class=\"FormAccount-label\">App type</label>\n+    </div>\n+    <%- @mobile_app.data(current_user, app_types: true)[:app_types].each do |type, values| %>\n+      <%- is_disabled = values[:available] === true ? '' : 'disabled' %>\n+      <%- is_checked = values[:selected] === true ? 'checked' : '' %>\n+\n+      <div class=\"FormAccount-rowData in-block u-vspace-s\">\n+        <div class=\"RadioButton\">\n+          <input class=\"RadioButtonInput\" type=\"radio\" name=\"mobile_app[app_type]\" value=\"<%= type %>\" <%= is_disabled %> <%= is_checked %> required>\n+          <span class=\"RadioButtonInput-face\"></span>\n+          <label class=\"RadioButton-label <%= is_disabled == 'disabled' ? '' : 'dark-color' %>\"><%= type.capitalize %></label>\n+        </div>\n+        <div class=\"FormAccount-rowInfo u-lspace-28\">\n+          <p class=\"FormAccount-rowInfoText\"><%= values[:text].html_safe %></p>\n+        </div>\n+      </div>\n+    <% end %>\n+  </div>\n+\n+  <div class=\"FormAccount-footer FormAccount-footer--noMarginBottom\">\n+    <p class=\"FormAccount-footerText\"></p>\n+    <%= button_tag(type: 'submit', class: 'Button Button--main') do %>\n+      <% content_tag(:span, 'Save') %>\n+    <% end %>\n+  </div>\n+\n+  <%- if @mobile_app.persisted? %>\n+    <%- if @mobile_app.app_type == \"dev\" %>\n+      <%- max_users = @max_dev_users %>\n+      <%- users_bar_width = (@mobile_app.monthly_users*100)/@max_dev_users %>\n+    <% elsif @mobile_app.app_type == \"open\" %>\n+      <%- max_users = current_user.mobile_max_open_users %>\n+      <%- users_bar_width = (@mobile_app.monthly_users*100)/max_users %>\n+    <% elsif @mobile_app.app_type == \"private\" %>\n+      <%- max_users = current_user.mobile_max_private_users %>\n+      <%- users_bar_width = (@mobile_app.monthly_users*100)/max_users %>","path":"app/views/carto/admin/mobile_apps/_form.html.erb","position":113,"original_position":113,"commit_id":"61a632418362c709304f41591e13324e7f636ada","original_commit_id":"61a632418362c709304f41591e13324e7f636ada","user":{"login":"viddo","id":978461,"avatar_url":"https://avatars.githubusercontent.com/u/978461?v=3","gravatar_id":"","url":"https://api.github.com/users/viddo","html_url":"https://github.com/viddo","followers_url":"https://api.github.com/users/viddo/followers","following_url":"https://api.github.com/users/viddo/following{/other_user}","gists_url":"https://api.github.com/users/viddo/gists{/gist_id}","starred_url":"https://api.github.com/users/viddo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viddo/subscriptions","organizations_url":"https://api.github.com/users/viddo/orgs","repos_url":"https://api.github.com/users/viddo/repos","events_url":"https://api.github.com/users/viddo/events{/privacy}","received_events_url":"https://api.github.com/users/viddo/received_events","type":"User","site_admin":false},"body":"These different types and calculations doesn't seem to belong to the template, just by the looks of it seem to be related to business logic so probably belongs in a model","created_at":"2016-05-23T07:50:03Z","updated_at":"2016-05-23T07:50:03Z","html_url":"https://github.com/CartoDB/cartodb/pull/7392#discussion_r64180573","pull_request_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/7392","_links":{"self":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments/64180573"},"html":{"href":"https://github.com/CartoDB/cartodb/pull/7392#discussion_r64180573"},"pull_request":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/7392"}}},"pull_request":{"url":"https://api.github.com/repos/CartoDB/cartodb/pulls/7392","id":69967681,"html_url":"https://github.com/CartoDB/cartodb/pull/7392","diff_url":"https://github.com/CartoDB/cartodb/pull/7392.diff","patch_url":"https://github.com/CartoDB/cartodb/pull/7392.patch","issue_url":"https://api.github.com/repos/CartoDB/cartodb/issues/7392","number":7392,"state":"open","locked":false,"title":"Mobile keys UI","user":{"login":"javitonino","id":7569673,"avatar_url":"https://avatars.githubusercontent.com/u/7569673?v=3","gravatar_id":"","url":"https://api.github.com/users/javitonino","html_url":"https://github.com/javitonino","followers_url":"https://api.github.com/users/javitonino/followers","following_url":"https://api.github.com/users/javitonino/following{/other_user}","gists_url":"https://api.github.com/users/javitonino/gists{/gist_id}","starred_url":"https://api.github.com/users/javitonino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javitonino/subscriptions","organizations_url":"https://api.github.com/users/javitonino/orgs","repos_url":"https://api.github.com/users/javitonino/repos","events_url":"https://api.github.com/users/javitonino/events{/privacy}","received_events_url":"https://api.github.com/users/javitonino/received_events","type":"User","site_admin":false},"body":"Closes #7178 \r\n\r\nHere for testing.\r\ncc @MariaCheca ","created_at":"2016-05-13T09:33:14Z","updated_at":"2016-05-23T07:50:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1075dc8d78b0f8ead00f833f6c2d0054faef7b5b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/7392/commits","review_comments_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/7392/comments","review_comment_url":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/issues/7392/comments","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/61a632418362c709304f41591e13324e7f636ada","head":{"label":"CartoDB:7178-mobile_sdk_keys_ui","ref":"7178-mobile_sdk_keys_ui","sha":"61a632418362c709304f41591e13324e7f636ada","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":4909355,"name":"cartodb","full_name":"CartoDB/cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/cartodb","description":"Location Intelligence & Data Visualization tool","fork":false,"url":"https://api.github.com/repos/CartoDB/cartodb","forks_url":"https://api.github.com/repos/CartoDB/cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/cartodb/deployments","created_at":"2012-07-05T15:23:45Z","updated_at":"2016-05-22T21:45:08Z","pushed_at":"2016-05-23T06:51:38Z","git_url":"git://github.com/CartoDB/cartodb.git","ssh_url":"git@github.com:CartoDB/cartodb.git","clone_url":"https://github.com/CartoDB/cartodb.git","svn_url":"https://github.com/CartoDB/cartodb","homepage":"http://cartodb.com","size":386578,"stargazers_count":1139,"watchers_count":1139,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":288,"mirror_url":null,"open_issues_count":911,"forks":288,"open_issues":911,"watchers":1139,"default_branch":"master"}},"base":{"label":"CartoDB:master","ref":"master","sha":"fe0e2bc0dedaa6ca5655e5931a686ab58c0f02db","user":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"repo":{"id":4909355,"name":"cartodb","full_name":"CartoDB/cartodb","owner":{"login":"CartoDB","id":1799254,"avatar_url":"https://avatars.githubusercontent.com/u/1799254?v=3","gravatar_id":"","url":"https://api.github.com/users/CartoDB","html_url":"https://github.com/CartoDB","followers_url":"https://api.github.com/users/CartoDB/followers","following_url":"https://api.github.com/users/CartoDB/following{/other_user}","gists_url":"https://api.github.com/users/CartoDB/gists{/gist_id}","starred_url":"https://api.github.com/users/CartoDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CartoDB/subscriptions","organizations_url":"https://api.github.com/users/CartoDB/orgs","repos_url":"https://api.github.com/users/CartoDB/repos","events_url":"https://api.github.com/users/CartoDB/events{/privacy}","received_events_url":"https://api.github.com/users/CartoDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CartoDB/cartodb","description":"Location Intelligence & Data Visualization tool","fork":false,"url":"https://api.github.com/repos/CartoDB/cartodb","forks_url":"https://api.github.com/repos/CartoDB/cartodb/forks","keys_url":"https://api.github.com/repos/CartoDB/cartodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CartoDB/cartodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CartoDB/cartodb/teams","hooks_url":"https://api.github.com/repos/CartoDB/cartodb/hooks","issue_events_url":"https://api.github.com/repos/CartoDB/cartodb/issues/events{/number}","events_url":"https://api.github.com/repos/CartoDB/cartodb/events","assignees_url":"https://api.github.com/repos/CartoDB/cartodb/assignees{/user}","branches_url":"https://api.github.com/repos/CartoDB/cartodb/branches{/branch}","tags_url":"https://api.github.com/repos/CartoDB/cartodb/tags","blobs_url":"https://api.github.com/repos/CartoDB/cartodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CartoDB/cartodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CartoDB/cartodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/CartoDB/cartodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CartoDB/cartodb/statuses/{sha}","languages_url":"https://api.github.com/repos/CartoDB/cartodb/languages","stargazers_url":"https://api.github.com/repos/CartoDB/cartodb/stargazers","contributors_url":"https://api.github.com/repos/CartoDB/cartodb/contributors","subscribers_url":"https://api.github.com/repos/CartoDB/cartodb/subscribers","subscription_url":"https://api.github.com/repos/CartoDB/cartodb/subscription","commits_url":"https://api.github.com/repos/CartoDB/cartodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/CartoDB/cartodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/CartoDB/cartodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/CartoDB/cartodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/CartoDB/cartodb/contents/{+path}","compare_url":"https://api.github.com/repos/CartoDB/cartodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CartoDB/cartodb/merges","archive_url":"https://api.github.com/repos/CartoDB/cartodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CartoDB/cartodb/downloads","issues_url":"https://api.github.com/repos/CartoDB/cartodb/issues{/number}","pulls_url":"https://api.github.com/repos/CartoDB/cartodb/pulls{/number}","milestones_url":"https://api.github.com/repos/CartoDB/cartodb/milestones{/number}","notifications_url":"https://api.github.com/repos/CartoDB/cartodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CartoDB/cartodb/labels{/name}","releases_url":"https://api.github.com/repos/CartoDB/cartodb/releases{/id}","deployments_url":"https://api.github.com/repos/CartoDB/cartodb/deployments","created_at":"2012-07-05T15:23:45Z","updated_at":"2016-05-22T21:45:08Z","pushed_at":"2016-05-23T06:51:38Z","git_url":"git://github.com/CartoDB/cartodb.git","ssh_url":"git@github.com:CartoDB/cartodb.git","clone_url":"https://github.com/CartoDB/cartodb.git","svn_url":"https://github.com/CartoDB/cartodb","homepage":"http://cartodb.com","size":386578,"stargazers_count":1139,"watchers_count":1139,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":288,"mirror_url":null,"open_issues_count":911,"forks":288,"open_issues":911,"watchers":1139,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/7392"},"html":{"href":"https://github.com/CartoDB/cartodb/pull/7392"},"issue":{"href":"https://api.github.com/repos/CartoDB/cartodb/issues/7392"},"comments":{"href":"https://api.github.com/repos/CartoDB/cartodb/issues/7392/comments"},"review_comments":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/7392/comments"},"review_comment":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CartoDB/cartodb/pulls/7392/commits"},"statuses":{"href":"https://api.github.com/repos/CartoDB/cartodb/statuses/61a632418362c709304f41591e13324e7f636ada"}}}}
{"actor":{"display_login":"viddo"}}