Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tutorials.html #2

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion handlebars/bin/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ function program12(depth0,data) {

return " class=\"active\"";}

buffer += "<header>\n <div id=\"nav\" class=\"navbar navbar-fixed-top\">\n <div class=\"navbar-inner\">\n <div class=\"container\">\n <a class=\"brand\" href=\"/index.html\">LTI of Magic</a>\n <div class=\"nav-collapse\">\n <ul class=\"nav\">\n <li";
buffer += "<header>\n <div id=\"nav\" class=\"navbar navbar-fixed-top\">\n <div class=\"navbar-inner\">\n <div class=\"container\">\n <a class=\"brand\" href=\"/index.html\">Edu Apps</a>\n <div class=\"nav-collapse\">\n <ul class=\"nav\">\n <li";
foundHelper = helpers.index;
stack1 = foundHelper || depth0.index;
stack2 = helpers['if'];
Expand Down
2 changes: 1 addition & 1 deletion handlebars/header.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div id="nav" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/index.html">LTI of Magic</a>
<a class="brand" href="/index.html">Edu Apps</a>
<div class="nav-collapse">
<ul class="nav">
<li{{#if index}} class="active"{{/if}}><a href="/index.html">Home</a></li>
Expand Down
29 changes: 10 additions & 19 deletions lib/apps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ def self.registered(app)
json_result(result.to_json)
end

app.post "/api/v1/filter" do
halt 400, {:error => "Not logged in"}.to_json unless session['user_key']
@filter = AppFilter.first_or_new(:username => "@#{session['user_key']}")
@filter.update_settings(params)
json_result(@filter.to_json)
end

# review an app
app.post "/api/v1/apps/:tool_id/reviews" do
host = request.scheme + "://" + request.host_with_port
Expand Down Expand Up @@ -94,23 +101,6 @@ def self.registered(app)
json_result(json.to_json)
end

# deprecated
app.get "/data/lti_examples.jsonp" do
json = App.load_apps.to_json
return "#{params['callback'] || 'callback'}(#{json})"
end

# deprecated
app.get "/data/lti_apps.json" do
return apps_list(request, false).to_json
end

# deprecated
app.get "/data/lti_apps.jsonp" do
return "#{params['callback'] || 'callback'}(#{apps_list(request, false).to_json})"
end


app.get "/data/app_reviews.atom" do
reviews = AppReview.all(:created_at.gt => (Date.today - 60), :order => :id.desc)
host = request.scheme + "://" + request.host_with_port
Expand Down Expand Up @@ -199,8 +189,9 @@ def apps_list(request, paginated=true)
limit = 24
params = request.params
offset = params['offset'].to_i
filter = AppFilter.first(:code => params['filter'])

data = App.load_apps.sort_by{|a| [(0 - (a['uses'] || 0)), a['name'].downcase || 'zzz'] }
data = App.load_apps(filter).sort_by{|a| [(0 - (a['uses'] || 0)), a['name'].downcase || 'zzz'] }
[['category', 'categories'], ['level', 'levels'], ['extension', 'extensions']].each do |filter, key|
if params[filter] && params[filter].length > 0
if params[filter] == 'all'
Expand Down Expand Up @@ -251,7 +242,7 @@ def apps_list(request, paginated=true)
if paginated
next_url = data.length > offset + limit ? (host + "/api/v1/apps?offset=#{offset + limit}") : nil
if next_url
['no_meta', 'category', 'level', 'extension', 'recent', 'public', 'platform', 'pending'].each do |key|
['filter', 'no_meta', 'category', 'level', 'extension', 'recent', 'public', 'platform', 'pending'].each do |key|
next_url += "&#{key}=#{CGI.escape(params[key])}" if params[key]
end
response.headers['Link'] = "<#{next_url}>; rel=\"next\""
Expand Down
5 changes: 5 additions & 0 deletions lib/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ def self.registered(app)
end
end

app.get "/index.html" do
@sheets = ['loading', 'index']
erb :index
end

app.get "/twitter.html" do
redirect to("/tools/twitter/index.html")
end
Expand Down
42 changes: 39 additions & 3 deletions lib/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,38 @@ class LaunchRedirect
property :launches, Integer
end

class AppFilter
include DataMapper::Resource
property :id, Serial
property :username, String
property :code, String, :length => 1024
property :settings, Json

def update_settings(params)
self.settings = {}
self.code ||= Digest::MD5.hexdigest(self.username + Time.now.to_i.to_s + rand(9999).to_s)
self.settings['app_ids'] = {}
self.settings['allow_new'] = params['allow_new'] == true || params['allow_new'] == '1'
App.load_apps.each do |app|
self.settings['app_ids'][app['id']] = false
end
(params['app_ids'] || []).each do |id|
self.settings['app_ids'][id] = true
end
self.save
end

def as_json
res = self.settings || {}
res['code'] = self.code
res
end

def to_json
as_json.to_json
end
end

class App
include DataMapper::Resource
property :id, Serial
Expand Down Expand Up @@ -156,9 +188,13 @@ def update_counts
self.save
end

def self.load_apps
# json_apps = JSON.parse(File.read('./public/data/lti_examples.json')).select{|a| !a['pending'] }
data_apps = App.all(:pending => false).select{|a| a.settings }.map{|a| a.settings }
def self.load_apps(filter=nil)
allow_new = true if !filter
lookups = ((filter && filter.settings) || {})['app_ids'] || {}
allow_new = (filter.settings['allow_new'] || false) if filter
data_apps = App.all(:pending => false).select{|a|
a.settings && lookups[a.settings['id']] != false && (allow_new || lookups[a.settings['id']] == true )
}.map{|a| a.settings }
end

def self.build_or_update(id, params, admin_permission, user_key=nil)
Expand Down
6 changes: 6 additions & 0 deletions public/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,9 @@ span.stars.star4_5 img.star5 {
.filters select {
margin-right: 20px;
}
label.app {
opacity: 0.5;
}
label.app.selected {
opacity: 1.0;
}
2 changes: 1 addition & 1 deletion public/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ function program12(depth0,data) {

return " class=\"active\"";}

buffer += "<header>\n <div id=\"nav\" class=\"navbar navbar-fixed-top\">\n <div class=\"navbar-inner\">\n <div class=\"container\">\n <a class=\"brand\" href=\"/index.html\">LTI of Magic</a>\n <div class=\"nav-collapse\">\n <ul class=\"nav\">\n <li";
buffer += "<header>\n <div id=\"nav\" class=\"navbar navbar-fixed-top\">\n <div class=\"navbar-inner\">\n <div class=\"container\">\n <a class=\"brand\" href=\"/index.html\">Edu Apps</a>\n <div class=\"nav-collapse\">\n <ul class=\"nav\">\n <li";
foundHelper = helpers.index;
stack1 = foundHelper || depth0.index;
stack2 = helpers['if'];
Expand Down
22 changes: 22 additions & 0 deletions public/filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$("#filter_settings").submit(function(event) {
event.preventDefault();
var array = $(event.target).serializeArray();
console.log(array);
$.ajax({
url: $(event.target).attr('action'),
type: "POST",
data: array,
dataType: 'json',
success: function(data) {
location.reload();
},
error: function() {
alert("Error!");
}
});
});
$(":checkbox").change(function() {
$(this).closest(".app").toggleClass('selected', !!$(this).attr('checked'));
}).each(function() {
$(this).change();
});
86 changes: 86 additions & 0 deletions public/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
.app .icon {
text-align: center;
}
.app .icon .logo {
width: 72px;
height: 72px;
}
.app .icon .banner {
width: 240px;
height: 125px;
}
.app h3 {
text-align: center;
}
.app h3 a {
color: #000;
}
.app {
margin-bottom: 5px;
}
.app .config.alert {
margin-bottom: 5px;
}
.app .header {
padding: 5px;
}
.app:hover .header {
background-color: #E5E5E5;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
.app.single_app:hover .header {
background: transparent;
}
.app .description {
height: 110px;
overflow: hidden;
}
.app.single_app .description {
height: auto;
}
.app .extensions {
margin-top: 5px;
line-height: 20px;
}
.app .config {
margin-top: 2px;
visibility: hidden;
}
.app:hover .config {
visibility: visible;
}
.app .author {
color: #888;
text-align: center;
font-size: 12px;
}
.data-row {
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid #E5E5E5;
}
.config_field {
height: auto;
width: 300px;
}
.filters.well {
margin-top: -15px;
padding-top: 5px;
padding-bottom: 5px;

}
#preview {
vertical-align: top;
}
#config_options td {
padding: 0 5px;
text-align: center;
}
.ratings_on_hover {
opacity: 0.5;
}
.app:hover .ratings_on_hover {
opacity: 1.0;
}
3 changes: 3 additions & 0 deletions public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@
} else {
var tools = [];
var url = '/api/v1/apps';
if(params.filter) {
url = url + "?filter=" + params.filter;
}
function moreTools() {
if(url) {
$.getJSON(url, function(data) {
Expand Down
4 changes: 2 additions & 2 deletions public/index.html → public/old_index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<head>
<meta charset="utf-8">
<title>LTI Apps</title>
<title>Edu Apps</title>
<link href="/data/lti_apps.atom" type="application/atom+xml" rel="alternate" title="App Feed" />
<link href="/data/app_reviews.atom" type="application/atom+xml" rel="alternate" title="App Reviews Feed" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand Down Expand Up @@ -122,7 +122,7 @@
<div id="fb-root"></div>
<div class="container" id="content">
<div class="hero-unit" style="padding-bottom: 30px;">
<h1>LTI Apps</h1>
<h1>Edu Apps</h1>
<div id="hero-content">
<p>
Awesome stuff happens with <a href="http://www.imsglobal.org/lti/">LTI<span style="font-size: 12px; line-height: 20px; vertical-align: top;">&trade;</span></a>. You know this is true. Here's a collection of LTI apps you can use in your classes today.
Expand Down
37 changes: 4 additions & 33 deletions public/talk.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,42 +50,13 @@ <h1>LTI Talk</h1>
</p>
</div>
<div class="row">
<span class="span12">
<div style='margin-bottom: 5px;'>
<a href="https://twitter.com/intent/tweet?button_hashtag=lti_apps&text=" class="twitter-hashtag-button" data-lang="en" data-size="large" data-related="whitmer">Tweet #lti_apps</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<span class="span6 offset3">
<div>
<a class="twitter-timeline" href="https://twitter.com/search?q=%23lti_apps" data-widget-id="321746801289994240">Tweets about "#lti_apps"</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>

<script charset="utf-8" src="https://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({
version: 2,
type: 'search',
search: '#lti_apps',
interval: 30000,
title: 'LTI Apps Talk',
subject: 'Of Awesomeness and Quality',
width: 'auto',
height: 300,
theme: {
shell: {
background: '#7d7d7d',
color: '#ffffff'
},
tweets: {
background: '#ffffff',
color: '#444444',
links: '#1985b5'
}
},
features: {
scrollbar: true,
loop: false,
live: true,
behavior: 'all'
}
}).render().start();
</script>
</span>
</div>
</div>
Expand Down
Binary file added public/tools/badge_stack/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/badge_stack/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/book_shelf/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/book_shelf/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/echo_center/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/echo_center/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/evaluation_kit/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/evaluation_kit/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/harvard_pub/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/harvard_pub/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/learning_com/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/learning_com/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/media_core/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/media_core/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/mediasite/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/odyssey/.DS_Store
Binary file not shown.
Binary file added public/tools/odyssey/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/odyssey/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/pathbrite/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/pebble_pad/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/smart_thinking/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/smart_thinking/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/sword/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/sword/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/taskstream/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/taskstream/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tools/toolwire/banner.png
Binary file added public/tools/toolwire/logo.png
Binary file added public/tools/ucertify/banner.png
Binary file added public/tools/ucertify/logo.png
Binary file added public/tools/web_assign/banner.png
Binary file added public/tools/web_assign/logo.png
2 changes: 1 addition & 1 deletion public/tutorials.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h2>Configuring Apps in Canvas</h2>
link configuration (copy the URL from one of the links below).
</p>
<p>After the app is saved you should see it appear as configured in the
course our account content. Depending on the integration type, the app
course or account content. Depending on the integration type, the app
may appear different places, but most apps will appear under
"External Tools" when adding items to a module.</p>
</span>
Expand Down
Loading