Skip to content

Commit

Permalink
Merge pull request #4 from francoecp/fix-styles
Browse files Browse the repository at this point in the history
Fix Styles
  • Loading branch information
estebancordoba committed Mar 14, 2019
2 parents ba00ae9 + 9ecf6b0 commit d14a3ab
Show file tree
Hide file tree
Showing 34 changed files with 153 additions and 67 deletions.
11 changes: 4 additions & 7 deletions src/main/java/com/bfmanager/beans/LanguageBean.java
Expand Up @@ -5,7 +5,6 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Properties;

import javax.faces.bean.ManagedBean;
Expand All @@ -27,6 +26,7 @@ public String getLanguage() {
}

public void setLanguage(String language) {
System.out.println("LANGUAGE SET: "+language);
this.language = language;
}

Expand All @@ -46,7 +46,7 @@ private void cargarArchivoLanguage(){
String path = servletContext.getRealPath("") + File.separatorChar
+ "WEB-INF" + File.separatorChar + "classes" + File.separatorChar + "com"+ File.separatorChar + "bfmanager"+ File.separatorChar + "languages"
+ File.separatorChar + "messages_"+language+".properties";

archivoProperties.load(new FileInputStream(path));

} catch (FileNotFoundException e) {
Expand All @@ -56,12 +56,9 @@ private void cargarArchivoLanguage(){
}
}

public static String obtenerMensaje(String name){
public static String obtenerMensaje(String name){
String message = archivoProperties.getProperty(name);
if(message == null) return name;
try {
message = new String(message.getBytes("ISO-8859-1"), "UTF-8");
} catch (UnsupportedEncodingException e) {}
if(message == null) return name;
return message;
}
}
85 changes: 85 additions & 0 deletions src/main/webapp/resources/global/css/index.css
@@ -0,0 +1,85 @@
.max-w-xs {
max-width: 20rem;
}

.max-w-sm {
max-width: 30rem;
}

.max-w-md {
max-width: 40rem;
}

.max-w-lg {
max-width: 50rem;
}

.max-w-xl {
max-width: 60rem;
}

.max-w-2xl{
max-width: 70rem;
}

.overflow-y-auto {
overflow-y: auto;
}

.overflow-x-auto {
overflow-x: auto;
}

.max-h-dialog {
max-height: none;
}

.flex {
display: flex;
}

.flex-row {
flex-direction: row;
}

.flex-col {
flex-direction: column;
}

.flex-1 {
flex: 1;
}

.flex-grow {
flex-grow: 1;
}

.w-full {
width: 100% !important;
}

.w-1\/3 {
width: 33.33333% !important;
}

.w-3\/4 {
width: 75% !important;
}

.panel-values {
border: none !important;
}

.pin-t-5 {
top: 5rem !important;
}

.pin-l-auto {
left: auto !important;
}

@media (max-width: 600px) {
.max-h-dialog {
max-height: 30rem;
}
}
2 changes: 1 addition & 1 deletion src/main/webapp/views/admin/adminGroups.xhtml
Expand Up @@ -60,7 +60,7 @@
<p:confirm header="#{language.confirmation}" message="#{language.delete_records}" icon="ui-icon-alert" />
</p:commandButton>

<p:dialog widgetVar="dlgAgregar" closeOnEscape="true" id="dialogA" responsive="true" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
<p:dialog widgetVar="dlgAgregar" closeOnEscape="true" id="dialogA" responsive="true" modal="true" showEffect="fade" hideEffect="fade" resizable="false" class="max-w-sm">
<p:ajax event="close" update=":formGroups:dialogA" listener="#{groupsBean.cancelarGroup()}" />
<h:form>
<p:panelGrid columns="1" id="panelAgregar" layout="grid" styleClass="ui-panelgrid-blank form-group">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/views/admin/adminUsers.xhtml
Expand Up @@ -69,7 +69,7 @@
<p:confirm header="#{language.confirmation}" message="#{language.delete_records}" icon="ui-icon-alert" />
</p:commandButton>

<p:dialog widgetVar="dlgAgregar" onHide="PF('dlgAgregar').content.empty()" closeOnEscape="true" id="dialogA" responsive="true" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
<p:dialog widgetVar="dlgAgregar" onHide="PF('dlgAgregar').content.empty()" closeOnEscape="true" id="dialogA" responsive="true" modal="true" showEffect="fade" hideEffect="fade" resizable="false" class="max-w-sm">
<p:ajax event="close" update=":formUsers:dialogA" listener="#{usersBean.cancelar()}" />
<h:form>
<p:tabView id="tabA">
Expand Down Expand Up @@ -157,7 +157,7 @@
</p:dialog>
</h:form>

<p:dialog widgetVar="dlgMultipleUsers" onHide="PF('dlgMultipleUsers').content.empty()" closeOnEscape="true" id="dialogMU" responsive="true" modal="true" showEffect="fade" hideEffect="fade" resizable="false" header="#{language.upload_csv}">
<p:dialog widgetVar="dlgMultipleUsers" onHide="PF('dlgMultipleUsers').content.empty()" closeOnEscape="true" id="dialogMU" responsive="true" modal="true" showEffect="fade" hideEffect="fade" resizable="false" header="#{language.upload_csv}" class="max-w-sm">
<p:ajax event="close" resetValues="true" />
<h:form enctype="multipart/form-data">
<p:fileUpload id="fileMU" fileUploadListener="#{usersBean.submitMultipleUsers}" mode="advanced" dragDropSupport="true"
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/views/admin/assignGroups.xhtml
Expand Up @@ -54,13 +54,13 @@
</p:commandButton>

<h:form id="formAgregar">
<p:dialog widgetVar="dlgAgregar" modal="true" showEffect="fade" hideEffect="fade" resizable="false" responsive="true">
<p:dialog widgetVar="dlgAgregar" modal="true" showEffect="fade" hideEffect="fade" resizable="false" responsive="true" class="max-w-xs">
<p:ajax event="close" update=":formGroups" listener="#{groupsBean.cancelarSurveyGroup()}" />
<p:outputPanel id="pAgregar">
<p:panelGrid styleClass="ui-panelgrid-blank form-group" columns="1" layout="grid">
<h:panelGroup>
<label for="group">#{language.group}: </label>
<p:selectCheckboxMenu id="group" value="#{groupsBean.groupsS}" placeholder="#{language.user}" panelStyle="width:20%"
<p:selectCheckboxMenu id="group" value="#{groupsBean.groupsS}" placeholder="#{language.user}" panelStyle="width:auto"
effect="fade" multiple="true" filter="true" filterMatchMode="startsWith">

<f:selectItems value="#{groupsBean.getGroupsAvailable(surveysBean.survey.idSurvey)}" var="u" itemLabel="#{u.name}" itemValue="#{u.idGroup}"/>
Expand Down
10 changes: 5 additions & 5 deletions src/main/webapp/views/admin/backup.xhtml
Expand Up @@ -12,7 +12,7 @@
<ui:define name="content">
<p:growl id="growl" sticky="true" showDetail="true" showSummary="true" autoUpdate="true" life="3000" escape="false" />

<p:dialog widgetVar="statusDialog" modal="true" draggable="false" closable="false" resizable="false" showHeader="false">
<p:dialog widgetVar="statusDialog" modal="true" draggable="false" closable="false" resizable="false" showHeader="false" class="max-w-xs">
<p:graphicImage name="images/ajaxloadingbar.gif" />
</p:dialog>

Expand Down Expand Up @@ -63,7 +63,7 @@
</h:form>

<h:form id="formBackup">
<p:dialog modal="true" showEffect="fade" hideEffect="fade" header="#{language.perform_backup}" widgetVar="dlgBackup" resizable="false" focus="cbCancel"
<p:dialog modal="true" showEffect="fade" hideEffect="fade" header="#{language.perform_backup}" widgetVar="dlgBackup" resizable="false" focus="cbCancel" class="max-w-sm"
onHide="PF('dlgBackup').content.empty()">

<h:panelGrid columns="2" cellpadding="4" style="margin: 0 auto; text-align:center">
Expand All @@ -80,7 +80,7 @@
</h:form>

<h:form id="formRestore">
<p:dialog modal="true" showEffect="fade" hideEffect="fade" header="#{language.restore_backup}" widgetVar="dlgRestore" resizable="false" focus="cbCancel"
<p:dialog modal="true" showEffect="fade" hideEffect="fade" header="#{language.restore_backup}" widgetVar="dlgRestore" resizable="false" focus="cbCancel" class="max-w-sm"
onHide="PF('dlgResore').content.empty()">
<h:panelGrid columns="2" cellpadding="4" style="margin: 0 auto; text-align:center">
<h:outputText value="#{language.sure_restore_backup}&lt;br&gt;&lt;b&gt;#{backupBean.backupFile.name}&lt;/b&gt;?"
Expand All @@ -96,7 +96,7 @@
</h:form>

<h:form id="formEliminar">
<p:dialog modal="true" showEffect="fade" hideEffect="fade" header="#{language.remove_backup}" widgetVar="dlgEliminar" resizable="false"
<p:dialog modal="true" showEffect="fade" hideEffect="fade" header="#{language.remove_backup}" widgetVar="dlgEliminar" resizable="false" class="max-w-sm"
focus="cbCancel" onHide="PF('dlgEliminar').content.empty()">
<p:growl id="growlEliminar" showSummary="true" showDetail="true" life="2000"/>
<h:panelGrid columns="2" cellpadding="4" style="margin: 0 auto; text-align:center">
Expand All @@ -113,7 +113,7 @@

</p:panel>

<p:dialog widgetVar="dlgSubmitBK" onHide="PF('dlgSubmitBK').content.empty()" closeOnEscape="true" id="dialogBK" responsive="true" modal="true" showEffect="fade" hideEffect="fade" resizable="false" header="#{language.upload_csv}">
<p:dialog widgetVar="dlgSubmitBK" onHide="PF('dlgSubmitBK').content.empty()" closeOnEscape="true" id="dialogBK" responsive="true" modal="true" showEffect="fade" hideEffect="fade" resizable="false" header="#{language.upload_csv}" class="max-w-sm">
<p:ajax event="close" resetValues="true" />
<h:form enctype="multipart/form-data">
<p:fileUpload id="fileBK" fileUploadListener="#{backupBean.submitBK}" mode="advanced" dragDropSupport="true"
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/views/admin/bfDimensions.xhtml
Expand Up @@ -68,7 +68,7 @@
<p:confirm header="#{language.confirmation}" message="#{language.delete_records}" icon="ui-icon-alert" />
</p:commandButton>

<p:dialog widgetVar="dlgAgregar" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
<p:dialog widgetVar="dlgAgregar" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false" class="max-w-sm pin-t-5 overflow-y-auto">
<p:ajax event="close" update=":formDimensions:dialogA" listener="#{bigFiveBean.cancelarDimension()}" />
<h:form>

Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/views/admin/bfValueQuestions.xhtml
Expand Up @@ -45,11 +45,11 @@
<f:selectItem itemLabel="#{language.negative}" itemValue="false"/>
</p:selectOneMenu>
</f:facet>
<h:outputText value="#{q.addition ? '#{language.positive}':'#{language.negative}'}" />
<h:outputText value="#{q.addition ? language.positive:language.negative}" />
</p:column>

<p:column headerText="#{language.reverse}">
<h:outputText value="#{q.reverse? '#{language.yes}':'#{language.no}'}" />
<h:outputText value="#{q.reverse? language.yes:language.no}" />
</p:column>

<p:column headerText="#{language.question}" filterBy="#{bigFiveBean.getQuestionTitle(q.idQuestion)}" filterMatchMode="contains">
Expand All @@ -72,7 +72,7 @@
<p:confirm header="#{language.confirmation}" message="#{language.delete_records}" icon="ui-icon-alert" />
</p:commandButton>

<p:dialog widgetVar="dlgAgregar" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false" width="50%">
<p:dialog widgetVar="dlgAgregar" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false" class="max-w-md">
<p:ajax event="close" update=":formValueQuestions:dialogA" listener="#{bigFiveBean.cancelarValueQuestion()}" />
<h:form>

Expand All @@ -88,7 +88,7 @@
</h:panelGroup>

<h:panelGroup>
<p:selectOneMenu id="id_question_vp" value="#{bigFiveBean.bf_value_question.idQuestion}" required="true" requiredMessage="#{language.select_question}">
<p:selectOneMenu id="id_question_vp" value="#{bigFiveBean.bf_value_question.idQuestion}" required="true" requiredMessage="#{language.select_question}" panelStyleClass="max-w-sm">
<f:selectItem itemLabel="#{language.question}" itemValue="#{null}" itemDisabled="true" noSelectionOption="true" />
<f:selectItems value="#{bigFiveBean.getQuestionsxIdSurveyAvailable(surveysBean.survey.idSurvey,bigFiveBean.bf_dimension.idBfDimension)}" var="qt" itemLabel="#{qt.title}" itemValue="#{qt.idQuestion}" />
</p:selectOneMenu>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/views/admin/bigFive.xhtml
Expand Up @@ -47,7 +47,7 @@

</p:dataTable>

<p:dialog closeOnEscape="true" header="#{language.configuracion_Normalizacion}" id="dialogN" widgetVar="dlgNormalization" modal="true" showEffect="fade" hideEffect="fade" resizable="false" responsive="true">
<p:dialog closeOnEscape="true" header="#{language.configuracion_Normalizacion}" id="dialogN" widgetVar="dlgNormalization" modal="true" showEffect="fade" hideEffect="fade" resizable="false" responsive="true" class="max-w-sm">
<p:ajax event="close" update=":formBigFive:dialogN" listener="#{bigFiveBean.cancelarNormalization()}" />
<h:form>

Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/views/admin/dropDown.xhtml
Expand Up @@ -55,7 +55,7 @@
</p:commandButton>


<p:dialog widgetVar="dlgAgregar" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
<p:dialog widgetVar="dlgAgregar" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false" class="max-w-sm">
<p:ajax event="close" update=":formOptions:dialogA" listener="#{questionsAllBean.renovarDD(questionsBean.question.idQuestion)}" />
<h:form>

Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/views/admin/managerGroups.xhtml
Expand Up @@ -54,14 +54,14 @@
</p:commandButton>

<h:form id="formAgregar">
<p:dialog widgetVar="dlgAgregar" modal="true" showEffect="fade" hideEffect="fade" resizable="false" responsive="true">
<p:dialog widgetVar="dlgAgregar" modal="true" showEffect="fade" hideEffect="fade" resizable="false" responsive="true" class="max-w-sm">
<p:ajax event="close" update=":formUserGroup" listener="#{groupsBean.cancelarUserGroup()}" />
<p:outputPanel id="pAgregar">
<p:panelGrid styleClass="ui-panelgrid-blank form-group" columns="1" layout="grid">

<h:panelGroup>
<label for="usuario">#{language.users}: </label><br/>
<p:selectCheckboxMenu id="usuario" value="#{groupsBean.usersS}" panelStyle="width:20%"
<p:selectCheckboxMenu id="usuario" value="#{groupsBean.usersS}" panelStyle="width:auto"
effect="fade" multiple="true" filter="true" filterMatchMode="startsWith">
<f:selectItems value="#{usersBean.getUsuariosAvailable(groupsBean.group.idGroup)}" var="u" itemLabel="#{u.user}" itemValue="#{u.idUser}"/>
</p:selectCheckboxMenu>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/views/admin/multipleChoice.xhtml
Expand Up @@ -56,7 +56,7 @@
</p:commandButton>


<p:dialog widgetVar="dlgAgregar" closeOnEscape="true" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
<p:dialog widgetVar="dlgAgregar" closeOnEscape="true" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false" class="max-w-sm">
<p:ajax event="close" update=":formOptions:dialogA" listener="#{questionsAllBean.renovarMC(questionsBean.question.idQuestion)}" />
<h:form>
<p:panelGrid columns="1" id="panelAgregar" layout="grid" styleClass="ui-panelgrid-blank form-group">
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/views/admin/preview.xhtml
Expand Up @@ -27,9 +27,9 @@
</center>

<p:stack icon="/resources/images/menu_stack.png" expanded="true">
<p:menuitem value="#{cw_language.instructions}" icon="/resources/images/instrucciones.png" url="#" onclick="PF('dlgI').show()"/>
<p:menuitem value="#{language.instructions}" icon="/resources/images/instrucciones.png" url="#" onclick="PF('dlgI').show()"/>
</p:stack>
<p:dialog widgetVar="dlgI" modal="true" header="#{cw_language.instructions}" resizable="false" showEffect="clip" hideEffect="clip" width="60%">
<p:dialog widgetVar="dlgI" modal="true" header="#{language.instructions}" resizable="false" showEffect="clip" hideEffect="clip" class="max-w-lg">
<h:outputText value="#{showSurveyBean.instrucciones}" escape="false"/>
</p:dialog>
</ui:define>
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/views/admin/questions.xhtml
Expand Up @@ -40,7 +40,7 @@
</p:column>

<p:column headerText="#{language.required}">
<h:outputText value="#{q.required? '#{language.yes}':'#{language.no}'}" />
<h:outputText value="#{q.required ? language.yes:language.no}" />
</p:column>

<p:column headerText="#{language.help}">
Expand Down Expand Up @@ -81,7 +81,7 @@
</p:commandButton>


<p:dialog widgetVar="dlgAgregar" closeOnEscape="true" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
<p:dialog widgetVar="dlgAgregar" closeOnEscape="true" id="dialogA" modal="true" showEffect="fade" hideEffect="fade" resizable="false" class="max-w-sm pin-t-5 overflow-y-auto">
<p:ajax event="close" update=":formQuestions:dialogA" listener="#{questionsBean.renovar(surveysBean.survey.idSurvey)}" />
<h:form>
<p:panelGrid columns="1" id="panelAgregar" layout="grid" styleClass="ui-panelgrid-blank form-group">
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/views/admin/responsesBFI.xhtml
Expand Up @@ -78,7 +78,7 @@
<p:dataExporter type="csv" target="tblBFI" fileName="bigfive_#{surveysBean.survey.title}_#{groupsBean.getGroupxId(answersBean.id_group).name}" pageOnly="false" />
</h:commandLink>

<p:dialog position="center,center-20%" id="dialogR" header="Resultados: #{bigFiveBean.user_chart.name} #{bigFiveBean.user_chart.surname} (#{bigFiveBean.user_chart.user})" widgetVar="dlgRes" modal="true" showEffect="fade" hideEffect="fade" resizable="false" width="50%">
<p:dialog id="dialogR" header="Resultados: #{bigFiveBean.user_chart.name} #{bigFiveBean.user_chart.surname} (#{bigFiveBean.user_chart.user})" widgetVar="dlgRes" modal="true" showEffect="fade" hideEffect="fade" resizable="false" class="max-w-xl overflow-y-auto pin-t-5 pin-l-auto">
<p:panel header="#{language.dimensions}">
<div style="text-align:center;">
<p:commandButton id="expDim" type="button" style="margin: 0 auto; display: inline-block;" icon="ui-icon-help"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/views/admin/results.xhtml
Expand Up @@ -13,7 +13,7 @@

<ui:define name="content">

<p:dialog widgetVar="dlgGroup" header="#{language.choose_group}" modal="true" showEffect="fade" hideEffect="fade" resizable="false" responsive="true">
<p:dialog widgetVar="dlgGroup" header="#{language.choose_group}" modal="true" showEffect="fade" hideEffect="fade" resizable="false" responsive="true" class="max-w-xs">
<h:form id="formGroup">
<p:panelGrid columns="1" layout="grid" styleClass="ui-panelgrid-blank form-group">
<p:selectOneMenu required="true" requiredMessage="#{language.should_choose_group}" id="group" value="#{showStatisticsBean.id_group}" placeholder="#{language.group}"
Expand Down

0 comments on commit d14a3ab

Please sign in to comment.