Skip to content

Commit

Permalink
misc styling fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mah0001 committed Jan 17, 2024
1 parent d03eb00 commit dc2dfd2
Show file tree
Hide file tree
Showing 7 changed files with 781 additions and 671 deletions.
11 changes: 6 additions & 5 deletions application/views/editor_common/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@


<ul class="navbar-nav ml-auto">
<li class="nav-item">
<?php echo $this->load->view('user_menu/user-menu',null,true);?>
</li>
<li class="nav-item">
<li class="nav-item">
<?php echo $this->load->view('user_menu/lang-bar',null,true);?>
</li>
</li>

<li class="nav-item">
<?php echo $this->load->view('user_menu/user-menu',null,true);?>
</li>
</ul>


Expand Down
23 changes: 19 additions & 4 deletions application/views/metadata_editor/index_vuetify.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$template_parts=array();

//update template_parts
get_template_part($metadata_template_arr['items'],$template_parts);
//get_template_part($metadata_template_arr['items'],$template_parts);

function get_template_part($items,&$output)
{
Expand All @@ -37,8 +37,23 @@ function get_template_part($items,&$output)
if (isset($item['key'])){
$output[$item['key']]=$item;
}
}
}


get_template_keys($metadata_template_arr['items'],$template_keys);
function get_template_keys($items,&$output)
{
foreach($items as $item){
if (isset($item['items'])){
get_template_keys($item['items'],$output);
}
if (isset($item['key']) && $item['type']!='section' ){
$output[]=$item['key'];
}
}
}
}

?>

<style>
Expand All @@ -51,7 +66,7 @@ function get_template_part($items,&$output)
let sid='<?php echo $sid;?>';
let form_template=<?php echo $metadata_template;?>;
let form_template_parts= <?php echo json_encode($template_parts,JSON_PRETTY_PRINT); ?>;
let metadata_schema=<?php echo $metadata_schema;?>;
//let metadata_schema=<?php //echo $metadata_schema;?>;
</script>

<div id="app" data-app>
Expand Down Expand Up @@ -150,7 +165,7 @@ function get_template_part($items,&$output)
dataset_idno:project_idno,
dataset_type:project_type,
form_template: form_template,
metadata_schema: metadata_schema,
//metadata_schema: metadata_schema,
is_loading:false,
vuex_is_loaded:false,
loading_status:null,
Expand Down
42 changes: 38 additions & 4 deletions application/views/metadata_editor/index_vuetify_main_app.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
})

<?php

echo $this->load->view("metadata_editor/vue-toast-component.js",null,true);
echo $this->load->view("metadata_editor/vue-login-component.js",null,true);
echo $this->load->view("metadata_editor/fields/vue-field-date.js",null,true);

Expand Down Expand Up @@ -262,8 +262,8 @@
router.beforeEach((to, from, next)=>{
route_path=to.path.replace('/study/','');

if (!store.state.treeActiveNode){
if (store.state.formTemplateParts[route_path] !== undefined){
if (!store.state.treeActiveNode){
if (store.getters.getTemplateItemByKey(route_path)){
store.commit('tree_active_node_path',route_path);
}
}
Expand Down Expand Up @@ -441,6 +441,9 @@
getProjectType(state){
return state.project_type;
},
getProjectTemplate(state){
return state.formTemplate;
},
getDataFiles(state) {
return state.data_files;
},
Expand Down Expand Up @@ -503,6 +506,37 @@
getTreeItems(state){
return state.treeItems;
},
//find template item by key
getTemplateItemByKey: (state) => (key) => {

let findTemplateByItemKey= function (items,key){
let item=null;
let found=false;
let i=0;

while(!found && i<items.length){
if (items[i].key==key){
item=items[i];
found=true;
}else{
if (items[i].items){
item=findTemplateByItemKey(items[i].items,key);
if (item){
found=true;
}
}
}
i++;
}
return item;
}

//search nested formTemplate
let items=store.state.formTemplate.template.items;
let item=findTemplateByItemKey(items,route_path);

return item;
},
},
actions: {
async initData({commit},options) {
Expand Down Expand Up @@ -679,7 +713,7 @@
//state.treeActiveNode=state.formTemplateParts[node];
},
tree_active_node_path(state,node_key){
state.treeActiveNode=state.formTemplateParts[node_key];
state.treeActiveNode=store.getters.getTemplateItemByKey(node_key);
},
tree_active_node_data(state,node){
state.treeActiveNode=node;
Expand Down
106 changes: 27 additions & 79 deletions application/views/metadata_editor/layout.php
Original file line number Diff line number Diff line change
@@ -1,93 +1,31 @@
<v-app style="position:relative;height: 100vh">
<!--header-->

<nav class="main-header sticky-top navbar navbar-expand navbar-white navbar-light bg-light border-bottom" style="margin-left:0px;">

<ul class="navbar-nav">
<li class="nav-item">
<a href="<?php echo site_url();?>" title="<?php echo t("home");?>" role="button" class="nav-link"><i class="mdi mdi-home-outline"></i>
</a>
</li>
<li class="nav-item">
<a href="<?php echo site_url('editor');?>" class="nav-link"><i class="mdi mdi-folder-multiple-outline"></i> <?php echo t("my_projects");?>
</a>
</li>

<li class="nav-item">
<a href="<?php echo site_url('editor/templates');?>" role="button" class="nav-link btn btn-link"><i class="mdi mdi-alpha-t-box-outline"></i> <?php echo t("templates");?></a>
</li>
</ul>

<div class="pl-2 border-left ml-5">
<div class="d-flex flex-row">



<div>
<i style="font-size:x-large;" :class="project_types_icons[dataset_type]"></i>
</div>
<div>
<div style="font-size:20px;">&nbsp; <strong>{{Title}}</strong></div>
</div>
</div>
</div>

<div>{{this.loading_status}}</div>

<ul class="navbar-nav ml-5 ml-auto">

<div class="dropdown">
<a class="btn btn-link dropdown-toggle" href="#" role="button" id="dropdownProjectMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="far fa-folder-open"></i> <?php echo t("project");?>
</a>


<div class="dropdown-menu" aria-labelledby="dropdownProjectMenu">
<a class="dropdown-item" href="#/project-package">
<span style="font-size:20px;" class="mdi mdi-package-down"></span> <?php echo t("export_package_zip");?></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#/publish">
<span style="font-size:20px;" class="mdi mdi-arrow-top-right-thick"></span> <?php echo t("publish_to_nada");?></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#/generate-pdf"><span style="font-size:20px;" class="mdi mdi-file-pdf-box"></span> <?php echo t("pdf_documentation");?></a>
</div>
</div>

<div class="dropdown">
<a class="btn btn-link dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-random"></i> <?php echo t("metadata");?>
</a>

<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="#/import"><i class="fas fa-file-invoice"></i> <?php echo t("import_project_metadata");?></a>
<a class="dropdown-item" href="#/external-resources/import"><i class="fas fa-clone"></i> <?php echo t("import_external_resources");?></a>
<div class="dropdown-divider"></div>
<a v-if="dataset_type=='survey'" class="dropdown-item" :href="'<?php echo site_url('api/editor/ddi/'); ?>' + dataset_id" target="_blank"><i class="far fa-file-alt"></i> <?php echo t("export_ddi");?></a>
<a class="dropdown-item" :href="'<?php echo site_url('api/editor/json/'); ?>' + dataset_id" target="_blank"><i class="far fa-file-code"></i> <?php echo t("export_json");?></a>
<a class="dropdown-item" :href="'<?php echo site_url('api/resources/rdf/'); ?>' + dataset_id" target="_blank"><i class="far fa-file-alt"></i> <?php echo t("export_external_resources");?> (RDF/XML)</a>
<a class="dropdown-item" :href="'<?php echo site_url('api/resources/'); ?>' + dataset_id" target="_blank"><i class="far fa-file-alt"></i> <?php echo t("export_external_resources");?> (JSON)</a>
</div>
</div>

<li class="nav-item">
<?php echo $this->load->view('user_menu/user-menu', null, true); ?>
</li>

</ul>


<!--header-->

</nav>
<?php //echo $this->load->view('metadata_editor/header', array(), true); ?>

<!--end-header-->

<splitpanes class="default-theme splitpanes splitpanes--vertical" style="min-height: 100px">
<?php /* <div class="row no-gutters">
<div class="col-md-3 col-xl-2 col-xs-4 "> */?>
<splitpanes class="default-theme splitpanes splitpanes--vertical editor-split-panes" style="min-height: 100px">
<pane min-size="15" max-size="35" size="20" class="editor-sidebar">
<!--left -->

<div class="container-fluid bg-secondary-light pt-2 pb-3 editor-sidebar-container">
<div class="container-fluid-x pt-2 pb-3 editor-sidebar editor-sidebar-container" >

<div class="p-1 mb-3 pl-2 sticky-top" style="border-bottom:1px solid #343a40; color:#343a40">
<a href="<?php echo site_url('projects');?>" class="navbar-brand">
<i class="fas fa-compass" ></i>
<span class="brand-text font-weight-light color-white">Metadata Editor</span>
</a>
</div>

<!-- icons -->
<div class="pb-2 sidebar-menu-bar d-flex justify-content-center">
<div class="pb-2 mb-3 sidebar-menu-bar d-flex justify-content-center" style="border-bottom:1px solid #343a40; color:#343a40">



Expand Down Expand Up @@ -130,7 +68,7 @@



<div class="mb-5">
<div class="mb-5" >
<v-treeview color="warning" v-model="tree" :active.sync="tree_active_items" @update:open="treeOnUpdate" :open.sync="initiallyOpen" :items="items" activatable dense item-key="key" item-text="title" expand-icon="mdi-chevron-down" indeterminate-icon="mdi-bookmark-minus" on-icon="mdi-bookmark" off-icon="mdi-bookmark-outline" item-children="items">

<template #label="{ item }">
Expand Down Expand Up @@ -180,10 +118,16 @@
</div>
</div>
<!--end left-->
</pane>

</pane>
<?php /*
</div>*/ ?>
<?php /* <div class="col col-md-9 col-xl-10" style="height:100vh;overflow-y:scroll;">*/?>
<pane size="80" class="pane-main-content">
<!-- right -->


<?php echo $this->load->view('metadata_editor/header', array(), true); ?>

<div class="content-wrapper" style="margin-left:0px;">

Expand Down Expand Up @@ -240,4 +184,8 @@
<!--end right-->
</pane>
</splitpanes>
<?php /*</div>
</div>*/?>

<v-toast></v-toast>
</v-app>
Loading

0 comments on commit dc2dfd2

Please sign in to comment.