Skip to content
This repository was archived by the owner on Oct 27, 2018. It is now read-only.

Commit 6ac5753

Browse files
authored
Merge pull request #54 from mtancoigne/release/v0.1
Release/v0.1
2 parents 4e95643 + 2654000 commit 6ac5753

File tree

100 files changed

+3059
-3473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+3059
-3473
lines changed

CHANGELOG.md

+18-31
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,23 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
3-
This project will adhere to [Semantic Versioning](http://semver.org/) as soon as possible.
43

54
## [Unreleased]
5+
_Nothing for now_
6+
7+
## [0.1.0] - 2017-01-12
8+
First notable version with all base features working:
9+
- User management
10+
- Administration section
11+
- User section to
12+
- Manage albums (groups of _files_)
13+
- Manage files (images, text, video, sounds)
14+
- Manage notes (short texts)
15+
- Manage posts (articles)
16+
- Manage projects (a project can have related albums, files, notes and posts)
17+
- "Safe For Work" state for the above items
18+
- Tagging system
19+
- Content reporting
20+
- Comments (private)
21+
- Internationalization support
22+
- Licenses support
623

7-
- [ ] **Auth mechanism**
8-
- [ ] **User registration**
9-
- [ ] Account activation
10-
- [ ] **Login**
11-
- [ ] Persistent login (for a week/month/year ?)
12-
- [x] Simple login
13-
- [ ] **Close account*
14-
- [ ] Proper messages on login
15-
- [x] Lock and deactivate user
16-
- [x] Auth check on actions (via `$this->Auth->allow()` for now)
17-
- [x] User logout
18-
- [x] **Flow control mechanism** (_Acts_, may be changed for something more understandable, as _Activities_)
19-
- [x] Handle deleted/unpublished items
20-
- [x] Component to add items to flow
21-
- [ ] **Article management**
22-
- [x] Filters for indexes
23-
- [ ] Markdown support
24-
- [ ] File export from DB
25-
- [x] Render markdown properly (almost)
26-
- [ ] Tool to link to projects and/or files
27-
- [ ] **Projects management**
28-
- [ ] Team management
29-
- [ ] **Files management**
30-
- [ ] **Licenses management**
31-
- [ ] **Tags management**
32-
- [ ] **Report management**
33-
- [ ] **General ideas**
34-
- [ ] **NSFW mechanism**
35-
- [ ] **...**
36-
- [ ] :red_circle: Make this CHANGELOG follow Semantic versioning as soon as possible

README.md

+226-32
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,238 @@
1-
[![Build Status](https://travis-ci.org/el-cms/elabs.svg?branch=master)](https://travis-ci.org/el-cms/elabs)
2-
[![codecov](https://codecov.io/gh/el-cms/elabs/branch/master/graph/badge.svg)](https://codecov.io/gh/el-cms/elabs)
3-
4-
[![Gitter](https://badges.gitter.im/elabs-cms/Lobby.svg)](https://gitter.im/elabs-cms/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)[as much as I can]
1+
[![ExperimentsLabs CMS](https://img.shields.io/badge/elabs-0.1.0-blue.svg)](https://github.com/el-cms/elabs/) [![Travis](https://img.shields.io/travis/el-cms/elabs.svg)](https://travis-ci.org/el-cms/elabs) [![Codecov](https://img.shields.io/codecov/c/github/el-cms/elabs.svg)](https://codecov.io/gh/el-cms/elabs) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/el-cms/elabs/master/LICENSE) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/elabs-cms/Lobby)
52

63
# ELabs
7-
CMS for ExperimentsLabs.com based on CakePHP 3
4+
CMS for ExperimentsLabs.com created with [CakePHP 3](https://cakephp.org)
85

96
## What is it ?
10-
It's a small website made to make a presentation of projects, files and some articles... for now.
7+
It's a small website made to make a presentation of projects, files and some articles...
118

129
**In any case, that's not a modular CMS, with plugins and lot of stuff** (as [Croogo](http://croogo.org))
1310

14-
This structure allows :
15-
16-
- multiple users
17-
- a simple "project management system" (a page about your project)
18-
- a simple article management system
19-
- a simple file upload system.
20-
- a report system for the visitors/users to report pages or items (may be extended as a way to leave comments to users too)
21-
- licenses support for any item published on the site
22-
23-
This structure does **not** have comments system (and will never have publicly shown comments)
24-
25-
## Why ?
26-
27-
I know there are a lot of tools existing around to make this kind of thing, but
28-
that was a way for me to approach CakePHP3 and finally make my own website.
11+
## Features in v0.0.1
12+
First notable version with all base features working:
13+
14+
- User management
15+
- Administration section
16+
- User section to
17+
- Manage albums (groups of _files_)
18+
- Manage files (images, text, video, sounds)
19+
- Manage notes (short texts)
20+
- Manage posts (articles)
21+
- Manage projects (a project can have related albums, files, notes and posts)
22+
- "Safe For Work" state for the above items
23+
- Tagging system
24+
- Content reporting
25+
- Comments (private only)
26+
- Internationalization support
27+
- Licenses support
2928

3029
## Get started:
31-
First, download or clone the repository. Then, run setup.sh and follow the instructions. This will download extra js files, some sources if you want them, call `composer install` and populate the db.
32-
33-
## Future evolutions ?
34-
You're welcome to use/reuse the code, fork, make pull requests...
35-
36-
I don't know yet how the website will evolve, but it will.
3730

38-
**Translations** are welcome :)
31+
### Dependencies
32+
- A web server wich can serve PHP files
33+
- You will need the following PHP dependencies:
34+
- gd
35+
- intl
36+
- xml
37+
- mbstring
38+
- gd
39+
- A database server. The following have been tested
40+
- MySql was used during development
41+
- Sqlite is used for tests, so it should _work_
42+
- [Composer](https://getcomposer.org/)
43+
44+
For now there is no package for Composer.
45+
46+
There are many ways to get started with this CMS, i'll present two of them:
47+
48+
### The easy way: A virtual machine
49+
I call this method the _easy way_ as there is nothing
50+
51+
To get started quickly if you have a good internet connection and some coffee to relax:
52+
53+
#### Quick install
54+
For people who know how it works.
55+
56+
- Download this [PuPHPet configuration](https://github.com/mtancoigne/cake3-puphpet-vm) for vagrant
57+
- Configure it if you want.
58+
- Create the `data/html` subfolder
59+
- Launch `vagrant up`
60+
- Delete `data/html/index.php` and download/clone this repository in `data/html/`
61+
- Login on the machine and head to `/var/www/html`
62+
- Run `./setup.sh`
63+
- Configure the db access with:
64+
```php
65+
'username' => 'root,
66+
'password' => '123',
67+
'database' => 'vagrant',
68+
```
69+
- Done. Access `https://192.168.6.200`.
70+
71+
### Step by step:
72+
- Download and install [Virtualbox](http://www.virtualbox.org/) and Vagrant(https://www.vagrantup.com/) and check that Vagrant is in your PATH variable (accessible from everywhere in a console) by running `vagrant -v`.
73+
- Download the [box configuration](https://github.com/mtancoigne/cake3-puphpet-vm) created with PuPHPet(https://puphpet.com/) and extract it somewhere.
74+
- Edit the `puphet/config.yml` to fit your needs:
75+
- Change all occurrences of `my-cake3-project` by something else (`elabs` is a nice choice). You'll have to change it on every new project with this vm.
76+
- If your system is a 32bit OS, change lines 6 and 7 by `puphpet/ubuntu1604-i386`
77+
- Change the `private_network` (line 26) value to something else.
78+
- **Note:** The vm is configured to have 768Mb memory (line 31). You can lower it to 512 if you have issues.
79+
- Create a `data` folder, in wich you will create an `html` one. This folder will be shared with the virtual machine. It's your project base.
80+
- Open a console in the vm folder and run `vagrant up`. It will download the virtual machine image and configure it. Here comes the coffee time.
81+
- When vagrant finished, remove the `data/html/index.html` file that has been created.
82+
- Clone or download this repository in `data/html`. `index.php` should be directly under `html/`.
83+
- Login on the virtual machine: `vagrant ssh`. You're in a linux machine, so now, it's linux commands.
84+
- Go to the webserver root directory: `cd /var/www/html`.
85+
- Launch the setup: `./setup.sh` and follow the instructions.
86+
- _Do you want to keep the sources needed to build the css ? [Y/n]_: If you select no, Sass sources will be deleted. This step downloads some JS files.
87+
- _Do you want to install the development dependencies ? [Y/n]_: If you select no, composer won't download the dev. dependencies. This step runs `composer install`.
88+
- Database setup: from your OS, edit `data/html/config/app.php` and change from the line 232:
89+
```php
90+
'username' => 'root,
91+
'password' => '123',
92+
'database' => 'vagrant',
93+
```
94+
- When it's done, hit return. The tables will be created with a default admin.
95+
- Open a browser to `https://192.168.6.200` if you haven't changed the IP address.
96+
97+
**Notes**: I had some trouble with :
98+
- `phpcbf` in the vm: it changes the file mode of the fixed files.
99+
- git in the vm: Don't use it. Every file is marked as changed. Use git from your host.
100+
101+
### The not so hard way: Locally under a Linux system
102+
103+
- Check if your server have the good requirements.
104+
- For the setup to work, you should have [Composer](https://getcomposer.org/) installed globally.
105+
- Download/clone this repository in a folder accessible by your webserver
106+
- Edit `.htaccess` and `webroot/.htaccess` to add a [rewriteBase](https://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteBase) option if needed.
107+
- Launch the setup: `./setup.sh` and follow the instructions.
108+
- _Do you want to keep the sources needed to build the css ? [Y/n]_: If you select no, Sass sources will be deleted. This step downloads some JS files.
109+
- _Do you want to install the development dependencies ? [Y/n]_: If you select no, composer won't download the dev. dependencies. This step runs `composer install`.
110+
- Database setup: edit `data/html/config/app.php` and change from the line 232:
111+
```php
112+
'username' => 'root,
113+
'password' => '123',
114+
'database' => 'vagrant',
115+
```
116+
- When it's done, hit return. The tables will be created with a default admin.
117+
- Done.
118+
119+
### The insane way: Install under Windows
120+
- Check if your server have the good requirements.
121+
- Download/clone this repository in a folder accessible by your webserver
122+
- Edit `.htaccess` and `webroot/.htaccess` to add a [rewriteBase](https://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteBase) option if needed.
123+
- If you want all the SCSS dependencies to build your css:
124+
- Follow step by step the content of `Sources/Sass/setup.sh`. And do it manually.
125+
- Strings with $XXX are variables. Check the first lines of the script, they are defined here. They are used for folder references.
126+
- _wget xxx_ = download xxx
127+
- _cp xxx yyy_ = copy xxx to yyy
128+
- _mv xxx yyy_ = move xxx to yyy (also used to rename the files)
129+
- Launch `composer install` to install the dependencies. Use the `--no-dev` option to ignore development dependencies.
130+
- Once it's done, edit `config/app.php` for the db configuration (line 232):
131+
```php
132+
'username' => 'root,
133+
'password' => '123',
134+
'database' => 'vagrant',
135+
```
136+
- Create the tables and the default user:
137+
- `bin/cake migrations migrate`
138+
- `bin/cake migrations seed`
139+
- Done.
140+
141+
I'm sorry for you, windows user, as there is no _easy_ way for now.
142+
143+
## Update
144+
As there is no composer package for elabs now, all you can do is run the `update.sh` script from the virtual machine or your linux system. It will clean and re-download sass/js files and run `composer update`.
145+
146+
Again, for Windows, sorry.
147+
148+
## Configuration
149+
150+
Some configuration can be made in the files in `config/` folder:
151+
- app.php : is a file with CakePHP configuration
152+
- site_config.php : basic configuration for the CMS
153+
154+
## Testing
155+
156+
You can run the PHPUnit tests if you have installed the dev dependencies: `composer phpunit`.
157+
You can run the CodeSniffer tests too: `composer phpcs`.
158+
To automatically fix some of the CodeSniffer errors you can run `composer phpcbf`. But it may change the file mode too (orininally `644` on all files except the dirs: `bin/`, `log/`, `tmp/` and `vendor/bin`).
159+
160+
## How to contribute
161+
162+
### New ideas
163+
Ideas are welcome. Just open an issue to describe it.
164+
165+
### Translations
166+
Translations of the cms are welcome. The translation system is the same as [CakePHP](https://book.cakephp.org/3.0/en/core-libraries/internationalization-and-localization.html) and located in `src/Locales`.
167+
168+
All the files in this folder are extracted from the source files using `bin/cake i18n extract`:
169+
- Message from the core are extracted (file `cake.pot`)
170+
- Domain strings are **not** merged (other files)
171+
172+
If you want to start a new translation:
173+
- Create a folder in `src/Locale` with the language name (i.e.: _fr_FR_)
174+
- Copy the `.pot` files in it.
175+
- Change the extension to `.po`.
176+
- Edit the translations with your preferred editor ([Virtaal](http://virtaal.translatehouse.org/) and [PoEdit](http://www.poedit.net/) are my choices).
177+
- Commit your changes with all new `.mo` files generated by the editor.
178+
179+
### Design improvements
180+
Well... Design is not really my cup of tea. For now the website is not responsive (at least not _totally_). If you want to do something about that, it uses [Twitter Bootstrap v3.x](http://getbootstrap.com/), [BootFlat](https://bootflat.github.io/), [Font Awesome](http://fontawesome.io/) icons, [Bootstrap Tagsinput](http://bootstrap-tagsinput.github.io/), [Codemirror](http://codemirror.net/) and [Prism](http://prismjs.com/).
181+
182+
#### CSS: Created with SCSS
183+
All the CSS is generated from custom scss files located in `Sources/Sass/`. The entry point is `style.scss`. No other files should be generated if you want to modify the core CSS. But if you want to create other CSS files, no problem, explain it.
184+
185+
I usually use [Koala](http://koala-app.com/) to generate the CSS and there is a configuration file for it; all you have to do is to drag'n'drop the `Sources/Sass` folder in Koala. (**Notes:** Sometimes, Koala will tell you the build failed, but as long as there is no error message about this, it didn't. And sometimes, Koala will not build anything on file change, so you have to manually do it.)
186+
187+
#### Templates
188+
All the templates are located in `src/Template`. For the majority of the folders, they represent a controller, except for the following (If you're familiar with CakePHP, you'll have no problem to understand):
189+
190+
```text
191+
src/Template/
192+
193+
│ [ CakePHP Prefixes: ]
194+
195+
├── Admin/ Views for the admin workspace
196+
│ └── <Controller>/ Views for admin/<controller>/<action> views
197+
│ └── .ctp files
198+
├── User/ Views for the user workspace
199+
│ └── <Controller>/ Views for user/<controller>/xxx views
200+
│ └── .ctp files
201+
202+
│ [ Other folders: ]
203+
204+
├── Cell/ Views for cells (special elements with their own controller-like logic)
205+
│ └── <Cell>/
206+
│ └── .ctp files Views for the cell
207+
├── Element/ Small chunks of templates, included in other views
208+
│ ├── Flash/ Flash messages
209+
│ ├── layout/ Layout elements (menus, blocks that are not controller/action specific)
210+
│ ├── layouts/ Specific layouts (as a standard form, a standard index, ...)
211+
│ └── ...Other dirs/ Other elements related to controllers
212+
├── Email/ Email templates
213+
├── Error/ Error pages templates
214+
├── Layout/ Layouts for the public, user and admin workspaces
215+
├── Plugin/ Views to override plugins default views
216+
217+
│ [ Other folders: ]
218+
219+
└── <Controller>/ Views for the public workspace
220+
└── .ctp files
221+
```
222+
223+
For basic informations about the CakePHP templates, you should look in the [CakePHP Cookbook](https://book.cakephp.org/3.0/en/views.html).
224+
225+
### Other
226+
227+
All notable changes to this project will be documented in `CHANGELOG.md` :
228+
- The format is based on [Keep a Changelog](http://keepachangelog.com/)
229+
- This project adheres to [Semantic Versioning](http://semver.org/).
230+
231+
You can check the issues too.
232+
233+
## License
234+
The code is licensed under the MIT license except for files that have their own licenses.
39235

40-
**Design improvements** are really welcome
41-
42-
**New ideas are welcome**
236+
## Why ?
43237

44-
**If you want to help**, check the TODO.md, and look at all the amount of work there is...
238+
This tool was created for the pleasure to make [experiments labs](https://experimentslabs.com) and use CakePHP.

Sources/Sass/components/_cards.scss

+34
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,37 @@
191191
}
192192

193193
}
194+
195+
.more-item {
196+
vertical-align: middle;
197+
padding: 0 2em;
198+
opacity: .5;
199+
}
200+
201+
/**
202+
"Card" for tag management in admin
203+
*/
204+
.tag-item {
205+
display: inline-block;
206+
box-shadow:$panel-shadow;
207+
padding: 0;
208+
margin-left: 5px;
209+
background-color:$well-background-color;
210+
.tag-name{
211+
font-weight:bold;
212+
padding:0 $padding-small-horizontal;
213+
}
214+
.tag-counts{
215+
display: inline;
216+
list-style-type:none;
217+
margin:0;
218+
padding:0 $padding-small-horizontal;
219+
border-left: 1px solid #CCC;
220+
color:lighten($text-color, 50%);
221+
li{
222+
display:inline;
223+
padding:0;
224+
margin:0;
225+
}
226+
}
227+
}

Sources/Sass/components/_navbar.scss

+9
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
background-color: darken($navbar-default-bg, 15%);
4040
color: darken($navbar-default-bg, 30%);
4141
}
42+
.admin-link{
43+
background-color:mix($navbar-default-bg, $navbar-admin-bg, 75%);
44+
}
4245
}
4346
}
4447

@@ -69,6 +72,9 @@
6972
background-color: darken($navbar-admin-bg, 15%);
7073
color: darken($navbar-admin-bg, 30%);
7174
}
75+
.admin-link{
76+
background-color:$navbar-admin-bg;
77+
}
7278
}
7379
}
7480

@@ -100,5 +106,8 @@
100106
background-color: darken($navbar-user-bg, 15%);
101107
color: darken($navbar-user-bg, 30%);
102108
}
109+
.admin-link{
110+
background-color:mix($navbar-user-bg, $navbar-admin-bg, 75%);
111+
}
103112
}
104113
}

0 commit comments

Comments
 (0)