Commit 6b96b084 authored by Adrien PARROT's avatar Adrien PARROT
Browse files

Mise en page SearchPage a J1

parent 790a1bf0
function getConceptAjax(sVal) {
// var URL_concept = "http://127.0.0.1:5000/api/concept/";
var URL_concept = "http://omop-mapper.fgh.ovh/api/concept/";
if (sVal !== undefined) {
$.ajax({
type:"GET",
url: URL_concept + sVal,
dataType:"json",
async: false,
header: {
"Content-Type": "application/json",
},
success: function(oData, response, xhr) {
var oModel = new sap.ui.model.json.JSONModel(oData);
sap.ui.getCore().setModel(oModel, "conceptDetailModel");
console.log("connection");
},
error : function(error) {
alert("pb in the connection");
console.log(error);
}
})}
}
sap.ui.controller("conceptmapper.conceptDetailPage", {
goToConceptDetailol : function(oEvt) {
var sVal = oEvt.getSource().getAttributes()[0].getProperty('text');
debugger;
getConceptAjax(sVal);
// app.to('idConceptDetailPage', 'flip');
// sap.ui.getCore().byId("idSearchPage").getController().getConceptAjax(sVal);
},
/**
* Called when a controller is instantiated and its View controls (if
......
......@@ -90,10 +90,11 @@ sap.ui.jsview("conceptmapper.conceptDetailPage", {
title : "{conceptDetailModel>concept_name}",
number : "{conceptDetailModel>standard_concept}",
numberUnit : "{conceptDetailModel>invalid_reason}",
// type:"Active",
// press: function(){
// app.back();
// },
type:"Active",
press: [oController.goToConceptDetailol, oController ],
attributes : [
new sap.m.ObjectAttribute({
title : "concept_id",
......
......@@ -96,7 +96,10 @@ var oItemTemplateStandard = new sap.ui.core.Item({
sap.ui.controller("conceptmapper.searchPage", {
searcher : function (oEvt) {
searcher : function (oEvt, first) {
var oStandardMCB_ref = sap.ui.getCore().byId('oStandardMCB').getSelectedItems();
var oStandardMCB_list = [];
......@@ -128,6 +131,10 @@ sap.ui.controller("conceptmapper.searchPage", {
oLangMCB_list.push(oLangMCB_ref[i].getProperty('text'));
}
if (first !== 'undefined' && first === 1) {
oLangMCB_list = ['FR'];
}
var oRowsNumber = parseInt(sap.ui.getCore().byId('oRowInPageInput').getProperty('value'));
var oData = {};
......@@ -866,10 +873,50 @@ sap.ui.controller("conceptmapper.searchPage", {
*/
onInit: function() {
onInit: function(oEvt) {
sap.ui.getCore().byId("__container1-Master").addStyleClass('searchPage');
sap.ui.getCore().byId("__bar1--header").addStyleClass('__bar1--header');
// Hide Navbutton
sap.ui.getCore().byId("__page1-navButton").addStyleClass('__page1-navButton');
// Hide Master at the beginning
sap.ui.getCore().byId("__container1-Master").toggleStyleClass("toggle-masterPage");
var oModel = new sap.ui.model.json.JSONModel();
var mData = {
"selected" : "15",
"items" : [{
"key" : "15",
"text" : "15"
},
{
"key" : "30",
"text" : "30"
},
{
"key" : "50",
"text" : "15"
},
{
"key" : "100",
"text" : "100"
},
{
"key" : "200",
"text" : "200"
},
// {
// "key" : "EN",
// "text" : "EN"
// }
]
};
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "RowsPerLignModel");
var oModel = new sap.ui.model.json.JSONModel();
......@@ -1177,6 +1224,9 @@ sap.ui.controller("conceptmapper.searchPage", {
oModel.setData(mData);
sap.ui.getCore().setModel(oModel, "vocabulary");
// this.searcher(oEvt, 1);
},
......@@ -1187,9 +1237,15 @@ sap.ui.controller("conceptmapper.searchPage", {
* (NOT before the first rendering! onInit() is used for that one!).
* @memberOf conceptmapper.searchPage
*/
// onBeforeRendering: function() {
//
// },
onBeforeRendering: function() {
// to suppress when many pages
//sap.ui.getCore().byId("__page2-intHeader-BarLeft").addStyleClass('__page2-intHeader-BarLeft');
},
/**
* Called when the View has been rendered (so its HTML is part of the document). Post-rendering manipulations of the HTML could be done here.
......
......@@ -19,7 +19,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
* @memberOf conceptmapper.searchPage
*/
createContent : function(oController) {
var oSplitContainer = new sap.m.SplitContainer();
var oSplitContainer = new sap.m.SplitContainer({mode: sap.m.SplitAppMode.ShowHideMode});
......@@ -133,12 +133,14 @@ sap.ui.jsview("conceptmapper.searchPage", {
var oMasterPage = new sap.m.Page({
title : "{i18n>filters}",
showNavButton : true,
navButtonPress : function(oEvt) {
app.back();
},
// navButtonPress : function(oEvt) {
// app.back();
// },
content : [ oMiniIB, oMaxiIB, oDomainMCB, oVocMCB, oStandardMCB, oValidMCB,
oLangMCB, ],
mode:"SingleSelectMaster",
});
......@@ -166,6 +168,16 @@ sap.ui.jsview("conceptmapper.searchPage", {
}) ]
});
var oRowsPerLignTemplate = new sap.ui.core.Item({
key : "{RowsPerLignModel>key}",
text : "{RowsPerLignModel>text}",
enabled : "{RowsPerLignModel>enabled}"
});
var oTable = new sap.ui.table.Table({
id : "oTable",
toolbar : new sap.m.Toolbar({
......@@ -181,6 +193,29 @@ sap.ui.jsview("conceptmapper.searchPage", {
// type : "Reject",
// press : [ oController.openDeleteDialog, oController ],
// }),
// new sap.m.Input({
// id : "oRowInPageInput",
// placeholder : "{i18n>config_items_per_page}",
// }).addStyleClass('rowInPageInput'),
//
new sap.m.Label({
text : "{i18n>config_items_per_page}"
}), new sap.m.ComboBox({
// width : "400px",
//placeholder : "Standard Concepts",
id: "oRowInPageInput",
items : {
path : "RowsPerLignModel>/items",
template : oRowsPerLignTemplate
},
selectedKey : {
path : "RowsPerLignModel>/selected",
template : "{RowsPerLignModel>selected}"
}
}).addStyleClass('rowInPageInput'),
new sap.m.SearchField({
id: 'searchField',
placeholder : "{i18n>research}",
......@@ -193,6 +228,7 @@ sap.ui.jsview("conceptmapper.searchPage", {
highlight:"{conceptsModel>status}"
})
});
debugger;
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
......@@ -327,10 +363,24 @@ sap.ui.jsview("conceptmapper.searchPage", {
var icoToolbar = new sap.m.IconTabBar({
expandable : false,
expanded : false,
items : [ new sap.m.IconTabFilter({
text : "Concepts",
showAll : true,
count : "{conceptsModel>/num_found}",
items : [
// new sap.m.IconTabFilter({
// text : "{i18n>concepts_shown}",
// showAll : true,
// count : "{conceptsModel>/num_shown}",
// enabled:false,
//
// }),
// new sap.m.IconTabSeparator(),
new sap.m.IconTabFilter({
text : "{i18n>concepts_found}",
showAll : true,
count : "{conceptsModel>/num_found}",
enabled:false,
}),
// }), new sap.m.IconTabFilter({
// text : "Valid",
// icon : "sap-icon://message-success",
......@@ -351,8 +401,8 @@ sap.ui.jsview("conceptmapper.searchPage", {
// icon : "sap-icon://message-success",
// count : "{conceptsModel>/total_valid_concepts}",
}) ]
});
]
}).addStyleClass('notClickableTab');
var oDetailPage = new sap.m.Page({
......@@ -369,10 +419,10 @@ sap.ui.jsview("conceptmapper.searchPage", {
// }) ],
content : [ icoToolbar, oTable ],
footer: new sap.m.Bar({
contentRight: new sap.m.Input({
id : "oRowInPageInput",
placeholder : "Rows per page : 15",
}),
// contentRight: new sap.m.Input({
// id : "oRowInPageInput",
// placeholder : "Rows per page : 15",
// }),
contentMiddle: [
......@@ -429,19 +479,35 @@ sap.ui.jsview("conceptmapper.searchPage", {
contentLeft: new sap.m.Button({
id: "hideShowFilter",
text: "{i18n>hide_show}",
text: "{i18n>filters}",
type : "Reject",
press: function(){
if (oSplitContainer.getMode() === 'ShowHideMode') {
oSplitContainer.setMode(sap.m.SplitAppMode.HideMode);
oDetailPage.setShowNavButton(true);
oMasterPage.setShowNavButton(false);
sap.ui.getCore().byId("__container1-Master").toggleStyleClass("toggle-masterPage");
// if (sap.ui.getCore().byId("__container1-Master").hasStyleClass("toggle-masterPage")) {
// var lol = "{i18n>show_filter}";
// this.setText(lol);
// } else {
// this.setText("{i18n>hide_filter}");
//
//
// }
} else if (oSplitContainer.getMode() === 'HideMode') {
oSplitContainer.setMode(sap.m.SplitAppMode.ShowHideMode);
oDetailPage.setShowNavButton(false);
oMasterPage.setShowNavButton(true);
}
// if (oSplitContainer.getMode() === 'ShowHideMode') {
// oSplitContainer.setMode(sap.m.SplitAppMode.HideMode);
// oDetailPage.setShowNavButton(true);
// oMasterPage.setShowNavButton(false);
// } else if (oSplitContainer.getMode() === 'HideMode') {
// oSplitContainer.setMode(sap.m.SplitAppMode.ShowHideMode);
// sap.ui.getCore().byId("__page2-intHeader-BarLeft").addStyleClass('__page2-intHeader-BarLeft');
// oDetailPage.setShowNavButton(false);
// oMasterPage.setShowNavButton(true);
// }
}
......@@ -451,11 +517,12 @@ sap.ui.jsview("conceptmapper.searchPage", {
// Master and detail in one Page
oSplitContainer.addMasterPage(oMasterPage);
oSplitContainer.addDetailPage(oDetailPage);
return oSplitContainer;
}
......
.searchField {
width: 75% !important;
padding-left: 20% !important;
width: 73% !important;
padding-left: 15% !important;
}
.goTo {
......@@ -15,4 +15,21 @@
.searchPage {
padding-top:100% !important;
}
\ No newline at end of file
}
.__bar1--header {
box-shadow: None !important;
}
.rowInPageInput {
width: 5%! important;
}
.__page1-navButton {
width: 0px;
}
.toggle-masterPage {
display:None;
}
......@@ -30,6 +30,9 @@ domain_label=Choose your domain
vocabulary_label=Choose your vocabulary
language_label=Choose your language
filters=Filters
config_items_per_page=Items per page
concepts_shown=Item(s) per page
concepts_found=Item(s) (total)
create_concept=Create
update_concept=Update
delete_concept=Delete
......@@ -41,6 +44,6 @@ vocabulary_id=Vocabulary
domain_id=Domain
validity=Validity
standard_concept=Standard
hide_show=Hide-Show Filters
filters=Filters
previous=Previous
next=Next
\ No newline at end of file
......@@ -30,6 +30,9 @@ domain_label=Filtrer selon le domaine
vocabulary_label=Fitrer selon le vocabulaire
language_label=Filtrer selon la langue
filters=Filtres
config_items_per_page=Items par page
concepts_shown=Item(s) par page
concepts_found=Item(s) (total)
create_concept=Cr\u00e9ation
update_concept=Actualisation
delete_concept=Suppression
......@@ -41,6 +44,6 @@ vocabulary_id=Vocabulaire
domain_id=Domain
validity=Validit\u00e9
standard_concept=Standard
hide_show=Cacher-Montrer les filtres
filters=Filtres
previous=Pr\u00e9c\u00e9dent
next=Suivant
\ No newline at end of file
......@@ -48,9 +48,11 @@
}));
//var shell = new sap.m.Shell();
//shell.setApp(app);
app.placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment