Browse Source

Added LESS support.

master
Alexander Yakovlev 8 years ago
parent
commit
a48b7fc7b6
  1. 3
      .gitmodules
  2. 2
      application/assets/stylesheets/base.less
  3. 0
      application/assets/stylesheets/colors.less
  4. 0
      application/assets/stylesheets/layout.less
  5. 3
      application/assets/stylesheets/style.less
  6. 3
      application/bootstrap.php
  7. 3
      application/classes/controller/header.php
  8. 2
      application/config/database.php
  9. 8
      application/config/less.php
  10. 4
      application/views/header.php
  11. 4
      assets/stylesheets/compile.sh
  12. 1
      modules/less

3
.gitmodules

@ -13,3 +13,6 @@
[submodule "modules/markdown"]
path = modules/markdown
url = git://github.com/aptgraph/kohana-markdown.git
[submodule "modules/less"]
path = modules/less
url = git://github.com/mongeslani/kohana-less.git

2
assets/stylesheets/base.less → application/assets/stylesheets/base.less

@ -177,4 +177,4 @@ th,td,caption {
tfoot {
font-style: italic;
}
}

0
assets/stylesheets/colors.less → application/assets/stylesheets/colors.less

0
assets/stylesheets/layout.less → application/assets/stylesheets/layout.less

3
application/assets/stylesheets/style.less

@ -0,0 +1,3 @@
@import "colors";
@import "layout";
@import "base";

3
application/bootstrap.php

@ -80,7 +80,7 @@ if (isset($_SERVER['KOHANA_ENV']))
* - boolean caching enable or disable internal caching FALSE
*/
Kohana::init(array(
'base_url' => '/',
'base_url' => '/phunt',
'index_file' => FALSE,
'errors' => TRUE,
'profile' => (Kohana::$environment == Kohana::DEVELOPMENT),
@ -110,6 +110,7 @@ Kohana::modules(array(
// 'unittest' => MODPATH.'unittest', // Unit testing
// 'userguide' => MODPATH.'userguide', // User guide and API documentation
'markdown' => MODPATH.'markdown', // Markdown module
'less' => MODPATH.'less'
));
/**

3
application/classes/controller/header.php

@ -4,6 +4,7 @@ class Controller_Header extends Controller_Template {
public $template = 'header';
public function action_standard() {
$this->template->title = $this->request->post('title');
$this->template->stylesheet = Less::compile(APPPATH.'assets/stylesheets/style');
$scripts = $this->request->post('scripts');
$temp = "";
if (is_array($scripts)) foreach($scripts as $script):
@ -12,4 +13,4 @@ class Controller_Header extends Controller_Template {
$this->template->scripts = $temp;
}
public function action_view(){$this->request->redirect('');}
}
}

2
application/config/database.php

@ -18,7 +18,7 @@ return array
* Ports and sockets may be appended to the hostname.
*/
'hostname' => 'localhost',
'database' => 'plastek',
'database' => 'dandelion',
'username' => 'dandelion',
'password' => '',
'persistent' => FALSE,

8
application/config/less.php

@ -0,0 +1,8 @@
<?php defined('SYSPATH') OR die('No direct access allowed.');
return array(
'compress' => TRUE,
'path' => 'application/cache/css/',
);

4
application/views/header.php

@ -4,7 +4,7 @@
<title><?php echo $title ?></title>
<meta charset="utf-8">
<link href='<?php echo URL::site('favicon.ico')?>' rel='shortcut icon' type='image/x-icon'/>
<link rel="stylesheet" type="text/css" media="all" href="<?php echo URL::site('assets/stylesheets/main.css') ?>">
<?php echo $stylesheet ?>
<?php echo $scripts ?>
</head>
<body>
@ -15,4 +15,4 @@
<div id="menu">
<?php echo Request::factory('navigation/actions')->execute() ?>
</div>
<div id="column_text">
<div id="column_text">

4
assets/stylesheets/compile.sh

@ -1,4 +0,0 @@
#!/bin/bash
lessc -x base.less >main.css
lessc -x layout.less >>main.css
lessc -x colors.less >>main.css

1
modules/less

@ -0,0 +1 @@
Subproject commit 18624ccfdf559e2eedd1fe9c9bcdadd99fccf0b1