[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [ocs-webserver/dev] /: no message
From: david nelband <null () kde ! org>
Date: 2018-09-20 10:18:54
Message-ID: E1g2w2w-0002CS-OS () code ! kde ! org
[Download RAW message or body]
Git commit 21f34861e8b3db1142030018a9921d7581aeb98b by david nelband.
Committed on 20/09/2018 at 10:18.
Pushed by dnelband into branch 'dev'.
no message
M +122 -122 application/modules/default/views/scripts/product/index.phtml
A +110 -0 httpdocs/theme/react/app-getit/__app-helpers.js
A +156 -0 httpdocs/theme/react/app-getit/__product-helpers.js
A +158 -0 httpdocs/theme/react/app-getit/app.js
A +548 -0 httpdocs/theme/react/getit.js
https://commits.kde.org/ocs-webserver/21f34861e8b3db1142030018a9921d7581aeb98b
diff --git a/application/modules/default/views/scripts/product/index.phtml \
b/application/modules/default/views/scripts/product/index.phtml index \
86fa492d..4264a7f2 100644
--- a/application/modules/default/views/scripts/product/index.phtml
+++ b/application/modules/default/views/scripts/product/index.phtml
@@ -72,13 +72,13 @@ $this->updates = \
$tableProjectUpdates->fetchProjectUpdates($this->product->proje $tableProjectRatings \
= new Default_Model_DbTable_ProjectRating(); $this->ratings = \
$tableProjectRatings->fetchRating($this->product->project_id); $cntRatingsActive = \
0;
- foreach ($this->ratings as $p) {
+ foreach ($this->ratings as $p) {
if($p['rating_active']==1) $cntRatingsActive =$cntRatingsActive+1;
}
if (Zend_Auth::getInstance()->hasIdentity()){
- $this->ratingOfUser = \
$tableProjectRatings->getProjectRateForUser($this->product->project_id,$identity->member_id); \
-}
+ $this->ratingOfUser = \
$tableProjectRatings->getProjectRateForUser($this->product->project_id,$identity->member_id);
+}
$tableProjectFollower = new Default_Model_DbTable_ProjectFollower();
$this->likes = $tableProjectFollower->fetchLikesForProject($this->product->project_id);
@@ -95,8 +95,8 @@ $userRoleName = $helperUserRole->userRole();
<!-- facebook -->
<div id="fb-root"></div>
- <?php if (Zend_Auth::getInstance()->hasIdentity()) {
- ?>
+ <?php if (Zend_Auth::getInstance()->hasIdentity()) {
+ ?>
<div id="report-product-<?= $this->product->project_id ?>" class="modal \
report-product" tabindex="-1" role="dialog"> <div class="modal-dialog modal-sm">
<div class="modal-content">
@@ -132,8 +132,8 @@ $userRoleName = $helperUserRole->userRole();
data-target="#report-product-fraud-<?= \
$this->product->project_id ?>-message" >
<input type="hidden" name="p" value="<?= \
$this->product->project_id ?>">
<div id="report-product-fraud-<?= $this->product->project_id \
?>-message" class="message" style="padding: 20px">
- <div>Please specify why this product is misused (min 5 \
chars):
- <textarea class="" id="report-text" name="t" cols="50" \
rows="3"></textarea> + \
<div>Please specify why this product is misused (min 5 chars): + \
<textarea class="" id="report-text" name="t" cols="50" rows="3"></textarea> </div>
<div class="modal-footer">
<button type="submit" class="small">
@@ -159,7 +159,7 @@ $userRoleName = $helperUserRole->userRole();
data-target="#report-product-clone-<?= \
$this->product->project_id ?>-message">
<input type="hidden" name="p" value="<?= \
$this->product->project_id ?>">
<div id="report-product-clone-<?= $this->product->project_id \
?>-message" class="message" style="padding: 20px">
- <div>
+ <div>
<label class="form-label">Original product ID on \
opendesktop: </label><br/>
<input name="pc" \
onkeyup="this.value=this.value.replace(/[^\d]/,'')"/><br/><br/>
<label class="form-label">External link to original \
product: </label><br/> @@ -167,7 +167,7 @@ $userRoleName = \
$helperUserRole->userRole(); <br/><br/>
<label class="form-label">Additional message: </label>
<br/>
- <textarea class="" id="report-text" name="t" rows="3" \
style="width: 440px;"></textarea> \
+ <textarea class="" id="report-text" name="t" rows="3" \
style="width: 440px;"></textarea> </div>
<div class="modal-footer">
<button type="submit" class="small">
@@ -179,14 +179,14 @@ $userRoleName = $helperUserRole->userRole();
</div>
</div>
</div>
-
+
<?php } ?>
-
- <?php if (Zend_Auth::getInstance()->hasIdentity()) {
- ?>
+
+ <?php if (Zend_Auth::getInstance()->hasIdentity()) {
+ ?>
<div id="like-product-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content" style="padding-bottom: 20px">
@@ -205,20 +205,20 @@ $userRoleName = $helperUserRole->userRole();
</div>
</div>
</div>
-
- <?php
+
+ <?php
} else { ?>
-
+
<div id="like-product-modal" class="modal fade noid" tabindex="-1" \
role="dialog"> <div class="modal-dialog modal-sm" role="document">
<div class="modal-content" style="min-height: 100px; ">
<span style="text-align: center; display: block; padding-top: \
30px">Please login. <br/><a href="<?=$loginUrl?>">Login</a></span> </div>
- </div>
+ </div>
</div>
-
+
<?php } ?>
-
+
<?php if (Zend_Auth::getInstance()->hasIdentity()) { ?>
<div id="review-product-modal" class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm" role="document">
@@ -235,7 +235,7 @@ $userRoleName = $helperUserRole->userRole();
<input type="hidden" name="v" value="1" id="voteup"/>
<input type="hidden" name="pm" \
value="<?=$this->product->member_id?>" id="productcreator"/>
<input type="hidden" name="otxt" \
value="<?=$this->ratingOfUser!=null?$this->ratingOfUser['comment_text']:''?>" \
id="otxt"/>
- <input type="hidden" name="userrate" \
value="<?=$this->ratingOfUser==null?-1:$this->ratingOfUser['user_like']?>" \
id="userrate"/> + <input \
type="hidden" name="userrate" \
value="<?=$this->ratingOfUser==null?-1:$this->ratingOfUser['user_like']?>" \
id="userrate"/> <textarea name="msg" class="full-width" \
id="commenttext"><?=$this->ratingOfUser!=null?$this->ratingOfUser['comment_text']:''?></textarea>
<button type="submit" class="small pull-right">Rate \
Now</button> </form>
@@ -243,7 +243,7 @@ $userRoleName = $helperUserRole->userRole();
</div>
</div>
</div>
-
+
<?php } else {?>
<div id="review-product-modal" class="modal fade noid" tabindex="-1" \
role="dialog"> <div class="modal-dialog modal-sm" role="document">
@@ -254,23 +254,23 @@ $userRoleName = $helperUserRole->userRole();
<a href="<?=$loginUrl?>"> Login </a>
<?php /*
Only registered members with an active supporting can \
vote<br/>to limit spam and fraud voting.<br/>
- <a href="/support">Become a supporter</a>
- <br/><br/>You can still 'Like' a product, but that doesn't \
affect its score. + <a href="/support">Become a supporter</a>
+ <br/><br/>You can still 'Like' a product, but that doesn't \
affect its score.
*/
?>
</span>
</div>
- </div>
+ </div>
</div>
-
+
<?php } ?>
-
-
+
+
<main id="product-page-content">
<div class="flex-column">
<div class="flex-item-4 sidebar-left" style="">
- <?php echo $this->render('explore/partials/filter.phtml'); ?> \
+ <?php echo $this->render('explore/partials/filter.phtml'); ?>
</div>
<div class="flex-item-16 " id="product-main">
@@ -283,7 +283,7 @@ $userRoleName = $helperUserRole->userRole();
array('width' => 85, 'height' => 85, 'crop' => \
'crop')); ?>"/> </div>
<div style="margin-left: 95px">
-
+
<div>
<?php if (false === \
empty($this->product->link_1)): ?><a
href="<?php echo $this->product->link_1; ?>"
@@ -295,7 +295,7 @@ $userRoleName = $helperUserRole->userRole();
<?= $this->product->title; ?>
<?php endif; ?>
- <?php \
+ <?php
if($this->product->featured=='1'){
?>
<span class=" label label-info right" \
style="font-size: 13px;padding: .2em .6em .3em;"> Featured</span> @@ -303,29 +303,29 \
@@ $userRoleName = $helperUserRole->userRole();
<?php \
if($this->isProjectOriginal($this->product->project_id)){?>
<span class=" label label-info right" \
style="font-size: 13px;padding: .2em .6em .3em;"> Original</span>
- <?php }?>
-
+ <?php }?>
+
</div>
-
-
- <p class="product_category" \
style="margin-bottom: 5px"> +
+
+ <p class="product_category" \
style="margin-bottom: 5px"> <?php
echo '<a href="/browse/cat/' . \
$this->product->project_category_id . '/order/latest">' . $this->product->cat_title . \
' </a>';
- ?>
+ ?>
<?php
echo '<span class="topics">';
-
- $tagsuser = \
$tagmodel->getTagsUser($this->product->project_id, \
Default_Model_Tags::TAG_TYPE_PROJECT); \
+
+ $tagsuser = \
$tagmodel->getTagsUser($this->product->project_id, \
Default_Model_Tags::TAG_TYPE_PROJECT); echo '<span class="topicslink">';
if(false === empty($tagsuser))
- {
- foreach (explode(',',$tagsuser) as $tag) {
+ {
+ foreach (explode(',',$tagsuser) as $tag) {
?>
<a rel="nofollow" \
href="/search/projectSearchText/<?=$tag?>/f/tags" class="topic-tag topic-tag-link \
usertagslabel"><?=$tag?></a>
- <?php
- }
- }
+ <?php
+ }
+ }
echo '</span><!--end of topicslink-->';
if(Zend_Auth::getInstance()->hasIdentity() && \
$identity->member_id==$this->product->member_id){
\
$this->headLink()->appendStylesheet('/theme/flatui/css/select2.min.css'); @@ -333,10 \
+333,10 @@ $userRoleName = $helperUserRole->userRole();
\
$this->inlineScript()->appendFile('/theme/flatui/js/lib/select2.min.js'); ?>
<span class="tagsuserselectpanel" \
style="display: none">
- <select
- id="tagsuserselect" \
- name="tagsuser"
- multiple="true" \
+ <select
+ id="tagsuserselect"
+ name="tagsuser"
+ multiple="true"
class="taggingSelect2"
data-pid="<?php echo \
$this->product->project_id?>" >
@@ -345,9 +345,9 @@ $userRoleName = $helperUserRole->userRole();
$element_value =$tagsuser;
$value = empty($element_value) ? \
array() : explode(',',$element_value); foreach ($value as $v) {
- echo '<option value="'.$v.'" \
selected="selected">'.$v.'</option>'; + \
echo '<option value="'.$v.'" selected="selected">'.$v.'</option>'; }
- ?>
+ ?>
</select>
</span>
@@ -355,14 +355,14 @@ $userRoleName = $helperUserRole->userRole();
<span class="topic-tags-saved"><i class="fa \
fa-check"></i> Saved </span> <?php
$this->inlineScript()->appendScript(
- ' $(document).ready(function(){ \
- TagingProductDetail.setup(); \
+ ' $(document).ready(function(){
+ TagingProductDetail.setup();
});
');
}
- echo '</span>'; \
+ echo '</span>';
?>
-
+
<p class="light small">
<span class="source">Source (required if based \
on other people's work): </span>
<?php if (false === \
empty($this->product->source_url)): @@ -370,30 +370,30 @@ $userRoleName = \
$helperUserRole->userRole();
. ' <span class="fa \
fa-external-link"></span></a>'; endif;
?>
-
-
+
+
</div>
</div>
-
+
<div class="product-title-right" >
-
+
<div class="projectdtailHeart">
- <div \
id="container-follow<?=$this->product->project_id?>" \
class="container-pling">
- <?php
+ <div \
id="container-follow<?=$this->product->project_id?>" class="container-pling"> + \
<?php echo $this->partial(
\
'/product/partials/projectlike.phtml', array(
"authMember" => $identity,
"project_id" => \
$this->product->project_id )
- );
- ?>
- </div> \
+ );
+ ?>
+ </div>
</div>
-
-
-
+
+
+
<div class="projectdetailRating" style="clear: \
right">
<?php echo \
$this->render('partials/sidebarRating.phtml'); ?> </div>
@@ -409,13 +409,13 @@ $userRoleName = $helperUserRole->userRole();
if ((null != $this->product->embed_code) && \
trim($this->product->embed_code)!=''): ?>
<li data-target="#myCarousel" \
data-slide-to="<?php echo $cnt ?>" class="active"></li>
- <?php
+ <?php
$cnt = 2;
endif; ?>
<?php
$this->galleryPictures = \
$tableProject->getGalleryPictureSources($this->product->project_id);
- if (count($this->galleryPictures) > 0) { \
+ if (count($this->galleryPictures) > 0) {
foreach ($this->galleryPictures as \
$picture): ?>
<li data-target="#myCarousel" \
data-slide-to="<?php echo $cnt ?>"
class="<?php if \
(!$this->product->ppload_collection_id && $cnt == 1) { @@ -434,15 +434,15 @@ \
$userRoleName = $helperUserRole->userRole(); <?php // media embed code
$cnt = 1;
if ((null != $this->product->embed_code) && \
(trim($this->product->embed_code)!='')): ?>
- <div class="item active" \
style="text-align:center"> \
- <?= $this->product->embed_code ?> \
+ <div class="item active" \
style="text-align:center"> + <?= \
$this->product->embed_code ?> </div>
- <?php
+ <?php
$cnt = 2;
endif; ?>
<?php
-
+
foreach ($this->galleryPictures as $picture): ?>
<div class="item <?php if \
(!$this->product->ppload_collection_id && $cnt == 1) { echo 'active';
@@ -466,7 +466,7 @@ $userRoleName = $helperUserRole->userRole();
</div><!-- End Carousel -->
</div>
-
+
</div>
</div>
@@ -522,7 +522,7 @@ $userRoleName = $helperUserRole->userRole();
</article>
-
+
<?php
if (count($this->updates) > 0) {
$this->productUpdate = \
$this->updates[0]; @@ -533,7 +533,7 @@ $userRoleName = $helperUserRole->userRole();
<?= \
$this->render('product/partials/productUpdatesV1.phtml'); ?> </article>
<?php } ?>
-
+
<!-- comments -->
<div id="product-discussion">
@@ -580,7 +580,7 @@ $userRoleName = $helperUserRole->userRole();
<div class="tab-pane" id="updates-panel">
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-9">
<article>
- <?php
+ <?php
foreach ($this->updates as $this->productUpdate) \
{
echo \
$this->render('product/partials/productUpdatesV1.phtml'); }
@@ -596,8 +596,8 @@ $userRoleName = $helperUserRole->userRole();
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-9">
<article>
<div id="productRatingContainer">
- <?php
- echo \
$this->render('product/partials/productRating.phtml'); \
+ <?php
+ echo \
$this->render('product/partials/productRating.phtml'); ?>
</div>
</article>
@@ -611,8 +611,8 @@ $userRoleName = $helperUserRole->userRole();
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-9">
<article>
<div id="productLikesContainer">
- <?php
- echo \
$this->render('product/partials/productLikes.phtml'); \
+ <?php
+ echo \
$this->render('product/partials/productLikes.phtml'); ?>
</div>
</article>
@@ -626,19 +626,19 @@ $userRoleName = $helperUserRole->userRole();
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-9">
<article>
<div id="productPlingsContainer">
- <?php
- echo \
$this->render('product/partials/productPlings.phtml'); \
+ <?php
+ echo \
$this->render('product/partials/productPlings.phtml'); ?>
</div>
</article>
</div>
</div>
<?php } ?>
-
+
<div class="tab-pane" id="files-panel">
<div class="col-lg-12">
- <?php
- echo \
$this->render('product/partials/ppload.phtml'); + \
<?php + echo \
$this->render('product/partials/ppload.phtml'); ?>
</div>
</div>
@@ -656,7 +656,7 @@ $userRoleName = $helperUserRole->userRole();
<div class="flex-item-4 flex-right" id="product-maker">
<div>
<div class="project-share-new col-lg-12 col-md-12 col-sm-12 \
col-xs-12">
-
+
<script type="text/javascript">
function fbs_click(a) {
u = location.href;
@@ -696,8 +696,8 @@ $userRoleName = $helperUserRole->userRole();
</script>
<script src="https://apis.google.com/js/platform.js" async \
defer></script>
-
-
+
+
@@ -708,11 +708,11 @@ $userRoleName = $helperUserRole->userRole();
<div class="product-maker-thumbnail \
relative">
<a href="<?php echo \
$helpMemberUrl->buildMemberUrl($this->product->member_id); ?>" title="<?= \
$this->product->username ?>" class="tooltipuserleft" \
data-tooltip-content="#tooltip_content" \
data-user="<?=$this->product->member_id?>">
- <?php
+ <?php
\
if($this->isSupporter($this->product->member_id)) { ?>
- <span class="supporter-badge" \
>S</span>
- <?php } ?> \
+ <span class="supporter-badge" \
>S</span> + <?php } ?>
<img src="<?= \
$helpImage->Image($this->product->profile_image_url,
array('width' => 80, 'height' => \
80)) ?>"
alt="product-maker" width="15" \
height="15" @@ -733,12 +733,12 @@ $userRoleName = $helperUserRole->userRole();
<?php } ?>
<div class="prod-widget-box right ">
-
+
<div class="projectdtailHeart">
-
- <div \
id="container-pling<?=$this->product->project_id?>" \
class="container-pling" >
- <?php
+
+ <div \
id="container-pling<?=$this->product->project_id?>" class="container-pling" > + \
<?php echo $this->partial(
'/product/partials/projectplings.phtml',
array(
@@ -747,13 +747,13 @@ $userRoleName = $helperUserRole->userRole();
"ppload_collection_id" => \
$this->product->ppload_collection_id,
"project_category_id" => \
$this->product->project_category_id )
- );
- ?>
- </div> \
+ );
+ ?>
+ </div>
</div>
</div>
-
+
<?php /* echo $this->render('partials/sidebarRating.phtml'); \
*/ ?> <?php /*
@@ -761,12 +761,12 @@ $userRoleName = $helperUserRole->userRole();
<div class="prod-widget-box right">
<div class="btn-group dropleft" style="width: \
100%">
<button style="width: 100%" \
id="project_btn_download" class="btn btn-primary active" \
type="button">
- Get it
- </button> \
- </div> \
+ Get it
+ </button>
+ </div>
</div>
</div>
- */
+ */
?>
<div>
@@ -776,24 +776,23 @@ $userRoleName = $helperUserRole->userRole();
<span class="caret"></span></button>
<ul class="dropdown-menu hide" \
id="dropdown_downloads" style="min-width: 270px;"> </ul>
- </div>
-
+ </div>
+
<div id="project_btn_grp_install" class="btn-group \
dropleft hide" style="width: 100%; padding-top: 10px;"> <button style="width: 100%" \
id="project_btn_install" class="btn btn-primary dropdown-toggle disabled hide" \
type="button" data-toggle="dropdown">Install <span class="caret"></span></button>
<ul class="dropdown-menu hide" \
id="dropdown_installs" style="min-width: 270px;"> </ul>
- </div>
+ </div>
+
-
<?php if \
(Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) \
: ?>
- <div class="btn-group dropleft " style="width: \
100%; padding-top: 10px;">
- <button style="width: 100%" \
id="project_btn_getit" class="btn dropdown-toggle active btn-primary " type="button" \
>Get it</button>
- </div>
+ <div id="get-it-container" class="btn-group \
dropleft " style="width: 100%; padding-top: 10px;"> + \
</div> <?php endif; ?>
</div>
</div>
-
+
<!-- origins-->
<div>
@@ -823,9 +822,9 @@ $userRoleName = $helperUserRole->userRole();
echo \
$this->render('product/partials/productCloneFrom.phtml');
} ?>
-
- <?php
+
+ <?php
$relatednew=array();
$related = \
$modelClone->fetchRelatedProducts($this->product->project_id); $bflag = false;
@@ -846,9 +845,9 @@ $userRoleName = $helperUserRole->userRole();
}
$this->moreProducts = $relatednew;
-
+
$this->moreProductsTitle = 'Variants';
- if (count($this->moreProducts) > 0) { \
+ if (count($this->moreProducts) > 0) {
echo \
$this->render('product/partials/productCloneFrom.phtml');
} ?>
@@ -856,7 +855,7 @@ $userRoleName = $helperUserRole->userRole();
</div>
</div>
-
+
<!-- MORE PRODUCTS -->
@@ -905,7 +904,8 @@ $userRoleName = $helperUserRole->userRole();
</div>
</main>
-
+
+ <script type="text/javascript" src="/theme/react/getit.js"></script>
<script>(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
@@ -957,14 +957,14 @@ $userRoleName = $helperUserRole->userRole();
</script>
<?php $this->inlineScript()->appendScript(
- ' $(document).ready(function(){
+ ' $(document).ready(function(){
PartialJson.setup();
PartialJsonFraud.setup();
- ProductDetailCarousel.setup();
+ ProductDetailCarousel.setup();
PartialCommentReviewForm.setup();
- PartialsButtonHeartDetail.setup();
- PartialsButtonPlingProject.setup();
- TooltipUser.setup("tooltipuserleft","left");
- AppimagequestionOnClick.setup();
+ PartialsButtonHeartDetail.setup();
+ PartialsButtonPlingProject.setup();
+ TooltipUser.setup("tooltipuserleft","left");
+ AppimagequestionOnClick.setup();
});
');
diff --git a/httpdocs/theme/react/app-getit/__app-helpers.js \
b/httpdocs/theme/react/app-getit/__app-helpers.js new file mode 100644
index 00000000..cf3f8e02
--- /dev/null
+++ b/httpdocs/theme/react/app-getit/__app-helpers.js
@@ -0,0 +1,110 @@
+window.appHelpers = (function(){
+
+ function getEnv(domain){
+ let env;
+ if (this.splitByLastDot(domain) === 'com'){
+ env = 'live';
+ } else {
+ env = 'test';
+ }
+ return env;
+ }
+
+ function getDeviceWidth(width){
+ let device;
+ if (width > 1720){
+ device = "very-huge";
+ } else if (width < 1720 && width > 1500){
+ device = "huge";
+ } else if (width < 1500 && width > 1250){
+ device = "full";
+ } else if (width < 1250 && width >= 1000){
+ device = "large";
+ } else if (width < 1000 && width >= 661){
+ device = "mid";
+ } else if (width < 661 && width >= 400){
+ device = "tablet";
+ } else if (width < 400){
+ device = "phone"
+ }
+ return device;
+ }
+
+ function splitByLastDot(text) {
+ var index = text.lastIndexOf('.');
+ return text.slice(index + 1);
+ }
+
+ function getTimeAgo(datetime){
+ const a = timeago().format(datetime);
+ return a;
+ }
+
+ function getFileSize(size) {
+ if (isNaN(size))
+ size = 0;
+
+ if (size < 1024)
+ return size + ' Bytes';
+
+ size /= 1024;
+
+ if (size < 1024)
+ return size.toFixed(2) + ' Kb';
+
+ size /= 1024;
+
+ if (size < 1024)
+ return size.toFixed(2) + ' Mb';
+
+ size /= 1024;
+
+ if (size < 1024)
+ return size.toFixed(2) + ' Gb';
+
+ size /= 1024;
+
+ return size.toFixed(2) + ' Tb';
+ }
+
+ function generateFilterUrl(location,currentCat){
+ let link = {}
+ if (currentCat && currentCat !== 0){
+ link.base = "/browse/cat/" + currentCat + "/ord/";
+ } else {
+ link.base = "/browse/ord/";
+ }
+ if (location.search) link.search = location.search;
+ return link;
+ }
+
+ function generateFileDownloadHash(file,env){
+ let salt;
+ if (env === "test"){
+ salt = "vBHnf7bbdhz120bhNsd530LsA2mkMvh6sDsCm4jKlm23D186Fj";
+ } else {
+ salt = "Kcn6cv7&dmvkS40Hna §4ffcvl=021nfMs2sdlPs123MChf4s0K";
+ }
+
+ const timestamp = Math.floor((new Date().getTime() / 1000)+3600)
+ const hash = md5(salt,file.collection_id+timestamp);
+ return hash;
+ /*
+ $salt = PPLOAD_DOWNLOAD_SECRET;
+ $collectionID = $productInfo->ppload_collection_id;
+ $timestamp = time() + 3600; // one hour valid
+ $hash = md5($salt . $collectionID . $timestamp);
+ */
+ }
+
+ return {
+ getEnv,
+ getDeviceWidth,
+ splitByLastDot,
+ getTimeAgo,
+ getFileSize,
+ generateFilterUrl,
+ generateFileDownloadHash
+ }
+
+}());
diff --git a/httpdocs/theme/react/app-getit/__product-helpers.js \
b/httpdocs/theme/react/app-getit/__product-helpers.js new file mode 100644
index 00000000..0554d690
--- /dev/null
+++ b/httpdocs/theme/react/app-getit/__product-helpers.js
@@ -0,0 +1,156 @@
+window.productHelpers = (function(){
+
+ function getNumberOfProducts(device,numRows){
+ let num;
+ if (device === "very-huge"){
+ num = 7;
+ } else if (device === "huge"){
+ num = 6;
+ } else if (device === "full"){
+ num = 5;
+ } else if (device === "large"){
+ num = 4;
+ } else if (device === "mid"){
+ num = 3;
+ } else if (device === "tablet"){
+ num = 2;
+ } else if (device === "phone"){
+ num = 1;
+ }
+ if (numRows) num = num * numRows;
+ return num;
+ }
+
+ function generatePaginationObject(numPages,pathname,currentCategoy,order,page){
+ let pagination = [];
+
+ let baseHref = "/browse";
+ if (pathname.indexOf('cat') > -1){
+ baseHref += "/cat/" + currentCategoy;
+ }
+
+ if (page > 1){
+ const prev = {
+ number:'previous',
+ link:baseHref + "/page/" + parseInt(page - 1) + "/ord/" + order
+ }
+ pagination.push(prev);
+ }
+
+ for (var i = 0; i < numPages; i++){
+ const p = {
+ number:parseInt(i + 1),
+ link:baseHref + "/page/" + parseInt(i + 1) + "/ord/" + order
+ }
+ pagination.push(p);
+ }
+
+ if (page < numPages){
+ const next = {
+ number:'next',
+ link:baseHref + "/page/" + parseInt(page + 1) + "/ord/" + order
+ }
+ pagination.push(next);
+ }
+
+ return pagination;
+ }
+
+ function calculateProductRatings(ratings){
+ let pRating;
+ let totalUp = 0,
+ totalDown = 0;
+ ratings.forEach(function(r,index){
+ if (r.rating_active === "1"){
+ if (r.user_like === "1"){
+ totalUp += 1;
+ } else if (r.user_dislike === "1"){
+ totalDown += 1;
+ }
+ }
+ });
+ pRating = 100 / ratings.length * (totalUp - totalDown);
+ return pRating;
+ }
+
+ function getActiveRatingsNumber(ratings){
+ let activeRatingsNumber = 0;
+ ratings.forEach(function(r,index){
+ if (r.rating_active === "1"){
+ activeRatingsNumber += 1;
+ }
+ });
+ return activeRatingsNumber;
+ }
+
+ function getFilesSummary(files){
+ let summery = {
+ downloads:0,
+ archived:0,
+ fileSize:0,
+ total:0,
+ }
+ files.forEach(function(file,index){
+ summery.total += 1;
+ summery.fileSize += parseInt(file.size);
+ summery.downloads += parseInt(file.downloaded_count);
+ });
+
+ return summery;
+ }
+
+ function checkIfLikedByUser(user,likes){
+ let likedByUser = false;
+ likes.forEach(function(like,index){
+ if (user.member_id === like.member_id){
+ likedByUser = true;
+ }
+ });
+ return likedByUser;
+ }
+
+ function getLoggedUserRatingOnProduct(user,ratings){
+ let userRating = -1;
+ ratings.forEach(function(r,index){
+ if (r.member_id === user.member_id){
+ if (r.user_like === "1"){
+ userRating = 1;
+ } else {
+ userRating = 0
+ }
+ }
+ });
+ return userRating;
+ }
+
+ function calculateProductLaplaceScore(ratings){
+ let laplace_score = 0;
+ let upvotes = 0;
+ let downvotes = 0;
+ ratings.forEach(function(rating,index){
+ console.log(rating.active);
+ if (rating.rating_active === "1"){
+ console.log(rating.user_like);
+ if (rating.user_like === "1"){
+ upvotes += 1;
+ } else if (rating.user_like === "0") {
+ downvotes += 1;
+ }
+ }
+ });
+ laplace_score = (Math.round(((upvotes + 6) / ((upvotes + downvotes) + 12)),2) * \
100); + console.log(laplace_score);
+ return laplace_score;
+ }
+
+ return {
+ getNumberOfProducts,
+ generatePaginationObject,
+ calculateProductRatings,
+ getActiveRatingsNumber,
+ getFilesSummary,
+ checkIfLikedByUser,
+ getLoggedUserRatingOnProduct,
+ calculateProductLaplaceScore
+ }
+}());
diff --git a/httpdocs/theme/react/app-getit/app.js \
b/httpdocs/theme/react/app-getit/app.js new file mode 100644
index 00000000..36aaeab9
--- /dev/null
+++ b/httpdocs/theme/react/app-getit/app.js
@@ -0,0 +1,158 @@
+class GetIt extends React.Component {
+ constructor(props){
+ super(props);
+ this.state = {};
+ this.onGetItButtonClick = this.onGetItButtonClick.bind(this);
+ }
+
+ componentDidMount() {
+ console.log('bla bla');
+ }
+
+ onGetItButtonClick(){
+ console.log('on get it button click');
+ }
+
+
+ render(){
+ return (
+ <div id="get-it">
+ <button
+ data-toggle="modal"
+ data-target="#myModal"
+ style={{"width":"100%"}}
+ id="project_btn_getit" className="btn dropdown-toggle active btn-primary \
" + type="button">Get it</button>
+ <div className="modal fade" id="myModal" tabIndex="-1" role="dialog" \
aria-labelledby="myModalLabel"> + <div className="modal-dialog" \
role="document"> + <div className="modal-content">
+ <div className="modal-header">
+ <button type="button" className="close" data-dismiss="modal" \
aria-label="Close"><span aria-hidden="true">×</span></button> + \
<h4 className="modal-title" id="myModalLabel">Modal title</h4> + \
</div> + <div className="modal-body">
+ ...
+ </div>
+ <div className="modal-footer">
+ <button type="button" className="btn btn-default" \
data-dismiss="modal">Close</button> + <button type="button" \
className="btn btn-primary">Save changes</button> + </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ )
+ }
+}
+
+class GetItFilesList extends React.Component {
+ render(){
+ let filesDisplay;
+ const files = this.props.files.map((f,index) => (
+ <GetItFilesListItem
+ product={this.props.product}
+ key={index}
+ file={f}
+ />
+ ));
+ const summeryRow = productHelpers.getFilesSummary(this.props.files);
+ filesDisplay = (
+ <tbody>
+ {files}
+ <tr>
+ <td>{summeryRow.total} files (0 archived)</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>{summeryRow.downloads}</td>
+ <td></td>
+ <td>{appHelpers.getFileSize(summeryRow.fileSize)}</td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody>
+ );
+ return (
+ <div id="files-tab" className="product-tab">
+ <table className="mdl-data-table mdl-js-data-table mdl-shadow--2dp">
+ <thead>
+ <tr>
+ <th className="mdl-data-table__cell--non-numericm">File</th>
+ <th className="mdl-data-table__cell--non-numericm">Version</th>
+ <th className="mdl-data-table__cell--non-numericm">Description</th>
+ <th className="mdl-data-table__cell--non-numericm">Packagetype</th>
+ <th className="mdl-data-table__cell--non-numericm">Architecture</th>
+ <th className="mdl-data-table__cell--non-numericm">Downloads</th>
+ <th className="mdl-data-table__cell--non-numericm">Date</th>
+ <th className="mdl-data-table__cell--non-numericm">Filesize</th>
+ <th className="mdl-data-table__cell--non-numericm">DL</th>
+ <th className="mdl-data-table__cell--non-numericm">OCS-Install</th>
+ </tr>
+ </thead>
+ {filesDisplay}
+ </table>
+ </div>
+ );
+ }
+}
+
+class GetItFilesListItem extends React.Component {
+ constructor(props){
+ super(props);
+ this.state = {downloadLink:""};
+ }
+
+ componentDidMount() {
+ let baseUrl, downloadLinkUrlAttr;
+ if (store.getState().env === 'live') {
+ baseUrl = 'opendesktop.org';
+ downloadLinkUrlAttr = "https%3A%2F%dl.opendesktop.org%2Fapi%2F";
+ } else {
+ baseUrl = 'pling.cc';
+ downloadLinkUrlAttr = "https%3A%2F%2Fcc.ppload.com%2Fapi%2F";
+ }
+
+ const f = this.props.file;
+ const timestamp = Math.floor((new Date().getTime() / 1000)+3600)
+ const fileDownloadHash = \
appHelpers.generateFileDownloadHash(f,store.getState().env); + let downloadLink = \
"https://"+baseUrl+ + "/p/"+this.props.product.project_id+
+ "/startdownload?file_id="+f.id+
+ "&file_name="+f.title+
+ "&file_type="+f.type+
+ "&file_size="+f.size+
+ "&url="+downloadLinkUrlAttr+
+ "files%2Fdownloadfile%2Fid%2F"+f.id+
+ "%2Fs%2F"+fileDownloadHash+
+ "%2Ft%2F"+timestamp+
+ "%2Fu%2F"+this.props.product.member_id+
+ "%2F"+f.title;
+ this.setState({downloadLink:downloadLink});
+ }
+
+ render(){
+ const f = this.props.file;
+ return (
+ <tr>
+ <td className="mdl-data-table__cell--non-numericm">
+ <a href={this.state.downloadLink}>{f.title}</a>
+ </td>
+ <td>{f.version}</td>
+ <td className="mdl-data-table__cell--non-numericm">{f.description}</td>
+ <td className="mdl-data-table__cell--non-numericm">{f.packagename}</td>
+ <td className="mdl-data-table__cell--non-numericm">{f.archname}</td>
+ <td>{f.downloaded_count}</td>
+ <td className="mdl-data-table__cell--non-numericm">{appHelpers.getTimeAgo(f.created_timestamp)}</td>
+ <td className="mdl-data-table__cell--non-numericm">{appHelpers.getFileSize(f.size)}</td>
+ <td><a href={this.state.downloadLink}><i \
className="material-icons">cloud_download</i></a></td> + \
<td>{f.ocs_compatible}</td> + </tr>
+ )
+ }
+}
+
+ReactDOM.render(
+ <GetIt />,
+ document.getElementById('get-it-container')
+);
diff --git a/httpdocs/theme/react/getit.js b/httpdocs/theme/react/getit.js
new file mode 100644
index 00000000..b1d51561
--- /dev/null
+++ b/httpdocs/theme/react/getit.js
@@ -0,0 +1,548 @@
+window.appHelpers = function () {
+
+ function getEnv(domain) {
+ let env;
+ if (this.splitByLastDot(domain) === 'com') {
+ env = 'live';
+ } else {
+ env = 'test';
+ }
+ return env;
+ }
+
+ function getDeviceWidth(width) {
+ let device;
+ if (width > 1720) {
+ device = "very-huge";
+ } else if (width < 1720 && width > 1500) {
+ device = "huge";
+ } else if (width < 1500 && width > 1250) {
+ device = "full";
+ } else if (width < 1250 && width >= 1000) {
+ device = "large";
+ } else if (width < 1000 && width >= 661) {
+ device = "mid";
+ } else if (width < 661 && width >= 400) {
+ device = "tablet";
+ } else if (width < 400) {
+ device = "phone";
+ }
+ return device;
+ }
+
+ function splitByLastDot(text) {
+ var index = text.lastIndexOf('.');
+ return text.slice(index + 1);
+ }
+
+ function getTimeAgo(datetime) {
+ const a = timeago().format(datetime);
+ return a;
+ }
+
+ function getFileSize(size) {
+ if (isNaN(size)) size = 0;
+
+ if (size < 1024) return size + ' Bytes';
+
+ size /= 1024;
+
+ if (size < 1024) return size.toFixed(2) + ' Kb';
+
+ size /= 1024;
+
+ if (size < 1024) return size.toFixed(2) + ' Mb';
+
+ size /= 1024;
+
+ if (size < 1024) return size.toFixed(2) + ' Gb';
+
+ size /= 1024;
+
+ return size.toFixed(2) + ' Tb';
+ }
+
+ function generateFilterUrl(location, currentCat) {
+ let link = {};
+ if (currentCat && currentCat !== 0) {
+ link.base = "/browse/cat/" + currentCat + "/ord/";
+ } else {
+ link.base = "/browse/ord/";
+ }
+ if (location.search) link.search = location.search;
+ return link;
+ }
+
+ function generateFileDownloadHash(file, env) {
+ let salt;
+ if (env === "test") {
+ salt = "vBHnf7bbdhz120bhNsd530LsA2mkMvh6sDsCm4jKlm23D186Fj";
+ } else {
+ salt = "Kcn6cv7&dmvkS40Hna §4ffcvl=021nfMs2sdlPs123MChf4s0K";
+ }
+
+ const timestamp = Math.floor(new Date().getTime() / 1000 + 3600);
+ const hash = md5(salt, file.collection_id + timestamp);
+ return hash;
+ /*
+ $salt = PPLOAD_DOWNLOAD_SECRET;
+ $collectionID = $productInfo->ppload_collection_id;
+ $timestamp = time() + 3600; // one hour valid
+ $hash = md5($salt . $collectionID . $timestamp);
+ */
+ }
+
+ return {
+ getEnv,
+ getDeviceWidth,
+ splitByLastDot,
+ getTimeAgo,
+ getFileSize,
+ generateFilterUrl,
+ generateFileDownloadHash
+ };
+}();
+window.productHelpers = function () {
+
+ function getNumberOfProducts(device, numRows) {
+ let num;
+ if (device === "very-huge") {
+ num = 7;
+ } else if (device === "huge") {
+ num = 6;
+ } else if (device === "full") {
+ num = 5;
+ } else if (device === "large") {
+ num = 4;
+ } else if (device === "mid") {
+ num = 3;
+ } else if (device === "tablet") {
+ num = 2;
+ } else if (device === "phone") {
+ num = 1;
+ }
+ if (numRows) num = num * numRows;
+ return num;
+ }
+
+ function generatePaginationObject(numPages, pathname, currentCategoy, order, page) \
{ + let pagination = [];
+
+ let baseHref = "/browse";
+ if (pathname.indexOf('cat') > -1) {
+ baseHref += "/cat/" + currentCategoy;
+ }
+
+ if (page > 1) {
+ const prev = {
+ number: 'previous',
+ link: baseHref + "/page/" + parseInt(page - 1) + "/ord/" + order
+ };
+ pagination.push(prev);
+ }
+
+ for (var i = 0; i < numPages; i++) {
+ const p = {
+ number: parseInt(i + 1),
+ link: baseHref + "/page/" + parseInt(i + 1) + "/ord/" + order
+ };
+ pagination.push(p);
+ }
+
+ if (page < numPages) {
+ const next = {
+ number: 'next',
+ link: baseHref + "/page/" + parseInt(page + 1) + "/ord/" + order
+ };
+ pagination.push(next);
+ }
+
+ return pagination;
+ }
+
+ function calculateProductRatings(ratings) {
+ let pRating;
+ let totalUp = 0,
+ totalDown = 0;
+ ratings.forEach(function (r, index) {
+ if (r.rating_active === "1") {
+ if (r.user_like === "1") {
+ totalUp += 1;
+ } else if (r.user_dislike === "1") {
+ totalDown += 1;
+ }
+ }
+ });
+ pRating = 100 / ratings.length * (totalUp - totalDown);
+ return pRating;
+ }
+
+ function getActiveRatingsNumber(ratings) {
+ let activeRatingsNumber = 0;
+ ratings.forEach(function (r, index) {
+ if (r.rating_active === "1") {
+ activeRatingsNumber += 1;
+ }
+ });
+ return activeRatingsNumber;
+ }
+
+ function getFilesSummary(files) {
+ let summery = {
+ downloads: 0,
+ archived: 0,
+ fileSize: 0,
+ total: 0
+ };
+ files.forEach(function (file, index) {
+ summery.total += 1;
+ summery.fileSize += parseInt(file.size);
+ summery.downloads += parseInt(file.downloaded_count);
+ });
+
+ return summery;
+ }
+
+ function checkIfLikedByUser(user, likes) {
+ let likedByUser = false;
+ likes.forEach(function (like, index) {
+ if (user.member_id === like.member_id) {
+ likedByUser = true;
+ }
+ });
+ return likedByUser;
+ }
+
+ function getLoggedUserRatingOnProduct(user, ratings) {
+ let userRating = -1;
+ ratings.forEach(function (r, index) {
+ if (r.member_id === user.member_id) {
+ if (r.user_like === "1") {
+ userRating = 1;
+ } else {
+ userRating = 0;
+ }
+ }
+ });
+ return userRating;
+ }
+
+ function calculateProductLaplaceScore(ratings) {
+ let laplace_score = 0;
+ let upvotes = 0;
+ let downvotes = 0;
+ ratings.forEach(function (rating, index) {
+ console.log(rating.active);
+ if (rating.rating_active === "1") {
+ console.log(rating.user_like);
+ if (rating.user_like === "1") {
+ upvotes += 1;
+ } else if (rating.user_like === "0") {
+ downvotes += 1;
+ }
+ }
+ });
+ laplace_score = Math.round((upvotes + 6) / (upvotes + downvotes + 12), 2) * 100;
+ console.log(laplace_score);
+ return laplace_score;
+ }
+
+ return {
+ getNumberOfProducts,
+ generatePaginationObject,
+ calculateProductRatings,
+ getActiveRatingsNumber,
+ getFilesSummary,
+ checkIfLikedByUser,
+ getLoggedUserRatingOnProduct,
+ calculateProductLaplaceScore
+ };
+}();
+class GetIt extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {};
+ this.onGetItButtonClick = this.onGetItButtonClick.bind(this);
+ }
+
+ componentDidMount() {
+ console.log('bla bla');
+ }
+
+ onGetItButtonClick() {
+ console.log('on get it button click');
+ }
+
+ render() {
+ return React.createElement(
+ 'div',
+ { id: 'get-it' },
+ React.createElement(
+ 'button',
+ {
+ 'data-toggle': 'modal',
+ 'data-target': '#myModal',
+ style: { "width": "100%" },
+ id: 'project_btn_getit', className: 'btn dropdown-toggle active \
btn-primary ', + type: 'button' },
+ 'Get it'
+ ),
+ React.createElement(
+ 'div',
+ { className: 'modal fade', id: 'myModal', tabIndex: '-1', role: 'dialog', \
'aria-labelledby': 'myModalLabel' }, + React.createElement(
+ 'div',
+ { className: 'modal-dialog', role: 'document' },
+ React.createElement(
+ 'div',
+ { className: 'modal-content' },
+ React.createElement(
+ 'div',
+ { className: 'modal-header' },
+ React.createElement(
+ 'button',
+ { type: 'button', className: 'close', 'data-dismiss': 'modal', \
'aria-label': 'Close' }, + React.createElement(
+ 'span',
+ { 'aria-hidden': 'true' },
+ '\xD7'
+ )
+ ),
+ React.createElement(
+ 'h4',
+ { className: 'modal-title', id: 'myModalLabel' },
+ 'Modal title'
+ )
+ ),
+ React.createElement(
+ 'div',
+ { className: 'modal-body' },
+ '...'
+ ),
+ React.createElement(
+ 'div',
+ { className: 'modal-footer' },
+ React.createElement(
+ 'button',
+ { type: 'button', className: 'btn btn-default', 'data-dismiss': \
'modal' }, + 'Close'
+ ),
+ React.createElement(
+ 'button',
+ { type: 'button', className: 'btn btn-primary' },
+ 'Save changes'
+ )
+ )
+ )
+ )
+ )
+ );
+ }
+}
+
+class GetItFilesList extends React.Component {
+ render() {
+ let filesDisplay;
+ const files = this.props.files.map((f, index) => \
React.createElement(GetItFilesListItem, { + product: this.props.product,
+ key: index,
+ file: f
+ }));
+ const summeryRow = productHelpers.getFilesSummary(this.props.files);
+ filesDisplay = React.createElement(
+ 'tbody',
+ null,
+ files,
+ React.createElement(
+ 'tr',
+ null,
+ React.createElement(
+ 'td',
+ null,
+ summeryRow.total,
+ ' files (0 archived)'
+ ),
+ React.createElement('td', null),
+ React.createElement('td', null),
+ React.createElement('td', null),
+ React.createElement('td', null),
+ React.createElement(
+ 'td',
+ null,
+ summeryRow.downloads
+ ),
+ React.createElement('td', null),
+ React.createElement(
+ 'td',
+ null,
+ appHelpers.getFileSize(summeryRow.fileSize)
+ ),
+ React.createElement('td', null),
+ React.createElement('td', null)
+ )
+ );
+ return React.createElement(
+ 'div',
+ { id: 'files-tab', className: 'product-tab' },
+ React.createElement(
+ 'table',
+ { className: 'mdl-data-table mdl-js-data-table mdl-shadow--2dp' },
+ React.createElement(
+ 'thead',
+ null,
+ React.createElement(
+ 'tr',
+ null,
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'File'
+ ),
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'Version'
+ ),
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'Description'
+ ),
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'Packagetype'
+ ),
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'Architecture'
+ ),
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'Downloads'
+ ),
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'Date'
+ ),
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'Filesize'
+ ),
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'DL'
+ ),
+ React.createElement(
+ 'th',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ 'OCS-Install'
+ )
+ )
+ ),
+ filesDisplay
+ )
+ );
+ }
+}
+
+class GetItFilesListItem extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = { downloadLink: "" };
+ }
+
+ componentDidMount() {
+ let baseUrl, downloadLinkUrlAttr;
+ if (store.getState().env === 'live') {
+ baseUrl = 'opendesktop.org';
+ downloadLinkUrlAttr = "https%3A%2F%dl.opendesktop.org%2Fapi%2F";
+ } else {
+ baseUrl = 'pling.cc';
+ downloadLinkUrlAttr = "https%3A%2F%2Fcc.ppload.com%2Fapi%2F";
+ }
+
+ const f = this.props.file;
+ const timestamp = Math.floor(new Date().getTime() / 1000 + 3600);
+ const fileDownloadHash = appHelpers.generateFileDownloadHash(f, \
store.getState().env); + let downloadLink = "https://" + baseUrl + "/p/" + \
this.props.product.project_id + "/startdownload?file_id=" + f.id + "&file_name=" + \
f.title + "&file_type=" + f.type + "&file_size=" + f.size + "&url=" + \
downloadLinkUrlAttr + "files%2Fdownloadfile%2Fid%2F" + f.id + "%2Fs%2F" + \
fileDownloadHash + "%2Ft%2F" + timestamp + "%2Fu%2F" + this.props.product.member_id + \
"%2F" + f.title; + this.setState({ downloadLink: downloadLink });
+ }
+
+ render() {
+ const f = this.props.file;
+ return React.createElement(
+ 'tr',
+ null,
+ React.createElement(
+ 'td',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ React.createElement(
+ 'a',
+ { href: this.state.downloadLink },
+ f.title
+ )
+ ),
+ React.createElement(
+ 'td',
+ null,
+ f.version
+ ),
+ React.createElement(
+ 'td',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ f.description
+ ),
+ React.createElement(
+ 'td',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ f.packagename
+ ),
+ React.createElement(
+ 'td',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ f.archname
+ ),
+ React.createElement(
+ 'td',
+ null,
+ f.downloaded_count
+ ),
+ React.createElement(
+ 'td',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ appHelpers.getTimeAgo(f.created_timestamp)
+ ),
+ React.createElement(
+ 'td',
+ { className: 'mdl-data-table__cell--non-numericm' },
+ appHelpers.getFileSize(f.size)
+ ),
+ React.createElement(
+ 'td',
+ null,
+ React.createElement(
+ 'a',
+ { href: this.state.downloadLink },
+ React.createElement(
+ 'i',
+ { className: 'material-icons' },
+ 'cloud_download'
+ )
+ )
+ ),
+ React.createElement(
+ 'td',
+ null,
+ f.ocs_compatible
+ )
+ );
+ }
+}
+
+ReactDOM.render(React.createElement(GetIt, null), \
document.getElementById('get-it-container'));
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic