platform 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -3
- data/README.rdoc +140 -3
- data/app/assets/images/platform/help/app_reg.png +0 -0
- data/app/assets/images/platform/help/app_reg_ext.png +0 -0
- data/app/assets/images/platform/help/app_reg_web.png +0 -0
- data/app/assets/images/platform/help/auth_desktop.png +0 -0
- data/app/assets/images/platform/help/auth_iframe.png +0 -0
- data/app/assets/images/platform/help/auth_iphone.png +0 -0
- data/app/assets/images/platform/help/auth_web.png +0 -0
- data/app/assets/images/platform/help/authorize.png +0 -0
- data/app/assets/images/platform/help/ext.png +0 -0
- data/app/assets/images/platform/help/login_desktop.png +0 -0
- data/app/assets/images/platform/help/login_iphone.png +0 -0
- data/app/assets/images/platform/help/login_web.png +0 -0
- data/app/assets/images/platform/help/register_desktop.png +0 -0
- data/app/assets/images/platform/help/register_iphone.png +0 -0
- data/app/assets/javascripts/platform/platform.js +1 -1
- data/app/controllers/platform/api/base_controller.rb +24 -14
- data/app/controllers/platform/apps_controller.rb +16 -0
- data/app/controllers/platform/developer/help_controller.rb +2 -15
- data/app/controllers/platform/oauth_controller.rb +3 -3
- data/app/helpers/platform/admin/categories_helper.rb +1 -1
- data/app/helpers/platform/developer/help_helper.rb +2 -1
- data/app/models/platform/application.rb +2 -0
- data/app/models/platform/developer.rb +2 -0
- data/app/models/platform/logged_exception.rb +1 -1
- data/app/views/platform/admin/clientsdk/index.html.erb +12 -12
- data/app/views/platform/apps/_search_apps_module.html.erb +1 -1
- data/app/views/platform/apps/settings.html.erb +77 -0
- data/app/views/platform/developer/api_explorer/options.html.erb +0 -2
- data/app/views/platform/developer/dashboard/index.html.erb +1 -1
- data/app/views/platform/developer/help/_navigation.html.erb +1 -1
- data/app/views/platform/developer/help/oauth_client_side.html.erb +17 -15
- data/app/views/platform/developer/help/oauth_extensions.html.erb +1 -1
- data/app/views/platform/developer/help/oauth_mobile.html.erb +12 -12
- data/app/views/platform/developer/help/oauth_server_side.html.erb +6 -6
- data/app/views/platform/developer/help/sdk_ios.html.erb +3 -3
- data/app/views/platform/developer/help/sdk_js.html.erb +13 -185
- data/app/views/platform/developer/info/_basic_info.html.erb +1 -1
- data/app/views/platform/developer/info/_header.html.erb +3 -3
- data/app/views/platform/developer/registration/index.html.erb +30 -30
- data/app/views/platform/oauth/_authorization_box.html.erb +6 -7
- data/app/views/platform/oauth/_authorization_popup.html.erb +1 -1
- data/app/views/platform/oauth/authorize_desktop.html.erb +1 -76
- data/config/routes.rb +2 -4
- data/lib/generators/platform/proxy_generator.rb +78 -0
- data/lib/generators/platform/templates/config/platform/api/0/platform.yml +55 -0
- data/lib/generators/platform/templates/config/platform/api/0/platform_application.yml +37 -0
- data/lib/generators/platform/templates/config/platform/api/0/platform_developer.yml +22 -0
- data/{config → lib/generators/platform/templates/config}/platform/config.yml +22 -19
- data/{config → lib/generators/platform/templates/config}/platform/data/default_applications.yml +0 -0
- data/{config → lib/generators/platform/templates/config}/platform/data/default_categories.yml +0 -0
- data/{config → lib/generators/platform/templates/config}/platform/data/default_permissions.yml +0 -0
- data/{config → lib/generators/platform/templates/config}/platform/site/features.yml +0 -0
- data/lib/platform.rb +23 -0
- data/lib/platform/api/proxy/base.rb +5 -2
- data/lib/platform/cache.rb +1 -1
- data/lib/platform/config.rb +20 -3
- data/lib/platform/engine.rb +23 -0
- data/lib/platform/exception.rb +1 -1
- data/lib/platform/extensions/action_view_extension.rb +25 -0
- data/lib/platform/helper.rb +1 -1
- data/lib/platform/logger.rb +1 -1
- data/lib/platform/random_password_generator.rb +1 -1
- data/lib/platform/simple_string_permissions.rb +1 -1
- data/lib/platform/version.rb +24 -1
- data/lib/tasks/platform.rake +1 -1
- data/platform.gemspec +1 -1
- data/test/dummy/.pryrc +15 -0
- data/test/dummy/app/controllers/api/base_controller.rb +0 -1
- data/test/dummy/app/controllers/api/bookmarks_controller.rb +6 -1
- data/{app/controllers/platform/developer/resources_controller.rb → test/dummy/app/controllers/api/platform_controller.rb} +16 -2
- data/test/dummy/app/controllers/api/users_controller.rb +1 -0
- data/test/dummy/app/controllers/login_controller.rb +2 -1
- data/test/dummy/app/models/user.rb +8 -0
- data/test/dummy/app/views/layouts/_header.html.erb +1 -0
- data/test/dummy/app/views/layouts/blank.html.erb +24 -0
- data/test/dummy/app/views/layouts/mobile.html.erb +68 -0
- data/test/dummy/app/views/login/index.html.erb +1 -2
- data/test/dummy/app/views/login/register.html.erb +3 -3
- data/test/dummy/config/application.rb +1 -1
- data/test/dummy/config/platform/api/1/bookmark.yml +23 -3
- data/test/dummy/config/platform/api/1/platform.yml +55 -0
- data/test/dummy/config/platform/api/1/platform_application.yml +37 -0
- data/test/dummy/config/platform/api/1/platform_developer.yml +22 -0
- data/test/dummy/config/platform/api/1/user.yml +1 -1
- data/test/dummy/config/platform/config.yml +5 -4
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config/tr8n/config.yml +1 -1
- data/test/dummy/lib/platform/api/platform_application_proxy_0.rb +28 -0
- data/test/dummy/lib/platform/api/platform_developer_proxy_0.rb +19 -0
- metadata +72 -65
- data/app/assets/images/platform/help/login.png +0 -0
- data/app/assets/javascripts/platform/jsdk.js +0 -539
- data/app/controllers/platform/api/apps_controller.rb +0 -40
- data/app/views/platform/developer/resources/index.html.erb +0 -23
- data/test/dummy/config/platform/site/sample_apps.yml +0 -100
@@ -10,7 +10,7 @@
|
|
10
10
|
<div id="basic_info_container">
|
11
11
|
<%=render(:partial => "header", :locals => {:section => "basic_info", :label => "Developer Details", :description => "Developer details section title", :mode => mode})%>
|
12
12
|
|
13
|
-
|
13
|
+
<%= form_for(platform_current_developer, :as => :developer, :url => {:action => :index}, :html => {:id => 'basic_info_form', :method => :post}) do |f| %>
|
14
14
|
<div class="section_box colored">
|
15
15
|
<div style="float:right; padding-right:5px;">
|
16
16
|
<%=platform_help_icon_tag %>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<div class="section_title">
|
2
2
|
<div style="float:right; padding-top:3px;">
|
3
3
|
<% if mode == :view %>
|
4
|
-
<%=link_to_function(
|
4
|
+
<%=link_to_function(image_tag("platform/table_edit.png"), "switchSectionMode('#{section}', 'edit')") %>
|
5
5
|
<% else %>
|
6
|
-
<%=link_to_function(image_tag("/
|
7
|
-
<%=link_to_function(image_tag("/
|
6
|
+
<%=link_to_function(image_tag("platform/disk.png"), "submitSection('#{section}')")%>
|
7
|
+
<%=link_to_function(image_tag("platform/cancel.png"), "switchSectionMode('#{section}', 'view')")%>
|
8
8
|
<% end %>
|
9
9
|
</div>
|
10
10
|
|
@@ -1,24 +1,24 @@
|
|
1
1
|
<div class="module page_title lengthy">
|
2
2
|
<div class="inner">
|
3
3
|
<div class="hd">
|
4
|
-
<h1><%= tr('Welcome to
|
4
|
+
<h1><%= tr('Welcome to #{Platform::Config.site_title} Platform!', 'Client application section title') %></h1>
|
5
5
|
</div>
|
6
6
|
</div>
|
7
7
|
</div>
|
8
8
|
|
9
9
|
<div style="padding:10px;border:1px solid #ccc;overflow:auto;height:500px;margin:10px;font-family:Arial;font-size:12px;">
|
10
10
|
<pre>
|
11
|
-
|
11
|
+
<%=Platform::Config.site_title %> Platform Policies
|
12
12
|
|
13
13
|
Introduction
|
14
14
|
|
15
15
|
Date of Last Revision: May 24, 2011
|
16
16
|
|
17
|
-
|
17
|
+
<%=Platform::Config.site_title %> Platform is an extension of <%=Platform::Config.site_title %>, whose mission is to give people the power to share and make the world more open and connected.
|
18
18
|
|
19
19
|
Platform applications and developers are required to comply with the following documents:
|
20
20
|
|
21
|
-
Statement of Rights and Responsibilities: requirements for anyone who uses
|
21
|
+
Statement of Rights and Responsibilities: requirements for anyone who uses <%=Platform::Config.site_title %>.
|
22
22
|
Principles: the spirit of the law for Platform.
|
23
23
|
Policies: the letter of the law for Platform.
|
24
24
|
|
@@ -42,33 +42,33 @@ Policies
|
|
42
42
|
|
43
43
|
I. Features and Functionality
|
44
44
|
|
45
|
-
You must not violate any law or the rights of any individual or entity, and must not expose
|
46
|
-
You must not include functionality that proxies, requests or collects
|
47
|
-
You must not circumvent (or claim to circumvent) our intended limitations on core
|
45
|
+
You must not violate any law or the rights of any individual or entity, and must not expose <%=Platform::Config.site_title %> or <%=Platform::Config.site_title %> users to harm or legal liability as determined by us in our sole discretion.
|
46
|
+
You must not include functionality that proxies, requests or collects <%=Platform::Config.site_title %> usernames or passwords.
|
47
|
+
You must not circumvent (or claim to circumvent) our intended limitations on core <%=Platform::Config.site_title %> features and functionality.
|
48
48
|
If you offer a service for a user that integrates user data into a physical product (such as a scrapbook or calendar), you must only create a physical product for that user's personal and non-commercial use.
|
49
49
|
If you exceed, or plan to exceed, any of the following thresholds please contact us as you may be subject to additional terms: (>5M MAU) or (>100M API calls per day) or (>50M impressions per day).
|
50
|
-
Your website must offer an explicit "Log Out" option that also logs the user out of
|
50
|
+
Your website must offer an explicit "Log Out" option that also logs the user out of <%=Platform::Config.site_title %>.
|
51
51
|
Special provisions for apps on Pages:
|
52
52
|
|
53
53
|
a. Apps on Pages must not host media that plays automatically without a user's interaction.
|
54
|
-
b. When a user visits your Page, if they have not given explicit permission by authorizing your
|
54
|
+
b. When a user visits your Page, if they have not given explicit permission by authorizing your <%=Platform::Config.site_title %> app or directly providing information to your Page, you may only use information obtained from us and the user's interaction with your Page in connection with that Page. For example, although you may use aggregate analytics for your individual Page, you must not combine information from any other sources to customize the user's experience on your Page and may not use any information about the user's interaction with your Page in any other context (such as analytics or customization across other Pages or websites).
|
55
55
|
|
56
|
-
You must not use or make derivative use of
|
56
|
+
You must not use or make derivative use of <%=Platform::Config.site_title %> icons, or use terms for <%=Platform::Config.site_title %> features and functionality, if such use could confuse users into thinking that the reference is to <%=Platform::Config.site_title %> features or functionality.
|
57
57
|
|
58
58
|
II. Storing and Using Data You Receive From Us
|
59
59
|
|
60
60
|
You will only request the data you need to operate your application.
|
61
|
-
You may cache data you receive through use of the
|
61
|
+
You may cache data you receive through use of the <%=Platform::Config.site_title %> API in order to improve your application’s user experience, but you should try to keep the data up to date. This permission does not give you any rights to such data.
|
62
62
|
You will have a privacy policy that tells users what user data you are going to use and how you will use, display, share, or transfer that data and you will include your privacy policy URL in the Developer Application.
|
63
63
|
A user's friends' data can only be used in the context of the user's experience on your application.
|
64
|
-
Subject to certain restrictions, including on transfer, users give you their basic account information when they connect with your application. For all other data obtained through use of the
|
65
|
-
You will not directly or indirectly transfer any data you receive from us, including user data or
|
66
|
-
You will not use
|
64
|
+
Subject to certain restrictions, including on transfer, users give you their basic account information when they connect with your application. For all other data obtained through use of the <%=Platform::Config.site_title %> API, you must obtain explicit consent from the user who provided the data to us before using it for any purpose other than displaying it back to the user on your application.
|
65
|
+
You will not directly or indirectly transfer any data you receive from us, including user data or <%=Platform::Config.site_title %> User IDs, to (or use such data in connection with) any ad network, ad exchange, data broker, or other advertising or monetization related toolset, even if a user consents to such transfer or use. By indirectly we mean you cannot, for example, transfer data to a third party who then transfers the data to an ad network. By any data we mean all data obtained through use of the <%=Platform::Config.site_title %> Platform (API, Social Plugins, etc.), including aggregate, anonymous or derivative data.
|
66
|
+
You will not use <%=Platform::Config.site_title %> User IDs for any purpose outside your application (e.g., your infrastructure, code, or services necessary to build and run your application). <%=Platform::Config.site_title %> User IDs may be used with external services that you use to build and run your application, such as a web infrastructure service or a distributed computing platform, but only if those services are necessary to running your application and the service has a contractual obligation with you to keep <%=Platform::Config.site_title %> User IDs confidential.
|
67
67
|
If you need an anonymous unique identifier to share outside your application with third parties such as content partners, advertisers, or ad networks, you must use our mechanism. You must never share this anonymous unique identifier with a data broker, information broker, or any other service that we may define as such under our sole discretion.
|
68
68
|
You will not sell any data. If you are acquired by or merge with a third party, you can continue to use user data within your application, but you cannot transfer data outside your application.
|
69
|
-
If you stop using Platform or we disable your application, you must delete all data you have received through use of the
|
69
|
+
If you stop using Platform or we disable your application, you must delete all data you have received through use of the <%=Platform::Config.site_title %> API unless: (a) it is basic account information; or (b) you have received explicit consent from the user to retain their data.
|
70
70
|
You cannot use a user’s friend list outside of your application, even if a user consents to such use, but you can use connections between users who have both connected to your application.
|
71
|
-
You will delete all data you receive from us concerning a user if the user asks you to do so, and will provide an easily accessible mechanism for users to make such a request. We may require you to delete data you receive from the
|
71
|
+
You will delete all data you receive from us concerning a user if the user asks you to do so, and will provide an easily accessible mechanism for users to make such a request. We may require you to delete data you receive from the <%=Platform::Config.site_title %> API if you violate our terms.
|
72
72
|
You will not include data you receive from us concerning a user in any advertising creative, even if a user consents to such use.
|
73
73
|
You must not give your secret key to another party, unless that party is an agent acting on your behalf as an operator of your application. You are responsible for all activities that occur under your account identifiers.
|
74
74
|
|
@@ -78,31 +78,31 @@ III. Application Content
|
|
78
78
|
Alcohol-related content (unless the appropriate Demographic Restrictions are used), or sale of tobacco products, ammunition and/or firearms;
|
79
79
|
Content that infringes upon the rights of any third party, including intellectual property rights, privacy, publicity or other personal or proprietary right, or that is deceptive or fraudulent;
|
80
80
|
Gambling, including without limitation, any online casino, sports books, bingo or poker;
|
81
|
-
Illegal activity and/or illegal contests, pyramid schemes, sweepstakes or chain letters; if you run, reference, or facilitate a legally permissible sweepstakes, contest, or other promotion you are subject to
|
81
|
+
Illegal activity and/or illegal contests, pyramid schemes, sweepstakes or chain letters; if you run, reference, or facilitate a legally permissible sweepstakes, contest, or other promotion you are subject to <%=Platform::Config.site_title %>'s Promotions Guidelines;
|
82
82
|
Content that is hateful, threatening, defamatory, or pornographic; incites violence; or contains nudity or graphic or gratuitous violence.
|
83
83
|
B. Advertisements and Cross-Promotions
|
84
|
-
You must not include advertisements or promotions, cross-promote other applications, or provide web search functionality in content distributed through
|
85
|
-
You can only utilize advertising or similar monetization related products or services from companies that appear on this list within Apps on
|
84
|
+
You must not include advertisements or promotions, cross-promote other applications, or provide web search functionality in content distributed through <%=Platform::Config.site_title %> social channels.
|
85
|
+
You can only utilize advertising or similar monetization related products or services from companies that appear on this list within Apps on <%=Platform::Config.site_title %>.com.
|
86
86
|
|
87
87
|
IV. Application Integration Points
|
88
88
|
|
89
|
-
You must not incentivize users to use (or gate content behind the use of)
|
90
|
-
You must not pre-fill any of the fields associated with the following products, unless the user manually generated the content earlier in the workflow: Stream stories (user_message parameter for
|
89
|
+
You must not incentivize users to use (or gate content behind the use of) <%=Platform::Config.site_title %> social channels, or imply that an incentive is directly tied to the use of our channels.
|
90
|
+
You must not pre-fill any of the fields associated with the following products, unless the user manually generated the content earlier in the workflow: Stream stories (user_message parameter for <%=Platform::Config.site_title %>.streamPublish and FB.Connect.streamPublish, and message parameter for stream.publish), Photos (caption), Videos (description), Notes (title and content), Links (comment), and Jabber/XMPP.
|
91
91
|
If a user grants you a publishing permission, you must still obtain consent from the user before taking any action on the user's behalf, such as publishing content or creating an event.
|
92
|
-
You must provide users with an easily identifiable "skip" option whenever you present users with an option to use a
|
92
|
+
You must provide users with an easily identifiable "skip" option whenever you present users with an option to use a <%=Platform::Config.site_title %> social channel.
|
93
93
|
You must not provide users with the option to publish more than one Stream story at a time.
|
94
94
|
Platform integrations, including social plugins:
|
95
95
|
a. Your advertisements must not include or be paired with any Platform integrations, including social plugins such as the Like button, without our written permission.
|
96
96
|
b. You must not sell or purchase placement of a Like button or Like box plugin.
|
97
97
|
c. You must not incentivize users to Like any Page other than your own site or application, and any incentive you provide must be available to new and existing users who Like your Page.
|
98
98
|
d. You must not obscure or cover elements of our social plugins, such as the Like button or Like box plugin.
|
99
|
-
|
99
|
+
<%=Platform::Config.site_title %> messaging (i.e., email sent to an @<%=Platform::Config.site_title %>.com address) is designed for communication between users, and not a channel for applications to communicate directly with users.
|
100
100
|
|
101
101
|
V. Enforcement
|
102
102
|
|
103
|
-
We can take enforcement action against you and any or all of your applications if we determine in our sole judgment that you or your application violates
|
103
|
+
We can take enforcement action against you and any or all of your applications if we determine in our sole judgment that you or your application violates <%=Platform::Config.site_title %> Platform Terms and Policies. Enforcement action is both automated and manual, and can include disabling your application, restricting you and your application's access to Platform functionality, terminating our agreements with you, or any other action as we in our sole discretion deem appropriate.
|
104
104
|
|
105
|
-
Communication with developers takes place via an email sent from the
|
105
|
+
Communication with developers takes place via an email sent from the <%=Platform::Config.site_title %>.com or <%=Platform::Config.site_title %>mail.com domain to the Developer Contact email address registered to the application. To stay in touch, please ensure that your email address is current and that you do not filter out any such messages.
|
106
106
|
|
107
107
|
VI. Changes
|
108
108
|
|
@@ -111,18 +111,18 @@ We can change these Platform Policies at any time without prior notice as we dee
|
|
111
111
|
VII. Definitions
|
112
112
|
|
113
113
|
By "Application" we mean canvas page application, Platform integration, or any other technical integration we have assigned an application identification number.
|
114
|
-
By "
|
114
|
+
By "<%=Platform::Config.site_title %> social channel" we mean Application Info Section, Application tab, Feed, requests (including invites), inbox attachments, Chat, Bookmarks, or any other feature of a user profile or <%=Platform::Config.site_title %> communication channel in which or through which an application can provide, display, or deliver content directed at, on behalf of, or by permission of a user.
|
115
115
|
By “basic account information” we mean: name, email, gender, birthday, current city, and profile picture URL.
|
116
|
-
By "
|
117
|
-
By "User data you receive from
|
116
|
+
By "<%=Platform::Config.site_title %> Platform Terms and Policies" we mean the Statement of Rights and Responsibilities and the Platform Policies.
|
117
|
+
By "User data you receive from <%=Platform::Config.site_title %>" we mean any data or content (including any images, text, or other information or materials) you receive from us, that was provided by users to us, or was associated by us with a particular user.
|
118
118
|
|
119
119
|
VIII. Branding and Promotion Policy
|
120
120
|
|
121
|
-
You must follow the guidelines set forth in the
|
121
|
+
You must follow the guidelines set forth in the <%=Platform::Config.site_title %> Brand Resource and Permissions Center.
|
122
122
|
|
123
123
|
IX. Advertising Guidelines
|
124
124
|
|
125
|
-
X.
|
125
|
+
X. <%=Platform::Config.site_title %> Credits
|
126
126
|
|
127
127
|
Developers participating in the program for accepting credits are subject to these terms.
|
128
128
|
</pre>
|
@@ -1,9 +1,7 @@
|
|
1
|
-
<%=
|
2
|
-
<%= stylesheet_link_tag "platform/oauth" %>
|
3
|
-
<%= javascript_include_tag "platform/platform" %>
|
1
|
+
<%= render :partial => "/platform/common/header" %>
|
4
2
|
|
5
3
|
<center>
|
6
|
-
<div style="width:700px; border:1px dotted #ccc; margin-bottom:30px; background-color:white; border-radius:10px">
|
4
|
+
<div style="width:700px; border:1px dotted #ccc; margin-bottom:30px; background-color:white; border-radius:10px; font-size:12px; font-family:Arial;margin-top:15px">
|
7
5
|
<div style="background:url('/assets/platform/oauth/perm_tile.gif'); height:15px;"> </div>
|
8
6
|
|
9
7
|
<div style="margin:20px; text-align:left;">
|
@@ -27,7 +25,7 @@
|
|
27
25
|
<td>
|
28
26
|
<div style="font-weight:bold;"><%=tr("Access to my profile information")%></div>
|
29
27
|
<div style="margin-top:10px; color:#666; padding-right:15px; ">
|
30
|
-
<%=tr("Includes name, profile picture, gender,
|
28
|
+
<%=tr("Includes name, profile picture, gender, photos and any information available on my profile or through my user account.")%>
|
31
29
|
</div>
|
32
30
|
</td>
|
33
31
|
</tr>
|
@@ -54,13 +52,13 @@
|
|
54
52
|
</div>
|
55
53
|
|
56
54
|
<div style="margin-top:10px; color: #888;">
|
57
|
-
<%=tr("By proceeding, you agree to the {application} [link1: Terms of Service] and [link2: Privacy Policy].", "", :application => @client_application.name, :link1 =>
|
55
|
+
<%=tr("By proceeding, you agree to the {application} [link1: Terms of Service] and [link2: Privacy Policy].", "", :application => @client_application.name, :link1 => {:href => @client_application.terms_of_service_url, :target => "_top"}, :link2 => {:href=>@client_application.privacy_policy_url, :target => "_top"})%>
|
58
56
|
</div>
|
59
57
|
</div>
|
60
58
|
|
61
59
|
<div style="background:#eee; text-align:right; padding:10px; vertical-align:middle; ">
|
62
60
|
<div style="float:left; padding-top:10px;">
|
63
|
-
<%=link_to(tr("Not {user}?", "", :user => Platform::Config.user_name), Platform::Config.logout_url(:display => params[:display], :client_id => @client_application.id))%>
|
61
|
+
<%=link_to(tr("Not {user}?", "", :user => Platform::Config.user_name), Platform::Config.logout_url(:display => params[:display], :client_id => @client_application.id), :target => "_top")%>
|
64
62
|
</div>
|
65
63
|
<button class="platform_btn platform_submit_btn" onClick="Platform.element('authorize').value = 1; Platform.element('auth_form').submit()">
|
66
64
|
<span><%=tr("Allow")%></span>
|
@@ -73,3 +71,4 @@
|
|
73
71
|
</center>
|
74
72
|
|
75
73
|
<%= render :partial => "authorize_form" %>
|
74
|
+
<%= render :partial => "/platform/common/footer" %>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<div class="media profile_thumb">
|
17
17
|
<%=image_tag(Platform::Config.user_mugshot, :class => "img")%>
|
18
18
|
<span class="soft">
|
19
|
-
<%=tr("Your name, profile picture, gender
|
19
|
+
<%=tr("Your name, profile picture, gender and any other information available through my user account.")%>
|
20
20
|
</span>
|
21
21
|
</div>
|
22
22
|
|
@@ -1,76 +1 @@
|
|
1
|
-
<%= render :partial => "
|
2
|
-
<body>
|
3
|
-
<div class="page_hd hd pvm phl">
|
4
|
-
<%= link_to(tr('Not {user}?', 'Client application action label', :user => [own_profile, :name]), '/logout?display=popup', :class => "flt_r small mvs") %>
|
5
|
-
<div href="/" class="i logo"></div>
|
6
|
-
</div>
|
7
|
-
<div class="page_bd bd">
|
8
|
-
|
9
|
-
<div class="mhm mvl">
|
10
|
-
|
11
|
-
<div class="module mbl">
|
12
|
-
<h3 class="mbs"><%=trl("[bold: {application}] would like permission to access your Geni account.","", :application => @client_application.name)%></h3>
|
13
|
-
<p class="quiet">
|
14
|
-
<%= trl("Only allow access if you trust this application with your Geni Information.") %>
|
15
|
-
</p>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div class="module pal mbl">
|
19
|
-
<div class="line">
|
20
|
-
<div class="unit size_3of5">
|
21
|
-
<div class="media mrl">
|
22
|
-
<%=image_tag(Platform::Config.user_mugshot(Platform::Config.current_user), :class => "img")%>
|
23
|
-
<div class="bd">
|
24
|
-
<h4><%= trl("This application will have access to:") %></h4>
|
25
|
-
<p class="quiet mbl">
|
26
|
-
<%=trl("Your name, profile picture, gender, family, photos and any other information available through my user account.")%>
|
27
|
-
</p>
|
28
|
-
<div>
|
29
|
-
<button class="blue super large button" onClick="$('authorize').value = 1; $('auth_form').submit()">
|
30
|
-
<%=trl('Authorize', 'Client application action label')%>
|
31
|
-
</button>
|
32
|
-
<button class="white super large button" onClick="$('authorize').value = 0; $('auth_form').submit()"">
|
33
|
-
<%=trl("Cancel", 'Client application action label')%>
|
34
|
-
</button>
|
35
|
-
</div>
|
36
|
-
</div>
|
37
|
-
</div>
|
38
|
-
</div>
|
39
|
-
<div class="unit size_2of5 last_unit">
|
40
|
-
<div class="mll pll" style="border-left:solid 1px #ddd">
|
41
|
-
<div class="mbm">
|
42
|
-
<%= image_tag(@client_application.logo_url) %>
|
43
|
-
</div>
|
44
|
-
<div class="mbs">
|
45
|
-
<%= link_to(h(@client_application.name), {:action => :view, :id => @client_application.id}, :target => "_blank") %><br>
|
46
|
-
</div>
|
47
|
-
<div>
|
48
|
-
<%= platform_app_rank_tag(@client_application, 95) %>
|
49
|
-
</div>
|
50
|
-
</div>
|
51
|
-
</div>
|
52
|
-
</div>
|
53
|
-
</div>
|
54
|
-
|
55
|
-
<div class="module small quiet prose">
|
56
|
-
<%=tr("By proceeding, you agree to the {application} [link1: Terms of Service] and [link2: Privacy Policy].", "", :application => @client_application.name, :link1 => [@client_application.terms_of_service_url], :link2 => [@client_application.privacy_policy_url])%>
|
57
|
-
</div>
|
58
|
-
|
59
|
-
</div>
|
60
|
-
|
61
|
-
</div>
|
62
|
-
<%= render :partial => "authorize_form" %>
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
<script>
|
67
|
-
function $(element_id) {
|
68
|
-
if (typeof element_id == 'string') return document.getElementById(element_id);
|
69
|
-
return element_id;
|
70
|
-
}
|
71
|
-
|
72
|
-
</script>
|
73
|
-
|
74
|
-
</div>
|
75
|
-
</body>
|
76
|
-
</html>
|
1
|
+
<%= render :partial => "authorization_popup" %>
|
data/config/routes.rb
CHANGED
@@ -29,6 +29,8 @@ Platform::Engine.routes.draw do
|
|
29
29
|
match "apps/paginate_module", :to => "apps#paginate_module"
|
30
30
|
match "apps/featured_applications_module_content", :to => "apps#featured_applications_module_content"
|
31
31
|
match "apps/xd", :to => "apps#xd"
|
32
|
+
match "apps/settings", :to => "apps#settings"
|
33
|
+
match "apps/remove", :to => "apps#remove"
|
32
34
|
match "apps(/:canvas_name)", :to => "apps#run"
|
33
35
|
|
34
36
|
[:forum, :oauth, :ratings].each do |ctrl|
|
@@ -39,10 +41,6 @@ Platform::Engine.routes.draw do
|
|
39
41
|
match "admin/#{ctrl}(/:action)", :controller => "admin/#{ctrl}"
|
40
42
|
end
|
41
43
|
|
42
|
-
[:apps].each do |ctrl|
|
43
|
-
match "api/#{ctrl}(/:action)", :controller => "api/#{ctrl}"
|
44
|
-
end
|
45
|
-
|
46
44
|
[:api_explorer, :apps, :blog, :dashboard, :forum, :help, :info, :registration, :resources].each do |ctrl|
|
47
45
|
match "developer/#{ctrl}(/:action)", :controller => "developer/#{ctrl}"
|
48
46
|
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2010-2011 Michael Berkovich
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# "Software"), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module Platform
|
25
|
+
module Generators
|
26
|
+
class ProxyGenerator < Rails::Generators::NamedBase
|
27
|
+
source_root File.expand_path("../templates", __FILE__)
|
28
|
+
class_option :version, :type => :string, :aliases => '-v', :desc => 'Version of the proxy to be generated.'
|
29
|
+
class_option :attributes, :type => :string, :aliases => '-a', :desc => 'List of attributes to be generated.'
|
30
|
+
class_option :class, :type => :string, :aliases => '-c', :desc => 'Name of the class for which the proxy is created. If left blank the template name will be used.'
|
31
|
+
|
32
|
+
desc "Creates an API proxy file for your model"
|
33
|
+
def create_proxy_file
|
34
|
+
create_file "#{Platform::Config.api_proxies_path}/#{file_name}_proxy_#{version}.rb", %Q{
|
35
|
+
module Api
|
36
|
+
module Proxy
|
37
|
+
class #{class_name}Proxy_#{version} < Platform::Api::Proxy::Base
|
38
|
+
proxy_for(#{proxy_class})
|
39
|
+
|
40
|
+
def to_api_hash(options={})
|
41
|
+
{#{attributes}}
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def version
|
53
|
+
options[:version] || '0'
|
54
|
+
end
|
55
|
+
|
56
|
+
def proxy_class_provided?
|
57
|
+
return false if options[:class].blank?
|
58
|
+
options[:class] != "class"
|
59
|
+
end
|
60
|
+
|
61
|
+
def proxy_class
|
62
|
+
return class_name unless proxy_class_provided?
|
63
|
+
options[:class]
|
64
|
+
end
|
65
|
+
|
66
|
+
def attributes
|
67
|
+
if proxy_class_provided?
|
68
|
+
klass = proxy_class.constantize
|
69
|
+
return klass.attribute_names.collect{|attr| ":#{attr} => instance.#{attr}"}.join(", ")
|
70
|
+
end
|
71
|
+
|
72
|
+
return ":id => instance.id" if options[:attributes].blank? or options[:attributes] == "attributes"
|
73
|
+
options[:attributes].split(",").collect{|attr| ":#{attr.strip} => instance.#{attr.strip}"}.join(", ")
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
platform:
|
2
|
+
type: "api"
|
3
|
+
path: "platform"
|
4
|
+
sample: "http://localhost:3000/api/platform"
|
5
|
+
description: "Returns status of the platform."
|
6
|
+
|
7
|
+
fields:
|
8
|
+
status:
|
9
|
+
description: "The platform status"
|
10
|
+
type: "String"
|
11
|
+
|
12
|
+
actions:
|
13
|
+
apps:
|
14
|
+
path: "platform/apps"
|
15
|
+
method: GET
|
16
|
+
description: "Returns list of all registered applications."
|
17
|
+
sample: "http://localhost:3000/api/platform/apps"
|
18
|
+
params:
|
19
|
+
limit:
|
20
|
+
description: "How many applications to display per page"
|
21
|
+
type: "Number"
|
22
|
+
required: false
|
23
|
+
page:
|
24
|
+
description: "Which page to display"
|
25
|
+
type: "Number"
|
26
|
+
required: false
|
27
|
+
fields:
|
28
|
+
results:
|
29
|
+
description: "List of platform applications"
|
30
|
+
type: "Array"
|
31
|
+
array_type: "PlatformApplication"
|
32
|
+
page:
|
33
|
+
description: "Current page"
|
34
|
+
type: "Number"
|
35
|
+
next_page:
|
36
|
+
description: "Url for the next page"
|
37
|
+
type: "String"
|
38
|
+
previous_page:
|
39
|
+
description: "Url for the previous page"
|
40
|
+
type: "String"
|
41
|
+
|
42
|
+
services:
|
43
|
+
path: "platform/services"
|
44
|
+
method: GET
|
45
|
+
description: "Returns a list of all available APIs on this platform."
|
46
|
+
sample: "http://localhost:3000/api/platform/services"
|
47
|
+
params:
|
48
|
+
version:
|
49
|
+
description: "Version of the API services."
|
50
|
+
type: "String"
|
51
|
+
required: false
|
52
|
+
fields:
|
53
|
+
results:
|
54
|
+
description: "Hash representation of available platform API services."
|
55
|
+
type: "Hash"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
platform_application:
|
2
|
+
type: "struct"
|
3
|
+
title: "Platform Application"
|
4
|
+
path: "platform/application"
|
5
|
+
description: "Returns information about an application."
|
6
|
+
|
7
|
+
fields:
|
8
|
+
name:
|
9
|
+
description: "The application's name"
|
10
|
+
type: "String"
|
11
|
+
description:
|
12
|
+
description: "The application's description"
|
13
|
+
type: "String"
|
14
|
+
url:
|
15
|
+
description: "The application's url"
|
16
|
+
type: "String"
|
17
|
+
icon_url:
|
18
|
+
description: "The application's icon url"
|
19
|
+
type: "String"
|
20
|
+
logo_url:
|
21
|
+
description: "The application's logo url"
|
22
|
+
type: "String"
|
23
|
+
locale:
|
24
|
+
description: "The application's locale"
|
25
|
+
type: "String"
|
26
|
+
privacy_policy_url:
|
27
|
+
description: "The application's privacy policy"
|
28
|
+
type: "String"
|
29
|
+
terms_of_service_url:
|
30
|
+
description: "The application's terms of service"
|
31
|
+
type: "String"
|
32
|
+
created_at:
|
33
|
+
description: "The application's creation timestamp"
|
34
|
+
type: "Number"
|
35
|
+
developer:
|
36
|
+
description: "The application's developer"
|
37
|
+
type: "PlatformDeveloper"
|