Skip to content

[Feature] Added possibility to upload files #431

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

Open
wants to merge 2 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
29 changes: 29 additions & 0 deletions css/layout-css/agenda-style.upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,35 @@
width: calc(100% - 60px);
}

.agenda-detail-overlay .file-holder {
padding: 0;
list-style-type: none;
}

.agenda-detail-overlay .file-holder li {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 10px;
border-bottom: 1px solid rgba(51,51,51,0.2);
cursor: pointer;
}

.agenda-detail-overlay .file-holder .file-title {
padding-top: 5px;
font-weight: bold;
color: #666;
}

.agenda-detail-overlay .file-holder .file-icon {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 34px;
min-width: 30px;
color: #666;
}

.new-agenda-list-container .slide-over .agenda-item-inner-content h2.agenda-item-title,
.agenda-detail-overlay .agenda-item-inner-content h2.agenda-item-title {
position: relative;
Expand Down
29 changes: 29 additions & 0 deletions css/layout-css/news-feed-style.upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,35 @@ html.ie11 .new-news-feed-list-container .news-feed-list-item:not(.open) .slide-o
z-index: 13;
}

.news-feed-detail-overlay-wrapper .file-holder {
padding: 0;
list-style-type: none;
}

.news-feed-detail-overlay-wrapper .file-holder li {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 10px;
border-bottom: 1px solid rgba(51,51,51,0.2);
cursor: pointer;
}

.news-feed-detail-overlay-wrapper .file-holder .file-title {
padding-top: 5px;
font-weight: bold;
color: #666;
}

.news-feed-detail-overlay-wrapper .file-holder .file-icon {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 34px;
min-width: 30px;
color: #666;
}

.news-feed-detail-overlay-wrapper .news-feed-detail-overlay-close.go-previous-screen {
font-size: 2em;
}
Expand Down
29 changes: 29 additions & 0 deletions css/layout-css/simple-list-style.upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,35 @@ html.ie11 .simple-list-item .list-item-description {
display: none;
}

.simple-list-detail-overlay .file-holder {
padding: 0;
list-style-type: none;
}

.simple-list-detail-overlay .file-holder li {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 10px;
border-bottom: 1px solid rgba(51,51,51,0.2);
cursor: pointer;
}

.simple-list-detail-overlay .file-holder .file-title {
padding-top: 5px;
font-weight: bold;
color: #666;
}

.simple-list-detail-overlay .file-holder .file-icon {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 34px;
min-width: 30px;
color: #666;
}

/* COMMENTS */

.simple-list-comment-panel {
Expand Down
29 changes: 29 additions & 0 deletions css/layout-css/small-card-style.upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,35 @@
display: none;
}

.small-card-details-holder .file-holder {
padding: 0;
list-style-type: none;
}

.small-card-details-holder .file-holder li {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 10px;
border-bottom: 1px solid rgba(51,51,51,0.2);
cursor: pointer;
}

.small-card-details-holder .file-holder .file-title {
padding-top: 5px;
font-weight: bold;
color: #666;
}

.small-card-details-holder .file-holder .file-icon {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 34px;
min-width: 30px;
color: #666;
}

@media screen and (min-width: 640px) {
.small-card-detail-overlay .small-card-detail-overlay-wrapper {
position: absolute;
Expand Down
29 changes: 29 additions & 0 deletions css/layout-css/small-h-card-style.upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,35 @@
z-index: 13;
}

.small-h-card-detail-overlay-wrapper .file-holder {
padding: 0;
list-style-type: none;
}

.small-h-card-detail-overlay-wrapper .file-holder li {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 10px;
border-bottom: 1px solid rgba(51,51,51,0.2);
cursor: pointer;
}

.small-h-card-detail-overlay-wrapper .file-holder .file-title {
padding-top: 5px;
font-weight: bold;
color: #666;
}

.small-h-card-detail-overlay-wrapper .file-holder .file-icon {
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 34px;
min-width: 30px;
color: #666;
}

.small-h-card-detail-overlay-wrapper .small-h-card-detail-overlay-close.go-previous-screen {
font-size: 2em;
}
Expand Down
10 changes: 5 additions & 5 deletions js/build.templates.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/interface.templates.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions js/layout-javascript/agenda-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,11 @@ DynamicList.prototype.attachObservers = function() {
$(this).parents('.agenda-item-bookmark-holder').removeClass('not-bookmarked').addClass('bookmarked');

record.bookmarkButton.like();
})
.on('click', '#file-item', function(file) {
var url = $(file.currentTarget).find('input[type=hidden]').val();

Fliplet.Navigate.file(url);
});
}

Expand Down Expand Up @@ -2385,6 +2390,8 @@ DynamicList.prototype.addDetailViewData = function (entry) {
// Define content
if (dynamicDataObj.customFieldEnabled) {
content = new Handlebars.SafeString(Handlebars.compile(dynamicDataObj.customField)(entry.originalData));
} else if (dynamicDataObj.type === 'file') {
content = _this.Utils.String.splitByCommas(entry.originalData[dynamicDataObj.column]);
} else {
content = entry.originalData[dynamicDataObj.column];
}
Expand Down
5 changes: 5 additions & 0 deletions js/layout-javascript/news-feed-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,11 @@ DynamicList.prototype.attachObservers = function() {
$(this).parents('.news-feed-like-holder').removeClass('not-liked').addClass('liked');
record.likeButton.like();
$(this).find('.count').html(count);
})
.on('click', '#file-item', function(file) {
var url = $(file.currentTarget).find('input[type=hidden]').val();

Fliplet.Navigate.file(url);
});
}

Expand Down
5 changes: 5 additions & 0 deletions js/layout-javascript/simple-list-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,11 @@ DynamicList.prototype.attachObservers = function() {
$(this).parents('.simple-list-like-holder').removeClass('not-liked').addClass('liked');
record.likeButton.like();
$(this).find('.count').html(count);
})
.on('click', '#file-item', function(file) {
var url = $(file.currentTarget).find('input[type=hidden]').val();

Fliplet.Navigate.file(url);
});
}

Expand Down
5 changes: 5 additions & 0 deletions js/layout-javascript/small-card-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,11 @@ DynamicList.prototype.attachObservers = function() {

$(this).parents('.small-card-bookmark-holder').removeClass('not-bookmarked').addClass('bookmarked');
record.bookmarkButton.like();
})
.on('click', '#file-item', function(file) {
var url = $(file.currentTarget).find('input[type=hidden]').val();

Fliplet.Navigate.file(url);
});
}

Expand Down
5 changes: 5 additions & 0 deletions js/layout-javascript/small-h-card-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ DynamicList.prototype.attachObservers = function() {
}).then(function() {
Fliplet.UI.Actions(options);
});
})
.on('click', '#file-item', function(file) {
var url = $(file.currentTarget).find('input[type=hidden]').val();

Fliplet.Navigate.file(url);
});
}

Expand Down
7 changes: 7 additions & 0 deletions js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ Fliplet.Registry.set('dynamicListUtils', (function () {
});
}

Handlebars.registerHelper('formatFilename', function(filename) {
var index = filename.indexOf('contents/');
var formattedName = filename.substring(index + 9);

return formattedName;
});

function isExecute (event) {
if (event.type === 'click') {
return true;
Expand Down
20 changes: 20 additions & 0 deletions templates/build/agenda-cards-detail.build.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,26 @@
\{{/if}}
\{{/ifCond}}

<!-- File template -->
\{{#ifCond type '==' 'file'}}
\{{#if content}}
<ul class="file-holder">
\{{#if labelEnabled}}
<div class="agenda-item-detail-label">\{{label}}</div>
\{{/if}}
\{{#each content}}
<li id="file-item">
<div class="file-title">\{{formatFilename this}}</div>
<input type="hidden" value=\{{this}}>
<div class="file-icon">
<i class="fa fa-angle-right"></i>
</div>
</li>
\{{/each}}
</ul>
\{{/if}}
\{{/ifCond}}

\{{/each}}
</div>

Expand Down
20 changes: 20 additions & 0 deletions templates/build/news-feed-detail.build.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,26 @@
\{{/if}}
\{{/ifCond}}

<!-- File template -->
\{{#ifCond type '==' 'file'}}
\{{#if content}}
<ul class="file-holder">
\{{#if labelEnabled}}
<div class="news-feed-detail-label">\{{label}}</div>
\{{/if}}
\{{#each content}}
<li id="file-item">
<div class="file-title">\{{formatFilename this}}</div>
<input type="hidden" value=\{{this}}>
<div class="file-icon">
<i class="fa fa-angle-right"></i>
</div>
</li>
\{{/each}}
</ul>
\{{/if}}
\{{/ifCond}}

\{{/each}}
</div>
<div class="news-feed-inner-holder \{{#ifCond editEntry '||' deleteEntry}}has-edit-controls\{{/ifCond}}">
Expand Down
21 changes: 21 additions & 0 deletions templates/build/simple-list-detail.build.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,27 @@
\{{/if}}
\{{/ifCond}}


<!-- File template -->
\{{#ifCond type '==' 'file'}}
\{{#if content}}
<ul class="file-holder">
\{{#if labelEnabled}}
<div class="simple-list-detail-label">\{{label}}</div>
\{{/if}}
\{{#each content}}
<li id="file-item">
<div class="file-title">\{{formatFilename this}}</div>
<input type="hidden" value=\{{this}}>
<div class="file-icon">
<i class="fa fa-angle-right"></i>
</div>
</li>
\{{/each}}
</ul>
\{{/if}}
\{{/ifCond}}

\{{/each}}

<!-- Edit and Delete buttons -->
Expand Down
21 changes: 21 additions & 0 deletions templates/build/small-card-detail.build.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,27 @@
\{{/if}}
\{{/ifCond}}


<!-- File template -->
\{{#ifCond type '==' 'file'}}
\{{#if content}}
<ul class="file-holder">
\{{#if labelEnabled}}
<div class="small-card-list-detail-label">\{{label}}</div>
\{{/if}}
\{{#each content}}
<li id="file-item">
<div class="file-title">\{{formatFilename this}}</div>
<input type="hidden" value=\{{this}}>
<div class="file-icon">
<i class="fa fa-angle-right"></i>
</div>
</li>
\{{/each}}
</ul>
\{{/if}}
\{{/ifCond}}

\{{/each}}
</div>

Expand Down
Loading