mirror of
https://github.com/Screenly/Anthias.git
synced 2026-05-25 00:48:32 -04:00
Add icon in asset list to describe the Asset's type: video, webpage, or image. Closes #59.
This commit is contained in:
@@ -91,6 +91,14 @@ class AssetRowView extends Backbone.View
|
||||
render: =>
|
||||
@$el.html @template @model.toJSON()
|
||||
(@$ ".toggle input").prop "checked", @model.get 'is_active'
|
||||
|
||||
switch (@model.get "mimetype")
|
||||
when "video" then icon_class = "icon-facetime-video"
|
||||
when "image" then icon_class = "icon-picture"
|
||||
when "webpage" then icon_class = "icon-globe"
|
||||
else icon_class = ""
|
||||
(@$ "#asset-icon").attr "class", icon_class
|
||||
|
||||
(@$ "#delete-asset-button").popover
|
||||
html: yes, placement: 'left', title: "Are you sure?", content: get_template 'confirm-delete'
|
||||
this
|
||||
|
||||
@@ -192,8 +192,23 @@
|
||||
};
|
||||
|
||||
AssetRowView.prototype.render = function() {
|
||||
var icon_class;
|
||||
this.$el.html(this.template(this.model.toJSON()));
|
||||
(this.$(".toggle input")).prop("checked", this.model.get('is_active'));
|
||||
switch (this.model.get("mimetype")) {
|
||||
case "video":
|
||||
icon_class = "icon-facetime-video";
|
||||
break;
|
||||
case "image":
|
||||
icon_class = "icon-picture";
|
||||
break;
|
||||
case "webpage":
|
||||
icon_class = "icon-globe";
|
||||
break;
|
||||
default:
|
||||
icon_class = "";
|
||||
}
|
||||
(this.$("#asset-icon")).attr("class", icon_class);
|
||||
(this.$("#delete-asset-button")).popover({
|
||||
html: true,
|
||||
placement: 'left',
|
||||
|
||||
@@ -26,7 +26,10 @@
|
||||
|
||||
%script(type="text/template", id="asset-row-template")
|
||||
:plain
|
||||
<td><%= name %></td>
|
||||
<td>
|
||||
<i id="asset-icon"></i>
|
||||
<%= name %>
|
||||
</td>
|
||||
<td><%= Screenly.date_to.string(start_date) %></td>
|
||||
<td><%= Screenly.date_to.string(end_date) %></td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user