Popup control now supports several sizes via `data-size` attribute: giant, huge, large, small, tiny.
Fixes various bugs in RC version
This commit is contained in:
parent
8c4dfd156d
commit
0a6e14f4d2
|
|
@ -1,6 +1,8 @@
|
|||
* **Build 187** (2015-03-31)
|
||||
- **Upgraded framework to Laravel version 5**, see the [end of beta page](http://octobercms.com/beta#advanced-upgrade) for information on how to upgrade.
|
||||
- Introduced a linking policy to control the way URLs are generated globally (see config cms.linkPolicy).
|
||||
- Popup control now supports several sizes via `data-size` attribute: giant, huge, large, small, tiny.
|
||||
- Added new scaffold command for creating form widgets `create:formwidget Acme.Blog PostSelector`.
|
||||
|
||||
* **Build 186** (2015-02-03)
|
||||
- File Upload form widget can now specify `fileTypes` for restricting which file extensions can be uploaded.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -621,7 +621,7 @@ this.$modal.on('shown.bs.modal',function(){self.triggerEvent('shown.oc.popup')})
|
|||
this.$modal.on('close.oc.popup',function(){self.hide()
|
||||
return false})
|
||||
this.init()}
|
||||
Popup.DEFAULTS={ajax:null,handler:null,keyboard:true,extraData:{},content:null}
|
||||
Popup.DEFAULTS={ajax:null,handler:null,keyboard:true,extraData:{},content:null,size:null}
|
||||
Popup.prototype.init=function(){var self=this
|
||||
if(self.isOpen)
|
||||
return
|
||||
|
|
@ -639,6 +639,8 @@ else if(this.options.content){var content=typeof this.options.content=='function
|
|||
this.setContent(content)}}
|
||||
Popup.prototype.createPopupContainer=function(){var
|
||||
modal=$('<div />').prop({class:'control-popup modal fade',role:'dialog',tabindex:-1}),modalDialog=$('<div />').addClass('modal-dialog'),modalContent=$('<div />').addClass('modal-content')
|
||||
if(this.options.size)
|
||||
modalDialog.addClass('size-'+this.options.size)
|
||||
return modal.append(modalDialog.append(modalContent))}
|
||||
Popup.prototype.setContent=function(contents){this.$content.html(contents)
|
||||
this.setLoading(false)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,8 @@
|
|||
handler: null,
|
||||
keyboard: true,
|
||||
extraData: {},
|
||||
content: null
|
||||
content: null,
|
||||
size: null
|
||||
}
|
||||
|
||||
Popup.prototype.init = function(){
|
||||
|
|
@ -164,6 +165,9 @@
|
|||
modalDialog = $('<div />').addClass('modal-dialog'),
|
||||
modalContent = $('<div />').addClass('modal-content')
|
||||
|
||||
if (this.options.size)
|
||||
modalDialog.addClass('size-' + this.options.size)
|
||||
|
||||
return modal.append(modalDialog.append(modalContent))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@
|
|||
// Popup
|
||||
// --------------------------------------------------
|
||||
|
||||
@popup-size-giant: 982px;
|
||||
@popup-size-huge: 900px;
|
||||
@popup-size-large: 750px;
|
||||
@popup-size-small: 400px;
|
||||
@popup-size-tiny: 300px;
|
||||
|
||||
.modal-content {
|
||||
.box-shadow(none);
|
||||
.border-radius(2px);
|
||||
|
|
@ -36,6 +42,18 @@
|
|||
}
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
@media (min-width: @screen-sm-min) {
|
||||
&.size-tiny { width: @popup-size-tiny; }
|
||||
&.size-small { width: @popup-size-small; }
|
||||
}
|
||||
@media (min-width: @screen-md-min) {
|
||||
&.size-large { width: @popup-size-large; }
|
||||
&.size-huge { width: @popup-size-huge; }
|
||||
&.size-giant { width: @popup-size-giant; }
|
||||
}
|
||||
}
|
||||
|
||||
.control-popup {
|
||||
&.fade {
|
||||
.modal-dialog {
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@ class FormController extends ControllerBehavior
|
|||
protected function prepareVars($model)
|
||||
{
|
||||
$this->controller->vars['formModel'] = $model;
|
||||
$this->controller->vars['formContext'] = $this->formGetContext();
|
||||
$this->controller->vars['formRecordName'] = Lang::get($this->getConfig('name', 'backend::lang.model.name'));
|
||||
}
|
||||
|
||||
|
|
@ -384,14 +385,14 @@ class FormController extends ControllerBehavior
|
|||
}
|
||||
|
||||
if (post('redirect', true)) {
|
||||
$redirectUrl = Backend::url($this->getRedirectUrl($context));
|
||||
$redirectUrl = $this->getRedirectUrl($context);
|
||||
}
|
||||
|
||||
if ($model && $redirectUrl) {
|
||||
$redirectUrl = RouterHelper::parseValues($model, array_keys($model->getAttributes()), $redirectUrl);
|
||||
}
|
||||
|
||||
return ($redirectUrl) ? Redirect::to($redirectUrl) : null;
|
||||
return ($redirectUrl) ? Backend::redirect($redirectUrl) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ use Exception;
|
|||
use BackendAuth;
|
||||
use Backend\Models\UserPreferences;
|
||||
use Backend\Models\BackendPreferences;
|
||||
use SystemException;
|
||||
use ApplicationException;
|
||||
use October\Rain\Exception\SystemException;
|
||||
use October\Rain\Exception\ValidationException;
|
||||
use October\Rain\Exception\ApplicationException;
|
||||
use October\Rain\Extension\Extendable;
|
||||
use ValidationException;
|
||||
use Illuminate\Database\Eloquent\MassAssignmentException;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ class Controller extends Extendable
|
|||
if (!BackendAuth::check()) {
|
||||
return Request::ajax()
|
||||
? Response::make(Lang::get('backend::lang.page.access_denied.label'), 403)
|
||||
: Redirect::guest(Backend::url('backend/auth'));
|
||||
: Backend::redirectGuest('backend/auth');
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class Auth extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
return Redirect::to(Backend::url('backend/auth/signin'));
|
||||
return Backend::redirect('backend/auth/signin');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -85,7 +85,7 @@ class Auth extends Controller
|
|||
AccessLog::add($user);
|
||||
|
||||
// Redirect to the intended page after successful sign in
|
||||
return Redirect::intended(Backend::url('backend'));
|
||||
return Backend::redirectIntended('backend');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -94,7 +94,7 @@ class Auth extends Controller
|
|||
public function signout()
|
||||
{
|
||||
BackendAuth::logout();
|
||||
return Redirect::to(Backend::url('backend'));
|
||||
return Backend::redirect('backend');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -144,7 +144,7 @@ class Auth extends Controller
|
|||
$message->to($user->email, $user->full_name)->subject(trans('backend::lang.account.password_reset'));
|
||||
});
|
||||
|
||||
return Redirect::to(Backend::url('backend/auth/signin'));
|
||||
return Backend::redirect('backend/auth/signin');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -199,6 +199,6 @@ class Auth extends Controller
|
|||
|
||||
Flash::success(trans('backend::lang.account.reset_success'));
|
||||
|
||||
return Redirect::to(Backend::url('backend/auth/signin'));
|
||||
return Backend::redirect('backend/auth/signin');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class Users extends Controller
|
|||
{
|
||||
// Users cannot edit themselves, only use My Settings
|
||||
if ($context != 'myaccount' && $recordId == $this->user->id) {
|
||||
return Redirect::to(Backend::url('backend/users/myaccount'));
|
||||
return Backend::redirect('backend/users/myaccount');
|
||||
}
|
||||
|
||||
return $this->asExtension('FormController')->update($recordId, $context);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
if (typeof option == 'string') result = data[option].apply(data, args)
|
||||
if (typeof result != 'undefined') return false
|
||||
})
|
||||
|
||||
|
||||
return result ? result : this
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
name="<?= $name ?>"
|
||||
value="<?= $value ?>"
|
||||
class="form-control align-right"
|
||||
autocomplete="off">
|
||||
autocomplete="off" />
|
||||
</div>
|
||||
|
||||
<?php elseif ($mode == 'datetime'): ?>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
name="<?= $name ?>"
|
||||
value="<?= $value ?>"
|
||||
class="form-control align-right"
|
||||
autocomplete="off">
|
||||
autocomplete="off" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
autocomplete="off"
|
||||
data-autoclose="true"
|
||||
data-placement="bottom"
|
||||
data-align="right">
|
||||
data-align="right" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
autocomplete="off"
|
||||
data-autoclose="true"
|
||||
data-placement="bottom"
|
||||
data-align="right">
|
||||
data-align="right" />
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
||||
|
|
|
|||
|
|
@ -22,9 +22,10 @@ use Cms\Models\MaintenanceSettings;
|
|||
use System\Models\RequestLog;
|
||||
use System\Classes\ErrorHandler;
|
||||
use System\Classes\CombineAssets;
|
||||
use ApplicationException;
|
||||
use System\Twig\Extension as SystemTwigExtension;
|
||||
use ValidationException;
|
||||
use October\Rain\Exception\SystemException;
|
||||
use October\Rain\Exception\ValidationException;
|
||||
use October\Rain\Exception\ApplicationException;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -83,8 +83,7 @@ class Themes extends Controller
|
|||
$model = $this->getThemeData($dirName);
|
||||
$model->delete();
|
||||
|
||||
$redirectUrl = Backend::url('cms/themes/update/'.$dirName);
|
||||
return Redirect::to($redirectUrl);
|
||||
return Backend::redirect('cms/themes/update/'.$dirName);
|
||||
}
|
||||
|
||||
protected function getThemeData($dirName)
|
||||
|
|
|
|||
|
|
@ -104,10 +104,10 @@ class Settings extends Controller
|
|||
*/
|
||||
if ($redirectUrl = post('redirect', true)) {
|
||||
$redirectUrl = ($item->context == 'mysettings')
|
||||
? Backend::url('system/settings/mysettings')
|
||||
: Backend::url('system/settings');
|
||||
? 'system/settings/mysettings'
|
||||
: 'system/settings';
|
||||
|
||||
return Redirect::to($redirectUrl);
|
||||
return Backend::redirect($redirectUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -117,8 +117,7 @@ class Settings extends Controller
|
|||
$model = $this->createModel($item);
|
||||
$model->resetDefault();
|
||||
|
||||
$redirectUrl = Backend::url('system/settings/update/'.$author.'/'.$plugin.'/'.$code);
|
||||
return Redirect::to($redirectUrl);
|
||||
return Backend::redirect('system/settings/update/'.$author.'/'.$plugin.'/'.$code);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -131,12 +131,12 @@ class Updates extends Controller
|
|||
case 'completeUpdate':
|
||||
$manager->update();
|
||||
Flash::success(Lang::get('system::lang.updates.update_success'));
|
||||
return Redirect::to(Backend::url('system/updates'));
|
||||
return Backend::redirect('system/updates');
|
||||
|
||||
case 'completeInstall':
|
||||
$manager->update();
|
||||
Flash::success(Lang::get('system::lang.install.install_success'));
|
||||
return Redirect::to(Backend::url('system/updates'));
|
||||
return Backend::redirect('system/updates');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -389,7 +389,7 @@ class Updates extends Controller
|
|||
]);
|
||||
|
||||
Flash::success(Lang::get('system::lang.project.unbind_success'));
|
||||
return Redirect::to(Backend::url('system/updates'));
|
||||
return Backend::redirect('system/updates');
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -545,6 +545,6 @@ class Updates extends Controller
|
|||
Flash::success(Lang::get('system::lang.plugins.enable_success'));
|
||||
}
|
||||
|
||||
return Redirect::to(Backend::url('system/updates/manage'));
|
||||
return Backend::redirect('system/updates/manage');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue