diff --git a/css/swad15.152.css b/css/swad15.152.css
index 4a98c288d..085c0d1b3 100644
--- a/css/swad15.152.css
+++ b/css/swad15.152.css
@@ -180,7 +180,7 @@ a:hover /* Default ==> underlined */
{
display:inline-block;
box-sizing:border-box;
- max-width:220px;
+ max-width:200px;
padding:0 4px;
color:#B0B0B0;
font-size:11pt;
diff --git a/swad_changelog.h b/swad_changelog.h
index 784fb2053..a982744d8 100644
--- a/swad_changelog.h
+++ b/swad_changelog.h
@@ -132,13 +132,15 @@
/****************************** Public constants *****************************/
/*****************************************************************************/
-#define Log_PLATFORM_VERSION "SWAD 15.153.1 (2016-03-19)"
+#define Log_PLATFORM_VERSION "SWAD 15.154 (2016-03-19)"
#define CSS_FILE "swad15.152.css"
#define JS_FILE "swad15.131.3.js"
// 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.154: Mar 19, 2016 Icon to add new survey integrated in frame.
+ Changes in layout of surveys. (196018 lines)
Version 15.153.1: Mar 19, 2016 Fixed layout in edition of assignments. (195980 lines)
Version 15.153: Mar 19, 2016 Icon to add new assignment integrated in frame.
Changes in layout of assignments. (195984 lines)
diff --git a/swad_survey.c b/swad_survey.c
index 3ef20acb5..d820c029f 100644
--- a/swad_survey.c
+++ b/swad_survey.c
@@ -92,15 +92,15 @@ struct SurveyQuestion
static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst);
static bool Svy_CheckIfICanCreateSvy (void);
+static void Svy_PutIconToCreateNewSvy (void);
+static void Svy_PutButtonToCreateNewSvy (void);
+static void Svy_PutParamsToCreateNewSvy (void);
static void Svy_PutFormToSelectWhichGroupsToShow (void);
static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,bool ShowOnlyThisSvyComplete);
static void Svy_WriteAuthor (struct Survey *Svy);
static void Svy_WriteStatus (struct Survey *Svy);
static void Svy_GetParamSvyOrderType (void);
-static void Svy_PutFormToCreateNewSvy (void);
-static void Svy_PutFormToCreateNewSvyParams (void);
-
static void Svy_PutFormsToRemEditOneSvy (long SvyCod,bool Visible);
static void Svy_PutParams (void);
static void Svy_GetSurveyTxtFromDB (long SvyCod,char *Txt);
@@ -173,14 +173,11 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst)
extern const char *Txt_ASG_ATT_OR_SVY_ORDER[2];
extern const char *Txt_Survey;
extern const char *Txt_Status;
+ extern const char *Txt_No_surveys;
tSvysOrderType Order;
struct Pagination Pagination;
unsigned NumSvy;
- /***** Put link (form) to create new survey *****/
- if (Svy_CheckIfICanCreateSvy ())
- Svy_PutFormToCreateNewSvy ();
-
/***** Get number of groups in current course *****/
if (!Gbl.CurrentCrs.Grps.NumGrps)
Gbl.CurrentCrs.Grps.WhichGrps = Grp_ALL_GROUPS;
@@ -198,58 +195,66 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst)
if (Pagination.MoreThanOnePage)
Pag_WriteLinksToPagesCentered (Pag_SURVEYS,0,&Pagination);
- /***** Start table *****/
- Lay_StartRoundFrameTable (NULL,2,Txt_Surveys);
+ /***** Start frame *****/
+ Lay_StartRoundFrame ("100%",Txt_Surveys,
+ Svy_CheckIfICanCreateSvy () ? Svy_PutIconToCreateNewSvy :
+ NULL);
/***** Select whether show only my groups or all groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps)
- {
- fprintf (Gbl.F.Out,"
"
- "");
Svy_PutFormToSelectWhichGroupsToShow ();
- fprintf (Gbl.F.Out," | "
- "
");
- }
- /***** Table head *****/
- fprintf (Gbl.F.Out,"");
- for (Order = Svy_ORDER_BY_START_DATE;
- Order <= Svy_ORDER_BY_END_DATE;
- Order++)
+ if (Gbl.Asgs.Num)
{
- fprintf (Gbl.F.Out,"");
- Act_FormStart (ActSeeAllSvy);
- Grp_PutParamWhichGrps ();
- Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
- Par_PutHiddenParamUnsigned ("Order",(unsigned) Order);
- Act_LinkFormSubmit (Txt_ASG_ATT_OR_SVY_HELP_ORDER[Order],"TIT_TBL");
- if (Order == Gbl.Svys.SelectedOrderType)
- fprintf (Gbl.F.Out,"");
- fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]);
- if (Order == Gbl.Svys.SelectedOrderType)
- fprintf (Gbl.F.Out,"");
- fprintf (Gbl.F.Out,"");
- Act_FormEnd ();
- fprintf (Gbl.F.Out," | ");
+ /***** Table head *****/
+ fprintf (Gbl.F.Out,""
+ "");
+ for (Order = Svy_ORDER_BY_START_DATE;
+ Order <= Svy_ORDER_BY_END_DATE;
+ Order++)
+ {
+ fprintf (Gbl.F.Out,"");
+ Act_FormStart (ActSeeAllSvy);
+ Grp_PutParamWhichGrps ();
+ Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
+ Par_PutHiddenParamUnsigned ("Order",(unsigned) Order);
+ Act_LinkFormSubmit (Txt_ASG_ATT_OR_SVY_HELP_ORDER[Order],"TIT_TBL");
+ if (Order == Gbl.Svys.SelectedOrderType)
+ fprintf (Gbl.F.Out,"");
+ fprintf (Gbl.F.Out,"%s",Txt_ASG_ATT_OR_SVY_ORDER[Order]);
+ if (Order == Gbl.Svys.SelectedOrderType)
+ fprintf (Gbl.F.Out,"");
+ fprintf (Gbl.F.Out,"");
+ Act_FormEnd ();
+ fprintf (Gbl.F.Out," | ");
+ }
+ fprintf (Gbl.F.Out,""
+ "%s"
+ " | "
+ ""
+ "%s"
+ " | "
+ "
",
+ Txt_Survey,
+ Txt_Status);
+
+ /***** Write all the surveys *****/
+ for (NumSvy = Pagination.FirstItemVisible;
+ NumSvy <= Pagination.LastItemVisible;
+ NumSvy++)
+ Svy_ShowOneSurvey (Gbl.Svys.LstSvyCods[NumSvy-1],SvyQst,false);
+
+ /***** Table end *****/
+ fprintf (Gbl.F.Out,"
");
}
- fprintf (Gbl.F.Out,""
- "%s"
- " | "
- ""
- "%s"
- " | "
- "
",
- Txt_Survey,
- Txt_Status);
+ else // No assignments created
+ Lay_ShowAlert (Lay_INFO,Txt_No_surveys);
- /***** Write all the surveys *****/
- for (NumSvy = Pagination.FirstItemVisible;
- NumSvy <= Pagination.LastItemVisible;
- NumSvy++)
- Svy_ShowOneSurvey (Gbl.Svys.LstSvyCods[NumSvy-1],SvyQst,false);
+ /***** Button to create a new survey *****/
+ Svy_PutButtonToCreateNewSvy ();
- /***** Table end *****/
- Lay_EndRoundFrameTable ();
+ /***** End frame *****/
+ Lay_EndRoundFrame ();
/***** Write again links to pages *****/
if (Pagination.MoreThanOnePage)
@@ -279,6 +284,43 @@ static bool Svy_CheckIfICanCreateSvy (void)
return false;
}
+/*****************************************************************************/
+/********************** Put icon to create a new survey **********************/
+/*****************************************************************************/
+
+static void Svy_PutIconToCreateNewSvy (void)
+ {
+ extern const char *Txt_New_survey;
+
+ Lay_PutContextualLink (ActFrmNewSvy,Svy_PutParamsToCreateNewSvy,
+ "plus64x64.png",Txt_New_survey,NULL);
+ }
+
+/*****************************************************************************/
+/********************* Put button to create a new survey *********************/
+/*****************************************************************************/
+
+static void Svy_PutButtonToCreateNewSvy (void)
+ {
+ extern const char *Txt_New_survey;
+
+ Act_FormStart (ActFrmNewSvy);
+ Svy_PutParamsToCreateNewSvy ();
+ Lay_PutConfirmButton (Txt_New_survey);
+ Act_FormEnd ();
+ }
+
+/*****************************************************************************/
+/******************* Put parameters to create a new survey *******************/
+/*****************************************************************************/
+
+static void Svy_PutParamsToCreateNewSvy (void)
+ {
+ Svy_PutHiddenParamSvyOrderType ();
+ Grp_PutParamWhichGrps ();
+ Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
+ }
+
/*****************************************************************************/
/***************** Put form to select which groups to show *******************/
/*****************************************************************************/
@@ -695,28 +737,6 @@ void Svy_PutHiddenParamSvyOrderType (void)
Par_PutHiddenParamUnsigned ("Order",(unsigned) Gbl.Svys.SelectedOrderType);
}
-/*****************************************************************************/
-/********************* Put a link (form) to edit surveys *********************/
-/*****************************************************************************/
-
-static void Svy_PutFormToCreateNewSvy (void)
- {
- extern const char *Txt_New_survey;
-
- fprintf (Gbl.F.Out,"");
- }
-
-static void Svy_PutFormToCreateNewSvyParams (void)
- {
- Svy_PutHiddenParamSvyOrderType ();
- Grp_PutParamWhichGrps ();
- Pag_PutHiddenParamPagNum (Gbl.Pag.CurrentPage);
- }
-
/*****************************************************************************/
/******************* Put a link (form) to edit one survey ********************/
/*****************************************************************************/
diff --git a/swad_text.c b/swad_text.c
index 9713149db..90231bb85 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -23408,23 +23408,23 @@ const char *Txt_No_announcements_of_exams_of_X = // Warning: it is very importan
const char *Txt_No_assignments =
#if L==1
- "No hi ha activitats";
+ "No hi ha activitats.";
#elif L==2
- "Keine Aufgaben";
+ "Keine Aufgaben.";
#elif L==3
- "No assignments";
+ "No assignments.";
#elif L==4
- "No hay actividades";
+ "No hay actividades.";
#elif L==5
- "Il n'y a pas d'activités";
+ "Il n'y a pas d'activités.";
#elif L==6
- "No hay actividades"; // Okoteve traducción
+ "No hay actividades."; // Okoteve traducción
#elif L==7
- "Non ci sono attività";
+ "Non ci sono attività.";
#elif L==8
- "Brak zadania";
+ "Brak zadania.";
#elif L==9
- "Não há atividades";
+ "Não há atividades.";
#endif
const char *Txt_no_course_of_origin = // Means: "message sent from any course"
@@ -24285,6 +24285,27 @@ const char *Txt_no_subject =
"sem assunto";
#endif
+const char *Txt_No_surveys =
+#if L==1
+ "No hi ha enquestes.";
+#elif L==2
+ "Keine Umfragen.";
+#elif L==3
+ "No surveys.";
+#elif L==4
+ "No hay encuestas.";
+#elif L==5
+ "Il n'y a pas de sondages.";
+#elif L==6
+ "No hay encuestas."; // Okoteve traducción
+#elif L==7
+ "Non ci sono sondaggi.";
+#elif L==8
+ "Brak badania.";
+#elif L==9
+ "Não há inquéritos.";
+#endif
+
const char *Txt_no_tags = // Tags used in test
#if L==1
"sin descriptores"; // Necessita traduccio