Skip to content

Commit

Permalink
Merge pull request #478 from Shnoulle/master_fontawesome
Browse files Browse the repository at this point in the history
New feature #10954 : always add font-awesome in public and admin
  • Loading branch information
Shnoulle committed Apr 24, 2016
2 parents dbf9ffe + 237af25 commit 84e4ac6
Show file tree
Hide file tree
Showing 99 changed files with 1,557 additions and 8,630 deletions.
8 changes: 8 additions & 0 deletions application/config/third_party.php
Expand Up @@ -31,6 +31,14 @@
)
),

'fontawesome' => array(
//'basePath' => 'third_party.bootstrap', // Need fix third_party alias
'baseUrl' => 'third_party/fontawesome/',
'css'=> array(
'css/font-awesome.min.css',
),
),

// jQuery UI
'jqueryui' => array(
'baseUrl' => 'third_party/jqueryui/',
Expand Down
12 changes: 0 additions & 12 deletions application/controllers/survey/index.php
Expand Up @@ -36,27 +36,15 @@ public function run()
$param = $this->_getParameters(func_get_args(), $_POST);
$surveyid = $param['sid'];

// Font awesome
if(!YII_DEBUG)
{
App()->getClientScript()->registerCssFile( App()->getAssetManager()->publish( dirname(Yii::app()->request->scriptFile).'/styles-public/font-awesome-43.min.css') );
}
else
{
App()->getClientScript()->registerCssFile( Yii::app()->getBaseUrl(true).'/styles-public/font-awesome-43-debugmode.min.css' );
}

$oTemplate = Template::model()->getInstance('', $surveyid);
$this->oTemplate = $oTemplate;

App()->clientScript->registerScript('sLSJavascriptVar',$sLSJavascriptVar,CClientScript::POS_HEAD);
App()->clientScript->registerScript('setJsVar',"setJsVar();",CClientScript::POS_BEGIN);// Ensure all js var is set before rendering the page (User can click before $.ready)

foreach($oTemplate->packages as $package)
{
App()->getClientScript()->registerPackage($package);
}

App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts')."survey_runtime.js");


Expand Down
5 changes: 3 additions & 2 deletions application/helpers/common_helper.php
Expand Up @@ -7047,6 +7047,7 @@ function getLabelSets($languages = null)

function getHeader($meta = false)
{
/* Todo : move this to layout/public.html */
global $embedded,$surveyid ;
Yii::app()->loadHelper('surveytranslator');

Expand All @@ -7063,7 +7064,7 @@ function getHeader($meta = false)
{
$languagecode = Yii::app()->getConfig('defaultlang');
}

App()->getClientScript()->registerPackage('fontawesome');
$header= "<!DOCTYPE html>\n"
. "<html lang=\"{$languagecode}\"";

Expand All @@ -7082,7 +7083,7 @@ function getHeader($meta = false)
return $header;
}

global $embedded_headerfunc;
global $embedded_headerfunc; // Did this work ? Can be removed or not ?
if ( function_exists( $embedded_headerfunc ) )
return $embedded_headerfunc($header);
Expand Down
12 changes: 1 addition & 11 deletions application/views/admin/super/header.php
Expand Up @@ -15,17 +15,7 @@
// jQuery plugins
App()->getClientScript()->registerPackage('jqueryui');
App()->getClientScript()->registerPackage('jquery-cookie');

// Font awesome
if(!YII_DEBUG)
{
App()->getClientScript()->registerCssFile( App()->getAssetManager()->publish( dirname(Yii::app()->request->scriptFile).'/styles-public/font-awesome-43.min.css') );
}
else
{
App()->getClientScript()->registerCssFile( Yii::app()->getBaseUrl(true).'/styles-public/font-awesome-43-debugmode.min.css' );
}

App()->getClientScript()->registerPackage('fontawesome');
// Bootstrap
App()->bootstrap->register();

Expand Down
3 changes: 2 additions & 1 deletion application/views/layouts/installer.php
Expand Up @@ -11,11 +11,12 @@
<?php
App()->getClientScript()->registerPackage('jqueryui');
App()->bootstrap->register();
App()->getClientScript()->registerPackage('fontawesome');

App()->getClientScript()->registerCssFile(App()->baseUrl . '/styles/Sea_Green/css/lime-admin-colors.css');
App()->getClientScript()->registerCssFile(App()->baseUrl . '/styles/Sea_Green/css/lime-admin-common.css');
App()->getClientScript()->registerCssFile(App()->baseUrl . '/installer/css/main.css');
App()->getClientScript()->registerCssFile(App()->baseUrl . '/installer/css/fonts.css');
App()->getClientScript()->registerCssFile(App()->baseUrl . '/installer/css/font-awesome.css');

$script = "$(function() {
$('.on').animate({
Expand Down
64 changes: 32 additions & 32 deletions application/views/survey/questions/arrays/dualscale/answer.php
Expand Up @@ -62,7 +62,7 @@

<!-- Render header -->
<?php echo Yii::app()->getController()->renderPartial(
'/survey/questions/arrays/dualscale/answer_header',
'/survey/questions/arrays/dualscale/answer_header',
array(
'labelans0' => $labelans0,
'labelans1' => $labelans1,
Expand All @@ -71,7 +71,7 @@
'class' => ''
),
true
);
);
?>

</thead>
Expand Down Expand Up @@ -107,24 +107,24 @@
<th class="answertext">

<?php echo $ansrow['hiddenfield']; ?>

<?php if ($ansrow['showmandatoryviolation']): ?>
<div class="label label-danger">
<span class="glyphicon glyphicon-exclamation-sign"></span>&nbsp;
<span class="fa fa-exclamation-circle" aria-hidden="true"></span>
<?php echo $ansrow['answertext']; ?>
</div>
<?php else: ?>
<?php echo $ansrow['answertext']; ?>
<?php endif; ?>


<input type="hidden" disabled="disabled" name="java<?php echo $ansrow['myfid0']; ?>"
<input type="hidden" disabled="disabled" name="java<?php echo $ansrow['myfid0']; ?>"
id="java<?php echo $ansrow['myfid0']; ?>" value=""
<?php echo $ansrow['sessionfname0']; ?>
/>

<?php if (count($labelans1) > 0): ?>
<input type="hidden" disabled="disabled" name="java<?php echo $ansrow['myfid1']; ?>"
<input type="hidden" disabled="disabled" name="java<?php echo $ansrow['myfid1']; ?>"
id="java<?php echo $ansrow['myfid1']; ?>" value=""
<?php echo $ansrow['sessionfname1']; ?>
/>
Expand All @@ -138,11 +138,11 @@
<td class='visible-xs'><em><?php echo $leftheader; ?></em></td>
<?php endif; ?>
<td data-title='<?php echo $ld; ?>' class="answer_cell_1_<?php echo $ld; ?> answer-item <?php echo $answertypeclass; ?>-item text-center radio">
<input
class="radio"
type="radio"
name="<?php echo $ansrow['myfname0']; ?>"
value="<?php echo $ld; ?>"
<input
class="radio"
type="radio"
name="<?php echo $ansrow['myfname0']; ?>"
value="<?php echo $ld; ?>"
id="answer<?php echo $ansrow['myfid0']; ?>-<?php echo $ld; ?>"
<?php echo $labelcode0_checked[$ansrow['title']][$ld]; ?>
/>
Expand All @@ -156,11 +156,11 @@ class="radio"
<td data-title='' class="dual_scale_separator information-item">
<?php if ($shownoanswer): // No answer for accessibility and no javascript (but hide hide even with no js: need reworking) ?>
<label for='answer<?php echo $ansrow['myfid0']; ?>-'>
<input
class='radio jshide read'
type='radio'
name='<?php echo $ansrow['myfname0']; ?>'
value=''
<input
class='radio jshide read'
type='radio'
name='<?php echo $ansrow['myfname0']; ?>'
value=''
id='answer<?php echo $ansrow['myfid0']; ?>-'
<?php echo $myfname0_notset; ?>
/>
Expand All @@ -174,11 +174,11 @@ class='radio jshide read'
<td class='visible-xs'><em><?php echo $rightheader; ?></em></td>
<?php endif; ?>
<td data-title='<?php echo $labelans1[$k]; ?>' class="answer_cell_2_<?php echo $ld; ?> answer-item radio-item text-center radio">
<input
class="radio"
type="radio"
name="<?php echo $ansrow['myfname1']; ?>"
value="<?php echo $ld; ?>"
<input
class="radio"
type="radio"
name="<?php echo $ansrow['myfname1']; ?>"
value="<?php echo $ld; ?>"
id="answer<?php echo $ansrow['myfid1']; ?>-<?php echo $ld; ?>"
<?php echo $labelcode1_checked[$ansrow['title']][$ld]; ?>
/>
Expand All @@ -200,24 +200,24 @@ class="radio"
<?php if ($shownoanswer): ?>
<td data-title='<?php eT("No answer"); ?>' class="dual_scale_no_answer answer-item radio-item noanswer-item text-center radio">
<?php if (count($labelans1) > 0): ?>
<input
class='radio'
type='radio'
name='<?php echo $ansrow['myfname1']; ?>'
value=''
<input
class='radio'
type='radio'
name='<?php echo $ansrow['myfname1']; ?>'
value=''
id='answer<?php echo $ansrow['myfid1']; ?>-'
<?php echo $myfname1_notset; ?>
/>
<label for='answer<?php echo $ansrow['myfid1']; ?>-'>
<span class="hide label-text"><?php eT("No answer"); ?></span>
</label>
<?php else: ?>
<input
data-title='<?php eT("No answer"); ?>'
class='radio'
type='radio'
name='<?php echo $ansrow['myfname0']; ?>'
value=''
<input
data-title='<?php eT("No answer"); ?>'
class='radio'
type='radio'
name='<?php echo $ansrow['myfname0']; ?>'
value=''
id='answer<?php echo $ansrow['myfid0']; ?>-'
<?php echo $myfname0_notset; ?>
/>
Expand Down
Expand Up @@ -25,7 +25,7 @@
</label>

<span class='col-xs-12 col-sm-4'>
<i class='glyphicon glyphicon-calendar form-control-feedback'></i>
<i class='fa fa-calendar form-control-feedback' aria-hidden='true'></i>
<input
class='form-control popupdate'
type="text"
Expand Down
Expand Up @@ -5,6 +5,6 @@
*/
?>
<p class='errormandatory text-danger' role='alert'>
<span class='glyphicon glyphicon-exclamation-sign'></span>
<span class='fa fa-exclamation-circle' aria-hidden="true"></span>
<?php echo $sMandatoryText; ?>
</p>
Expand Up @@ -6,6 +6,6 @@
?>
<!-- views/survey/system/questionhelp -->
<div class="text-info questionhelp">
<span class="glyphicon glyphicon-question-sign"></span>
<span class="fa fa-question-circle" aria-hidden="true"></span>
&nbsp;<?php echo $questionHelp; ?>
</div>
4 changes: 2 additions & 2 deletions application/views/survey/system/questionhelp/tips.php
Expand Up @@ -8,6 +8,6 @@
?>
<div id='vmsg_<?php echo $qid; ?>_<?php echo $vclass; ?>' class='em_<?php echo $vclass; ?> emtip '>

<span class='glyphicon glyphicon-info-sign'></span>
&nbsp;<?php echo $vtip; ?>
<span class='fa fa-exclamation-circle' aria-hidden="true"></span>
<?php echo $vtip; ?>
</div>
13 changes: 8 additions & 5 deletions application/views/surveys/publicSurveyList.php
Expand Up @@ -7,11 +7,14 @@
$list .= CHtml::link($survey->localizedTitle, array('survey/index', 'sid' => $survey->sid, 'lang' => App()->language), array('class' => 'surveytitle btn btn-primary'));
if ($survey->publicstatistics == "Y")
{
//$list .= CHtml::link('(' . gT('View statistics') . ')', array('statistics_user/action', 'surveyid' => $survey->sid,'language' => App()->language));
$list .= '<a class="view-stats btn btn-success" data-toggle="tooltip" title="'.gT('View statistics').'" href="'.App()->createUrl('statistics_user/action/surveyid/'.$survey->sid.'/language/'.App()->language).'">';
$list .= ' <span class="glyphicon glyphicon-stats"></span>';
//$list .= ' (' . gT('View statistics') . ')';
$list .= '</a>';
$list .= CHtml::link('<span class="fa fa-bar-chart" aria-hidden="true"></span><span class="sr-only">'. gT('View statistics') .'</span>',
array('statistics_user/action', 'surveyid' => $survey->sid,'language' => App()->language),
array(
'class'=>'view-stats btn btn-success',
'title'=>gT('View statistics'),
'data-toggle'=>'tooltip',
)
);
}
$list .= CHtml::closeTag('li');

Expand Down

0 comments on commit 84e4ac6

Please sign in to comment.