Skip to content

Commit

Permalink
[frontend] add code.count.ly to app management view
Browse files Browse the repository at this point in the history
  • Loading branch information
ar2rsawseen committed Apr 28, 2016
1 parent 61b69b6 commit 5eacd03
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 3 deletions.
3 changes: 2 additions & 1 deletion frontend/express/app.js
Expand Up @@ -42,7 +42,8 @@ plugins.setConfigs("frontend", {
production: true,
theme: "",
session_timeout: 30*60*1000,
use_google: true
use_google: true,
code: "http://code.count.ly/"
});

var countlyDb = plugins.dbConnection(countlyConfig);
Expand Down
43 changes: 43 additions & 0 deletions frontend/express/public/images/dashboard/apps-sdk-icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions frontend/express/public/javascripts/countly/countly.template.js
Expand Up @@ -2486,6 +2486,26 @@ window.ManageAppsView = countlyView.extend({
}
});
});

if(countlyGlobal["config"] && countlyGlobal["config"].code && countlyGlobal["config"].code != "" && $("#code-countly").length){
$("#code-countly").show();
var url = countlyGlobal["config"].code;
if(url.indexOf("://") === -1)
url = "http://"+url;
if(url.indexOf("/", url.length-1) === -1)
url = url+"/";

$.getScript( url+"js/sdks.js", function( data, textStatus, jqxhr ) {
var server = (location.protocol || "http:")+location.hostname;
var app_id = $("#app-edit-id").val();
if(sdks && app_id && app_id != "" && countlyGlobal["apps"][app_id] && server){
for(var i in sdks){
if(sdks[i].integration)
$("#code-countly .sdks").append("<a href='"+url+"integration-"+i+".html?server="+server+"&app_key="+countlyGlobal["apps"][app_id].key+"' target='_blank'>"+sdks[i].name+"</a>");
}
}
});
}
}
});

Expand Down
Expand Up @@ -86,6 +86,9 @@ common.save-to-excel = Save for Excel
common.search = Search
common.unknown = Unknown
common.eu = European Union
common.integrate-sdks = Need some help with SDK integration?
common.integrate-sdks-text = Countly Code Generator helps you generate personalized code snippets and SDK integration tutorials based on your platforms and Countly features you want to use.
common.integrate-sdks-platforms = Select a platform to get started

#placeholders
placeholder.old-password = Old password...
Expand Down
9 changes: 9 additions & 0 deletions frontend/express/public/stylesheets/main.css
Expand Up @@ -386,6 +386,15 @@ a:active { color:inherit; }
#add-new-app .hint,
.app-details .hint { margin-top: 5px; font-size:11px; color:#B7B6B6; clear: both; }

#code-countly {background-color: #fff; border-radius: 4px; border: 1px solid #C2C2C2; padding: 30px;}
#code-countly h3 {font-size: 16px; color: #636363; margin-top: 0px;}
#code-countly p {font-size: 15px; color: #AFAFAF;}
#code-countly p.select-platforms {font-size: 12px; text-transform:uppercase; color: #D4D4D4;}
#code-countly .sdks {overflow: auto;}
#code-countly .sdks a{color:#779740; float: left; text-decoration: none; font-size: 14px; margin-right: 20px;}
#code-countly-content {margin-left: 135px;}
#code-countly-logo {background-image: url('../images/dashboard/apps-sdk-icon.svg'); float: left; width: 100px; height:100px; background-repeat: no-repeat; background-position: 50% 0%;}

/* TABLES */
table.d-table { width:100%; padding:0; margin:0; border-radius:7px; border:1px solid #C2C2C2; border-top-color:#959595; margin-bottom:20px; }
table.d-table:not(.no-fix) { table-layout:fixed; }
Expand Down
10 changes: 8 additions & 2 deletions frontend/express/views/dashboard.html
Expand Up @@ -848,8 +848,14 @@
</tbody>
</table>
</div>
<div style="float:right;">
<a target="blank" href="http://count.ly/resources/source/download-sdk" style="margin-right:14px;" class="icon-button light"><i class="fa fa-mobile-phone"></i> Countly SDKs</a>
<div id="code-countly" style="display: none;">
<div id="code-countly-logo"></div>
<div id="code-countly-content">
<h3 data-localize="common.integrate-sdks"></h3>
<p data-localize="common.integrate-sdks-text"></p>
<p class="select-platforms" data-localize="common.integrate-sdks-platforms"></p>
<div class="sdks"></div>
</div>
</div>
</div>
</div>
Expand Down

0 comments on commit 5eacd03

Please sign in to comment.