loans.xml 2.97 KB
Newer Older
Laurent's avatar
Laurent committed
1
<Page xmlns:nsDrawer="nativescript-ui-sidedrawer" xmlns:lv="nativescript-ui-listview" xmlns:shared="views/shared" loaded="{{ onPageLoaded }}">
Laurent's avatar
Laurent committed
2
  <Page.actionBar>
Laurent's avatar
Laurent committed
3
    <ActionBar title="{{ page_title }}" icon="">
4 5
      <NavigationButton  android.systemIcon="ic_menu_back" tap="{{ goHomeAction }}"/>

Laurent's avatar
Laurent committed
6
      <ActionItem text="{{ L('refresh') }}" tap="{{ refreshLoansAndHoldsAction }}">
7 8 9 10 11 12 13 14 15 16
        <ActionItem.actionView>
          <Label text='&#xf021;'/>
        </ActionItem.actionView>
      </ActionItem>
      
      <ActionItem text="{{ L('menu) }}" tap="{{ toggleDrawerAction }}">
        <ActionItem.actionView>
          <Label text='&#xf0c9;'/>
        </ActionItem.actionView>
      </ActionItem>
Laurent's avatar
Laurent committed
17 18
    </ActionBar>
  </Page.actionBar>
Patrick Barroca's avatar
Patrick Barroca committed
19
  
20
  <nsDrawer:RadSideDrawer id="sideDrawer" drawerLocation="Right" drawerTransition="PushTransition">
21
		<nsDrawer:RadSideDrawer.drawerContent xmlns:nsDrawer="nativescript-pro-ui/sidedrawer">
Laurent's avatar
Laurent committed
22 23
			<shared:sidedrawer />
		</nsDrawer:RadSideDrawer.drawerContent>
24

Patrick Barroca's avatar
Patrick Barroca committed
25
    <nsDrawer:RadSideDrawer.mainContent>
Laurent's avatar
Laurent committed
26
      <GridLayout colums="auto" row="auto">
27
        <Label id="no-loans" visibility="{{ loans.length || busy == 'on' ? 'collapsed' : 'visible'  }}" style="text-align: center; height: 100dip" text="{{ L('no_loans') }}"/>
Patrick Barroca's avatar
Patrick Barroca committed
28
        
29 30
        <lv:RadListView col="0" row="0"
                        items="{{ loans }}"
Laurent's avatar
Laurent committed
31
                        id="items"
32 33 34
                        itemTap="{{ onLoanTap }}"
                        separatorColor="transparent"
                        pullToRefresh="true"
Laurent's avatar
Laurent committed
35
                        pullToRefreshInitiated="{{ refreshLoansAndHoldsAction }}">
Laurent's avatar
Laurent committed
36
          <lv:RadListView.itemTemplate>
Laurent's avatar
Laurent committed
37
            <StackLayout class="list-item">
38 39 40 41
              <GridLayout  columns="100, *" rows="auto,auto,auto,auto,auto" class="{{ 'loan' + (isLate() ? ' late' : '')}}">
                <Label text="{{ getTitle() }}" class="title" textWrap="true" col="0" row="0" colSpan="3"/>

                <Image src="{{ getRecordThumbnail() }}" visibility="{{ getRecordThumbnail().length ? 'visible' : 'collapsed'  }}" col="0" row="1" stretch="aspectFill" rowSpan="4"/>
Laurent's avatar
Laurent committed
42
                
43 44
                <Label text="{{ L('author') + ':'}}" col="{{ getRecordThumbnail().length ? '1' : '0'  }}" row="1" class="form_label"/>
                <Label text="{{ getAuthor() }}" textWrap="true" col="1" row="{{ getRecordThumbnail().length ? '2' : '1'  }}"/>
Laurent's avatar
Laurent committed
45
                
46 47
                <Label text="{{ L('date_due') + ':'}}" col="{{ getRecordThumbnail().length ? '1' : '0'  }}" row="3" class="form_label"/>
                <Label text="{{ formattedDateDue() }}" col="1" row="{{ getRecordThumbnail().length ? '4' : '3'  }}" class="date_due"/>
Laurent's avatar
Laurent committed
48 49
              </GridLayout>
            </StackLayout>
Laurent's avatar
Laurent committed
50 51
          </lv:RadListView.itemTemplate>
        </lv:RadListView>
Laurent's avatar
Laurent committed
52 53
        
        <ActivityIndicator style="opacity: 0; height:50dip; width:50dip" col="0" row="0" id="activity-indicator" busy="true"/>
Laurent's avatar
Laurent committed
54
      </GridLayout>
Patrick Barroca's avatar
Patrick Barroca committed
55
    </nsDrawer:RadSideDrawer.mainContent>
Laurent's avatar
Laurent committed
56 57 58

  </nsDrawer:RadSideDrawer>

Laurent's avatar
Laurent committed
59
</Page>