loans.xml 1.85 KB
Newer Older
Laurent's avatar
Laurent committed
1 2
<GridLayout colums="auto" row="auto" xmlns:lv="nativescript-ui-listview">
  <Label visibility="{{ loans.length || busy == 'on' ? 'collapsed' : 'visible'  }}" style="text-align: center; height: 100dip" text="{{ L('no_loans') }}"/>
Claire Hernandez's avatar
Claire Hernandez committed
3

Laurent's avatar
Laurent committed
4 5 6 7 8 9 10 11 12
  <lv:RadListView col="0" row="0"
                  items="{{ loans }}"
                  id="loans"
                  itemTap="{{ onLoanTap }}"
                  separatorColor="transparent"
                  pullToRefresh="true"
                  pullToRefreshInitiated="{{ refreshLoansAndHoldsAction }}">
    <lv:RadListView.itemTemplate>
      <StackLayout class="list-item">
Laurent's avatar
Laurent committed
13
        <GridLayout  columns="120, *" rows="auto,auto,auto,auto,auto"
Claire Hernandez's avatar
Claire Hernandez committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
          class="{{ 'loan' + (isLate() ? ' late' : '')}}">

          <Label text="{{ getTitle() }}"
            textWrap="true" col="0" row="0" colSpan="3"
            class="title" />

          <Image src="{{ getRecordThumbnail() }}"
            visibility="{{ getRecordThumbnail().length ? 'visible' : 'collapsed'  }}"
            col="0" row="1" stretch="aspectFill" rowSpan="4"
            class="cover"/>

          <Label text="{{ L('author') + ':'}}"
            col="{{ getRecordThumbnail().length ? '1' : '0'  }}"
            row="1"
            class="form_label key"/>

          <Label text="{{ getAuthor() }}"
            textWrap="true" col="1"
            row="{{ getRecordThumbnail().length ? '2' : '1'  }}"
            class="value"/>

          <Label text="{{ L('date_due') + ':'}}"
            col="{{ getRecordThumbnail().length ? '1' : '0'  }}"
            row="3"
            class="form_label key"/>

          <Label text="{{ formattedDateDue() }}"
            col="1"
            row="{{ getRecordThumbnail().length ? '4' : '3'  }}"
            class="date_due value"/>

Laurent's avatar
Laurent committed
45 46 47 48 49
        </GridLayout>
      </StackLayout>
    </lv:RadListView.itemTemplate>
  </lv:RadListView>
</GridLayout>