From 1a04994f6e238a7f4ddb18748e01d12b2b797abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Wed, 31 Dec 2014 19:51:49 +0100 Subject: [PATCH] Version 14.50 --- css/swad_desktop.css | 115 +++++++++++++++++++++++++++++-------------- css/swad_mobile.css | 2 +- swad_changelog.h | 5 +- swad_exam.c | 2 +- swad_layout.c | 113 +++++++++++++++++++++++++++++++++++++++--- swad_text.c | 16 +++--- 6 files changed, 197 insertions(+), 56 deletions(-) diff --git a/css/swad_desktop.css b/css/swad_desktop.css index f05da22a8..7fe5266ab 100644 --- a/css/swad_desktop.css +++ b/css/swad_desktop.css @@ -22,10 +22,11 @@ along with this program. If not, see . */ -A:link {text-decoration:none;} -A:visited {text-decoration:none;} -A:active {text-decoration:none;} -A:hover {text-decoration:underline;} +a:link {text-decoration:none;} +a:visited {text-decoration:none;} +a:active {text-decoration:none;} +a:hover {text-decoration:none;} + body { margin:0; @@ -234,32 +235,33 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} .TAB_OFF { float:left; - width:86px;height:61px; + width:86px;height:59px; margin:1px 1px 0 1px; - padding:0 1px 0 1px; + padding:2px 1px 0 1px; border-radius:6px 6px 0 0; box-shadow:inset -2px -2px 1px 0 rgba(50, 50, 50, 0.2); text-align:center; + vertical-align:middle; overflow:hidden; display:inline-block; } .TAB_ON { float:left; - width:88px;height:62px; + width:88px;height:60px; margin:0; - padding:1px 1px 0 1px; + padding:3px 1px 0 1px; border-radius:6px 6px 0 0; box-shadow:inset -2px -2px 1px 0 rgba(50, 50, 50, 0.2); text-align:center; + vertical-align:middle; overflow:hidden; display:inline-block; } .WHITE_TAB_OFF { - font-family:Arial, "Nimbus Sans L", "DejaVu LGC Sans", "Bitstream Vera Sans", sans-serif; color:#707070; - font-size:7.5pt; + font-size:7pt; font-weight:bold; line-height:100%; white-space:nowrap; @@ -267,9 +269,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} } .GREY_TAB_OFF { - font-family:Arial, "Nimbus Sans L", "DejaVu LGC Sans", "Bitstream Vera Sans", sans-serif; color:#505050; - font-size:7.5pt; + font-size:7pt; font-weight:bold; line-height:100%; white-space:nowrap; @@ -277,9 +278,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} } .BLUE_TAB_OFF { - font-family:Arial, "Nimbus Sans L", "DejaVu LGC Sans", "Bitstream Vera Sans", sans-serif; color:#365E6E; - font-size:7.5pt; + font-size:7pt; font-weight:bold; line-height:100%; white-space:nowrap; @@ -287,9 +287,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} } .YELLOW_TAB_OFF { - font-family:Arial, "Nimbus Sans L", "DejaVu LGC Sans", "Bitstream Vera Sans", sans-serif; color:#7C4D2A; - font-size:7.5pt; + font-size:7pt; font-weight:bold; line-height:100%; white-space:nowrap; @@ -297,9 +296,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} } .WHITE_TAB_ON { - font-family:Arial, "Nimbus Sans L", "DejaVu LGC Sans", "Bitstream Vera Sans", sans-serif; color:#4D88A1; - font-size:7.5pt; + font-size:7pt; font-weight:bold; line-height:100%; white-space:nowrap; @@ -307,9 +305,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} } .GREY_TAB_ON { - font-family:Arial, "Nimbus Sans L", "DejaVu LGC Sans", "Bitstream Vera Sans", sans-serif; color:#606060; - font-size:7.5pt; + font-size:7pt; font-weight:bold; line-height:100%; white-space:nowrap; @@ -317,9 +314,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} } .BLUE_TAB_ON { - font-family:Arial, "Nimbus Sans L", "DejaVu LGC Sans", "Bitstream Vera Sans", sans-serif; color:#4D88A1; - font-size:7.5pt; + font-size:7pt; font-weight:bold; line-height:100%; white-space:nowrap; @@ -327,9 +323,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} } .YELLOW_TAB_ON { - font-family:Arial, "Nimbus Sans L", "DejaVu LGC Sans", "Bitstream Vera Sans", sans-serif; color:#BD4815; - font-size:7.5pt; + font-size:7pt; font-weight:bold; line-height:100%; white-space:nowrap; @@ -372,6 +367,7 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;} /*********************************** Icons ***********************************/ .ICON16x16 {width:16px; height:16px; vertical-align:middle;} .ICON16x16B {width:16px; height:16px; vertical-align:middle; display:block;} +.ICON28x28 {width:28px; height:28px; vertical-align:middle;} .ICON32x32 {width:32px; height:32px; vertical-align:middle;} .ICON64x64 {width:64px; height:64px; vertical-align:middle;} @@ -576,11 +572,59 @@ a:hover img.CENTRE_PHOTO_SHOW } .ICON_HIGHLIGHT { - opacity:0.8; + opacity:0.6; } .ICON_HIGHLIGHT:hover { opacity:1; + transform:scale(1.1,1.1); + } +.ICON_SCALED + { + opacity:1; + transform:scale(1.1,1.1); + } + +/***************************** Horizontal menu *******************************/ +#submenu_container ul + { + margin:0 auto; + padding:0; + list-style-type:none; + text-align:center; + vertical-align:middle; + } +#submenu_container ul li + { + display:table-cell; + height:60px; + vertical-align:middle; + } +#submenu_container li + { + display:inline-block; + width:100px;height:60px; + vertical-align:middle; + } +.MENU_OFF + { + display:inline-block; + width:100px;height:60px; + margin:0; + padding:0 2px; + text-align:center; + vertical-align:middle; + overflow:hidden; + } +.MENU_ON + { + display:inline-block; + width:100px;height:60px; + margin:0; + padding:0; + text-align:center; + vertical-align:middle; + overflow:hidden; } /******************************** Menu options *******************************/ @@ -608,20 +652,15 @@ a:hover img.CENTRE_PHOTO_SHOW display:table-cell; vertical-align:middle; } -.WHITE_MENU_OFF {color:#707070; font-size:11pt; font-weight:bold; line-height:110%;} -.GREY_MENU_OFF {color:#707070; font-size:11pt; font-weight:bold; line-height:110%;} -.BLUE_MENU_OFF {color:#4D88A1; font-size:11pt; font-weight:bold; line-height:110%;} -.YELLOW_MENU_OFF {color:#BD4815; font-size:11pt; font-weight:bold; line-height:110%;} +.WHITE_MENU_OFF {color:#707070; font-size:10pt; font-weight:bold; line-height:110%;} +.GREY_MENU_OFF {color:#707070; font-size:10pt; font-weight:bold; line-height:110%;} +.BLUE_MENU_OFF {color:#4D88A1; font-size:10pt; font-weight:bold; line-height:110%;} +.YELLOW_MENU_OFF {color:#BD4815; font-size:10pt; font-weight:bold; line-height:110%;} -.WHITE_MENU_ON {color:#4D88A1; font-size:11pt; font-weight:bold; line-height:110%; text-decoration:underline;} -.GREY_MENU_ON {color:#606060; font-size:11pt; font-weight:bold; line-height:110%; text-decoration:underline;} -.BLUE_MENU_ON {color:#4D88A1; font-size:11pt; font-weight:bold; line-height:110%; text-decoration:underline;} -.YELLOW_MENU_ON {color:#BD4815; font-size:11pt; font-weight:bold; line-height:110%; text-decoration:underline;} - -.WHITE_MENU_ON:link {text-decoration:underline;} -.GREY_MENU_ON:link {text-decoration:underline;} -.BLUE_MENU_ON:link {text-decoration:underline;} -.YELLOW_MENU_ON:link {text-decoration:underline;} +.WHITE_MENU_ON {color:#4D88A1; font-size:10pt; font-weight:bold; line-height:110%;} +.GREY_MENU_ON {color:#606060; font-size:10pt; font-weight:bold; line-height:110%;} +.BLUE_MENU_ON {color:#4D88A1; font-size:10pt; font-weight:bold; line-height:110%;} +.YELLOW_MENU_ON {color:#BD4815; font-size:10pt; font-weight:bold; line-height:110%;} .WHITE_FORMUL {color:#4D88A1; font-size:11pt;} .GREY_FORMUL {color:#4D88A1; font-size:11pt;} diff --git a/css/swad_mobile.css b/css/swad_mobile.css index 792563f20..d043a8ff5 100644 --- a/css/swad_mobile.css +++ b/css/swad_mobile.css @@ -420,7 +420,7 @@ a:hover img.CENTRE_PHOTO_SHOW } .ICON_HIGHLIGHT { - opacity:0.8; + opacity:0.7; } .ICON_HIGHLIGHT:hover { diff --git a/swad_changelog.h b/swad_changelog.h index 0f5d56913..89bbb3ce1 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -35,12 +35,13 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 14.49.2 (2014/12/31)" +#define Log_PLATFORM_VERSION "SWAD 14.50 (2014/12/31)" // 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 | tail -1 /* - Version 14.49.2 :Dec 31, 2014 Removed text of menu options whit BR. (172611 lines) + Version 14.50 :Dec 31, 2014 Horizontal menu (not finished). (172735 lines) + Version 14.49.2 :Dec 31, 2014 Removed text of menu options with BR. (172611 lines) Version 14.49.1 :Dec 31, 2014 Changes in layout. (174432 lines) Version 14.49 :Dec 31, 2014 Option to admin one user removed from main menu. Fixed bugs in layout. diff --git a/swad_exam.c b/swad_exam.c index 1ad1772b1..6dee12c60 100644 --- a/swad_exam.c +++ b/swad_exam.c @@ -779,7 +779,7 @@ static void Exa_ShowExamAnnouncement (long ExaCod,Exa_tTypeViewExamAnnouncement_ /***** Start frame *****/ Lay_StartRoundFrameTable10 ("500px",0,NULL); fprintf (Gbl.F.Out,"" \ - "" \ + "" \ ""); /***** Institution logo *****/ diff --git a/swad_layout.c b/swad_layout.c index 19f1308e7..acf144cc2 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -63,6 +63,8 @@ const char *Lay_LayoutIcons[Lay_NUM_LAYOUTS] = /****************************** Private constants ****************************/ /*****************************************************************************/ +// #define HORIZONTAL_MENU 1 + const char *Lay_TabIcons[Act_NUM_TABS] = { /* TabUnk */ NULL, @@ -107,13 +109,20 @@ static void Lay_DrawTabsDeskTop (void); static void Lay_DrawTabsMobile (void); static bool Lay_CheckIfICanViewTab (Act_Tab_t Tab); static void Lay_DrawBreadcrumb (void); -static void Lay_WriteMenuThisTabDesktop (void); +#ifndef HORIZONTAL_MENU +static void Lay_WriteVerticalMenuThisTabDesktop (void); +#endif +#ifdef HORIZONTAL_MENU +static void Lay_WriteHorizontalMenuThisTabDesktop (void); +#endif static void Lay_WriteMenuThisTabMobile (void); static void Lay_WriteBreadcrumbHome (void); static void Lay_WriteBreadcrumbTab (void); static void Lay_WriteBreadcrumbAction (void); +#ifndef HORIZONTAL_MENU static void Lay_WriteTitleAction (void); +#endif static void Lay_ShowLeftColumn (void); static void Lay_ShowRightColumn (void); @@ -295,11 +304,14 @@ void Lay_WriteStartOfPage (void) Prf_PutLeftIconToHideShowCols (); fprintf (Gbl.F.Out,""); +#ifndef HORIZONTAL_MENU /* Tab content, including always vertical menu (left) and always main zone (right) */ fprintf (Gbl.F.Out,""); +#endif + break; case Lay_LAYOUT_MOBILE: /* Tab content */ @@ -323,16 +335,26 @@ void Lay_WriteStartOfPage (void) fprintf (Gbl.F.Out,"
"); - Lay_WriteMenuThisTabDesktop (); + Lay_WriteVerticalMenuThisTabDesktop (); fprintf (Gbl.F.Out,""); +#ifdef HORIZONTAL_MENU + + fprintf (Gbl.F.Out,"
"); + Lay_WriteHorizontalMenuThisTabDesktop (); + fprintf (Gbl.F.Out,"
"); + +#endif + Usr_WarningWhenDegreeTypeDoesntAllowDirectLogin (); /* If it is mandatory to read any information about course */ if (Gbl.CurrentCrs.Info.ShowMsgMustBeRead) Inf_WriteMsgYouMustReadInfo (); +#ifndef HORIZONTAL_MENU /* Write title of the current action */ if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP && Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0) Lay_WriteTitleAction (); +#endif Gbl.Layout.WritingHTMLStart = false; Gbl.Layout.HTMLStartWritten = true; @@ -922,7 +944,9 @@ static void Lay_DrawTabsDeskTop (void) if (ICanViewTab) { fprintf (Gbl.F.Out,""); Act_FormStart (ActMnu); @@ -932,7 +956,7 @@ static void Lay_DrawTabsDeskTop (void) The_ClassTabOff[Gbl.Prefs.Theme]); fprintf (Gbl.F.Out,"\"%s\"" + " class=\"ICON28x28\" style=\"margin:4px;\" />" "
%s
" "" "", @@ -946,7 +970,7 @@ static void Lay_DrawTabsDeskTop (void) fprintf (Gbl.F.Out,"
" "\"%s\"" + " class=\"ICON28x28\" style=\"margin:4px;\" />" "
%s
", Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION_32x32, Lay_TabIcons[NumTab], @@ -1113,7 +1137,8 @@ static void Lay_DrawBreadcrumb (void) /************* Write the menu of current tab (desktop layout) ****************/ /*****************************************************************************/ -static void Lay_WriteMenuThisTabDesktop (void) +#ifndef HORIZONTAL_MENU +static void Lay_WriteVerticalMenuThisTabDesktop (void) { extern const char *The_ClassMenuOn[The_NUM_THEMES]; extern const char *The_ClassMenuOff[The_NUM_THEMES]; @@ -1200,6 +1225,80 @@ static void Lay_WriteMenuThisTabDesktop (void) /***** List end *****/ fprintf (Gbl.F.Out,""); } +#endif + +/*****************************************************************************/ +/********** Write horizontal menu of current tab (desktop layout) ************/ +/*****************************************************************************/ + +#ifdef HORIZONTAL_MENU +static void Lay_WriteHorizontalMenuThisTabDesktop (void) + { + extern const char *The_ClassMenuOn[The_NUM_THEMES]; + extern const char *The_ClassMenuOff[The_NUM_THEMES]; + extern const struct Act_Menu Act_Menu[Act_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB]; + extern const char *Txt_MENU_TITLE[Act_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB]; + unsigned NumOptInMenu; + Act_Action_t NumAct; + const char *Title; + bool IsTheSelectedAction; + + /***** List start *****/ + fprintf (Gbl.F.Out,"
    "); + + /***** Loop to write all options in menu. Each row holds an option *****/ + for (NumOptInMenu = 0; + NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB; + NumOptInMenu++) + { + NumAct = Act_Menu[Gbl.CurrentTab][NumOptInMenu].Action; + if (NumAct == 0) // At the end of each tab, actions are initialized to 0, so 0 marks the end of the menu + break; + if (Act_CheckIfIHavePermissionToExecuteAction (NumAct)) + { + IsTheSelectedAction = (NumAct == Act_Actions[Gbl.CurrentAct].SuperAction); + + Title = Act_GetSubtitleAction (NumAct); + + /***** Start of element *****/ + fprintf (Gbl.F.Out,"
  • ", + IsTheSelectedAction ? "MENU_ON" : + "MENU_OFF"); + + /***** Start of container used to highlight this option *****/ + if (IsTheSelectedAction) + fprintf (Gbl.F.Out,"
    "); + else + fprintf (Gbl.F.Out,"
    "); + + /***** Start of form and link *****/ + Act_FormStart (NumAct); + Act_LinkFormSubmit (Title,IsTheSelectedAction ? The_ClassMenuOn[Gbl.Prefs.Theme] : + The_ClassMenuOff[Gbl.Prefs.Theme]); + fprintf (Gbl.F.Out,"" + "
    %s
    " + "" + "", + Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION_32x32, + Act_Actions[NumAct].Icon, + IsTheSelectedAction ? "ICON28x28" : + "ICON28x28", + Txt_MENU_TITLE[Gbl.CurrentTab][NumOptInMenu]); + + /***** End of container used to highlight this option *****/ + fprintf (Gbl.F.Out,"
    "); + + /***** End of element *****/ + fprintf (Gbl.F.Out,"
  • "); + } + } + + /***** List end *****/ + fprintf (Gbl.F.Out,"
"); + } +#endif /*****************************************************************************/ /************* Write the menu of current tab (mobile layout) *****************/ @@ -1325,6 +1424,7 @@ static void Lay_WriteBreadcrumbAction (void) /*********** Write icon and title associated to the current action ***********/ /*****************************************************************************/ +#ifndef HORIZONTAL_MENU static void Lay_WriteTitleAction (void) { extern const char *The_ClassTitleAction[The_NUM_THEMES]; @@ -1351,6 +1451,7 @@ static void Lay_WriteTitleAction (void) /***** Container end *****/ fprintf (Gbl.F.Out,"
"); } +#endif /*****************************************************************************/ /***************************** Show left column ******************************/ diff --git a/swad_text.c b/swad_text.c index 8001ec5f0..40238171d 100644 --- a/swad_text.c +++ b/swad_text.c @@ -16689,23 +16689,23 @@ const char *Txt_MENU_TITLE[Act_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] = , // ActLstAdm #if L==0 - "Administradors" + "Administrad." // Administradors #elif L==1 "Verwalter" #elif L==2 - "Administrators" + "Administrat." // Administrators #elif L==3 - "Administradores" + "Administrad." // Administradores #elif L==4 - "Administrateurs" + "Administrat." // Administrateurs #elif L==5 - "Administradores" // Okoteve traducción + "Administrad." // Administradores // Okoteve traducción #elif L==6 - "Amministratori" + "Amministrat." // Amministratori #elif L==7 - "Administratorzy" + "Administrat." // Administratorzy #elif L==8 - "Administradores" + "Administrad." // Administradores #endif , // ActReqSignUp