Version 15.33

This commit is contained in:
Antonio Cañas Vargas 2015-11-01 14:11:46 +01:00
parent 503cd4d3f9
commit fbba451a99
6 changed files with 153 additions and 65 deletions

View File

@ -305,16 +305,25 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
} }
/********************************** Notice ***********************************/ /********************************** Notice ***********************************/
.NOTICE_CONTAINER .NOTICE_CONTAINER_ACTIVE
{ {
margin:10px auto; margin:10px auto;
padding:10px; padding:10px;
background-image:linear-gradient(#EED86C 0%,#FEED95 15%,#FAF098 100%); background-image:linear-gradient(rgba(238,216,108,0.8) 0%,rgba(248,237,149,0.8) 15%,rgba(250,240,152,0.8) 100%);
box-shadow:0 8px 10px -5px rgba(125,113,0,0.8); box-shadow:0 8px 10px -5px rgba(125,113,0,0.8);
text-align:left; text-align:left;
overflow:hidden; overflow:hidden;
} }
.NOTICE_DATE .NOTICE_CONTAINER_OBSOLETE
{
margin:10px auto;
padding:10px;
background-image:linear-gradient(rgba(238,216,108,0.4) 0%,rgba(248,237,149,0.4) 15%,rgba(250,240,152,0.4) 100%);
box-shadow:0 8px 10px -5px rgba(125,113,0,0.4);
text-align:left;
overflow:hidden;
}
.NOTICE_DATE_ACTIVE
{ {
float:right; float:right;
font-size:12pt; font-size:12pt;
@ -323,7 +332,16 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
overflow:hidden; overflow:hidden;
display:inline-block; display:inline-block;
} }
.NOTICE_SUBJECT .NOTICE_DATE_OBSOLETE
{
float:right;
font-size:12pt;
color:#808080;
text-align:right;
overflow:hidden;
display:inline-block;
}
.NOTICE_SUBJECT_ACTIVE
{ {
margin:12px auto; margin:12px auto;
font-size:15pt; font-size:15pt;
@ -332,17 +350,31 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
text-align:center; text-align:center;
overflow:hidden; overflow:hidden;
} }
.NOTICE_TEXT .NOTICE_TEXT_ACTIVE
{ {
clear:both; clear:both;
font-size:12pt; font-size:12pt;
color:#000080; color:#204080;
overflow:hidden; overflow:hidden;
} }
.NOTICE_AUTHOR .NOTICE_TEXT_OBSOLETE
{ {
clear:both;
font-size:12pt; font-size:12pt;
color:#4070A0;
overflow:hidden;
}
.NOTICE_AUTHOR_ACTIVE
{
color:#404040; color:#404040;
font-size:12pt;
text-align:right;
overflow:hidden;
}
.NOTICE_AUTHOR_OBSOLETE
{
color:#808080;
font-size:12pt;
text-align:right; text-align:right;
overflow:hidden; overflow:hidden;
} }
@ -425,8 +457,8 @@ hr.YELLOW_SEPARA {height:0; border-top:0; border-bottom:#BD4815 dotted 1px;}
.CONTEXT_OPT .CONTEXT_OPT
{ {
display:inline; display:inline;
margin-left:9px; margin-left:6px;
margin-right:9px; margin-right:6px;
} }
/********************************* Frame 10 **********************************/ /********************************* Frame 10 **********************************/

View File

@ -257,42 +257,77 @@ form {margin:0; display:inline;}
} }
/********************************** Notice ***********************************/ /********************************** Notice ***********************************/
.NOTICE_CONTAINER .NOTICE_CONTAINER_ACTIVE
{ {
margin:10px auto; margin:10px auto;
padding:10px; padding:10px;
background-image:linear-gradient(#EED86C 0%,#FEED95 15%,#FAF098 100%); background-image:linear-gradient(rgba(238,216,108,0.8) 0%,rgba(248,237,149,0.8) 15%,rgba(250,240,152,0.8) 100%);
box-shadow:0 8px 10px -5px rgba(125,113,0,0.8); box-shadow:0 8px 10px -5px rgba(125,113,0,0.8);
text-align:center; text-align:left;
overflow:hidden; overflow:hidden;
} }
.NOTICE_DATE .NOTICE_CONTAINER_OBSOLETE
{
margin:10px auto;
padding:10px;
background-image:linear-gradient(rgba(238,216,108,0.4) 0%,rgba(248,237,149,0.4) 15%,rgba(250,240,152,0.4) 100%);
box-shadow:0 8px 10px -5px rgba(125,113,0,0.4);
text-align:left;
overflow:hidden;
}
.NOTICE_DATE_ACTIVE
{ {
float:right; float:right;
font-size:12pt; font-size:12pt;
color:#404040; color:#404040;
text-align:right;
overflow:hidden; overflow:hidden;
display:inline-block;
} }
.NOTICE_SUBJECT .NOTICE_DATE_OBSOLETE
{ {
float:right;
font-size:12pt;
color:#808080;
text-align:right;
overflow:hidden;
display:inline-block;
}
.NOTICE_SUBJECT_ACTIVE
{
margin:12px auto;
font-size:15pt; font-size:15pt;
font-weight:bold; font-weight:bold;
color:#404040; color:#404040;
text-align:center; text-align:center;
overflow:hidden; overflow:hidden;
display:inline-block;
} }
.NOTICE_TEXT .NOTICE_TEXT_ACTIVE
{ {
clear:both; clear:both;
font-size:12pt; font-size:12pt;
color:#000080; color:#204080;
overflow:hidden; overflow:hidden;
} }
.NOTICE_AUTHOR .NOTICE_TEXT_OBSOLETE
{
clear:both;
font-size:12pt;
color:#4070A0;
overflow:hidden;
}
.NOTICE_AUTHOR_ACTIVE
{ {
color:#404040; color:#404040;
font-size:12pt; font-size:12pt;
text-align:right;
overflow:hidden;
}
.NOTICE_AUTHOR_OBSOLETE
{
color:#808080;
font-size:12pt;
text-align:right;
overflow:hidden; overflow:hidden;
} }
@ -390,8 +425,8 @@ form {margin:0; display:inline;}
.CONTEXT_OPT .CONTEXT_OPT
{ {
display:inline; display:inline;
margin-left:9px; margin-left:6px;
margin-right:9px; margin-right:6px;
} }
/********************************* Frame 10 **********************************/ /********************************* Frame 10 **********************************/

View File

@ -48,7 +48,6 @@
/*****************************************************************************/ /*****************************************************************************/
extern struct Globals Gbl; extern struct Globals Gbl;
// extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS];
/*****************************************************************************/ /*****************************************************************************/
/************************* Internal global variables *************************/ /************************* Internal global variables *************************/
@ -208,15 +207,15 @@ static void Ann_ShowAnnouncement (long AnnCod,const char *Subject,const char *Co
bool RolesSelected; bool RolesSelected;
/***** Start yellow note *****/ /***** Start yellow note *****/
fprintf (Gbl.F.Out,"<div class=\"NOTICE_CONTAINER\"" fprintf (Gbl.F.Out,"<div class=\"NOTICE_CONTAINER_ACTIVE\""
" style=\"width:500px;\">"); " style=\"width:500px;\">");
/***** Write the content of the announcement *****/ /***** Write the content of the announcement *****/
fprintf (Gbl.F.Out,"<div class=\"NOTICE_SUBJECT\">%s</div>", fprintf (Gbl.F.Out,"<div class=\"NOTICE_SUBJECT_ACTIVE\">%s</div>",
Subject); Subject);
/***** Write the content of the announcement *****/ /***** Write the content of the announcement *****/
fprintf (Gbl.F.Out,"<div class=\"NOTICE_TEXT\">%s</div>", fprintf (Gbl.F.Out,"<div class=\"NOTICE_TEXT_ACTIVE\">%s</div>",
Content); Content);
/***** Write form *****/ /***** Write form *****/

View File

@ -109,11 +109,12 @@
/****************************** Public constants *****************************/ /****************************** Public constants *****************************/
/*****************************************************************************/ /*****************************************************************************/
#define Log_PLATFORM_VERSION "SWAD 15.32.2 (2015/10/31)" #define Log_PLATFORM_VERSION "SWAD 15.33 (2015/11/01)"
// Number of lines (includes comments but not blank lines) has been got with the following command: // 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 // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
/* /*
Version 15.33: Nov 01, 2015 New layout of notices. (186708 lines)
Version 15.32.2: Oct 31, 2015 Fixed bug in form submit. (186618 lines) Version 15.32.2: Oct 31, 2015 Fixed bug in form submit. (186618 lines)
Version 15.32.1: Oct 31, 2015 Dates in holidays are shown in big-endian. Version 15.32.1: Oct 31, 2015 Dates in holidays are shown in big-endian.
All dates are now shown in ISO 8601 format (YYYY-MM-DD). (186627 lines) All dates are now shown in ISO 8601 format (YYYY-MM-DD). (186627 lines)
@ -138,7 +139,6 @@ Download JavaScript jstz script, available in:
Create new directory jstz in public HTML directory. Create new directory jstz in public HTML directory.
Copy script jstz.js from https://bitbucket.org/pellepim/jstimezonedetect/ > Download repository > pellepim-jstimezonedetect-3a00f59861bd.zip > dist > jstz.js to /var/www/html/swad/jstz/jstz.js Copy script jstz.js from https://bitbucket.org/pellepim/jstimezonedetect/ > Download repository > pellepim-jstimezonedetect-3a00f59861bd.zip > dist > jstz.js to /var/www/html/swad/jstz/jstz.js
(186302 lines)
Version 15.27: Oct 28, 2015 Fixed bug in dates. (186302 lines) Version 15.27: Oct 28, 2015 Fixed bug in dates. (186302 lines)
Version 15.26.1: Oct 27, 2015 Fixed bug in statistics. (186282 lines) Version 15.26.1: Oct 27, 2015 Fixed bug in statistics. (186282 lines)
Version 15.26: Oct 27, 2015 Statistics are computed properly for clients with time-zones different to that of the server. (186278 lines) Version 15.26: Oct 27, 2015 Statistics are computed properly for clients with time-zones different to that of the server. (186278 lines)

View File

@ -28,8 +28,8 @@
/** Uncomment one of the following installations of SWAD or create your own **/ /** Uncomment one of the following installations of SWAD or create your own **/
/*****************************************************************************/ /*****************************************************************************/
//#define LOCALHOST_UBUNTU // Comment this line if not applicable #define LOCALHOST_UBUNTU // Comment this line if not applicable
#define OPENSWAD_ORG // Comment this line if not applicable //#define OPENSWAD_ORG // Comment this line if not applicable
//#define SWAD_UGR_ES // Comment this line if not applicable //#define SWAD_UGR_ES // Comment this line if not applicable
//#define WWW_CEVUNA_UNA_PY // Comment this line if not applicable //#define WWW_CEVUNA_UNA_PY // Comment this line if not applicable

View File

@ -490,46 +490,88 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
extern const char *Txt_NOTICE_Obsolete_Mark_as_active; extern const char *Txt_NOTICE_Obsolete_Mark_as_active;
extern const char *Txt_See_full_notice; extern const char *Txt_See_full_notice;
extern const char *Txt_Remove; extern const char *Txt_Remove;
static const char *ContainerClass[Not_NUM_STATUS] =
{
"NOTICE_CONTAINER_ACTIVE", // Not_ACTIVE_NOTICE
"NOTICE_CONTAINER_OBSOLETE", // Not_OBSOLETE_NOTICE
};
static const char *DateClass[Not_NUM_STATUS] =
{
"NOTICE_DATE_ACTIVE", // Not_ACTIVE_NOTICE
"NOTICE_DATE_OBSOLETE", // Not_OBSOLETE_NOTICE
};
static const char *TextClass[Not_NUM_STATUS] =
{
"NOTICE_TEXT_ACTIVE", // Not_ACTIVE_NOTICE
"NOTICE_TEXT_OBSOLETE", // Not_OBSOLETE_NOTICE
};
static const char *AuthorClass[Not_NUM_STATUS] =
{
"NOTICE_AUTHOR_ACTIVE", // Not_ACTIVE_NOTICE
"NOTICE_AUTHOR_OBSOLETE", // Not_OBSOLETE_NOTICE
};
static unsigned UniqueId = 0; static unsigned UniqueId = 0;
struct UsrData UsrDat; struct UsrData UsrDat;
/***** Start yellow note *****/ /***** Start yellow note *****/
fprintf (Gbl.F.Out,"<div class=\"NOTICE_CONTAINER\" style=\"width:%upx;\">", fprintf (Gbl.F.Out,"<div class=\"%s\" style=\"width:%upx;\">",
ContainerClass[NoticeStatus],
Not_ContainerWidth[TypeNoticesListing]); Not_ContainerWidth[TypeNoticesListing]);
/***** Write the date in the top part of the yellow note *****/ /***** Write the date in the top part of the yellow note *****/
/* Write symbol to indicate if notice is obsolete or active */ /* Write symbol to indicate if notice is obsolete or active */
if (TypeNoticesListing == Not_LIST_FULL_NOTICES) if (TypeNoticesListing == Not_LIST_FULL_NOTICES)
{ {
if (ICanEditNotices) // Put form to change the state of the notice if (ICanEditNotices)
{
/* Form to delete notice */
Act_FormStart (ActRemNot);
Not_PutHiddenParamNotCod (NotCod);
fprintf (Gbl.F.Out,"<div class=\"CONTEXT_OPT ICON_HIGHLIGHT\">"
"<input type=\"image\""
" src=\"%s/delon16x16.gif\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON16x16\" />"
"</div>",
Gbl.Prefs.IconsURL,
Txt_Remove,
Txt_Remove);
Act_FormEnd ();
/* Put form to change the state of the notice */
switch (NoticeStatus) switch (NoticeStatus)
{ {
case Not_ACTIVE_NOTICE: case Not_ACTIVE_NOTICE:
Act_FormStart (ActHidNot); Act_FormStart (ActHidNot);
Not_PutHiddenParamNotCod (NotCod); Not_PutHiddenParamNotCod (NotCod);
fprintf (Gbl.F.Out,"<input type=\"image\"" fprintf (Gbl.F.Out,"<div class=\"CONTEXT_OPT ICON_HIGHLIGHT\">"
"<input type=\"image\""
" src=\"%s/visible_on16x16.gif\"" " src=\"%s/visible_on16x16.gif\""
" alt=%s\" title=\"%s\"" " alt=%s\" title=\"%s\""
" class=\"ICON16x16\" />", " class=\"ICON16x16\" />"
"</div>",
Gbl.Prefs.IconsURL, Gbl.Prefs.IconsURL,
Txt_NOTICE_Active_Mark_as_obsolete, Txt_NOTICE_Active_Mark_as_obsolete,
Txt_NOTICE_Active_Mark_as_obsolete); Txt_NOTICE_Active_Mark_as_obsolete);
Act_FormEnd ();
break; break;
case Not_OBSOLETE_NOTICE: case Not_OBSOLETE_NOTICE:
Act_FormStart (ActRevNot); Act_FormStart (ActRevNot);
Not_PutHiddenParamNotCod (NotCod); Not_PutHiddenParamNotCod (NotCod);
fprintf (Gbl.F.Out,"<input type=\"image\"" fprintf (Gbl.F.Out,"<div class=\"CONTEXT_OPT ICON_HIGHLIGHT\">"
"<input type=\"image\""
" src=\"%s/hidden_on16x16.gif\"" " src=\"%s/hidden_on16x16.gif\""
" alt=\"%s\" title=\"%s\"" " alt=\"%s\" title=\"%s\""
" class=\"ICON16x16\" />", " class=\"ICON16x16\" />"
"</div>",
Gbl.Prefs.IconsURL, Gbl.Prefs.IconsURL,
Txt_NOTICE_Obsolete_Mark_as_active, Txt_NOTICE_Obsolete_Mark_as_active,
Txt_NOTICE_Obsolete_Mark_as_active); Txt_NOTICE_Obsolete_Mark_as_active);
Act_FormEnd ();
break; break;
} }
else // Don't put form to change the state of the notice Act_FormEnd ();
}
else // Don't put forms
/* Status of the notice */
switch (NoticeStatus) switch (NoticeStatus)
{ {
case Not_ACTIVE_NOTICE: case Not_ACTIVE_NOTICE:
@ -557,15 +599,16 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
} }
} }
/* Write the date (DateTime is in YYYYMMDDHHMM format) */ /* Write the date */
UniqueId++; UniqueId++;
fprintf (Gbl.F.Out,"<div class=\"NOTICE_DATE\">"); fprintf (Gbl.F.Out,"<div class=\"%s\">",
DateClass[NoticeStatus]);
if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES)
{ {
/* Form to view full notice */ /* Form to view full notice */
Act_FormStart (ActShoNot); Act_FormStart (ActShoNot);
Not_PutHiddenParamNotCod (NotCod); Not_PutHiddenParamNotCod (NotCod);
Act_LinkFormSubmit (Txt_See_full_notice,"NOTICE_DATE"); Act_LinkFormSubmit (Txt_See_full_notice,DateClass[NoticeStatus]);
} }
fprintf (Gbl.F.Out,"<span id=\"notice_date_%u\"></span>", fprintf (Gbl.F.Out,"<span id=\"notice_date_%u\"></span>",
UniqueId); UniqueId);
@ -581,8 +624,8 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
UniqueId,(long) TimeUTC); UniqueId,(long) TimeUTC);
/***** Write the content of the notice *****/ /***** Write the content of the notice *****/
fprintf (Gbl.F.Out,"<div class=\"NOTICE_TEXT\">%s", fprintf (Gbl.F.Out,"<div class=\"%s\">%s",
Content); TextClass[NoticeStatus],Content);
if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES) if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES)
{ {
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">"); fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">");
@ -603,7 +646,8 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
/***** Write the author *****/ /***** Write the author *****/
fprintf (Gbl.F.Out,"<div class=\"NOTICE_AUTHOR\">"); fprintf (Gbl.F.Out,"<div class=\"%s\">",
AuthorClass[NoticeStatus]);
Usr_UsrDataConstructor (&UsrDat); Usr_UsrDataConstructor (&UsrDat);
UsrDat.UsrCod = UsrCod; UsrDat.UsrCod = UsrCod;
if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the autor if (Usr_ChkUsrCodAndGetAllUsrDataFromUsrCod (&UsrDat)) // Get from the database the data of the autor
@ -611,28 +655,6 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
Usr_UsrDataDestructor (&UsrDat); Usr_UsrDataDestructor (&UsrDat);
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
/***** Write form to delete this notice *****/
if (ICanEditNotices)
{
fprintf (Gbl.F.Out,"<div class=\"CENTER_MIDDLE\">");
/* Form to delete notice */
Act_FormStart (ActRemNot);
Not_PutHiddenParamNotCod (NotCod);
Act_LinkFormSubmit (Txt_Remove,The_ClassForm[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"<img src=\"%s/delon16x16.gif\""
" alt=\"%s\" title=\"%s\""
" class=\"ICON16x16\" />"
" %s</a>",
Gbl.Prefs.IconsURL,
Txt_Remove,
Txt_Remove,
Txt_Remove);
Act_FormEnd ();
fprintf (Gbl.F.Out,"</div>");
}
fprintf (Gbl.F.Out,"</div>"); fprintf (Gbl.F.Out,"</div>");
} }