Skip to content

Commit afa08db

Browse files
committed
First shot, based on OSClass Bender theme
0 parents  commit afa08db

File tree

221 files changed

+18430
-0
lines changed

Some content is hidden

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

221 files changed

+18430
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Node
2+
node_modules
3+
4+
# Sass
5+
.sass-cache
6+
7+
# .gitkeep
8+
dist/*
9+
packages/*

404.php

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/*
3+
* Osclass – software for creating and publishing online classified
4+
* advertising platforms
5+
*
6+
* Copyright (C) 2014 OSCLASS
7+
*
8+
* This program is free software: you can redistribute it and/or
9+
* modify it under the terms of the GNU Affero General Public License
10+
* as published by the Free Software Foundation, either version 3 of
11+
* the License, or (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful, but
14+
* WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Affero General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Affero General Public
19+
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
?>
22+
23+
<?php
24+
// meta tag robots
25+
osc_add_hook('header','osclassclsx_nofollow_construct');
26+
osclassclsx_add_body_class('error not-found');
27+
osc_current_web_theme_path('header.php') ;
28+
?>
29+
<div class="flashmessage-404">
30+
<h1><?php _e("Sorry but I can't find the page you're looking for", 'osclassclsx') ; ?></h1>
31+
32+
<p><?php _e("Let us help you, we have got a few tips for you to find it.", 'osclassclsx') ; ?></p>
33+
<ul>
34+
<li>
35+
<?php _e("<strong>Search</strong> for it:", 'osclassclsx') ; ?>
36+
<form action="<?php echo osc_base_url(true) ; ?>" method="get" class="search">
37+
<input type="hidden" name="page" value="search" />
38+
<fieldset class="main">
39+
<input type="text" name="sPattern" id="query" value="" />
40+
<button type="submit" class="ui-button ui-button-middle"><?php _e('Search', 'osclassclsx') ; ?></button>
41+
</fieldset>
42+
</form>
43+
</li>
44+
<li><?php _e("<strong>Look</strong> for it in the most popular categories.", 'osclassclsx') ; ?>
45+
<div class="categories">
46+
<?php osc_goto_first_category() ; ?>
47+
<?php while ( osc_has_categories() ) { ?>
48+
<h2><a class="category <?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> <span>(<?php echo osc_category_total_items() ; ?>)</h2>
49+
<?php if ( osc_count_subcategories() > 0 ) { ?>
50+
<?php while ( osc_has_subcategories() ) { ?>
51+
<?php if( osc_category_total_items() > 0 ) { ?>
52+
<h3><a class="category <?php echo osc_category_slug() ; ?>" href="<?php echo osc_search_category_url() ; ?>"><?php echo osc_category_name() ; ?></a> <span>(<?php echo osc_category_total_items() ; ?>)</h3>
53+
<?php } ?>
54+
<?php } ?>
55+
<?php } ?>
56+
<?php } ?>
57+
</div>
58+
<div class="clear"></div>
59+
</li>
60+
</ul>
61+
</div>
62+
<?php osc_current_web_theme_path('footer.php') ; ?>

Gruntfile.js

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
'use strict';
2+
3+
module.exports = function(grunt) {
4+
// Project configuration.
5+
grunt.initConfig({
6+
pkg: grunt.file.readJSON('package.json'),
7+
theme: grunt.file.readJSON('themes.json'),
8+
replace: { },
9+
watch: {
10+
template: {
11+
files: ['sass/colors.scss.tpl', 'index.php.tpl'],
12+
tasks: ['template:blue']
13+
}
14+
},
15+
shell: { },
16+
template: { },
17+
sass: {
18+
dist: {
19+
options: {
20+
style: 'compressed',
21+
compass: true
22+
},
23+
files: {
24+
'css/main.css': 'sass/main.scss'
25+
}
26+
}
27+
},
28+
copy: { }
29+
});
30+
31+
var themeObj = grunt.config.get('theme');
32+
var pkg = grunt.config.get('pkg');
33+
for ( var key in themeObj ) {
34+
var theme = themeObj[key];
35+
36+
grunt.config( 'template.' + key, {
37+
options: {
38+
data: {
39+
theme: themeObj[key],
40+
pkg: pkg
41+
}
42+
},
43+
files: {
44+
'sass/colors.scss': ['sass/colors.scss.tpl'],
45+
'index.php': ['index.php.tpl']
46+
}
47+
});
48+
49+
// copy scss files, compile sass, copy to root + replace variables
50+
grunt.config( 'watch.' + key, {
51+
files: ['sass/**'],
52+
tasks: ['template:' + key, 'sass'],
53+
options: {
54+
interrupt: true,
55+
}
56+
});
57+
58+
grunt.config( 'copy.' + key, {
59+
files: [
60+
{
61+
expand: true,
62+
src: [
63+
'*.php',
64+
'admin/**',
65+
'common/**',
66+
'css/**',
67+
'favicon/**',
68+
'fonts/**',
69+
'images/**',
70+
'js/**',
71+
'languages/**'
72+
],
73+
dest: 'dist/' + theme.slug
74+
}
75+
]
76+
});
77+
78+
grunt.config( 'copy.screenshoot_' + key, {
79+
files: [
80+
{
81+
expand: false,
82+
src: [
83+
'screenshot/' + key + '/screenshot.png'
84+
],
85+
dest: 'dist/' + theme.slug + '/screenshot.png'
86+
}
87+
]
88+
});
89+
90+
// replace theme strings
91+
grunt.config( 'replace.'+ key , {
92+
src: [
93+
'dist/' + theme.slug + '/*.php',
94+
'dist/' + theme.slug + '/admin/*.php',
95+
'dist/' + theme.slug + '/common/*.php',
96+
'dist/' + theme.slug + '/js/*.js'
97+
],
98+
overwrite: true,
99+
replacements: [
100+
{
101+
from: 'osclassclsx',
102+
to: theme.slug
103+
},
104+
{
105+
from: 'BENDER_THEME_VERSION',
106+
to: theme.slug.toUpperCase() + '_THEME_VERSION'
107+
},
108+
{
109+
from: 'BENDER_THEME_MARKET_SLUG',
110+
to: theme.slug
111+
}
112+
]
113+
});
114+
115+
var archive = '../packages/theme_'+ theme.slug + '_' + pkg.version + '.zip';
116+
grunt.config( 'shell.compress_'+ key , {
117+
command : 'cd dist/; zip -r ' + archive + ' ' + theme.slug + '/;',
118+
options: {
119+
stdout: false
120+
}
121+
});
122+
123+
grunt.registerTask('dist:' + key, ['template:' + key, 'sass', 'copy:' + key, 'copy:screenshoot_' + key, 'replace:' + key, 'shell:compress_' + key]);
124+
}
125+
126+
grunt.registerTask('dist', ['dist:red', 'dist:blue', 'dist:black', 'dist:purple'])
127+
128+
// Actually load this plugin's task(s).
129+
grunt.loadTasks('tasks');
130+
131+
grunt.loadNpmTasks('grunt-contrib-copy');
132+
grunt.loadNpmTasks('grunt-contrib-watch');
133+
grunt.loadNpmTasks('grunt-contrib-sass');
134+
grunt.loadNpmTasks('grunt-shell');
135+
grunt.loadNpmTasks('grunt-text-replace');
136+
grunt.loadNpmTasks('grunt-template');
137+
};

README_bender.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Bender
2+
3+
## Dependencies
4+
5+
* [Node.js](http://nodejs.org/)
6+
* [Sass](http://sass-lang.com/)
7+
8+
Once you have the dependencies installed, run the following command:
9+
10+
```
11+
$> npm install
12+
```
13+
14+
## Structure
15+
16+
There are two template files:
17+
18+
* `index.php.tpl`
19+
* `sass/colors.scss.tpl`
20+
21+
If you want to generate them again, you just have to execute `grunt template:blue`.
22+
23+
## Watch changes
24+
25+
You can compile sass files automatically every time it's changed by executing the following command:
26+
27+
```
28+
$> grunt watch:blue
29+
```
30+
31+
## Build
32+
33+
```
34+
$> grunt dist
35+
```
36+
37+
It generates a `.zip` file per color scheme: blue (default), red, black and purple. The `index.php` and `colors.scss` are generated from the variables in `themes.json`. The screenshots are taken from `screenshot/{color scheme}/screenshot.png`.
38+
39+
![Bender](http://pool.theinfosphere.org/images/1/14/Bender_promo_2.jpg)

admin/header.php

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?php
2+
/*
3+
* Osclass – software for creating and publishing online classified
4+
* advertising platforms
5+
*
6+
* Copyright (C) 2014 OSCLASS
7+
*
8+
* This program is free software: you can redistribute it and/or
9+
* modify it under the terms of the GNU Affero General Public License
10+
* as published by the Free Software Foundation, either version 3 of
11+
* the License, or (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful, but
14+
* WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Affero General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Affero General Public
19+
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
*/
21+
?>
22+
23+
<?php if ( (!defined('ABS_PATH')) ) exit('ABS_PATH is not loaded. Direct access is not allowed.'); ?>
24+
<?php if ( !OC_ADMIN ) exit('User access is not allowed.'); ?>
25+
<style type="text/css" media="screen">
26+
.command { background-color: white; color: #2E2E2E; border: 1px solid black; padding: 8px; }
27+
.theme-files { min-width: 500px; }
28+
</style>
29+
<h2 class="render-title"><?php _e('Header logo', 'osclassclsx'); ?></h2>
30+
<?php
31+
$logo_prefence = osc_get_preference('logo', 'osclassclsx');
32+
?>
33+
<?php if( is_writable( osc_uploads_path()) ) { ?>
34+
<?php if($logo_prefence) { ?>
35+
<h3 class="render-title"><?php _e('Preview', 'osclassclsx') ?></h3>
36+
<img border="0" alt="<?php echo osc_esc_html( osc_page_title() ); ?>" src="<?php echo osclassclsx_logo_url().'?'.filemtime(osc_uploads_path() . osc_get_preference('logo','osclassclsx'));?>" />
37+
<form action="<?php echo osc_admin_render_theme_url('oc-content/themes/osclassclsx/admin/header.php');?>" method="post" enctype="multipart/form-data" class="nocsrf">
38+
<input type="hidden" name="action_specific" value="remove" />
39+
<fieldset>
40+
<div class="form-horizontal">
41+
<div class="form-actions">
42+
<input id="button_remove" type="submit" value="<?php echo osc_esc_html(__('Remove logo','osclassclsx')); ?>" class="btn btn-red">
43+
</div>
44+
</div>
45+
</fieldset>
46+
</form>
47+
<?php } else { ?>
48+
<div class="flashmessage flashmessage-warning flashmessage-inline" style="display: block;">
49+
<p><?php _e('No logo has been uploaded yet', 'osclassclsx'); ?></p>
50+
</div>
51+
<?php } ?>
52+
<h2 class="render-title separate-top"><?php _e('Upload logo', 'osclassclsx') ?></h2>
53+
<p><?php _e('The preferred size of the logo is 600x100.', 'osclassclsx'); ?></p>
54+
<?php if( $logo_prefence ) { ?>
55+
<div class="flashmessage flashmessage-inline flashmessage-warning"><p><?php _e('<strong>Note:</strong> Uploading another logo will overwrite the current logo.', 'osclassclsx'); ?></p></div>
56+
<?php } ?>
57+
<br/><br/>
58+
<form action="<?php echo osc_admin_render_theme_url('oc-content/themes/osclassclsx/admin/header.php'); ?>" method="post" enctype="multipart/form-data" class="nocsrf">
59+
<input type="hidden" name="action_specific" value="upload_logo" />
60+
<fieldset>
61+
<div class="form-horizontal">
62+
<div class="form-row">
63+
<div class="form-label"><?php _e('Logo image (png,gif,jpg)','osclassclsx'); ?></div>
64+
<div class="form-controls">
65+
<input type="file" name="logo" id="package" />
66+
</div>
67+
</div>
68+
<div class="form-actions">
69+
<input id="button_save" type="submit" value="<?php echo osc_esc_html(__('Upload','osclassclsx')); ?>" class="btn btn-submit">
70+
</div>
71+
</div>
72+
</fieldset>
73+
</form>
74+
<?php } else { ?>
75+
<div class="flashmessage flashmessage-error" style="display: block;">
76+
<p>
77+
<?php
78+
$msg = sprintf(__('The images folder <strong>%s</strong> is not writable on your server', 'osclassclsx'), WebThemes::newInstance()->getCurrentThemePath() ."images/" ) .", ";
79+
$msg .= __("Osclass can't upload the logo image from the administration panel.", 'osclassclsx') . ' ';
80+
$msg .= __('Please make the aforementioned image folder writable.', 'osclassclsx') . ' ';
81+
echo $msg;
82+
?>
83+
</p>
84+
<p>
85+
<?php _e('To make a directory writable under UNIX execute this command from the shell:','osclassclsx'); ?>
86+
</p>
87+
<p class="command">
88+
chmod a+w <?php echo WebThemes::newInstance()->getCurrentThemePath() ."images/"; ?>
89+
</p>
90+
</div>
91+
<?php } ?>

0 commit comments

Comments
 (0)