Skip to content

Commit

Permalink
Dev: new question explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Dec 29, 2015
1 parent c819f6f commit 8dc9d3a
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 43 deletions.
83 changes: 41 additions & 42 deletions application/views/admin/super/_question_explorer.php
Expand Up @@ -15,55 +15,54 @@
<div id="explorer-lvl1" class="panel-collapse collapse" >
<div class="panel-body">
<ul class="nav navbar-nav dropdown-first-level" id="explorer-container">
<?php if(count($aGroups)):?>
<?php foreach($aGroups as $aGroup):?>
<li class="panel panel-default dropdownstyle" id="">

<!-- Group Name -->
<a data-toggle="collapse" id="" href="#questiongroup-<?php echo $aGroup->gid; ?>" class="question-group-collapse">
<span class="question-group-collapse-title"><?php echo $aGroup->group_name;?><span class="caret"></span></span>
</a>
<!-- Groups and questions-->
<?php if(count($aGroups)):?>
<li class="panel panel-default dropdownstyle" id="questionexplorer-group-container">

<div id="questiongroup-<?php echo $aGroup->gid; ?>" class="panel-collapse collapse questiongroupdropdown" >
<div class="panel-body">
<ul class="nav navbar-nav dropdown-first-level">
<?php foreach($aGroups as $aGroup):?>

<?php if(count($aGroup['aQuestions'])):?>
<?php foreach($aGroup['aQuestions'] as $question):?>
<!-- Question -->
<?php if($question->parent_qid == 0):?>
<!-- Group -->
<div class="row explorer-group-title">
<div class="col-sm-8">
<a href="#" data-question-group-id="<?php echo $aGroup->gid; ?>" class="explorer-group">
<span id="caret-<?php echo $aGroup->gid; ?>" class="fa fa-caret-right caret-explorer-group"></span>&nbsp&nbsp<?php echo $aGroup->group_name;?>
</a>
</div>
<div class="col-sm-3">
<!-- add question to this group -->
<a class="" href="<?php echo $this->createUrl("/admin/questions/sa/newquestion/surveyid/$iSurveyId/gid/$aGroup->gid"); ?>">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
</div>
</div>

<li class="toWhite">
<a href="<?php echo $this->createUrl("/admin/questions/sa/view/surveyid/$iSurveyId/gid/".$aGroup->gid."/qid/".$question->qid); ?>"">
<span class="question-collapse-title">
<span class="glyphicon glyphicon-list"></span>
<strong><?php echo sanitize_html_string($question->title);?> </strong>
<br/><em> <?php echo substr(sanitize_html_string($question->question), 0, 40);?></em>
</span>
</a>
</li>
<?php endif;?>
<?php endforeach; ?>
<?php else:?>
<li class="toWhite">
<a href="" onclick="event.preventDefault();" style="cursor: default;">
<?php eT('no questions in this group');?>
<!-- Questions -->
<div class="row" id="questions-group-<?php echo $aGroup->gid; ?>" style="display: none;">
<div class="col-sm-12">
<?php if(count($aGroup['aQuestions'])):?>
<?php foreach($aGroup['aQuestions'] as $question):?>
<?php if($question->parent_qid == 0):?>
<a href="<?php echo $this->createUrl("/admin/questions/sa/view/surveyid/$iSurveyId/gid/".$aGroup->gid."/qid/".$question->qid); ?>">
<span class="question-collapse-title">
<span class="glyphicon glyphicon-list"></span>
<strong><?php echo sanitize_html_string($question->title);?> </strong>
<br/><em> <?php echo substr(sanitize_html_string($question->question), 0, 40);?></em>
</span>
</a>
</li>
<?php endif;?>

<!-- add question to this group -->
<li>
<a class="text-success" href="<?php echo $this->createUrl("/admin/questions/sa/newquestion/surveyid/$iSurveyId/gid/$aGroup->gid"); ?>">
<span class="glyphicon glyphicon-plus-sign"></span>
<?php eT('Add new question to group');?>
</a>
</li>
</ul>
<?php endif; ?>
<?php endforeach;?>
<?php else:?>
<a href="" onclick="event.preventDefault();" style="cursor: default;">
<?php eT('no questions in this group');?>
</a>
<?php endif;?>
</div>
</div>
</li>
<?php endforeach;?>
<?php endforeach;?>
</li>


<?php else:?>
<li class="toWhite">
<a href="" onclick="event.preventDefault();" style="cursor: default;">
Expand Down
Binary file not shown.
12 changes: 12 additions & 0 deletions styles/Sea_Green/css/lime-admin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion styles/Sea_Green/css/lime-admin.css.map

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions styles/Sea_Green/css/lime-admin.scss
Expand Up @@ -4677,3 +4677,18 @@ span[data-tooltip] {
{
width: auto;
}

#sideMenu #dropdown #explorer li#questionexplorer-group-container, #sideMenu #dropdown li#questionexplorer-group-container > a{
line-height: 1.4;
}

#sideMenu #dropdown #explorer li#questionexplorer-group-container:hover, #sideMenu #dropdown li#questionexplorer-group-container:hover > a{
background-color: #fafafa;
color: $color_deep_fir_approx;
font-weight: 400;
line-height: 1.4;
}

.explorer-group-title {
margin-top: 1em;
}
11 changes: 11 additions & 0 deletions styles/Sea_Green/scripts/sidemenu.js
Expand Up @@ -286,6 +286,17 @@ $(document).ready(function(){
$sidemenu.removeClass('exploring');
});

$('.explorer-group').click(function(){
$that = $(this);
$gid = $that.data('question-group-id');
$questionGroup = $('#questions-group-'+$gid);
$groupCaret = $('#caret-'+$gid);
$questionGroup.toggle(500);
$groupCaret.toggleClass('fa-caret-right');
$groupCaret.toggleClass('fa-caret-down');
return false;
});

});


Expand Down

0 comments on commit 8dc9d3a

Please sign in to comment.