center page content by default

This commit is contained in:
Mario Vavti 2015-09-11 11:54:35 +02:00
parent 5112b4b963
commit e42111545b
6 changed files with 13 additions and 23 deletions

View File

@ -18,7 +18,6 @@ aside {
display: table-cell; display: table-cell;
vertical-align: top; vertical-align: top;
padding: 80px 7px 0px 7px; padding: 80px 7px 0px 7px;
} }
section { section {

View File

@ -1,10 +0,0 @@
main {
margin-left: auto;
margin-right: auto;
}
aside#region_3 {
width: $aside_widthpx;
min-width: $aside_widthpx;
max-width: $aside_widthpx;
}

View File

@ -24,13 +24,15 @@ body {
height: 100%; height: 100%;
} }
aside#region_1 { aside {
width: $aside_widthpx; width: $aside_widthpx;
min-width: $aside_widthpx; min-width: $aside_widthpx;
max-width: $aside_widthpx; max-width: $aside_widthpx;
} }
main { main {
margin-left: auto;
margin-right: auto;
max-width: $main_widthpx; max-width: $main_widthpx;
} }

View File

@ -31,7 +31,7 @@ function theme_content(&$a) {
$arr['radius'] = get_pconfig(local_channel(),'redbasic', 'radius' ); $arr['radius'] = get_pconfig(local_channel(),'redbasic', 'radius' );
$arr['shadow'] = get_pconfig(local_channel(),'redbasic', 'photo_shadow' ); $arr['shadow'] = get_pconfig(local_channel(),'redbasic', 'photo_shadow' );
$arr['converse_width']=get_pconfig(local_channel(),"redbasic","converse_width"); $arr['converse_width']=get_pconfig(local_channel(),"redbasic","converse_width");
$arr['converse_center']=get_pconfig(local_channel(),"redbasic","converse_center"); $arr['align_left']=get_pconfig(local_channel(),"redbasic","align_left");
$arr['nav_min_opacity']=get_pconfig(local_channel(),"redbasic","nav_min_opacity"); $arr['nav_min_opacity']=get_pconfig(local_channel(),"redbasic","nav_min_opacity");
$arr['top_photo']=get_pconfig(local_channel(),"redbasic","top_photo"); $arr['top_photo']=get_pconfig(local_channel(),"redbasic","top_photo");
$arr['reply_photo']=get_pconfig(local_channel(),"redbasic","reply_photo"); $arr['reply_photo']=get_pconfig(local_channel(),"redbasic","reply_photo");
@ -68,7 +68,7 @@ function theme_post(&$a) {
set_pconfig(local_channel(), 'redbasic', 'radius', $_POST['redbasic_radius']); set_pconfig(local_channel(), 'redbasic', 'radius', $_POST['redbasic_radius']);
set_pconfig(local_channel(), 'redbasic', 'photo_shadow', $_POST['redbasic_shadow']); set_pconfig(local_channel(), 'redbasic', 'photo_shadow', $_POST['redbasic_shadow']);
set_pconfig(local_channel(), 'redbasic', 'converse_width', $_POST['redbasic_converse_width']); set_pconfig(local_channel(), 'redbasic', 'converse_width', $_POST['redbasic_converse_width']);
set_pconfig(local_channel(), 'redbasic', 'converse_center', $_POST['redbasic_converse_center']); set_pconfig(local_channel(), 'redbasic', 'align_left', $_POST['redbasic_align_left']);
set_pconfig(local_channel(), 'redbasic', 'nav_min_opacity', $_POST['redbasic_nav_min_opacity']); set_pconfig(local_channel(), 'redbasic', 'nav_min_opacity', $_POST['redbasic_nav_min_opacity']);
set_pconfig(local_channel(), 'redbasic', 'top_photo', $_POST['redbasic_top_photo']); set_pconfig(local_channel(), 'redbasic', 'top_photo', $_POST['redbasic_top_photo']);
set_pconfig(local_channel(), 'redbasic', 'reply_photo', $_POST['redbasic_reply_photo']); set_pconfig(local_channel(), 'redbasic', 'reply_photo', $_POST['redbasic_reply_photo']);
@ -126,7 +126,7 @@ if(feature_enabled(local_channel(),'expert'))
'$radius' => array('redbasic_radius', t('Set radius of corners'), $arr['radius']), '$radius' => array('redbasic_radius', t('Set radius of corners'), $arr['radius']),
'$shadow' => array('redbasic_shadow', t('Set shadow depth of photos'), $arr['shadow']), '$shadow' => array('redbasic_shadow', t('Set shadow depth of photos'), $arr['shadow']),
'$converse_width' => array('redbasic_converse_width',t('Set maximum width of content region in pixel'),$arr['converse_width'], t('Leave empty for default width')), '$converse_width' => array('redbasic_converse_width',t('Set maximum width of content region in pixel'),$arr['converse_width'], t('Leave empty for default width')),
'$converse_center' => array('redbasic_converse_center',t('Center page content'),$arr['converse_center'], '', array(t('No'),t('Yes'))), '$align_left' => array('redbasic_align_left',t('Left align page content'),$arr['align_left'], '', array(t('No'),t('Yes'))),
'$nav_min_opacity' => array('redbasic_nav_min_opacity',t('Set minimum opacity of nav bar - to hide it'),$arr['nav_min_opacity']), '$nav_min_opacity' => array('redbasic_nav_min_opacity',t('Set minimum opacity of nav bar - to hide it'),$arr['nav_min_opacity']),
'$top_photo' => array('redbasic_top_photo', t('Set size of conversation author photo'), $arr['top_photo']), '$top_photo' => array('redbasic_top_photo', t('Set size of conversation author photo'), $arr['top_photo']),
'$reply_photo' => array('redbasic_reply_photo', t('Set size of followup author photos'), $arr['reply_photo']), '$reply_photo' => array('redbasic_reply_photo', t('Set size of followup author photos'), $arr['reply_photo']),

View File

@ -36,7 +36,7 @@ if(! $a->install) {
$radius = get_pconfig($uid, "redbasic", "radius"); $radius = get_pconfig($uid, "redbasic", "radius");
$shadow = get_pconfig($uid,"redbasic","photo_shadow"); $shadow = get_pconfig($uid,"redbasic","photo_shadow");
$converse_width=get_pconfig($uid,"redbasic","converse_width"); $converse_width=get_pconfig($uid,"redbasic","converse_width");
$converse_center=get_pconfig($uid,"redbasic","converse_center"); $align_left=get_pconfig($uid,"redbasic","align_left");
$nav_min_opacity=get_pconfig($uid,'redbasic','nav_min_opacity'); $nav_min_opacity=get_pconfig($uid,'redbasic','nav_min_opacity');
$top_photo=get_pconfig($uid,'redbasic','top_photo'); $top_photo=get_pconfig($uid,'redbasic','top_photo');
$reply_photo=get_pconfig($uid,'redbasic','reply_photo'); $reply_photo=get_pconfig($uid,'redbasic','reply_photo');
@ -157,11 +157,11 @@ if(file_exists('view/theme/redbasic/css/style.css')) {
$aside_width = 285; $aside_width = 285;
// left aside and right aside are is 231px + converse width // left aside and right aside are is 231px + converse width
if($converse_center) { if($align_left) {
$main_width = (($aside_width * 2) + intval($converse_width)); $main_width = (($aside_width) + intval($converse_width));
} }
else { else {
$main_width = (($aside_width) + intval($converse_width)); $main_width = (($aside_width * 2) + intval($converse_width));
} }
// prevent main_width smaller than 768px // prevent main_width smaller than 768px
$main_width = (($main_width < 768) ? 768 : $main_width); $main_width = (($main_width < 768) ? 768 : $main_width);
@ -209,9 +209,8 @@ if($narrow_navbar && file_exists('view/theme/redbasic/css/narrow_navbar.css')) {
echo file_get_contents('view/theme/redbasic/css/narrow_navbar.css'); echo file_get_contents('view/theme/redbasic/css/narrow_navbar.css');
} }
if($converse_center && file_exists('view/theme/redbasic/css/converse_center.css')) { if($align_left && file_exists('view/theme/redbasic/css/align_left.css')) {
$cc = file_get_contents('view/theme/redbasic/css/converse_center.css'); echo file_get_contents('view/theme/redbasic/css/align_left.css');
echo str_replace(array_keys($options), array_values($options), $cc);
} }
if($schemecss) { if($schemecss) {

View File

@ -28,7 +28,7 @@
{{include file="field_input.tpl" field=$reply_photo}} {{include file="field_input.tpl" field=$reply_photo}}
{{/if}} {{/if}}
{{include file="field_input.tpl" field=$converse_width}} {{include file="field_input.tpl" field=$converse_width}}
{{include file="field_checkbox.tpl" field=$converse_center}} {{include file="field_checkbox.tpl" field=$align_left}}
{{include file="field_checkbox.tpl" field=$narrow_navbar}} {{include file="field_checkbox.tpl" field=$narrow_navbar}}
{{if $expert}} {{if $expert}}
<script> <script>