loans.xml 1.98 KB
Newer Older
Laurent's avatar
Laurent committed
1 2 3 4 5 6 7 8 9 10
<GridLayout colums="auto" row="auto" xmlns:lv="nativescript-ui-listview">
  <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
11
        <GridLayout  columns="120, *" rows="auto,auto,auto,auto,auto"
Claire Hernandez's avatar
Claire Hernandez committed
12 13 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
          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
43 44 45 46
        </GridLayout>
      </StackLayout>
    </lv:RadListView.itemTemplate>
  </lv:RadListView>
Laurent's avatar
Laurent committed
47
  <Label visibility="{{ loans.length || busy == 'on' ? 'collapsed' : 'visible'  }}" style="text-align: center; height: 100dip" text="{{ L('no_loans') }}" col="0" row="0"/>
laurent l's avatar
laurent l committed
48
  <ActivityIndicator id="activity-indicator" col="0" row="0" busy="{{ busy == 'on' ? 'true' : 'false' }}" color="orange"/>
Laurent's avatar
Laurent committed
49
</GridLayout>