Skip to content
This repository has been archived by the owner on Oct 8, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:thaddeusmt/swomaha
Browse files Browse the repository at this point in the history
  • Loading branch information
thaddeusmt committed Sep 18, 2011
2 parents 7cf7330 + 8d9ea83 commit b4884c9
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 49 deletions.
2 changes: 1 addition & 1 deletion protected/views/app/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php echo $form->errorSummary($model); ?>

<div class="row">
<?php echo $form->labelEx($model,'name'); ?>
<h3 style="margin:0px;"><?php echo $form->labelEx($model,'name'); ?></h3>
<?php echo $form->textField($model,'name',array('size'=>45,'maxlength'=>45)); ?>
<?php echo $form->error($model,'name'); ?>
</div>
50 changes: 26 additions & 24 deletions protected/views/app/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,29 @@
);
?>

<h1> Create App </h1>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'App-form',
'enableAjaxValidation'=>true,
));
echo $this->renderPartial('_form', array(
'model'=>$model,
'form' =>$form
)); ?>

<div class="row buttons">
<?php
$url = array(Yii::app()->request->getQuery('returnTo'));
if(empty($url[0]))
$url = array('App/admin');
echo CHtml::Button(Yii::t('app', 'Cancel'), array('submit' => $url)); ?>&nbsp;
<?php echo CHtml::submitButton(Yii::t('app', 'Create')); ?>
</div>

<?php $this->endWidget(); ?>

</div>
<div style="margin:20px 0px;padding:10px;border:1px solid #888;-moz-border-radius:4px;border-radius:4px;background:#f5f5f5;">
<h1>New App</h1>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'App-form',
'enableAjaxValidation'=>true,
));
echo $this->renderPartial('_form', array(
'model'=>$model,
'form' =>$form
)); ?>

<div class="row buttons">
<?php
$url = array(Yii::app()->request->getQuery('returnTo'));
if(empty($url[0]))
$url = array('App/admin');
echo CHtml::Button(Yii::t('app', 'Cancel'), array('submit' => $url)); ?>&nbsp;
<?php echo CHtml::submitButton(Yii::t('app', 'Create')); ?>
</div>

<?php $this->endWidget(); ?>

</div>
</div>
1 change: 1 addition & 0 deletions protected/views/app/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
)); ?>
<div class="actions" style="margin-bottom:20px;float:right;clear:right;"><a href="/app/create" style="-moz-border-radius:8px;border-radius:8px;border:1px solid #888;display:inline-block;padding:6px 6px 6px 34px;background:#eee url(/images/add.png) no-repeat 4px 50%;">Add App</a></div>
11 changes: 4 additions & 7 deletions protected/views/app/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@
echo $this->renderPartial('_view', array(
'model'=>$model['App'],
'link' => true
)); ?>
<div class="challenges" style="margin:20px 0px;padding:10px;border:1px solid #555;-moz-border-radius:4px;border-radius:4px;background:#efefef url(/images/brain-icon.png) 98% 6px no-repeat;">
<?php
));
if(sizeof($model['Challenge']) > 0) { ?>

<div class="challenges" style="margin:20px 0px;padding:10px;border:1px solid #555;-moz-border-radius:4px;border-radius:4px;background:#efefef url(/images/brain-icon.png) 98% 6px no-repeat;">
<h2>Challenges</h2>
<?php foreach($model['Challenge'] as $challenge) {
echo $this->renderPartial('/challenge/_view', array(
'model'=>$challenge,
'form' =>$form,
'link' => true
)); ?>
<?php }?>
</div>
<?php } else {
echo '<p style="float:left;">No challenges found.</p>';
echo '<p style="margin:14px;float:left;">No challenges found.</p>';
}?>
</div>
<div class="actions" style="margin-bottom:20px;float:right;clear:right;"><a href="/challenge/create/id/<?php echo $model['App']->id?>" style="-moz-border-radius:8px;border-radius:8px;border:1px solid #888;display:inline-block;padding:6px 6px 6px 34px;background:#eee url(/images/add.png) no-repeat 4px 50%;">Add Challenge</a></div>
4 changes: 3 additions & 1 deletion protected/views/assessment/_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
$actions .= '<a style="margin:0px 6px;" href="/assessment/delete/id/'.$data->id.'" onclick="return confirm(\'Are you sure you want to delete this challenge? All related questions will be permnently deleted.\');"><img style="height:20px;vertical-align:middle;" src="/images/delete.png" alt="Delete"/></a>';
$actions .= '</div>';
$style = 'margin:8px 0px;padding:5px;border:1px solid #666;-moz-border-radius:4px;-border-radius:4px;background-color:#fefefe;';
$h2Style = 'border-bottom:none;';
} else {
$title = $model->name;
$description = $model->description;
$actions = '';
$style = 'margin:20px 0px;padding:10px;border:1px solid #555;-moz-border-radius:4px;border-radius:4px;background:#efefef url(/images/brain-icon.png) 98% 6px no-repeat;';
$h2Style = '';
}?>
<div class="question" style="<?php echo $style;?>">
<?php echo $actions;?>
<h2 style="margin:0px;"><?php echo $title;?></h2>
<h2 style="margin:0px;<?php echo $h2Style;?>"><?php echo $title;?></h2>
</div>
2 changes: 1 addition & 1 deletion protected/views/assessment/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
);
?>

<h1> Create Assessment </h1>
<h1>Create Assessment</h1>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
Expand Down
29 changes: 21 additions & 8 deletions protected/views/assessment/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,39 @@
array('label'=>Yii::t('app', 'Manage') . ' Assessment', 'url'=>array('admin')),
);
?>

<div style="margin:20px 0px;padding:10px;border:1px solid #555;-moz-border-radius:4px;border-radius:4px;background:#efefef">
<h1><em><?php echo $model['Assessment']->name?></em></h1>
<?php
if(sizeof($model['AssessmentQuestion']) > 0) { ?>

<h2>Multiple Choice Questions</h2>
<?php foreach($model['AssessmentQuestion'] as $question) {?>
<div class="question" style="margin:8px 0px;padding:5px;border:1px solid black;background-color:#eee;">
<?php echo $question->prompt;?>
</div>
<?php foreach($model['AssessmentQuestion'] as $question) {
$actions = '<div class="actions" style="float:right;line-height:30px;">';
$actions .= '<a style="margin:0px 6px;" href="/assessment/updateMultipleChoice/id/'.$question->id.'"><img style="height:20px;vertical-align:middle;" src="/images/edit.png" alt="Edit"/></a>';
$actions .= '<a style="margin:0px 6px;" href="/assessment/deleteMultipleChoice/id/'.$question->id.'" onclick="return confirm(\'Are you sure you want to permanently delete this question?\');"><img style="height:20px;vertical-align:middle;" src="/images/delete.png" alt="Delete"/></a>';
$actions .= '</div>';
?>
<div class="question" style="min-height:30px;-moz-border-radius:4px;border-radius:4px;margin:8px 0px;padding:5px;border:1px solid black;background-color:#fefefe;">
<?php echo $actions; ?>
<a href=""><?php echo $question->prompt;?></a>
</div>
<?php }?>
<?php }
if(sizeof($model['AssessmentFreeform']) > 0) { ?>
<h2>Free Form Questions</h2>
<?php foreach($model['AssessmentFreeform'] as $question) {?>
<div class="question" style="margin:8px 0px;padding:5px;border:1px solid black;background-color:#eee;">
<?php foreach($model['AssessmentFreeform'] as $question) {
$actions = '<div class="actions" style="float:right;line-height:30px;">';
$actions .= '<a style="margin:0px 6px;" href="/assessment/updateMultipleChoice/id/'.$question->id.'"><img style="height:20px;vertical-align:middle;" src="/images/edit.png" alt="Edit"/></a>';
$actions .= '<a style="margin:0px 6px;" href="/assessment/deleteMultipleChoice/id/'.$question->id.'" onclick="return confirm(\'Are you sure you want to permanently delete this question?\');"><img style="height:20px;vertical-align:middle;" src="/images/delete.png" alt="Delete"/></a>';
$actions .= '</div>';
?>
<div class="question" style="-moz-border-radius:4px;border-radius:4px;margin:8px 0px;padding:5px;border:1px solid black;background-color:#fefefe;">
<?php echo $actions; ?>
<?php echo $question->prompt;?>
</div>
<?php }?>
<?php }?>

</div>
<div class="actions">Add <?php echo CHtml::link('Freeform', array('assessment/addFreeform/id/'.$model['Assessment']->id));?> | <?php echo CHtml::link('Multiple Choice', array('assessment/addMultipleChoice/id/'.$model['Assessment']->id));?></div>


6 changes: 3 additions & 3 deletions protected/views/challenge/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<?php echo $form->errorSummary($model); ?>

<div style="float:left;margin-right:40px;">
<h2 style="margin:0px;">Name <span class="required">*</span></h2>
<h3 style="margin:0px;">Name <span class="required">*</span></h3>
<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div style="float:left;">
<h2 style="margin-bottom:0px;">Type <span class="required">*</span></h2>
<h3 style="margin-bottom:0px;">Type <span class="required">*</span></h3>
<?php echo CHtml::activeDropDownList($model, 'type', array(
'video' => Yii::t('app', 'video') ,
'reading' => Yii::t('app', 'reading') ,
Expand All @@ -18,7 +18,7 @@
</div>

<div style="clear:left;">
<h2 style="margin-bottom:0px;">Description <span class="required">*</span></h2>
<h3 style="margin-bottom:0px;">Description <span class="required">*</span></h3>
<?php
$this->widget('application.extensions.ckeditor.CKEditorWidget',
array(
Expand Down
4 changes: 3 additions & 1 deletion protected/views/challenge/_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
$actions .= '<a style="margin:0px 6px;" href="/challenge/delete/id/'.$data->id.'" onclick="return confirm(\'Are you sure you want to delete this challenge? All related questions will be permnently deleted.\');"><img style="height:20px;vertical-align:middle;" src="/images/delete.png" alt="Delete"/></a>';
$actions .= '</div>';
$style = 'margin:8px 0px;padding:5px;border:1px solid #666;-moz-border-radius:4px;-border-radius:4px;background-color:#fefefe;';
$h2Style = 'border-bottom:none;';
} else {
$title = $model->name;
$description = $model->description;
$actions = '';
$style = 'margin:20px 0px;padding:10px;border:1px solid #555;-moz-border-radius:4px;border-radius:4px;background:#fefefe url(/images/brain-icon.png) 98% 6px no-repeat;';
$h2Style = '';
}
?>
<div class="challenge" style="<?php echo $style; ?>">
<?php echo $actions;?>
<h2 style="margin:0px;"><?php echo $title;?></h2>
<h2 style="margin:0px;<?php echo $h2Style;?>"><?php echo $title;?></h2>
<?php echo $description;?>
</div>
2 changes: 1 addition & 1 deletion protected/views/student/_gameView.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div style="clear: both; padding: 10px; border: 2px solid #ccc; margin: 10px 0;">

<div style="float: left; margin-right: 15px; padding: 2px; border: 1px solid #ccc; ">
<?php echo CHtml::link(CHtml::image($data->image,CHtml::encode($data->name),array('style'=>'width:80px;')), array('student/game', 'id'=>$data->id)); ?>
<?php echo CHtml::link(CHtml::image('/images/apps/'.$data->image,CHtml::encode($data->name),array('style'=>'width:80px;')), array('student/game', 'id'=>$data->id)); ?>
</div>

<div style="float: left; width: 300px;">
Expand Down
3 changes: 1 addition & 2 deletions protected/views/student/game.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
Student::model()->findByPk(2),
Student::model()->findByPk(3),
);

?>

<h1 style="font-size: 34px; font-weight: bold"><?php echo $model->name; ?></h1>

<div style="width:400px; float: left; margin-right: 20px;">
<img style="width:400px;" src="<?php echo $model->image ?>" />
<img style="width:400px;" src="/images/apps/<?php echo $model->image ?>" />
<?php echo $model->description ?>

<h2 style="font-size: 24px; font-weight: bold; border-bottom: 2px solid #ccc;">Leaderboard</h2>
Expand Down

0 comments on commit b4884c9

Please sign in to comment.