Extract out project list item to template and add OL-specific template

This commit is contained in:
Alasdair Smith 2017-10-30 11:27:24 +00:00
parent d072fabb25
commit 532a26c68f
3 changed files with 60 additions and 41 deletions

View file

@ -0,0 +1,40 @@
.col-xs-6
input.select-item(
select-individual,
type="checkbox",
ng-model="project.selected"
stop-propagation="click"
aria-label=translate('select_project') + " '{{ project.name }}'"
)
span
a.projectName(
ng-href="{{projectLink(project)}}"
stop-propagation="click"
) {{project.name}}
span(
ng-controller="TagListController"
)
.tag-label(
ng-repeat='tag in project.tags'
stop-propagation="click"
)
a.label.label-default.tag-label-name(
href,
ng-click="selectTag(tag)"
) {{tag.name}}
a.label.label-default.tag-label-remove(
href
ng-click="removeProjectFromTag(project, tag)"
) ×
.col-xs-2
span.owner {{ownerName()}}
span(ng-if="isLinkSharingProject(project)")
|  
i.fa.fa-link.small(
tooltip=translate("link_sharing")
tooltip-placement="right"
tooltip-append-to-body="true"
)
.col-xs-4
span.last-modified {{project.lastUpdated | formatDate}}

View file

@ -0,0 +1,11 @@
.col-xs-6
span
a.projectName(
href="/project/{{project.id}}"
stop-propagation="click"
) {{project.name}}
.col-xs-2
span.owner
.col-xs-4
span.last-modified

View file

@ -142,47 +142,15 @@
ng-repeat="project in visibleProjects | orderBy:predicate:reverse",
ng-controller="ProjectListItemController"
)
.row(select-row)
.col-xs-6
input.select-item(
select-individual,
type="checkbox",
ng-model="project.selected"
stop-propagation="click"
aria-label=translate('select_project') + " '{{ project.name }}'"
)
span
a.projectName(
ng-href="{{projectLink(project)}}"
stop-propagation="click"
) {{project.name}}
span(
ng-controller="TagListController"
)
.tag-label(
ng-repeat='tag in project.tags'
stop-propagation="click"
)
a.label.label-default.tag-label-name(
href,
ng-click="selectTag(tag)"
) {{tag.name}}
a.label.label-default.tag-label-remove(
href
ng-click="removeProjectFromTag(project, tag)"
) ×
.col-xs-2
span.owner {{ownerName()}}
span(ng-if="isLinkSharingProject(project)")
|  
i.fa.fa-link.small(
tooltip=translate("link_sharing")
tooltip-placement="right"
tooltip-append-to-body="true"
)
.col-xs-4
span.last-modified {{project.lastUpdated | formatDate}}
.row(
ng-if="!project.isOLProject"
select-row
)
include ./item
.row(
ng-if="project.isOLProject"
)
include ./ol-item
li(
ng-if="visibleProjects.length == 0",
ng-cloak