-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
262 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = Z.Region.extend({ | ||
el: 'div.create-link-container', | ||
|
||
showModal: function(options) { | ||
this.setView(require('account/views/create-link'), options).show(); | ||
return this; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.create-link-container { | ||
margin-bottom: -15px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@require '_file'; | ||
|
||
.card[data-type="link"] { | ||
@extends .card[data-type="file"]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="link-modal modal" id="create-link-modal"> | ||
<div class="create-link-modal modal-dialog"> | ||
<div class="modal-content"> | ||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
<div class="create-link-container" class="modal-body"></div> | ||
</div> {{! .modal-content }} | ||
</div> {{! .modal-dialog }} | ||
</div> {{! #create-link-modal }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<form class="create-link-form"> | ||
<div class="create-link-form-title form-group"> | ||
<input name="name" type="text" class="form-control" placeholder="Title" autofocus> | ||
<div data-error="name" class="help-block"></div> | ||
</div> {{! .create-link-form-title }} | ||
|
||
<div class="create-link-form-content form-group"> | ||
<input name="content" type="text" class="form-control" placeholder="http://"> | ||
<div data-error="content" class="help-block"></div> | ||
</div> {{! .create-link-form-content }} | ||
|
||
<div class="create-link-form-actions"> | ||
<button class="btn btn-default" data-action="submit">Done</button> | ||
<button type="button" class="btn btn-link btn-cancel" data-action="cancel">Cancel</button> | ||
</div> {{! .create-link-form-actions }} | ||
</form> {{! .create-link-form }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<button type="button" class="navbar-toggle pull-left" data-action="toggleSidebar"> | ||
{{icon-sidebar-close}} {{! TODO: toggle this icon with icon-sidebar-open }} | ||
</button> {{! [data-action="toggleSidebar"] }} | ||
|
||
<div class="pull-left"> | ||
<a href="{{boardUrl}}" class="card-detail-actions-back" data-action="back"> | ||
<span class="board-thumbnail-partial card-detail-actions-back-avatar"> | ||
{{partial "account/templates/board-preview" boardPreview}} | ||
</span> {{! .board-thumbnail-partial }} | ||
<div class="card-detail-actions-back-text"> | ||
<small class="text-muted">BACK TO</small> | ||
<strong class="card-detail-actions-board">{{boardName}}</strong> | ||
</div> {{! .card-detail-actions-back-text }} | ||
</a> {{! .card-detail-actions-back }} | ||
</div> {{! .pull-left }} | ||
|
||
<div class="pull-right"> | ||
<a href="{{content}}" class="btn btn-link item-action" target="_blank">{{icon-visit}} Visit</a> | ||
<button type="button" class="btn btn-link item-action" data-action="delete">{{icon-delete}} Delete</button> | ||
</div> {{! .pull-right }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{#if hasPreview}} | ||
<a href="{{content}}" target="_blank"> | ||
<img src="{{preview.image}}" class="card-preview card-preview-loader"> | ||
</a> | ||
{{else}} | ||
<a href="{{content}}" target="_blank"> | ||
<img src="{{asset-url}}images/patterns/{{preview.pattern}}.svg" class="card-preview-loader"> | ||
<div class="card-preview-extension">{{preview.extension}}</div> | ||
<div class="card-preview" data-pattern="{{preview.pattern}}" style="background-color:{{preview.color}};"></div> | ||
</a> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="card-preview-wrapper"> | ||
{{partial "account/templates/link-detail-preview" this}} | ||
</div> {{! .card-preview-wrapper }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<a href="{{html_url}}" class="card-link"> | ||
<div class="card-actions"> | ||
<button type="button" class="btn btn-link btn-xs" data-action="highlight">{{icon-star}}</button> | ||
<button type="button" class="btn btn-link btn-xs" data-action="delete">{{icon-delete}}</button> | ||
</div> {{! .card-actions }} | ||
|
||
<div class="card-preview-wrapper"> | ||
{{partial "account/templates/file-preview" this}} | ||
</div> {{! .card-preview-wrapper }} | ||
|
||
<div class="card-info"> | ||
<div class="card-info-item card-name">{{name}}</div> | ||
<div class="card-info-item card-author">Added by {{created_by.username}}</div> | ||
<div class="card-info-item card-comments">{{inflect comments_count "comment" "comments" true}}</div> | ||
</div> {{! .card-info }} | ||
</a> {{! .card-link }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module.exports = Zeppelin.FormView.extend({ | ||
className: 'create-link', | ||
|
||
formSelector: 'form.create-link-form', | ||
|
||
template: require('account/templates/create-link'), | ||
|
||
model: require('core/models/link'), | ||
|
||
events: { | ||
'click [data-action=cancel]': 'close', | ||
'click [data-action=submit]': 'submit' | ||
}, | ||
|
||
initialize: function() { | ||
$('#create-link-modal').on('hide.bs.modal', _.bind(function() { | ||
this.reset(); | ||
}, this)); | ||
|
||
this.prepareModel(); | ||
}, | ||
|
||
prepareModel: function() { | ||
this.setModel(require('core/models/link')); | ||
this.model.set('board', this.options.board.id); | ||
return this; | ||
}, | ||
|
||
close: function() { | ||
this.reset(); | ||
$('#create-link-modal').modal('hide'); | ||
}, | ||
|
||
onValidationSuccess: function() { | ||
this.broadcast('card:created', this.model); | ||
}, | ||
|
||
onSubmit: function() { | ||
if (!this.model.validationError) { | ||
this.prepareModel(); | ||
this.close(); | ||
} | ||
}, | ||
|
||
onUnplug: function() { | ||
$('#create-link-modal').off('hide.bs.modal'); | ||
} | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FileDetail = require('account/views/file-detail'); | ||
|
||
module.exports = FileDetail.extend({ | ||
attributes: { | ||
'data-type': 'link' | ||
}, | ||
|
||
template: require('account/templates/link-detail') | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
var File = require('account/views/file'); | ||
|
||
module.exports = File.extend({ | ||
template: require('account/templates/link') | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var File = require('core/models/file'); | ||
|
||
module.exports = File.extend({ | ||
defaults: function() { | ||
return _.extend(File.prototype.defaults(), { | ||
type: 'link' | ||
}); | ||
}, | ||
|
||
validations: _.extend({}, File.prototype.validations, { | ||
content: function(content) { | ||
if (!content) { | ||
return 'Every card requires some type of content.'; | ||
} else if (!Z.Validations.isUrl(content)) { | ||
return 'Please provide a valid url.'; | ||
} | ||
} | ||
}), | ||
|
||
getExtension: function() { | ||
return _.last(this.get('content').split('.')).replace(/\/.+|\//, ''); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<div class="card-preview-wrapper"> | ||
{{partial "account/templates/file-preview" this}} | ||
</div> {{! .card-preview-wrapper }} | ||
|
||
<div class="card-info"> | ||
<div class="card-info-item card-name">{{name}}</div> | ||
<div class="card-info-item card-author">Added by {{created_by.username}}</div> | ||
<div class="card-info-item card-comments">{{inflect comments_count "comment" "comments" true}}</div> | ||
</div> {{! .card-info }} | ||
<a href="{{html_url}}" class="card-link"> | ||
<div class="card-preview-wrapper"> | ||
{{partial "account/templates/file-preview" this}} | ||
</div> {{! .card-preview-wrapper }} | ||
|
||
<div class="card-info"> | ||
<div class="card-info-item card-name">{{name}}</div> | ||
<div class="card-info-item card-author">Added by {{created_by.username}}</div> | ||
<div class="card-info-item card-comments">{{inflect comments_count "comment" "comments" true}}</div> | ||
</div> {{! .card-info }} | ||
</a> {{! .card-link }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div class="pull-left"> | ||
<a href="{{boardUrl}}" class="card-detail-actions-back" data-action="back"> | ||
<span class="board-thumbnail-partial card-detail-actions-back-avatar"> | ||
{{partial "account/templates/board-preview" boardPreview}} | ||
</span> {{! .board-thumbnail-partial }} | ||
<div class="card-detail-actions-back-text"> | ||
<small class="text-muted">BACK TO</small> | ||
<strong class="card-detail-actions-board">{{boardName}}</strong> | ||
</div> {{! .card-detail-actions-back-text }} | ||
</a> {{! .card-detail-actions-back }} | ||
</div> {{! .pull-left }} | ||
|
||
<div class="pull-right"> | ||
<a href="{{content}}" class="btn btn-link item-action" target="_blank">{{icon-visit}} Visit</a> | ||
</div> {{! .pull-right }} |
Oops, something went wrong.