Merge pull request #127 from openclassify/vedatt

create base theme
This commit is contained in:
Fatih Alp 2019-10-29 17:18:49 +03:00 committed by GitHub
commit ff585f7512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2220 changed files with 197 additions and 615 deletions

View File

@ -1,31 +0,0 @@
$(document).ready(function () {
const query = {};
query.getParentCats = (id) => {
$.ajax({
type: 'get',
url: '/categories/checkparent/' + id,
success: function (response) {
hideLoader()
var array = response.reverse();
for(var i=0;i<array.length;i++){
if (i != 0) {
array[i]=" > " + array[i];
}
}
$('[name="parent_category"] option[value="'+ id + '"]').html(array);
},
beforeSend: function () {
showLoader()
},
error:function (err) {
return 'it broke';
}
});
};
$('[name="parent_category"] option').each(function (value) {
if (value != 0) {
query.getParentCats(value);
}
});
});

View File

@ -1,10 +0,0 @@
var catId;
$('.add_custom_field').on('click', function () {
catId = $(this).attr('data-content');
});
function custom_field (attr) {
var link = attr + "&id=" + catId;
window.location.href = link;
}

View File

@ -1,26 +0,0 @@
const fav = {};
fav.checkFav = (id, type, divId, iconId) => {
$.ajax({
type: 'get',
url: '/favs/check_favorites/'+ id+"/" +type,
success: function (response) {
if(response.length == 0) {
$(divId).attr("href", "/favs/add_fav/" + id+ "/"+type);
$(iconId).attr("class", "far fa-heart");
} else {
$(divId).attr("href", "/favs/delete_fav/" + id + "/" + "adv");
$(iconId).attr("class", "fas fa-heart");
}
},
error:function (err) {
// reject(Error("It broke"));
}
});
};
var id = $('#adv_id').html();
var owner = $('#owner').data('content');
fav.checkFav(id,'adv', '.favorites', '#heart-icon-adv');
fav.checkFav(owner,'seller', '#owner-fav', '#heart-icon-seller');

View File

@ -1,12 +0,0 @@
(function(c,K,C){c.fn.responsiveSlides=function(m){var a=c.extend({auto:!0,speed:500,timeout:4E3,pager:!1,nav:!1,random:!1,pause:!1,pauseControls:!0,prevText:"Previous",nextText:"Next",maxwidth:"",navContainer:"",manualControls:"",namespace:"rslides",before:c.noop,after:c.noop},m);return this.each(function(){C++;var f=c(this),u,t,v,n,q,r,p=0,e=f.children(),D=e.length,h=parseFloat(a.speed),E=parseFloat(a.timeout),w=parseFloat(a.maxwidth),g=a.namespace,d=g+C,F=g+"_nav "+d+"_nav",x=g+"_here",k=d+"_on",
y=d+"_s",l=c("<ul class='"+g+"_tabs "+d+"_tabs' />"),z={"float":"left",position:"relative",opacity:1,zIndex:2},A={"float":"none",position:"absolute",opacity:0,zIndex:1},G=function(){var b=(document.body||document.documentElement).style,a="transition";if("string"===typeof b[a])return!0;u=["Moz","Webkit","Khtml","O","ms"];var a=a.charAt(0).toUpperCase()+a.substr(1),c;for(c=0;c<u.length;c++)if("string"===typeof b[u[c]+a])return!0;return!1}(),B=function(b){a.before(b);G?(e.removeClass(k).css(A).eq(b).addClass(k).css(z),
p=b,setTimeout(function(){a.after(b)},h)):e.stop().fadeOut(h,function(){c(this).removeClass(k).css(A).css("opacity",1)}).eq(b).fadeIn(h,function(){c(this).addClass(k).css(z);a.after(b);p=b})};a.random&&(e.sort(function(){return Math.round(Math.random())-.5}),f.empty().append(e));e.each(function(a){this.id=y+a});f.addClass(g+" "+d);m&&m.maxwidth&&f.css("max-width",w);e.hide().css(A).eq(0).addClass(k).css(z).show();G&&e.show().css({"-webkit-transition":"opacity "+h+"ms ease-in-out","-moz-transition":"opacity "+
h+"ms ease-in-out","-o-transition":"opacity "+h+"ms ease-in-out",transition:"opacity "+h+"ms ease-in-out"});if(1<e.length){if(E<h+100)return;if(a.pager&&!a.manualControls){var H=[];e.each(function(a){a+=1;H+="<li><a href='#' class='"+y+a+"'>"+a+"</a></li>"});l.append(H);m.navContainer?c(a.navContainer).append(l):f.after(l)}a.manualControls&&(l=c(a.manualControls),l.addClass(g+"_tabs "+d+"_tabs"));(a.pager||a.manualControls)&&l.find("li").each(function(a){c(this).addClass(y+(a+1))});if(a.pager||a.manualControls)r=
l.find("a"),t=function(a){r.closest("li").removeClass(x).eq(a).addClass(x)};a.auto&&(v=function(){q=setInterval(function(){e.stop(!0,!0);var b=p+1<D?p+1:0;(a.pager||a.manualControls)&&t(b);B(b)},E)},v());n=function(){a.auto&&(clearInterval(q),v())};a.pause&&f.hover(function(){clearInterval(q)},function(){n()});if(a.pager||a.manualControls)r.bind("click",function(b){b.preventDefault();a.pauseControls||n();b=r.index(this);p===b||c("."+k).queue("fx").length||(t(b),B(b))}).eq(0).closest("li").addClass(x),
a.pauseControls&&r.hover(function(){clearInterval(q)},function(){n()});if(a.nav){g="<a href='#' class='"+F+" prev'>"+a.prevText+"</a><a href='#' class='"+F+" next'>"+a.nextText+"</a>";m.navContainer?c(a.navContainer).append(g):f.after(g);var d=c("."+d+"_nav"),I=d.filter(".prev");d.bind("click",function(b){b.preventDefault();b=c("."+k);if(!b.queue("fx").length){var d=e.index(b);b=d-1;d=d+1<D?p+1:0;B(c(this)[0]===I[0]?b:d);(a.pager||a.manualControls)&&t(c(this)[0]===I[0]?b:d);a.pauseControls||n()}});
a.pauseControls&&d.hover(function(){clearInterval(q)},function(){n()})}}if("undefined"===typeof document.body.style.maxWidth&&m.maxwidth){var J=function(){f.css("width","100%");f.width()>w&&f.css("width",w)};J();c(K).bind("resize",function(){J()})}})}})(jQuery,this,0);
$(".rslides").responsiveSlides({
nav: true
});

View File

@ -1,27 +0,0 @@
<div class="modal-header">
<button class="close" data-dismiss="modal">
<span>&times;</span>
</button>
<h4 class="modal-title">{{ trans('module::message.choose_type') }}</h4>
</div>
<div class="modal-body">
{% include "streams::modals/filter" %}
{% if not categories.isEmpty() %}
<ul class="nav nav-pills nav-stacked">
{% for category in categories %}
<li class="nav-item">
<a href="{{ url_to('admin/advs/advs/create?cat=' ~ category.id) }}" class="nav-link">
<strong>{{ category.name }}</strong>
<br>
<small>{{ category.description }}</small>
</a>
</li>
{% endfor %}
</ul>
{% else %}
{{ trans('streams::message.no_results') }}
{% endif %}
</div>

View File

@ -1,23 +0,0 @@
<div class="modal-header">
<button class="close" data-dismiss="modal">
<span>&times;</span>
</button>
<h4 class="modal-title">{{ trans('visiosoft.module.advs::message.choose_field_type') }}</h4>
</div>
<div class="modal-body">
{% include "streams::modals/filter" %}
<ul class="nav nav-pills nav-stacked">
{% for field_type in field_types %}
<li class="nav-item">
<a href="{{ url_to('admin/advs/fields/create?field_type=' ~ field_type.namespace) }}" class="nav-link">
<strong>{{ trans(field_type.getTitle()) }}</strong>
<br>
<small>{{ trans(field_type.getDescription()) }}</small>
</a>
</li>
{% endfor %}
</ul>
</div>

View File

@ -1,25 +0,0 @@
{% extends "theme::layouts/default" %}
{% block content %}
{% include "theme::partials/messages" %}
{% set form = form('advs', 'categories').entry(id).get() %}
{{ form_open()|raw }}
<div class="container-fluid">
<div class="card">
<div class="card-block">
{{ form.fields.name|raw }}
{{ form.fields.slug|raw }}
<input type="hidden" name="parent_category"
value="{% if form.fields.parent_category.value.id is defined %}{{ form.fields.parent_category.value.id }}{% elseif app.request.get('parent') is defined %}{{ app.request.get('parent') }}{% endif %}">
{{ form.fields.order|raw }}
{{ form.fields.files|raw }}
</div>
</div>
<div class="controls card">
<div class="card-block">
{{ form.actions|raw }}
</div>
</div>
</div>
{{ form.close|raw}}
{{ asset_add("scripts.js", "visiosoft.module.advs::js/admin-cat.js") }}
{% endblock %}

View File

@ -1,32 +0,0 @@
{% extends "theme::layouts/default" %}
{% block content %}
{% include "theme::partials/messages" %}
{% set form = form('advs', app.request.query|keys|first).entry(id).get() %}
{{ form_open()|raw }}
<div class="container-fluid">
<div class="card">
<div class="card-block">
{{ form.fields.name|raw }}
{{ form.fields.slug|raw }}
{% if app.request.get('cities') is not empty %}
<input type="hidden" name="parent_country_id" value="{{ app.request.get('cities') }}">
{% elseif app.request.get('districts') is not empty %}
<input type="hidden" name="parent_city_id" value="{{ app.request.get('districts') }}">
{% elseif app.request.get('neighborhoods') is not empty %}
<input type="hidden" name="parent_district_id" value="{{ app.request.get('neighborhoods') }}">
{% elseif app.request.get('village') is not empty %}
<input type="hidden" name="parent_neighborhood_id" value="{{ app.request.get('village') }}">
{% endif %}
{{ form.fields.order|raw }}
</div>
</div>
<div class="controls card">
<div class="card-block">
{{ form.actions|raw }}
</div>
</div>
</div>
{{ form.close|raw}}
{% endblock %}

View File

@ -1,22 +0,0 @@
{% extends template.layout ?: "theme::layouts/default" %}
{% block content %}
<div class="row">
<div class="col-sm-24">
{% if message %}
<ul>
{% for message_detail in message_details %}
<li style="margin-bottom:10px;">
{{message_detail.sender.display_name}}
<br>
{{ message_detail.detail }}
<br>
{{ message_detail.sent_at.format(config_get('streams::datetime.date_format')) }}
</li>
{% endfor %}
</ul>
{% endif %}
</div>
</div>
{% endblock %}

View File

@ -1,31 +0,0 @@
<tbody>
{% for row in table.rows %}
<tr id="{{ loop.index }}" class="{{ row.class }}">
{% if table.options.sortable %}
<td>
{{ icon('fa fa-arrows handle') }}
<input type="hidden" name="{{ row.table.options.prefix }}order[]" value="{{ row.key }}"/>
</td>
{% endif %}
{% if not table.actions.empty() %}
<td>
<input type="checkbox" data-toggle="action" name="{{ row.table.options.prefix }}id[]" value="{{ row.key }}"/>
</td>
{% endif %}
{% for column in row.columns %}
<td data-title="{{ trans(column.heading) }}"
class="{{ column.class }}" {{ html_attributes(column.attributes) }}>
{{ column.value|raw }}
</td>
{% endfor %}
<td class="text-lg-right">
{{ buttons(row.buttons)|raw }}
</td>
</tr>
{% endfor %}
</tbody>

View File

@ -1,57 +0,0 @@
{{ asset_add("scripts.js", "streams::js/table/table.js") }}
{% if not actions.empty() %}
{{ asset_add("scripts.js", "streams::js/table/actions.js") }}
{% endif %}
{% if table.options.sortable %}
{{ asset_add("scripts.js", "streams::js/table/sortable.js") }}
{% endif %}
<div class="container-fluid">
{{ view("streams::table/partials/filters", {'table': table}) }}
{{ view("streams::table/partials/views", {'table': table}) }}
{{ view(table.options.heading ?: "streams::table/partials/heading", {'table': table}) }}
{% if not table.rows.empty() %}
{% block card %}
<div class="card">
{{ form_open({ 'url': url_full() }) }}
<div class="table-stack">
<table
class="
{{ table.options.class ?: 'table' }}
{{ table.options.sortable ? 'table--sortable' }}
"
{{ table.options.sortable ? 'data-sortable' }}
{{ html_attributes(table.options.attributes) }}>
{{ view("streams::table/partials/header", {'table': table}) }}
{% block body %}
{{ view("visiosoft.module.advs::table.body", {'table': table}) }}
{% endblock %}
{{ view("streams::table/partials/footer", {'table': table}) }}
</table>
</div>
{{ form_close() }}
</div>
{% endblock %}
{% else %}
{% block no_results %}
<div class="card">
<div class="card-block">
{{ trans(table.options.get('no_results_message', 'streams::message.no_results')) }}
</div>
</div>
{% endblock %}
{% endif %}
</div>

View File

@ -42,7 +42,7 @@ class AdvCriteria extends EntryCriteria
->where('status', '=', 'approved')
->where('slug', '!=', '')
->orderBy('publish_at', 'desc')
->paginate($this->settings->value('visiosoft.theme.default::s-type-latest-limit'));
->paginate($this->settings->value('visiosoft.theme.base::s-type-latest-limit'));
$ads = $advModel->getLocationNames($latest_advs);
foreach ($ads as $index => $ad) {

View File

@ -21,7 +21,7 @@ class AdvResponse {
if (!$adv->getResponse()) {
$response = $this->response->view(
'visiosoft.module.advs::advs.list-item',
'visiosoft.theme.base::ad-detail/detail',
[
'adv' => $adv,
]

View File

@ -96,10 +96,6 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
'uses' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@manage'
],
'admin/class/actions/{id}/{type}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\AdvsController@actions',
'admin/advs/fields' => 'Visiosoft\AdvsModule\Http\Controller\Admin\FieldsController@index',
'admin/advs/fields/choose' => 'Visiosoft\AdvsModule\Http\Controller\Admin\FieldsController@choose',
'admin/advs/fields/create' => 'Visiosoft\AdvsModule\Http\Controller\Admin\FieldsController@create',
'admin/advs/fields/edit/{id}' => 'Visiosoft\AdvsModule\Http\Controller\Admin\FieldsController@edit',
'advs/list' => [
'as' => 'visiosoft.module.advs::list',
'uses' => 'Visiosoft\AdvsModule\Http\Controller\advsController@index'

View File

@ -40,8 +40,8 @@ class AdvsController extends AdminController
*/
public function index(AdvTableBuilder $table, \Anomaly\UsersModule\User\UserModel $userModel, CityModel $cityModel, CatsCategoryEntryModel $categoryModel)
{
$table->addAsset("theme.css", "visiosoft.module.advs::css/custom.css");
$table->addAsset('script.js', 'visiosoft.module.advs::js/admin-list.js');
$table->addAsset("theme.css", "visiosoft.theme.base::css/custom.css");
$table->addAsset('script.js', 'visiosoft.theme.base::js/admin-list.js');
$table->addButtons([
'status' => [

View File

@ -1,85 +0,0 @@
<?php namespace Visiosoft\AdvsModule\Http\Controller\Admin;
use Anomaly\Streams\Platform\Addon\FieldType\FieldTypeCollection;
use Anomaly\Streams\Platform\Assignment\AssignmentModel;
use Anomaly\Streams\Platform\Assignment\Contract\AssignmentInterface;
use Anomaly\Streams\Platform\Assignment\Contract\AssignmentRepositoryInterface;
use Anomaly\Streams\Platform\Assignment\Table\AssignmentTableBuilder;
use Anomaly\Streams\Platform\Field\Form\FieldAssignmentFormBuilder;
use Anomaly\Streams\Platform\Field\Form\FieldFormBuilder;
use Anomaly\Streams\Platform\Http\Controller\AdminController;
use Anomaly\UsersModule\Assignment\AssignmentObserver;
use Illuminate\Http\Request;
use Visiosoft\AdvsModule\Adv\AdvModel;
/**
* Class FieldsController
*
* @link http://openclassify.com/
* @author OpenClassify, Inc. <support@openclassify.com>
* @author Visiosoft Inc <support@openclassify.com>
*/
class FieldsController extends AdminController
{
/**
* Return an index of existing fields.
*
* @param AssignmentTableBuilder $table
* @return \Symfony\Component\HttpFoundation\Response
*/
public function index(AssignmentTableBuilder $table, AdvModel $advs)
{
AssignmentModel::observe(AssignmentObserver::class);
return $table
->setOption('sortable', true)
->setStream($advs->getStream())
->render();
}
/**
* Choose a field type for creating a field.
*
* @param FieldTypeCollection $fieldTypes
* @return \Illuminate\View\View
*/
public function choose(FieldTypeCollection $fieldTypes)
{
return $this->view->make('visiosoft.module.advs::admin/fields/choose', ['field_types' => $fieldTypes]);
}
public function create(FieldFormBuilder $form, AdvModel $advs, FieldTypeCollection $fieldTypes)
{
$form
->setStream($advs->getStream())
->setOption('auto_assign', true)
->setFieldType($fieldTypes->get($this->request->get('field_type')));
if ($this->request->action == 'save') {
$form->render();
$fields = new AdvModel();
$last_field = $fields->getLatestField($this->request->slug);
$fields->saveCustomField($this->request->id, $last_field->id, $last_field->slug);
return redirect('/admin/advs/categories');
} else {
return $form->render();
}
}
public function edit(AssignmentRepositoryInterface $assignments, FieldFormBuilder $form, AdvModel $model, $id)
{
/* @var AssignmentInterface $assignment */
$custom_field = new AdvModel();
$custom_field_id = $custom_field->getCustomFieldEditId($id);
$assignment = $assignments->find($custom_field_id->id);
return $form
->setStream($model->getStream())
->render($assignment->getFieldId());
}
}

View File

@ -14,6 +14,6 @@ class CategoriesController extends PublicController {
->select('advs_advs.*','u1.username as owner', 't1.name as name')
->get();
return $this->view->make('visiosoft.module.advs::advs/list', compact('advs'));
return $this->view->make('visiosoft.theme.base::list/list', compact('advs'));
}
}

View File

@ -220,11 +220,11 @@ class AdvsController extends PublicController
$viewType = $this->requestHttp->cookie('viewType');
if (isset($viewType) and $viewType == 'table')
return $this->view->make('visiosoft.module.advs::advs/table', $compact);
return $this->view->make('visiosoft.theme.base::list/table', $compact);
elseif (isset($viewType) and $viewType == 'map')
return $this->view->make('visiosoft.module.advs::advs/map', $compact);
return $this->view->make('visiosoft.theme.base::list/map', $compact);
return $this->view->make('visiosoft.module.advs::advs/list', $compact);
return $this->view->make('visiosoft.theme.base::list/list', $compact);
}
public function viewType($type)
@ -302,7 +302,7 @@ class AdvsController extends PublicController
if ($adv->created_by_id == isset(auth()->user()->id) OR $adv->status == "approved") {
return $this->view->make('visiosoft.module.advs::advs/list-item', compact('adv', 'complaints', 'recommended_advs', 'categories', 'features', 'tags', 'profile', 'comments', 'qrSRC'));
return $this->view->make('visiosoft.theme.base::ad-detail/detail', compact('adv', 'complaints', 'recommended_advs', 'categories', 'features', 'tags', 'profile', 'comments', 'qrSRC'));
} else {
return back();
}
@ -396,7 +396,7 @@ class AdvsController extends PublicController
$custom_fields = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->create($categories);
}
//Cloudinary Module
return $this->view->make('visiosoft.module.advs::advs/new-create', compact(
return $this->view->make('visiosoft.theme.base::new-ad/new-create', compact(
'request', 'formBuilder', 'cats_d', 'custom_fields'));
}
@ -707,7 +707,7 @@ class AdvsController extends PublicController
$custom_fields = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->edit($adv, $categories, $cats);
}
return $this->view->make('visiosoft.module.advs::advs/new-create', compact('id', 'cats_d', 'request', 'Cloudinary', 'cities', 'adv', 'custom_fields', 'nameField', 'descField'));
return $this->view->make('visiosoft.theme.base::new-ad/new-create', compact('id', 'cats_d', 'request', 'Cloudinary', 'cities', 'adv', 'custom_fields', 'nameField', 'descField'));
}
public function destroy($id)
@ -764,7 +764,7 @@ class AdvsController extends PublicController
}
$main_cats = $this->category_repository->mainCats();
return $this->view->make('visiosoft.module.advs::advs/post-cat', compact('main_cats'));
return $this->view->make('visiosoft.theme.base::new-ad/post-cat', compact('main_cats'));
}
@ -801,7 +801,7 @@ class AdvsController extends PublicController
$main_cats = $this->category_repository->mainCats();
return $this->view->make('visiosoft.module.advs::advs/edit-cat', compact('main_cats', 'id'));
return $this->view->make('visiosoft.theme.base::new-ad/edit-cat', compact('main_cats', 'id'));
}
@ -813,7 +813,7 @@ class AdvsController extends PublicController
$urlPrev = str_replace(url('/'), '', url()->previous());
return $this->view->make('visiosoft.theme.default::login', compact('urlPrev'));
return $this->view->make('visiosoft.theme.base::login', compact('urlPrev'));
}
public function register()
@ -823,7 +823,7 @@ class AdvsController extends PublicController
return redirect('/');
}
return $this->view->make('visiosoft.theme.default::register');
return $this->view->make('visiosoft.theme.base::register');
}
public function passwordForgot()
@ -832,7 +832,7 @@ class AdvsController extends PublicController
return redirect('/');
}
return $this->view->make('visiosoft.theme.default::passwords/forgot');
return $this->view->make('visiosoft.theme.base::passwords/forgot');
}
public function passwordReset(Request $request)
@ -841,14 +841,14 @@ class AdvsController extends PublicController
return redirect('/');
}
$code = $request->email;
return $this->view->make('visiosoft.theme.default::passwords/reset', compact('code'));
return $this->view->make('visiosoft.theme.base::passwords/reset', compact('code'));
}
public function homePage(CategoryRepositoryInterface $repository)
{
$cats = $repository->mainCats();
return $this->view->make('visiosoft.theme.default::addons/anomaly/pages-module/page', compact('cats'));
return $this->view->make('visiosoft.theme.base::addons/anomaly/pages-module/page', compact('cats'));
}
public function map(AdvRepositoryInterface $advRepository,

View File

@ -0,0 +1,22 @@
{
"name": "visiosoft/base-theme",
"type": "streams-addon",
"authors": [
{
"name": "Visiosoft, LTD.",
"email": "support@visiosoft.com.tr",
"homepage": "https://visiosoft.com.tr/",
"role": "Owner"
},
{
"name": "Vedat Akdoğan",
"email": "vedat@visiosoft.com.tr",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"Visiosoft\\BaseTheme\\": "src/"
}
}
}

Some files were not shown because too many files have changed in this diff Show More