diff --git a/css/swad_desktop.css b/css/swad_desktop.css index 4e27e9c18..0ee73f2ac 100644 --- a/css/swad_desktop.css +++ b/css/swad_desktop.css @@ -302,12 +302,23 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} display:table; width:100%; } -.LEFT_RIGHT_COL +.LEFT_COL { display:table-cell; width:160px; text-align:center; vertical-align:top; + position:absolute; + left:0; + } +.RIGHT_COL + { + display:table-cell; + width:160px; + text-align:center; + vertical-align:top; + position:absolute; + right:0; } .LEFT_RIGHT_CELL { @@ -319,26 +330,57 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} { width:138px; } -#main_zone_central + +@media only screen and (max-width: 1280px) { /* For mobile phones: */ + #main_zone_central_none, #main_zone_central_left, #main_zone_central_right, #main_zone_central_both { display:table-cell; text-align:center; vertical-align:top; } +} +@media only screen and (min-width: 1280px) { /* For desktop: */ + #main_zone_central_none /* Hide left and right columns */ + { + display:table-cell; + text-align:center; + vertical-align:top; + } + #main_zone_central_left /* Show left column, hide right column */ + { + display:table-cell; + text-align:center; + vertical-align:top; + padding-left:160px; + } + #main_zone_central_right /* Hide left column, show right column */ + { + display:table-cell; + text-align:center; + vertical-align:top; + padding-right:160px; + } + #main_zone_central_both /* Show both columns */ + { + display:table-cell; + text-align:center; + vertical-align:top; + padding-left:160px; + padding-right:160px; + } +} + #main_zone_central_container { min-width:925px; min-height:925px; - width:100%; margin:-8px 0 0 0; padding:10px 0; border-radius:6px; box-shadow:inset -2px -2px 1px 0 rgba(50,50,50,0.2); text-align:center; vertical-align:top; - overflow:hidden; position:relative; - display:inline-block; } #main_zone_central_content { diff --git a/swad_changelog.h b/swad_changelog.h index b59853782..b427f6970 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -115,11 +115,12 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.45.15 (2015/11/25)" +#define Log_PLATFORM_VERSION "SWAD 15.46 (2015/11/27)" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 15.46: Nov 27, 2015 First version with responsive design: both side columns are hidden when screen size is small. (188078 lines) Version 15.45.15: Nov 25, 2015 Some CSS styles related to layout are moved to CSS file. (188021 lines) Version 15.45.14: Nov 25, 2015 Some CSS styles related to layout are moved to CSS file. (188037 lines) Version 15.45.13: Nov 25, 2015 Some CSS styles related to layout are moved to CSS file. (188059 lines) diff --git a/swad_global.c b/swad_global.c index e0443fd01..7a7a5a52b 100644 --- a/swad_global.c +++ b/swad_global.c @@ -130,7 +130,6 @@ void Gbl_InitializeGlobals (void) Gbl.Prefs.FirstDayOfWeek = Cal_FIRST_DAY_OF_WEEK_DEFAULT; // Default first day of week Gbl.Prefs.Layout = Lay_LAYOUT_DEFAULT; // Default layout Gbl.Prefs.Menu = Mnu_MENU_DEFAULT; // Default menu - Gbl.Prefs.SideCols = Cfg_DEFAULT_COLUMNS; // Show both side columns, left and right Gbl.Prefs.Theme = The_THEME_DEFAULT; // Default theme Gbl.Prefs.IconSet = Ico_ICON_SET_DEFAULT; // Default icon set sprintf (Gbl.Prefs.IconsURL,"%s/%s", diff --git a/swad_layout.c b/swad_layout.c index ab5fd078c..18a35caeb 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -177,6 +177,10 @@ void Lay_WriteStartOfPage (void) Txt_STR_LANG_ID[Gbl.Prefs.Language], Cfg_PLATFORM_SHORT_NAME); + /* Viewport (used for responsive design) */ + fprintf (Gbl.F.Out,"\n"); + /* Title */ Lay_WritePageTitle (); @@ -257,16 +261,6 @@ void Lay_WriteStartOfPage (void) return; } - if (Act_Actions[Gbl.CurrentAct].BrowserWindow == Act_MAIN_WINDOW) - fprintf (Gbl.F.Out,"
" - "\"\"" - "
" - "
" - "
", - Gbl.Prefs.IconsURL); - /***** Start of box that contains the whole page except the foot *****/ fprintf (Gbl.F.Out,"
",IdWholePage[Gbl.Prefs.Theme]); @@ -290,23 +284,48 @@ void Lay_WriteStartOfPage (void) if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) if (Gbl.Prefs.SideCols & Lay_SHOW_LEFT_COLUMN) // Left column visible { - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); Lay_ShowLeftColumn (); fprintf (Gbl.F.Out,"
"); } + /* Right column */ + if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) + if (Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN) // Right column visible + { + fprintf (Gbl.F.Out,"
"); + Lay_ShowRightColumn (); + fprintf (Gbl.F.Out,"
"); + } + /* Central (main) part */ - fprintf (Gbl.F.Out,"
" - "
" + switch (Gbl.Prefs.SideCols) + { + case 0: + fprintf (Gbl.F.Out,"
"); + break; + case Lay_SHOW_LEFT_COLUMN: + fprintf (Gbl.F.Out,"
"); + break; + case Lay_SHOW_RIGHT_COLUMN: + fprintf (Gbl.F.Out,"
"); + break; + case (Lay_SHOW_LEFT_COLUMN | Lay_SHOW_RIGHT_COLUMN): + fprintf (Gbl.F.Out,"
"); + break; + } + fprintf (Gbl.F.Out,"
" "
", The_TabOnBgColors[Gbl.Prefs.Theme]); switch (Gbl.Prefs.Layout) { case Lay_LAYOUT_DESKTOP: /* Left bar used to expand-contract central zone */ + /* fprintf (Gbl.F.Out,"
"); Pre_PutLeftIconToHideShowCols (); fprintf (Gbl.F.Out,"
"); + */ if (Gbl.Prefs.Menu == Mnu_MENU_VERTICAL) { @@ -381,31 +400,25 @@ static void Lay_WriteEndOfPage (void) if (!Gbl.Layout.TablEndWritten) { Gbl.Layout.TablEndWritten = true; - fprintf (Gbl.F.Out,"
"); + fprintf (Gbl.F.Out,"
"); // main_zone_canvas + /* if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) { - /* Right bar used to expand-contract central zone */ + // Right bar used to expand-contract central zone fprintf (Gbl.F.Out,"
"); Pre_PutRigthIconToHideShowCols (); fprintf (Gbl.F.Out,"
"); } + */ - fprintf (Gbl.F.Out,"
" - "
" - "
"); - - /* Right column */ - if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) - if (Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN) // Right column visible - { - fprintf (Gbl.F.Out,"
"); - Lay_ShowRightColumn (); - fprintf (Gbl.F.Out,"
"); - } + fprintf (Gbl.F.Out,"
" // main_zone_central_content + "
" // main_zone_central_container + "
" // main_zone_central + "
"); // main_zone /***** End of box that contains the whole page except the foot *****/ - fprintf (Gbl.F.Out,"
\n"); + fprintf (Gbl.F.Out,"\n"); // whole_page_* } } @@ -769,7 +782,7 @@ static void Lay_WritePageTopHeadingDesktop (void) Usr_PutFormLogIn (); fprintf (Gbl.F.Out,""); - /* Start of 1st. row */ + /* End of 1st. row */ fprintf (Gbl.F.Out,""); /***** 2nd. row *****/