<div class="container">
<div class="row">
<div class="col-md-6">
Картинка с названием
</div>
<div class="col-md-6">
<div class="row">
<div class="col-lg-3 col-md-6">
Цена
</div>
<div class="col-lg-3 col-md-6">
Количество
</div>
<div class="col-lg-3 col-md-6">
Сумма
</div>
<div class="col-lg-3 col-md-6">
Лайки
</div>
</div>
</div>
</div>
</div>
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var jade = require('gulp-jade');
var concat = require('gulp-concat');
var extender = require('gulp-html-extend');
var browserSync = require('browser-sync');
var autoprefixer = require('gulp-autoprefixer');
var pub = './dist/';
var src = './src/';
gulp.task('js', function () {
gulp.src(src + 'js/**/*.*')
.pipe(gulp.dest(pub + 'js/'))
.pipe(browserSync.stream());
});
gulp.task('sass', function () {
gulp.src(src + 'sass/index.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 3 versions'],
cascade: false
}))
.pipe(concat('app.css'))
.pipe(gulp.dest(pub + 'css'))
.pipe(browserSync.stream());
});
gulp.task('directory', function () {
gulp.src(src + 'fonts/**/*.*')
.pipe(gulp.dest(pub + 'fonts/'));
gulp.src(src + 'svg/**/*.*')
.pipe(gulp.dest(pub + 'svg/'));
});
// gulp.task('jade', function () {
// return gulp.src(src + 'templates/jade/*.jade')
// .pipe(jade())
// .pipe(gulp.dest(pub))
// .pipe(browserSync.stream());
// });
gulp.task('extend', function () {
gulp.src(src + 'templates/*.html')
.pipe(extender({annotations:true,verbose:false})) // default options
.pipe(gulp.dest(pub))
});
gulp.task('sync', function () {
browserSync.init({
server: {
baseDir: pub
},
port: '3000',
ghostMode: false,
open: false,
serveStatic: [src]
});
gulp.watch(
[ '*.html' ],
{ cwd: pub },
browserSync.reload
);
});
gulp.task('watchers', function() {
gulp.watch(src + 'sass/**/*.scss', ['sass']);
gulp.watch(src + 'templates/**/*.html', ['extend']);
gulp.watch(src + 'js/**/*.*', ['js']);
});
gulp.task(
'default',
[
'watchers',
'sass',
'directory',
'extend',
'js',
'sync'
]
);
Принципиально, чтобы услуги были вложены в регион, а не наоборот.
mysite.ru/regions/region_id/servises/all
mysite.ru/moskva/services/all
resources :regions, path: ''
class Article < ...
# ...
def to_param
"#{created_at.year}/#{created_at.month}/#{created_at.day}/#{transliterated_title}"
end
# ..
end
def to_param
"#{created_at.year}/#{created_at.month}/#{created_at.day}/#{id}-#{transliterated_title}"
end
def to_param
"#{created_at.year}/#{created_at.month}/#{created_at.day}/#{transliterated_title}-#{id}"
end
before_save :update_slug
private
def update_slug
self.slug = to_param
end
def to_param
"#{id}-#{transliterated_title}"
end
@resource = Article.find params[:id].to_i