Skip to content

Commit

Permalink
mvc refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
lcf committed Nov 21, 2011
1 parent 61e5676 commit 9ce7337
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 28 deletions.
10 changes: 0 additions & 10 deletions application/views/helpers/LayoutHeader.php

This file was deleted.

18 changes: 9 additions & 9 deletions application/views/layouts/company.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ $loginedAs = $this->session->getUser()->getEmail();
?>
<!DOCTYPE html>
<html lang="en">
<?= $this->layoutHeader() ?>
<? //TODO: refactor views, remove repetitions ?>
<?= $this->render('layout-header.phtml') ?>
<body>
<div class="topbar-wrapper" style="z-index: 5;">
<div class="topbar">
Expand All @@ -35,13 +34,14 @@ $loginedAs = $this->session->getUser()->getEmail();
<div class="container">
<div class="container-fluid">
<div class="sidebar">
<ul> <? /* TODO: different ULs for each block of actions */ ?>
<? if ($isAdmin) : ?>
<? // Admin only actions listed here ?>
<li><a href="/company/add-user"><strong>Add new user</strong></a></li>
<li><a href="/company/switch-admin"><strong>Switch administrator</strong></a></li>
<li class="divider"></li>
<? endif ?>
<? if ($isAdmin) : ?>
<ul>
<? // Admin only actions listed here ?>
<li><a href="/company/add-user"><strong>Add new user</strong></a></li>
<li><a href="/company/switch-admin"><strong>Switch administrator</strong></a></li>
</ul>
<? endif ?>
<ul>
<li><a href="/company/users">View colleagues</a></li>
<li><a href="/auth/change-password">Change password</a></li>
<li><a href="/company/clients">Manage clients</a></li>
Expand Down
3 changes: 1 addition & 2 deletions application/views/scripts/auth/change-password-success.phtml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<?= $this->pageHeader('Success!') ?>
<p>You have changed your password</p>
<? /* TODO: format file like this according to the new markup */ ?>
<p>You have changed your password</p>
4 changes: 1 addition & 3 deletions application/views/scripts/error/error.phtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<div class="page-header"> <? // TODO: page header view helper ?>
<h1>An error occured</h1>
</div>
<?= $this->pageHeader('An error occurred') ?>

<div class="alert-message block-message error">
<p><strong><?= $this->message ?></strong></p>
Expand Down
4 changes: 1 addition & 3 deletions application/views/scripts/index/about.phtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<div class="page-header">
<h1>About BasicCRM</h1>
</div>
<?= $this->pageHeader('About BasicCRM') ?>
<p>BasicCRM is a simple Customer Relationship Management tool which helps you and your team to organize work
with your clients and tasks related to them.</p>

Expand Down
11 changes: 10 additions & 1 deletion application/views/scripts/layout-header.phtml
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
bla bla
<head>
<meta charset="utf-8">
<title>BasicCRM</title>
<meta name="description" content="Description can be found at blog.lcf.name">
<meta name="author" content="Alexander Steshenko">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script src="http://twitter.github.com/bootstrap/1.4.0/bootstrap-dropdown.js"></script>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">
<style type="text/css">body {padding-top: 60px;}</style>
</head>

0 comments on commit 9ce7337

Please sign in to comment.