1
0

Added About page

This commit is contained in:
2014-05-14 11:15:32 +02:00
parent b8d8e888d2
commit a2b684eee1
16 changed files with 450 additions and 397 deletions

View File

@@ -5,4 +5,5 @@ RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Leite andernfalls auf index.php um
RewriteRule . index.php
RewriteRule . index.php

35
www/css/styles.css Normal file
View File

@@ -0,0 +1,35 @@
/* Footer
-------------------------------------------------- */
.footer {
padding: 70px 0;
margin-top: 70px;
border-top: 1px solid #e5e5e5;
background-color: #f5f5f5;
text-align: center;
}
.footer p {
margin-bottom: 0;
color: #777;
}
.footer-links {
margin: 10px 0;
}
.footer-links li {
display: inline;
margin-right: 10px;
}
/* Helper
-------------------------------------------------- */
.cstm-background-white {
background-color: white;
}
.cstm-main-navbar {
margin-bottom: 0px;
}

View File

@@ -49,7 +49,7 @@ return ArrayX::merge(array(
'urlManager'=>array(
'urlFormat' => 'path',
//'caseSensitive' => true,
'caseSensitive' => false,
'showScriptName' => true,
'rules'=>array(

View File

@@ -2,39 +2,13 @@
class SiteController extends Controller
{
/**
* Declares class-based actions.
*/
public function actions()
{
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha'=>array(
'class'=>'CCaptchaAction',
'backColor'=>0xFFFFFF,
),
// page action renders "static" pages stored under 'protected/views/site/pages'
// They can be accessed via: index.php?r=site/page&view=FileName
'page'=>array(
'class'=>'CViewAction',
),
);
}
public $selectedNav = '';
/**
* This is the default 'index' action that is invoked
* when an action is not explicitly requested by users.
*/
public function actionIndex()
{
// renders the view file 'protected/views/site/index.php'
// using the default layout 'protected/views/layouts/main.php'
$this->render('index');
}
/**
* This is the action to handle external exceptions.
*/
public function actionError()
{
if($error=Yii::app()->errorHandler->error)
@@ -46,64 +20,8 @@ class SiteController extends Controller
}
}
/**
* Displays the contact page
*/
public function actionContact()
public function actionAbout()
{
$model=new ContactForm;
if(isset($_POST['ContactForm']))
{
$model->attributes=$_POST['ContactForm'];
if($model->validate())
{
$name='=?UTF-8?B?'.base64_encode($model->name).'?=';
$subject='=?UTF-8?B?'.base64_encode($model->subject).'?=';
$headers="From: $name <{$model->email}>\r\n".
"Reply-To: {$model->email}\r\n".
"MIME-Version: 1.0\r\n".
"Content-Type: text/plain; charset=UTF-8";
mail(Yii::app()->params['adminEmail'],$subject,$model->body,$headers);
Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');
$this->refresh();
}
}
$this->render('contact',array('model'=>$model));
}
/**
* Displays the login page
*/
public function actionLogin()
{
$model=new LoginForm;
// if it is ajax validation request
if(isset($_POST['ajax']) && $_POST['ajax']==='login-form')
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
// collect user input data
if(isset($_POST['LoginForm']))
{
$model->attributes=$_POST['LoginForm'];
// validate user input and redirect to the previous page if valid
if($model->validate() && $model->login())
$this->redirect(Yii::app()->user->returnUrl);
}
// display the login form
$this->render('login',array('model'=>$model));
}
/**
* Logs out the current user and redirect to homepage.
*/
public function actionLogout()
{
Yii::app()->user->logout();
$this->redirect(Yii::app()->homeUrl);
$this->render('about');
}
}

View File

@@ -0,0 +1,17 @@
<h2>Disclaimer</h2>
<h3>Haftung für Inhalte</h3>
<p>Obwohl wir uns um Aktualität, Vollständigkeit und Richtigkeit der Inhalte unserer Seiten bemühen, können wir hierfür keine Garantie übernehmen.</p>
<p>Nach § 7 Absatz 1 TMG sind wir als Diensteanbieter für eigene Inhalte auf unseren Seiten nach den allgemeinen Gesetzen verantwortlich. </p>
<p>Eine Verpflichtung zur Überwachung übermittelter oder gespeicherter fremder Informationen besteht jedoch nicht (§§ 8-10 TMG). Sobald uns Rechtsverstöße bekannt werden, werden wir die entsprechenden Inhalte umgehend entfernen. Eine dahingehende Haftung wird jedoch erst ab dem Zeitpunkt der Kenntnis konkreter Rechtsverletzungen übernommen.</p>
<h3>Haftung für Links</h3>
<p>Unsere Seiten enthalten Links auf externe Webseiten Dritter. Auf die Inhalte dieser direkt oder indirekt verlinkten Webseiten haben wir keinen Einfluss. Für die Richtigkeit der Inhalte ist immer der jeweilige Anbieter oder Betreiber verantwortlich, weshalb wir diesbezüglich keinerlei Gewähr übernehmen.</p>
<p>Die fremden Webseiten haben wir zum Zeitpunkt der Verlinkung auf mögliche Rechtsverstöße überprüft. Zum Zeitpunkt der Verlinkung waren keinerlei Rechtsverletzungen erkennbar. Eine ständige Überprüfung sämtlicher Inhalte der von uns verlinkten Seiten ohne tatsächliche Anhaltspunkte für einen Rechtsverstoß können wir nicht leisten. Falls uns Rechtsverletzungen bekannt werden, werden wir die entsprechenden Links sofort entfernen.</p>
<h3>Urheberrecht</h3>
<p>Die durch den Betreiber dieser Seite erstellten Inhalte und Werke auf diesen Webseiten unterliegen dem deutschen Urheberrecht. Sämtliche Beiträge Dritter sind als solche gekennzeichnet. Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung außerhalb der Grenzen des Urheberrechts bedürfen der schriftlichen Zustimmung des jeweiligen Autors bzw. Erstellers. Kopien von diesen Seiten sind nur für den privaten Bereich gestattet, nicht jedoch für kommerzielle Zwecke.</p>
<h3>Datenschutz</h3>
<p>Für die Sicherheit der Datenübertragung im Internet können wir keine Gewähr übernehmen, insbesondere besteht bei der Übertragung von Daten per E-Mail die Gefahr des Zugriffs durch Dritte.</p>
<p>Im Falle der Erhebung personenbezogener oder geschäftlicher Daten (E-Mail-Adressen, Namen, Anschriften) auf unseren Seiten erfolgt die Preisgabe dieser Daten seitens des Nutzers stets auf freiwilliger Basis. Die Inanspruchnahme und Bezahlung aller angebotenen Dienste ist auch ohne Angabe solcher Daten bzw. unter Angabe anonymisierter Daten oder eines Pseudonyms gestattet, soweit dies technisch möglich und zumutbar ist.</p>
<p>Einer Nutzung der im Impressum veröffentlichten Kontaktdaten durch Dritte zu Werbezwecken wird hiermit ausdrücklich widersprochen. Der Betreiber behält sich für den Fall unverlangt zugesandter Werbe- oder Informationsmaterialien ausdrücklich rechtliche Schritte vor.</p>
<h3>Rechtswirksamkeit dieses Haftungsausschlusses</h3>
<p>Vorstehender Haftungsausschluss ist Teil des Internetangebots, von dem aus auf diese Seite verwiesen wurde. Sollten einzelne Regelungen oder Formulierungen dieses Haftungsausschlusses unwirksam sein oder werden, bleiben die übrigen Regelungen in ihrem Inhalt und ihrer Gültigkeit hiervon unberührt.</p>
<p>Quelle: <a href="http://www.anwalt-seiten.de">anwalt-seiten.de</a></p>

View File

@@ -1,28 +0,0 @@
CREATE TABLE tbl_user (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(128) NOT NULL,
password VARCHAR(128) NOT NULL,
email VARCHAR(128) NOT NULL
);
INSERT INTO tbl_user (username, password, email) VALUES ('test1', 'pass1', 'test1@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test2', 'pass2', 'test2@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test3', 'pass3', 'test3@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test4', 'pass4', 'test4@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test5', 'pass5', 'test5@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test6', 'pass6', 'test6@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test7', 'pass7', 'test7@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test8', 'pass8', 'test8@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test9', 'pass9', 'test9@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test10', 'pass10', 'test10@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test11', 'pass11', 'test11@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test12', 'pass12', 'test12@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test13', 'pass13', 'test13@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test14', 'pass14', 'test14@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test15', 'pass15', 'test15@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test16', 'pass16', 'test16@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test17', 'pass17', 'test17@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test18', 'pass18', 'test18@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test19', 'pass19', 'test19@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test20', 'pass20', 'test20@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test21', 'pass21', 'test21@example.com');

View File

@@ -1,28 +0,0 @@
CREATE TABLE tbl_user (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
username VARCHAR(128) NOT NULL,
password VARCHAR(128) NOT NULL,
email VARCHAR(128) NOT NULL
);
INSERT INTO tbl_user (username, password, email) VALUES ('test1', 'pass1', 'test1@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test2', 'pass2', 'test2@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test3', 'pass3', 'test3@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test4', 'pass4', 'test4@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test5', 'pass5', 'test5@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test6', 'pass6', 'test6@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test7', 'pass7', 'test7@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test8', 'pass8', 'test8@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test9', 'pass9', 'test9@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test10', 'pass10', 'test10@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test11', 'pass11', 'test11@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test12', 'pass12', 'test12@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test13', 'pass13', 'test13@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test14', 'pass14', 'test14@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test15', 'pass15', 'test15@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test16', 'pass16', 'test16@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test17', 'pass17', 'test17@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test18', 'pass18', 'test18@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test19', 'pass19', 'test19@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test20', 'pass20', 'test20@example.com');
INSERT INTO tbl_user (username, password, email) VALUES ('test21', 'pass21', 'test21@example.com');

Binary file not shown.

View File

@@ -2351,22 +2351,7 @@ EOD;
return self::controls($controls, $htmlOptions);
}
/**
* Generates form actions.
* @param mixed $actions the actions.
* @param array $htmlOptions additional HTML attributes.
* @return string the generated actions.
*/
public static function formActions($actions, $htmlOptions = array())
{
self::addCssClass('form-actions', $htmlOptions);
if (is_array($actions)) {
$actions = implode(' ', $actions);
}
return self::tag('div', $htmlOptions, $actions);
}
/**
/**
* Generates a search form.
* @param mixed $action the form action URL.
* @param string $method form method (e.g. post, get).
@@ -2386,7 +2371,22 @@ EOD;
return $output;
}
// Buttons
/**
* Generates form actions.
* @param mixed $actions the actions.
* @param array $htmlOptions additional HTML attributes.
* @return string the generated actions.
*/
public static function formActions($actions, $htmlOptions = array())
{
self::addCssClass('form-actions', $htmlOptions);
if (is_array($actions)) {
$actions = implode(' ', $actions);
}
return self::tag('div', $htmlOptions, $actions);
}
// Buttons
// http://twitter.github.io/bootstrap/2.3.2/base-css.html#buttons
// --------------------------------------------------

View File

View File

@@ -15,6 +15,7 @@
<meta name="viewport" content="width=device-width">
<?php Yii::app()->bootstrap->register(); ?>
<link rel="stylesheet" type="text/css" href="/css/styles.css" />
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>
@@ -27,19 +28,21 @@
$this->widget('bootstrap.widgets.TbNavbar',
[
'brandLabel' => Yii::app()->name,
'display' => null, // default is static to top
'display' => null,
'htmlOptions' =>
[
'class' => 'cstm-main-navbar'
],
'items' =>
[
[
'class' => 'bootstrap.widgets.TbNav',
'items' =>
[
array('label' => 'Home', 'url' => '/', 'active' => true),
array('label' => 'Blog', 'url' => '#', 'active' => false),
array('label' => 'Programme', 'url' => '#', 'active' => false),
array('label' => 'About', 'url' => '#', 'active' => false),
array('label' => 'Home', 'url' => '/', 'active' => ($this->selectedNav === 'index')),
array('label' => 'Blog', 'url' => '#', 'active' => ($this->selectedNav === 'blog')),
array('label' => 'Programme', 'url' => '#', 'active' => ($this->selectedNav === 'prog')),
array('label' => 'About', 'url' => 'About', 'active' => ($this->selectedNav === 'about')),
],
],
@@ -66,9 +69,10 @@
<?php
if(isset($this->breadcrumbs))
{
$this->widget('bootstrap.widgets.TbBreadcrumb', array(
'links'=>$this->breadcrumbs,
));
$this->widget('bootstrap.widgets.TbBreadcrumb',
[
'links'=>$this->breadcrumbs,
]);
}
?>
@@ -76,8 +80,10 @@
echo $content;
?>
<div id="footer">
Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>
<hr>
<div class="footer">
Copyright &copy; <?php echo date('Y'); ?> by Mike Schwörer.<br/>
All Rights Reserved.<br/>
<?php echo Yii::powered(); ?>
</div>

View File

@@ -0,0 +1,74 @@
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name;
$this->breadcrumbs=
[
'About'
];
$this->selectedNav = 'about';
?>
<div class="container">
<?php echo TbHtml::pageHeader('About Mikescher.de', ''); ?>
<p>Welcome to my private homepage.</p>
<p>My name is Mike Schwörer, and this is my homepage - here i upload programs i write in my free time and sometimes i even write a blog entry ...'); </p>
<p>If you want you can look <?php echo TbHtml::link('here', '#'); // TODO Add Link ?> at the things I programmed </p>
<?php echo TbHtml::well( file_get_contents('protected/data/disclaimer.php') ); ?>
<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('layout' => TbHtml::FORM_LAYOUT_HORIZONTAL)); ?>
<div class="well cstm-background-white">
<fieldset>
<legend>Contact Me</legend>
<?php
echo TbHtml::textFieldControlGroup('name', '',
[
'label' => 'Name:',
'placeholder' => 'Name'
]);
echo TbHtml::textFieldControlGroup('email', '',
[
'label' => 'Email address:',
'placeholder' => 'Email'
]);
echo TbHtml::textFieldControlGroup('header', '',
[
'label' => 'Title:',
'placeholder' => 'Header'
]);
echo TbHtml::textAreaControlGroup('text', '',
[
'label' => 'Message:',
'rows' => 6
]);
?>
</fieldset>
<?php echo TbHtml::formActions(
[
TbHtml::submitButton('Submit', array('color' => TbHtml::BUTTON_COLOR_PRIMARY)),
TbHtml::resetButton('Reset'),
],
[
'class' => 'cstm-background-white',
]);
?>
<?php $this->endWidget(); ?>
</div>
</div>

View File

@@ -7,6 +7,9 @@ $this->breadcrumbs=
[
'Index'
];
$this->selectedNav = 'index';
?>
<div class="container">