repo
string
commit
string
message
string
diff
string
sila/AtomProject
c5af224d140011d5a7a516bff3cffa0d6fa39524
add new property NumberOfMonthsVertical
diff --git a/Atom.Web/DatePicker/JQDatePicker.cs b/Atom.Web/DatePicker/JQDatePicker.cs index bdbfd68..f9be263 100644 --- a/Atom.Web/DatePicker/JQDatePicker.cs +++ b/Atom.Web/DatePicker/JQDatePicker.cs @@ -319,864 +319,882 @@ namespace Atom.Web.UI.WebControls.DatePicker object navigationAsDateFormat = ViewState["NavigationAsDateFormatViewState"]; return (navigationAsDateFormat == null) ? false : Convert.ToBoolean(navigationAsDateFormat); } set { ViewState["NavigationAsDateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool SelectOtherMonths { get { object selectOtherMonths = ViewState["SelectOtherMonthsViewState"]; return (selectOtherMonths == null) ? false : Convert.ToBoolean(selectOtherMonths); } set { ViewState["SelectOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowButtonPanel { get { object showButtonPanel = ViewState["ShowButtonPanelViewState"]; return (showButtonPanel == null) ? false : Convert.ToBoolean(showButtonPanel); } set { ViewState["ShowButtonPanelViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowMonthAfterYear { get { object showMonthAfterYear = ViewState["ShowMonthAfterYearViewState"]; return (showMonthAfterYear == null) ? false : Convert.ToBoolean(showMonthAfterYear); } set { ViewState["ShowMonthAfterYearViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowWeek { get { object showWeek = ViewState["ShowWeekViewState"]; return (showWeek == null) ? false : Convert.ToBoolean(showWeek); } set { ViewState["ShowWeekViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowOtherMonths { get { object showOtherMonths = ViewState["ShowOtherMonthsViewState"]; return (showOtherMonths == null) ? false : Convert.ToBoolean(showOtherMonths); } set { ViewState["ShowOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Draggable { get { object draggable = ViewState["DraggableViewState"]; return (draggable == null) ? false : Convert.ToBoolean(draggable); } set { ViewState["DraggableViewState"] = value; } } #endregion #region str [ Category("Behavior"), Description(""), DefaultValue("") ] public string AltField { get { object autoSize = ViewState["AltFieldViewState"]; return (autoSize == null) ? string.Empty : autoSize.ToString(); } set { ViewState["AltFieldViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string AltFormat { get { object altFormat = ViewState["AltFormatViewState"]; return (altFormat == null) ? string.Empty : altFormat.ToString(); } set { ViewState["AltFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string AppendText { get { object appendText = ViewState["AppendTextViewState"]; return (appendText == null) ? string.Empty : appendText.ToString(); } set { ViewState["AppendTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string ButtonImage { get { object buttonImage = ViewState["ButtonImageViewState"]; return (buttonImage == null) ? string.Empty : buttonImage.ToString(); } set { ViewState["ButtonImageViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("...") ] public string ButtonText { get { object buttonText = ViewState["ButtonTextViewState"]; return (buttonText == null) ? "..." : buttonText.ToString(); } set { ViewState["ButtonTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Done") ] public string CloseText { get { object closeText = ViewState["CloseTextViewState"]; return (closeText == null) ? "Done" : closeText.ToString(); } set { ViewState["CloseTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Today") ] public string CurrentText { get { object currentText = ViewState["CurrentTextViewState"]; return (currentText == null) ? "Today" : currentText.ToString(); } set { ViewState["CurrentTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("mm/dd/yy") ] public string DateFormat { get { object dateFormat = ViewState["DateFormatViewState"]; return (dateFormat == null) ? "mm/dd/yy" : dateFormat.ToString(); } set { ViewState["DateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Wk") ] public string WeekHeader { get { object weekHeader = ViewState["WeekHeaderViewState"]; return (weekHeader == null) ? "Wk" : weekHeader.ToString(); } set { ViewState["WeekHeaderViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("c-10:c+10") ] public string YearRange { get { object yearRange = ViewState["YearRangeViewState"]; return (yearRange == null) ? "c-10:c+10" : yearRange.ToString(); } set { ViewState["YearRangeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string YearSuffix { get { object yearSuffix = ViewState["YearSuffixViewState"]; return (yearSuffix == null) ? string.Empty : yearSuffix.ToString(); } set { ViewState["YearSuffixViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Next") ] public string NextText { get { object nextText = ViewState["NextTextViewState"]; return (nextText == null) ? "Next" : nextText.ToString(); } set { ViewState["NextTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Prev") ] public string PrevText { get { object prevText = ViewState["PrevTextViewState"]; return (prevText == null) ? "Prev" : prevText.ToString(); } set { ViewState["PrevTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string DefaultDatePattern { get { object defaultDatePattern = ViewState["DefaultDatePatternViewState"]; return (defaultDatePattern == null) ? string.Empty : defaultDatePattern.ToString(); } set { ViewState["DefaultDatePatternViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string MaxDatePattern { get { object maxDatePattern = ViewState["MaxDatePatternViewState"]; return (maxDatePattern == null) ? string.Empty : maxDatePattern.ToString(); } set { ViewState["MaxDatePatternViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string MinDatePattern { get { object minDatePattern = ViewState["MinDatePatternViewState"]; return (minDatePattern == null) ? string.Empty : minDatePattern.ToString(); } set { ViewState["MinDatePatternViewState"] = value; } } //enum [ Category("Behavior"), Description(""), DefaultValue(DatePickerShowOn.Focus) ] public DatePickerShowOn ShowOn { get { object showOn = ViewState["ShowOnViewState"]; return (showOn == null) ? DatePickerShowOn.Focus : (DatePickerShowOn)showOn; } set { ViewState["ShowOnViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerDuration.Normal) ] public DatePickerDuration Duration { get { object duration = ViewState["DurationViewState"]; return (duration == null) ? DatePickerDuration.Normal : (DatePickerDuration)duration; } set { ViewState["DurationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerAnimation.Show) ] public DatePickerAnimation ShowAnimation { get { object showAnimation = ViewState["ShowAnimationViewState"]; return (showAnimation == null) ? DatePickerAnimation.Show : (DatePickerAnimation)showAnimation; } set { ViewState["ShowAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerMode.DatePicker) ] public DatePickerMode Mode { get { object mode = ViewState["ModeViewState"]; return (mode == null) ? DatePickerMode.DatePicker : (DatePickerMode)mode; } set { ViewState["ModeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public DateTime DefaultDate { get { object defaultDate = ViewState["DefaultDateViewState"]; return (defaultDate == null) ? DateTime.Today : Convert.ToDateTime(defaultDate); } set { ViewState["DefaultDateViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public DateTime MaxDate { get { object maxDate = ViewState["MaxDateViewState"]; return (maxDate == null) ? DateTime.MaxValue : Convert.ToDateTime(maxDate); } set { ViewState["MaxDateViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public DateTime MinDate { get { object minDate = ViewState["MinDateViewState"]; return (minDate == null) ? DateTime.MinValue : Convert.ToDateTime(minDate); } set { ViewState["MinDateViewState"] = value; } } #endregion #region int [ Category("Behavior"), Description(""), + DefaultValue(1) + ] + public int NumberOfMonthsHorizontal + { + get + { + object numberOfMonthsHorizontal = ViewState["NumberOfMonthsHorizontalViewState"]; + return (numberOfMonthsHorizontal == null) ? 1 : Convert.ToInt32(numberOfMonthsHorizontal); + } + set + { + ViewState["NumberOfMonthsHorizontalViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + DefaultValue(0) + ] + public int NumberOfMonthsVertical + { + get + { + object numberOfMonthsVertical = ViewState["NumberOfMonthsVerticalViewState"]; + return (numberOfMonthsVertical == null) ? 0 : Convert.ToInt32(numberOfMonthsVertical); + } + set + { + ViewState["NumberOfMonthsVerticalViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), DefaultValue(0) ] public int FirstDay { get { object firstDay = ViewState["FirstDayViewState"]; return (firstDay == null) ? 0 : Convert.ToInt32(firstDay); } set { ViewState["FirstDayViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(1) ] public int StepMonths { get { object stepMonths = ViewState["StepMonthsViewState"]; return (stepMonths == null) ? 1 : Convert.ToInt32(stepMonths); } set { ViewState["StepMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(0) ] public int ShowCurrentAtPos { get { object showCurrentAtPos = ViewState["ShowCurrentAtPosViewState"]; return (showCurrentAtPos == null) ? 0 : Convert.ToInt32(showCurrentAtPos); } set { ViewState["ShowCurrentAtPosViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(0) ] public int MonthNamesShort { get { object monthNamesShort = ViewState["MonthNamesShortViewState"]; return (monthNamesShort == null) ? 0 : Convert.ToInt32(monthNamesShort); } set { ViewState["MonthNamesShortViewState"] = value; } } #endregion #region arr [ Category("Behavior"), Description(""), DefaultValue("") ] public string DayNames { get { object dayNames = ViewState["DayNamesViewState"]; return (dayNames == null) ? string.Empty : dayNames.ToString(); } set { ViewState["DayNamesViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string DayNamesMin { get { object dayNamesMin = ViewState["DayNamesMinViewState"]; return (dayNamesMin == null) ? string.Empty : dayNamesMin.ToString(); } set { ViewState["DayNamesMinViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string DayNamesShort { get { object dayNamesShort = ViewState["DayNamesShortViewState"]; return (dayNamesShort == null) ? string.Empty : dayNamesShort.ToString(); } set { ViewState["DayNamesShortViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string MonthNames { get { object monthNames = ViewState["MonthNamesViewState"]; return (monthNames == null) ? string.Empty : monthNames.ToString(); } set { ViewState["MonthNamesViewState"] = value; } } - [ - Category("Behavior"), - Description(""), - DefaultValue(1) - ] - public int NumberOfMonths - { - get - { - object numberOfMonths = ViewState["NumberOfMonthsViewState"]; - return (NumberOfMonths == null) ? 1 : Convert.ToInt32(NumberOfMonths); - } - set - { - ViewState["NumberOfMonthsViewState"] = value; - } - } + [ Category("Behavior"), Description(""), DefaultValue("") ] public string ShortYearCutoff { get { object shortYearCutoff = ViewState["ShortYearCutoffViewState"]; return (shortYearCutoff == null) ? string.Empty : shortYearCutoff.ToString(); } set { ViewState["ShortYearCutoffViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string ShowOptions { get { object showOptions = ViewState["ShowOptionsViewState"]; return (showOptions == null) ? string.Empty : showOptions.ToString(); } set { ViewState["ShowOptionsViewState"] = value; } } #endregion #region inherit properties [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } #endregion } }
sila/AtomProject
bff1db769e9289791eba4fc2e2e0001ea16708ea
change type of NumberOfMonths property to int
diff --git a/Atom.Web/DatePicker/JQDatePicker.cs b/Atom.Web/DatePicker/JQDatePicker.cs index d30737f..bdbfd68 100644 --- a/Atom.Web/DatePicker/JQDatePicker.cs +++ b/Atom.Web/DatePicker/JQDatePicker.cs @@ -459,724 +459,724 @@ namespace Atom.Web.UI.WebControls.DatePicker return (altFormat == null) ? string.Empty : altFormat.ToString(); } set { ViewState["AltFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string AppendText { get { object appendText = ViewState["AppendTextViewState"]; return (appendText == null) ? string.Empty : appendText.ToString(); } set { ViewState["AppendTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string ButtonImage { get { object buttonImage = ViewState["ButtonImageViewState"]; return (buttonImage == null) ? string.Empty : buttonImage.ToString(); } set { ViewState["ButtonImageViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("...") ] public string ButtonText { get { object buttonText = ViewState["ButtonTextViewState"]; return (buttonText == null) ? "..." : buttonText.ToString(); } set { ViewState["ButtonTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Done") ] public string CloseText { get { object closeText = ViewState["CloseTextViewState"]; return (closeText == null) ? "Done" : closeText.ToString(); } set { ViewState["CloseTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Today") ] public string CurrentText { get { object currentText = ViewState["CurrentTextViewState"]; return (currentText == null) ? "Today" : currentText.ToString(); } set { ViewState["CurrentTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("mm/dd/yy") ] public string DateFormat { get { object dateFormat = ViewState["DateFormatViewState"]; return (dateFormat == null) ? "mm/dd/yy" : dateFormat.ToString(); } set { ViewState["DateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Wk") ] public string WeekHeader { get { object weekHeader = ViewState["WeekHeaderViewState"]; return (weekHeader == null) ? "Wk" : weekHeader.ToString(); } set { ViewState["WeekHeaderViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("c-10:c+10") ] public string YearRange { get { object yearRange = ViewState["YearRangeViewState"]; return (yearRange == null) ? "c-10:c+10" : yearRange.ToString(); } set { ViewState["YearRangeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string YearSuffix { get { object yearSuffix = ViewState["YearSuffixViewState"]; return (yearSuffix == null) ? string.Empty : yearSuffix.ToString(); } set { ViewState["YearSuffixViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Next") ] public string NextText { get { object nextText = ViewState["NextTextViewState"]; return (nextText == null) ? "Next" : nextText.ToString(); } set { ViewState["NextTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Prev") ] public string PrevText { get { object prevText = ViewState["PrevTextViewState"]; return (prevText == null) ? "Prev" : prevText.ToString(); } set { ViewState["PrevTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string DefaultDatePattern { get { object defaultDatePattern = ViewState["DefaultDatePatternViewState"]; return (defaultDatePattern == null) ? string.Empty : defaultDatePattern.ToString(); } set { ViewState["DefaultDatePatternViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string MaxDatePattern { get { object maxDatePattern = ViewState["MaxDatePatternViewState"]; return (maxDatePattern == null) ? string.Empty : maxDatePattern.ToString(); } set { ViewState["MaxDatePatternViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string MinDatePattern { get { object minDatePattern = ViewState["MinDatePatternViewState"]; return (minDatePattern == null) ? string.Empty : minDatePattern.ToString(); } set { ViewState["MinDatePatternViewState"] = value; } } //enum [ Category("Behavior"), Description(""), DefaultValue(DatePickerShowOn.Focus) ] public DatePickerShowOn ShowOn { get { object showOn = ViewState["ShowOnViewState"]; return (showOn == null) ? DatePickerShowOn.Focus : (DatePickerShowOn)showOn; } set { ViewState["ShowOnViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerDuration.Normal) ] public DatePickerDuration Duration { get { object duration = ViewState["DurationViewState"]; return (duration == null) ? DatePickerDuration.Normal : (DatePickerDuration)duration; } set { ViewState["DurationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerAnimation.Show) ] public DatePickerAnimation ShowAnimation { get { object showAnimation = ViewState["ShowAnimationViewState"]; return (showAnimation == null) ? DatePickerAnimation.Show : (DatePickerAnimation)showAnimation; } set { ViewState["ShowAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerMode.DatePicker) ] public DatePickerMode Mode { get { object mode = ViewState["ModeViewState"]; return (mode == null) ? DatePickerMode.DatePicker : (DatePickerMode)mode; } set { ViewState["ModeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public DateTime DefaultDate { get { object defaultDate = ViewState["DefaultDateViewState"]; return (defaultDate == null) ? DateTime.Today : Convert.ToDateTime(defaultDate); } set { ViewState["DefaultDateViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public DateTime MaxDate { get { object maxDate = ViewState["MaxDateViewState"]; return (maxDate == null) ? DateTime.MaxValue : Convert.ToDateTime(maxDate); } set { ViewState["MaxDateViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public DateTime MinDate { get { object minDate = ViewState["MinDateViewState"]; return (minDate == null) ? DateTime.MinValue : Convert.ToDateTime(minDate); } set { ViewState["MinDateViewState"] = value; } } #endregion #region int [ Category("Behavior"), Description(""), DefaultValue(0) ] public int FirstDay { get { object firstDay = ViewState["FirstDayViewState"]; return (firstDay == null) ? 0 : Convert.ToInt32(firstDay); } set { ViewState["FirstDayViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(1) ] public int StepMonths { get { object stepMonths = ViewState["StepMonthsViewState"]; return (stepMonths == null) ? 1 : Convert.ToInt32(stepMonths); } set { ViewState["StepMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(0) ] public int ShowCurrentAtPos { get { object showCurrentAtPos = ViewState["ShowCurrentAtPosViewState"]; return (showCurrentAtPos == null) ? 0 : Convert.ToInt32(showCurrentAtPos); } set { ViewState["ShowCurrentAtPosViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(0) ] public int MonthNamesShort { get { object monthNamesShort = ViewState["MonthNamesShortViewState"]; return (monthNamesShort == null) ? 0 : Convert.ToInt32(monthNamesShort); } set { ViewState["MonthNamesShortViewState"] = value; } } #endregion #region arr [ Category("Behavior"), Description(""), DefaultValue("") ] public string DayNames { get { object dayNames = ViewState["DayNamesViewState"]; return (dayNames == null) ? string.Empty : dayNames.ToString(); } set { ViewState["DayNamesViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string DayNamesMin { get { object dayNamesMin = ViewState["DayNamesMinViewState"]; return (dayNamesMin == null) ? string.Empty : dayNamesMin.ToString(); } set { ViewState["DayNamesMinViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string DayNamesShort { get { object dayNamesShort = ViewState["DayNamesShortViewState"]; return (dayNamesShort == null) ? string.Empty : dayNamesShort.ToString(); } set { ViewState["DayNamesShortViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string MonthNames { get { object monthNames = ViewState["MonthNamesViewState"]; return (monthNames == null) ? string.Empty : monthNames.ToString(); } set { ViewState["MonthNamesViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue(1) ] - public string NumberOfMonths + public int NumberOfMonths { get { object numberOfMonths = ViewState["NumberOfMonthsViewState"]; - return (NumberOfMonths == null) ? string.Empty : NumberOfMonths.ToString(); + return (NumberOfMonths == null) ? 1 : Convert.ToInt32(NumberOfMonths); } set { ViewState["NumberOfMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string ShortYearCutoff { get { object shortYearCutoff = ViewState["ShortYearCutoffViewState"]; return (shortYearCutoff == null) ? string.Empty : shortYearCutoff.ToString(); } set { ViewState["ShortYearCutoffViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string ShowOptions { get { object showOptions = ViewState["ShowOptionsViewState"]; return (showOptions == null) ? string.Empty : showOptions.ToString(); } set { ViewState["ShowOptionsViewState"] = value; } } #endregion #region inherit properties [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } #endregion } }
sila/AtomProject
72d681e7fc7c58d620e36d038f24ed3a4bdd646d
add new properties
diff --git a/Atom.Web/DatePicker/JQDatePicker.cs b/Atom.Web/DatePicker/JQDatePicker.cs index b6a3a57..d30737f 100644 --- a/Atom.Web/DatePicker/JQDatePicker.cs +++ b/Atom.Web/DatePicker/JQDatePicker.cs @@ -1,1052 +1,1182 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI; using System.ComponentModel; using System.Web; using System.Security.Permissions; using System.Web.UI.WebControls; namespace Atom.Web.UI.WebControls.DatePicker { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), Designer(typeof(DatePickerDesigner)), ToolboxData("<{0}:JQDatePicker runat=\"server\"> </{0}:JQDatePicker>") ] public class JQDatePicker : WebControl { private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("var " + this.UniqueID + "; "); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat(this.UniqueID + " = $('#" + this.UniqueID + "');"); startupScript.AppendFormat(this.UniqueID + ".datepicker({{"); if (!this.Enabled) { startupScript.AppendFormat(" disabled: true,"); } if (this.AutoSize) { startupScript.AppendFormat(" autoSize: true,"); } if (this.ButtonImageOnly) { startupScript.AppendFormat(" buttonImageOnly: true,"); } if (this.ChangeMonth) { startupScript.AppendFormat(" changeMonth: true,"); } if (this.ChangeYear) { startupScript.AppendFormat(" changeYear: true,"); } if (!this.ConstrainInput) { startupScript.AppendFormat(" constrainInput: false,"); } if (this.GotoCurrent) { startupScript.AppendFormat(" gotoCurrent: true,"); } if (this.HideIfNoPrevNext) { startupScript.AppendFormat(" hideIfNoPrevNext: true,"); } if (this.IsRTL) { startupScript.AppendFormat(" isRTL: true,"); } if (this.NavigationAsDateFormat) { startupScript.AppendFormat(" navigationAsDateFormat: true,"); } if (this.SelectOtherMonths) { startupScript.AppendFormat(" selectOtherMonths: true,"); } if (this.ShowButtonPanel) { startupScript.AppendFormat(" showButtonPanel: true,"); } if (this.ShowMonthAfterYear) { startupScript.AppendFormat(" showMonthAfterYear: true,"); } if (this.ShowWeek) { startupScript.AppendFormat(" showWeek: true,"); } if (this.ShowOtherMonths) { startupScript.AppendFormat(" showOtherMonths: true,"); } if (this.FirstDay != 0) { startupScript.AppendFormat(" firstDay: {0},", this.FirstDay); } if (this.StepMonths != 1) { startupScript.AppendFormat(" stepMonths: {0},", this.StepMonths); } if (this.ShowCurrentAtPos != 0) { startupScript.AppendFormat(" showCurrentAtPos: {0},", this.ShowCurrentAtPos); } + //array type properties + if (!string.IsNullOrEmpty(this.DayNames)) + { + startupScript.AppendFormat(" dayNames: [{0}],", this.DayNames); + } + if (!string.IsNullOrEmpty(this.DayNamesMin)) + { + startupScript.AppendFormat(" dayNamesMin: [{0}],", this.DayNamesMin); + } + if (!string.IsNullOrEmpty(this.DayNamesShort)) + { + startupScript.AppendFormat(" dayNamesShort: [{0}],", this.DayNamesShort); + } + if (!string.IsNullOrEmpty(this.MonthNames)) + { + startupScript.AppendFormat(" monthNames: [{0}],", this.MonthNames); + } + if (!string.IsNullOrEmpty(this.MonthNamesShort)) + { + startupScript.AppendFormat(" monthNamesShort: [{0}],", this.MonthNamesShort); + } + //calendar matrix startupScript.AppendFormat("}})"); if ((this.Mode == DatePickerMode.Calendar) && (this.Draggable)) { startupScript.AppendFormat(" .draggable()"); } startupScript.AppendFormat(";"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } protected override void Render(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); if (this.Mode == DatePickerMode.DatePicker) { writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); } else { writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderEndTag(); } } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } //properties #region bool [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool AutoSize { get { object autoSize = ViewState["AutoSizeViewState"]; return (autoSize == null) ? false : Convert.ToBoolean(autoSize); } set { ViewState["AutoSizeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ButtonImageOnly { get { object buttonImageOnly = ViewState["ButtonImageOnlyViewState"]; return (buttonImageOnly == null) ? false : Convert.ToBoolean(buttonImageOnly); } set { ViewState["ButtonImageOnlyViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ChangeMonth { get { object changeMonth = ViewState["ChangeMonthViewState"]; return (changeMonth == null) ? false : Convert.ToBoolean(changeMonth); } set { ViewState["ChangeMonthViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ChangeYear { get { object changeYear = ViewState["ChangeYearViewState"]; return (changeYear == null) ? false : Convert.ToBoolean(changeYear); } set { ViewState["ChangeYearViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool ConstrainInput { get { object changeYear = ViewState["ConstrainInputViewState"]; return (changeYear == null) ? true : Convert.ToBoolean(changeYear); } set { ViewState["ConstrainInputViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool GotoCurrent { get { object gotoCurrent = ViewState["GotoCurrentViewState"]; return (gotoCurrent == null) ? false : Convert.ToBoolean(gotoCurrent); } set { ViewState["GotoCurrentViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool HideIfNoPrevNext { get { object hideIfNoPrevNext = ViewState["HideIfNoPrevNextViewState"]; return (hideIfNoPrevNext == null) ? false : Convert.ToBoolean(hideIfNoPrevNext); } set { ViewState["HideIfNoPrevNextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool IsRTL { get { object rtl = ViewState["IsRTLViewState"]; return (rtl == null) ? false : Convert.ToBoolean(rtl); } set { ViewState["IsRTLViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool NavigationAsDateFormat { get { object navigationAsDateFormat = ViewState["NavigationAsDateFormatViewState"]; return (navigationAsDateFormat == null) ? false : Convert.ToBoolean(navigationAsDateFormat); } set { ViewState["NavigationAsDateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool SelectOtherMonths { get { object selectOtherMonths = ViewState["SelectOtherMonthsViewState"]; return (selectOtherMonths == null) ? false : Convert.ToBoolean(selectOtherMonths); } set { ViewState["SelectOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowButtonPanel { get { object showButtonPanel = ViewState["ShowButtonPanelViewState"]; return (showButtonPanel == null) ? false : Convert.ToBoolean(showButtonPanel); } set { ViewState["ShowButtonPanelViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowMonthAfterYear { get { object showMonthAfterYear = ViewState["ShowMonthAfterYearViewState"]; return (showMonthAfterYear == null) ? false : Convert.ToBoolean(showMonthAfterYear); } set { ViewState["ShowMonthAfterYearViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowWeek { get { object showWeek = ViewState["ShowWeekViewState"]; return (showWeek == null) ? false : Convert.ToBoolean(showWeek); } set { ViewState["ShowWeekViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowOtherMonths { get { object showOtherMonths = ViewState["ShowOtherMonthsViewState"]; return (showOtherMonths == null) ? false : Convert.ToBoolean(showOtherMonths); } set { ViewState["ShowOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Draggable { get { object draggable = ViewState["DraggableViewState"]; return (draggable == null) ? false : Convert.ToBoolean(draggable); } set { ViewState["DraggableViewState"] = value; } } #endregion #region str [ Category("Behavior"), Description(""), DefaultValue("") ] public string AltField { get { object autoSize = ViewState["AltFieldViewState"]; return (autoSize == null) ? string.Empty : autoSize.ToString(); } set { ViewState["AltFieldViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string AltFormat { get { object altFormat = ViewState["AltFormatViewState"]; return (altFormat == null) ? string.Empty : altFormat.ToString(); } set { ViewState["AltFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string AppendText { get { object appendText = ViewState["AppendTextViewState"]; return (appendText == null) ? string.Empty : appendText.ToString(); } set { ViewState["AppendTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string ButtonImage { get { object buttonImage = ViewState["ButtonImageViewState"]; return (buttonImage == null) ? string.Empty : buttonImage.ToString(); } set { ViewState["ButtonImageViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("...") ] public string ButtonText { get { object buttonText = ViewState["ButtonTextViewState"]; return (buttonText == null) ? "..." : buttonText.ToString(); } set { ViewState["ButtonTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Done") ] public string CloseText { get { object closeText = ViewState["CloseTextViewState"]; return (closeText == null) ? "Done" : closeText.ToString(); } set { ViewState["CloseTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Today") ] public string CurrentText { get { object currentText = ViewState["CurrentTextViewState"]; return (currentText == null) ? "Today" : currentText.ToString(); } set { ViewState["CurrentTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("mm/dd/yy") ] public string DateFormat { get { object dateFormat = ViewState["DateFormatViewState"]; return (dateFormat == null) ? "mm/dd/yy" : dateFormat.ToString(); } set { ViewState["DateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Wk") ] public string WeekHeader { get { object weekHeader = ViewState["WeekHeaderViewState"]; return (weekHeader == null) ? "Wk" : weekHeader.ToString(); } set { ViewState["WeekHeaderViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("c-10:c+10") ] public string YearRange { get { object yearRange = ViewState["YearRangeViewState"]; return (yearRange == null) ? "c-10:c+10" : yearRange.ToString(); } set { ViewState["YearRangeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string YearSuffix { get { object yearSuffix = ViewState["YearSuffixViewState"]; return (yearSuffix == null) ? string.Empty : yearSuffix.ToString(); } set { ViewState["YearSuffixViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Next") ] public string NextText { get { object nextText = ViewState["NextTextViewState"]; return (nextText == null) ? "Next" : nextText.ToString(); } set { ViewState["NextTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Prev") ] public string PrevText { get { object prevText = ViewState["PrevTextViewState"]; return (prevText == null) ? "Prev" : prevText.ToString(); } set { ViewState["PrevTextViewState"] = value; } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public string DefaultDatePattern + { + get + { + object defaultDatePattern = ViewState["DefaultDatePatternViewState"]; + return (defaultDatePattern == null) ? string.Empty : defaultDatePattern.ToString(); + } + set + { + ViewState["DefaultDatePatternViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public string MaxDatePattern + { + get + { + object maxDatePattern = ViewState["MaxDatePatternViewState"]; + return (maxDatePattern == null) ? string.Empty : maxDatePattern.ToString(); + } + set + { + ViewState["MaxDatePatternViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public string MinDatePattern + { + get + { + object minDatePattern = ViewState["MinDatePatternViewState"]; + return (minDatePattern == null) ? string.Empty : minDatePattern.ToString(); + } + set + { + ViewState["MinDatePatternViewState"] = value; + } + } + //enum [ Category("Behavior"), Description(""), DefaultValue(DatePickerShowOn.Focus) ] public DatePickerShowOn ShowOn { get { object showOn = ViewState["ShowOnViewState"]; return (showOn == null) ? DatePickerShowOn.Focus : (DatePickerShowOn)showOn; } set { ViewState["ShowOnViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerDuration.Normal) ] public DatePickerDuration Duration { get { object duration = ViewState["DurationViewState"]; return (duration == null) ? DatePickerDuration.Normal : (DatePickerDuration)duration; } set { ViewState["DurationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerAnimation.Show) ] public DatePickerAnimation ShowAnimation { get { object showAnimation = ViewState["ShowAnimationViewState"]; return (showAnimation == null) ? DatePickerAnimation.Show : (DatePickerAnimation)showAnimation; } set { ViewState["ShowAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerMode.DatePicker) ] public DatePickerMode Mode { get { object mode = ViewState["ModeViewState"]; return (mode == null) ? DatePickerMode.DatePicker : (DatePickerMode)mode; } set { ViewState["ModeViewState"] = value; } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public DateTime DefaultDate + { + get + { + object defaultDate = ViewState["DefaultDateViewState"]; + return (defaultDate == null) ? DateTime.Today : Convert.ToDateTime(defaultDate); + } + set + { + ViewState["DefaultDateViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public DateTime MaxDate + { + get + { + object maxDate = ViewState["MaxDateViewState"]; + return (maxDate == null) ? DateTime.MaxValue : Convert.ToDateTime(maxDate); + } + set + { + ViewState["MaxDateViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public DateTime MinDate + { + get + { + object minDate = ViewState["MinDateViewState"]; + return (minDate == null) ? DateTime.MinValue : Convert.ToDateTime(minDate); + } + set + { + ViewState["MinDateViewState"] = value; + } + } #endregion #region int [ Category("Behavior"), Description(""), DefaultValue(0) ] public int FirstDay { get { object firstDay = ViewState["FirstDayViewState"]; return (firstDay == null) ? 0 : Convert.ToInt32(firstDay); } set { ViewState["FirstDayViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(1) ] public int StepMonths { get { object stepMonths = ViewState["StepMonthsViewState"]; return (stepMonths == null) ? 1 : Convert.ToInt32(stepMonths); } set { ViewState["StepMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(0) ] public int ShowCurrentAtPos { get { object showCurrentAtPos = ViewState["ShowCurrentAtPosViewState"]; return (showCurrentAtPos == null) ? 0 : Convert.ToInt32(showCurrentAtPos); } set { ViewState["ShowCurrentAtPosViewState"] = value; } } + [ + Category("Behavior"), + Description(""), + DefaultValue(0) + ] + public int MonthNamesShort + { + get + { + object monthNamesShort = ViewState["MonthNamesShortViewState"]; + return (monthNamesShort == null) ? 0 : Convert.ToInt32(monthNamesShort); + } + set + { + ViewState["MonthNamesShortViewState"] = value; + } + } #endregion #region arr + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string DayNames { get { object dayNames = ViewState["DayNamesViewState"]; return (dayNames == null) ? string.Empty : dayNames.ToString(); } set { ViewState["DayNamesViewState"] = value; } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string DayNamesMin { get { object dayNamesMin = ViewState["DayNamesMinViewState"]; return (dayNamesMin == null) ? string.Empty : dayNamesMin.ToString(); } set { ViewState["DayNamesMinViewState"] = value; } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string DayNamesShort { get { object dayNamesShort = ViewState["DayNamesShortViewState"]; return (dayNamesShort == null) ? string.Empty : dayNamesShort.ToString(); } set { ViewState["DayNamesShortViewState"] = value; } } - public string DefaultDate - { - get - { - object defaultDate = ViewState["DefaultDateViewState"]; - return (defaultDate == null) ? string.Empty : defaultDate.ToString(); - } - set - { - ViewState["DefaultDateViewState"] = value; - } - } - public string MaxDate - { - get - { - object maxDate = ViewState["MaxDateViewState"]; - return (maxDate == null) ? string.Empty : maxDate.ToString(); - } - set - { - ViewState["MaxDateViewState"] = value; - } - } - public string MinDate - { - get - { - object minDate = ViewState["MinDateViewState"]; - return (minDate == null) ? string.Empty : minDate.ToString(); - } - set - { - ViewState["MinDateViewState"] = value; - } - } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string MonthNames { get { object monthNames = ViewState["MonthNamesViewState"]; return (monthNames == null) ? string.Empty : monthNames.ToString(); } set { ViewState["MonthNamesViewState"] = value; } } - public string MonthNamesShort - { - get - { - object monthNamesShort = ViewState["MonthNamesShortViewState"]; - return (monthNamesShort == null) ? string.Empty : monthNamesShort.ToString(); - } - set - { - ViewState["MonthNamesShortViewState"] = value; - } - } + + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string NumberOfMonths { get { object numberOfMonths = ViewState["NumberOfMonthsViewState"]; return (NumberOfMonths == null) ? string.Empty : NumberOfMonths.ToString(); } set { ViewState["NumberOfMonthsViewState"] = value; } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string ShortYearCutoff { get { object shortYearCutoff = ViewState["ShortYearCutoffViewState"]; return (shortYearCutoff == null) ? string.Empty : shortYearCutoff.ToString(); } set { ViewState["ShortYearCutoffViewState"] = value; } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string ShowOptions { get { object showOptions = ViewState["ShowOptionsViewState"]; return (showOptions == null) ? string.Empty : showOptions.ToString(); } set { ViewState["ShowOptionsViewState"] = value; } } #endregion #region inherit properties [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } #endregion } } diff --git a/TestApp/Accordion.aspx b/TestApp/Accordion.aspx index 32db9d5..4405096 100644 --- a/TestApp/Accordion.aspx +++ b/TestApp/Accordion.aspx @@ -1,36 +1,39 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Accordion.aspx.cs" Inherits="TestApp.WebForm1" %> <%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.Accordion" TagPrefix="accordion" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>JQAccordion</title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> </script> </head> <body> <form id="form1" runat="server"> <div> <accordion:JQAccordion ID="JQAccordion1" runat="server"> - <accordion:Item> + <accordion:Item Header="accItem0"> <Template> - 1</Template> + 0 + </Template> </accordion:Item> - <accordion:Item> + <accordion:Item Header="accItem1"> <Template> - 2</Template> + 1 + </Template> </accordion:Item> - <accordion:Item> + <accordion:Item Header="accItem2"> <Template> - 3</Template> + 2 + </Template> </accordion:Item> </accordion:JQAccordion> </div> </form> </body> </html> diff --git a/TestApp/DatePicker.aspx b/TestApp/DatePicker.aspx index debf594..3be1f4c 100644 --- a/TestApp/DatePicker.aspx +++ b/TestApp/DatePicker.aspx @@ -1,23 +1,30 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DatePicker.aspx.cs" Inherits="TestApp.DatePicker" %> <%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.DatePicker" TagPrefix="calendar" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>JQDatePicker</title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> - <script type="text/javascript"> - - + <script type="text/javascript"> + + function Button1_onclick() + { + $('#temp').val( new Date()); + } + </script> </head> <body> <form id="form1" runat="server"> <div> - <calendar:JQDatePicker ID="JQDatePicker1" runat="server" /> + <input type="text" name="temp" id="temp" value="" /> + <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /> + <calendar:JQDatePicker ID="JQDatePicker2" runat="server" Mode="Calendar" /> + <calendar:JQDatePicker ID="JQDatePicker1" runat="server" Mode="DatePicker" /> </div> </form> </body> </html> diff --git a/TestApp/DatePicker.aspx.designer.cs b/TestApp/DatePicker.aspx.designer.cs index eca4713..30d96af 100644 --- a/TestApp/DatePicker.aspx.designer.cs +++ b/TestApp/DatePicker.aspx.designer.cs @@ -1,33 +1,42 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace TestApp { public partial class DatePicker { /// <summary> /// form1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.HtmlControls.HtmlForm form1; + /// <summary> + /// JQDatePicker2 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::Atom.Web.UI.WebControls.DatePicker.JQDatePicker JQDatePicker2; + /// <summary> /// JQDatePicker1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Atom.Web.UI.WebControls.DatePicker.JQDatePicker JQDatePicker1; } } diff --git a/TestApp/Dialog.aspx b/TestApp/Dialog.aspx index 0bb85d6..6be5c00 100644 --- a/TestApp/Dialog.aspx +++ b/TestApp/Dialog.aspx @@ -1,26 +1,27 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Dialog.aspx.cs" Inherits="TestApp.WebForm4" %> <%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.Dialog" TagPrefix="dialog" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>JQDialog</title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> </script> </head> <body> <form id="form1" runat="server"> <div> <dialog:JQDialog ID="JQDialog1" runat="server"> <Template> - 1</Template> + dialog:JQDialog ID="JQDialog1" runat="server" + </Template> </dialog:JQDialog> </div> </form> </body> </html> diff --git a/TestApp/Progressbar.aspx b/TestApp/Progressbar.aspx index 1558499..ceee50f 100644 --- a/TestApp/Progressbar.aspx +++ b/TestApp/Progressbar.aspx @@ -1,24 +1,24 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Progressbar.aspx.cs" Inherits="TestApp.Progressbar" %> <%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.Progressbar" TagPrefix="progressbar" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>JQProgressbar</title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> </script> </head> <body> <form id="form1" runat="server"> <div> - <progressbar:JQProgressbar ID="JQProgressbar1" runat="server" /> + <progressbar:JQProgressbar ID="JQProgressbar1" runat="server" Value="60" /> </div> </form> </body> </html> diff --git a/TestApp/Slider.aspx b/TestApp/Slider.aspx index dd475d5..b6dbe31 100644 --- a/TestApp/Slider.aspx +++ b/TestApp/Slider.aspx @@ -1,23 +1,23 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Slider.aspx.cs" Inherits="TestApp.WebForm2" %> <%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.Slider" TagPrefix="slider" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>JQSlider</title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> </script> </head> <body> <form id="form1" runat="server"> <div> - <slider:JQSlider ID="JQSlider1" runat="server" /> + <slider:JQSlider ID="JQSlider1" runat="server" Value="40" /> </div> </form> </body> </html> diff --git a/TestApp/Tabs.aspx b/TestApp/Tabs.aspx index 5bca125..2a74a5e 100644 --- a/TestApp/Tabs.aspx +++ b/TestApp/Tabs.aspx @@ -1,29 +1,44 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Tabs.aspx.cs" Inherits="TestApp.WebForm3" %> <%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.Tabs" TagPrefix="tabs" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>JQTabs</title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> </script> </head> <body> <form id="form1" runat="server"> <div> <tabs:JQTabs ID="JQTabs1" runat="server"> - <tabs:Tab> + <tabs:Tab Header="tab0"> + <Template> + 0 + </Template> + </tabs:Tab> + <tabs:Tab Header="tab1"> <Template> 1 </Template> </tabs:Tab> + <tabs:Tab Header="tab2"> + <Template> + 2 + </Template> + </tabs:Tab> + <tabs:Tab Header="tab3"> + <Template> + 3 + </Template> + </tabs:Tab> </tabs:JQTabs> </div> </form> </body> </html>
sila/AtomProject
5ba4284023015030d7c9638b581253cb33b9cf64
add new properties in JQDatePicker
diff --git a/TestApp/DatePicker.aspx b/TestApp/DatePicker.aspx index dcb80b4..3be1f4c 100644 --- a/TestApp/DatePicker.aspx +++ b/TestApp/DatePicker.aspx @@ -1,24 +1,30 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DatePicker.aspx.cs" Inherits="TestApp.DatePicker" %> <%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.DatePicker" TagPrefix="calendar" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>JQDatePicker</title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> - <script type="text/javascript"> - - + <script type="text/javascript"> + + function Button1_onclick() + { + $('#temp').val( new Date()); + } + </script> </head> <body> <form id="form1" runat="server"> <div> + <input type="text" name="temp" id="temp" value="" /> + <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /> <calendar:JQDatePicker ID="JQDatePicker2" runat="server" Mode="Calendar" /> <calendar:JQDatePicker ID="JQDatePicker1" runat="server" Mode="DatePicker" /> </div> </form> </body> </html>
sila/AtomProject
1aead54c0dbf67d07050b5f96e82393d008dd436
add array properties in ViewState
diff --git a/Atom.Web/DatePicker/JQDatePicker.cs b/Atom.Web/DatePicker/JQDatePicker.cs index 7e96266..b6a3a57 100644 --- a/Atom.Web/DatePicker/JQDatePicker.cs +++ b/Atom.Web/DatePicker/JQDatePicker.cs @@ -247,729 +247,806 @@ namespace Atom.Web.UI.WebControls.DatePicker return (gotoCurrent == null) ? false : Convert.ToBoolean(gotoCurrent); } set { ViewState["GotoCurrentViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool HideIfNoPrevNext { get { object hideIfNoPrevNext = ViewState["HideIfNoPrevNextViewState"]; return (hideIfNoPrevNext == null) ? false : Convert.ToBoolean(hideIfNoPrevNext); } set { ViewState["HideIfNoPrevNextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool IsRTL { get { object rtl = ViewState["IsRTLViewState"]; return (rtl == null) ? false : Convert.ToBoolean(rtl); } set { ViewState["IsRTLViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool NavigationAsDateFormat { get { object navigationAsDateFormat = ViewState["NavigationAsDateFormatViewState"]; return (navigationAsDateFormat == null) ? false : Convert.ToBoolean(navigationAsDateFormat); } set { ViewState["NavigationAsDateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool SelectOtherMonths { get { object selectOtherMonths = ViewState["SelectOtherMonthsViewState"]; return (selectOtherMonths == null) ? false : Convert.ToBoolean(selectOtherMonths); } set { ViewState["SelectOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowButtonPanel { get { object showButtonPanel = ViewState["ShowButtonPanelViewState"]; return (showButtonPanel == null) ? false : Convert.ToBoolean(showButtonPanel); } set { ViewState["ShowButtonPanelViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowMonthAfterYear { get { object showMonthAfterYear = ViewState["ShowMonthAfterYearViewState"]; return (showMonthAfterYear == null) ? false : Convert.ToBoolean(showMonthAfterYear); } set { ViewState["ShowMonthAfterYearViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowWeek { get { object showWeek = ViewState["ShowWeekViewState"]; return (showWeek == null) ? false : Convert.ToBoolean(showWeek); } set { ViewState["ShowWeekViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowOtherMonths { get { object showOtherMonths = ViewState["ShowOtherMonthsViewState"]; return (showOtherMonths == null) ? false : Convert.ToBoolean(showOtherMonths); } set { ViewState["ShowOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Draggable { get { object draggable = ViewState["DraggableViewState"]; return (draggable == null) ? false : Convert.ToBoolean(draggable); } set { ViewState["DraggableViewState"] = value; } } #endregion #region str [ Category("Behavior"), Description(""), DefaultValue("") ] public string AltField { get { object autoSize = ViewState["AltFieldViewState"]; return (autoSize == null) ? string.Empty : autoSize.ToString(); } set { ViewState["AltFieldViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string AltFormat { get { object altFormat = ViewState["AltFormatViewState"]; return (altFormat == null) ? string.Empty : altFormat.ToString(); } set { ViewState["AltFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string AppendText { get { object appendText = ViewState["AppendTextViewState"]; return (appendText == null) ? string.Empty : appendText.ToString(); } set { ViewState["AppendTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string ButtonImage { get { object buttonImage = ViewState["ButtonImageViewState"]; return (buttonImage == null) ? string.Empty : buttonImage.ToString(); } set { ViewState["ButtonImageViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("...") ] public string ButtonText { get { object buttonText = ViewState["ButtonTextViewState"]; return (buttonText == null) ? "..." : buttonText.ToString(); } set { ViewState["ButtonTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Done") ] public string CloseText { get { object closeText = ViewState["CloseTextViewState"]; return (closeText == null) ? "Done" : closeText.ToString(); } set { ViewState["CloseTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Today") ] public string CurrentText { get { object currentText = ViewState["CurrentTextViewState"]; return (currentText == null) ? "Today" : currentText.ToString(); } set { ViewState["CurrentTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("mm/dd/yy") ] public string DateFormat { get { object dateFormat = ViewState["DateFormatViewState"]; return (dateFormat == null) ? "mm/dd/yy" : dateFormat.ToString(); } set { ViewState["DateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Wk") ] public string WeekHeader { get { object weekHeader = ViewState["WeekHeaderViewState"]; return (weekHeader == null) ? "Wk" : weekHeader.ToString(); } set { ViewState["WeekHeaderViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("c-10:c+10") ] public string YearRange { get { object yearRange = ViewState["YearRangeViewState"]; return (yearRange == null) ? "c-10:c+10" : yearRange.ToString(); } set { ViewState["YearRangeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string YearSuffix { get { object yearSuffix = ViewState["YearSuffixViewState"]; return (yearSuffix == null) ? string.Empty : yearSuffix.ToString(); } set { ViewState["YearSuffixViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Next") ] public string NextText { get { object nextText = ViewState["NextTextViewState"]; return (nextText == null) ? "Next" : nextText.ToString(); } set { ViewState["NextTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Prev") ] public string PrevText { get { object prevText = ViewState["PrevTextViewState"]; return (prevText == null) ? "Prev" : prevText.ToString(); } set { ViewState["PrevTextViewState"] = value; } } //enum [ Category("Behavior"), Description(""), DefaultValue(DatePickerShowOn.Focus) ] public DatePickerShowOn ShowOn { get { object showOn = ViewState["ShowOnViewState"]; return (showOn == null) ? DatePickerShowOn.Focus : (DatePickerShowOn)showOn; } set { ViewState["ShowOnViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerDuration.Normal) ] public DatePickerDuration Duration { get { object duration = ViewState["DurationViewState"]; return (duration == null) ? DatePickerDuration.Normal : (DatePickerDuration)duration; } set { ViewState["DurationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerAnimation.Show) ] public DatePickerAnimation ShowAnimation { get { object showAnimation = ViewState["ShowAnimationViewState"]; return (showAnimation == null) ? DatePickerAnimation.Show : (DatePickerAnimation)showAnimation; } set { ViewState["ShowAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DatePickerMode.DatePicker) ] public DatePickerMode Mode { get { object mode = ViewState["ModeViewState"]; return (mode == null) ? DatePickerMode.DatePicker : (DatePickerMode)mode; } set { ViewState["ModeViewState"] = value; } } #endregion #region int [ Category("Behavior"), Description(""), DefaultValue(0) ] public int FirstDay { get { object firstDay = ViewState["FirstDayViewState"]; return (firstDay == null) ? 0 : Convert.ToInt32(firstDay); } set { ViewState["FirstDayViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(1) ] public int StepMonths { get { object stepMonths = ViewState["StepMonthsViewState"]; return (stepMonths == null) ? 1 : Convert.ToInt32(stepMonths); } set { ViewState["StepMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(0) ] public int ShowCurrentAtPos { get { object showCurrentAtPos = ViewState["ShowCurrentAtPosViewState"]; return (showCurrentAtPos == null) ? 0 : Convert.ToInt32(showCurrentAtPos); } set { ViewState["ShowCurrentAtPosViewState"] = value; } } #endregion #region arr public string DayNames { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object dayNames = ViewState["DayNamesViewState"]; + return (dayNames == null) ? string.Empty : dayNames.ToString(); + } + set + { + ViewState["DayNamesViewState"] = value; + } } public string DayNamesMin { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object dayNamesMin = ViewState["DayNamesMinViewState"]; + return (dayNamesMin == null) ? string.Empty : dayNamesMin.ToString(); + } + set + { + ViewState["DayNamesMinViewState"] = value; + } } public string DayNamesShort { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object dayNamesShort = ViewState["DayNamesShortViewState"]; + return (dayNamesShort == null) ? string.Empty : dayNamesShort.ToString(); + } + set + { + ViewState["DayNamesShortViewState"] = value; + } } public string DefaultDate { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object defaultDate = ViewState["DefaultDateViewState"]; + return (defaultDate == null) ? string.Empty : defaultDate.ToString(); + } + set + { + ViewState["DefaultDateViewState"] = value; + } } public string MaxDate { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object maxDate = ViewState["MaxDateViewState"]; + return (maxDate == null) ? string.Empty : maxDate.ToString(); + } + set + { + ViewState["MaxDateViewState"] = value; + } } public string MinDate { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object minDate = ViewState["MinDateViewState"]; + return (minDate == null) ? string.Empty : minDate.ToString(); + } + set + { + ViewState["MinDateViewState"] = value; + } } public string MonthNames { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object monthNames = ViewState["MonthNamesViewState"]; + return (monthNames == null) ? string.Empty : monthNames.ToString(); + } + set + { + ViewState["MonthNamesViewState"] = value; + } } public string MonthNamesShort { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object monthNamesShort = ViewState["MonthNamesShortViewState"]; + return (monthNamesShort == null) ? string.Empty : monthNamesShort.ToString(); + } + set + { + ViewState["MonthNamesShortViewState"] = value; + } } public string NumberOfMonths { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object numberOfMonths = ViewState["NumberOfMonthsViewState"]; + return (NumberOfMonths == null) ? string.Empty : NumberOfMonths.ToString(); + } + set + { + ViewState["NumberOfMonthsViewState"] = value; + } } public string ShortYearCutoff { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object shortYearCutoff = ViewState["ShortYearCutoffViewState"]; + return (shortYearCutoff == null) ? string.Empty : shortYearCutoff.ToString(); + } + set + { + ViewState["ShortYearCutoffViewState"] = value; + } } public string ShowOptions { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object showOptions = ViewState["ShowOptionsViewState"]; + return (showOptions == null) ? string.Empty : showOptions.ToString(); + } + set + { + ViewState["ShowOptionsViewState"] = value; + } } #endregion #region inherit properties [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } #endregion } }
sila/AtomProject
929614a670674b5108a115b68da0a841bcff98ed
add README file
diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..8718e75 --- /dev/null +++ b/README.txt @@ -0,0 +1 @@ +The Atom project is open source project based on ASP.NET (4.0) and jQuery platform. \ No newline at end of file
sila/AtomProject
fffd36188653fa3c6c14b1ce4ee8010a31653ab4
add different form for each control
diff --git a/TestApp/Accordion.aspx b/TestApp/Accordion.aspx new file mode 100644 index 0000000..b533b6c --- /dev/null +++ b/TestApp/Accordion.aspx @@ -0,0 +1,22 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Accordion.aspx.cs" Inherits="TestApp.WebForm1" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title></title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> + <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> + <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> + <script type="text/javascript"> + + + </script> +</head> +<body> + <form id="form1" runat="server"> + <div> + + </div> + </form> +</body> +</html> diff --git a/TestApp/Accordion.aspx.cs b/TestApp/Accordion.aspx.cs new file mode 100644 index 0000000..c296203 --- /dev/null +++ b/TestApp/Accordion.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace TestApp +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/TestApp/Accordion.aspx.designer.cs b/TestApp/Accordion.aspx.designer.cs new file mode 100644 index 0000000..ac30c90 --- /dev/null +++ b/TestApp/Accordion.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TestApp +{ + + + public partial class WebForm1 + { + + /// <summary> + /// form1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/TestApp/AutoComplete.aspx b/TestApp/AutoComplete.aspx new file mode 100644 index 0000000..7cf3cc3 --- /dev/null +++ b/TestApp/AutoComplete.aspx @@ -0,0 +1,22 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AutoComplete.aspx.cs" Inherits="TestApp.AutoComplete" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title></title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> + <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> + <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> + <script type="text/javascript"> + + + </script> +</head> +<body> + <form id="form1" runat="server"> + <div> + + </div> + </form> +</body> +</html> diff --git a/TestApp/AutoComplete.aspx.cs b/TestApp/AutoComplete.aspx.cs new file mode 100644 index 0000000..eceba29 --- /dev/null +++ b/TestApp/AutoComplete.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace TestApp +{ + public partial class AutoComplete : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/TestApp/AutoComplete.aspx.designer.cs b/TestApp/AutoComplete.aspx.designer.cs new file mode 100644 index 0000000..308350c --- /dev/null +++ b/TestApp/AutoComplete.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TestApp +{ + + + public partial class AutoComplete + { + + /// <summary> + /// form1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/TestApp/Button.aspx b/TestApp/Button.aspx new file mode 100644 index 0000000..1b8e844 --- /dev/null +++ b/TestApp/Button.aspx @@ -0,0 +1,22 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Button.aspx.cs" Inherits="TestApp.Button" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title></title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> + <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> + <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> + <script type="text/javascript"> + + + </script> +</head> +<body> + <form id="form1" runat="server"> + <div> + + </div> + </form> +</body> +</html> diff --git a/TestApp/Button.aspx.cs b/TestApp/Button.aspx.cs new file mode 100644 index 0000000..0184bfa --- /dev/null +++ b/TestApp/Button.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace TestApp +{ + public partial class Button : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/TestApp/Button.aspx.designer.cs b/TestApp/Button.aspx.designer.cs new file mode 100644 index 0000000..7da4331 --- /dev/null +++ b/TestApp/Button.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TestApp +{ + + + public partial class Button + { + + /// <summary> + /// form1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/TestApp/DatePicker.aspx b/TestApp/DatePicker.aspx new file mode 100644 index 0000000..2a43b5c --- /dev/null +++ b/TestApp/DatePicker.aspx @@ -0,0 +1,22 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DatePicker.aspx.cs" Inherits="TestApp.DatePicker" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title></title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> + <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> + <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> + <script type="text/javascript"> + + + </script> +</head> +<body> + <form id="form1" runat="server"> + <div> + + </div> + </form> +</body> +</html> diff --git a/TestApp/DatePicker.aspx.cs b/TestApp/DatePicker.aspx.cs new file mode 100644 index 0000000..51fa37c --- /dev/null +++ b/TestApp/DatePicker.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace TestApp +{ + public partial class DatePicker : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/TestApp/DatePicker.aspx.designer.cs b/TestApp/DatePicker.aspx.designer.cs new file mode 100644 index 0000000..acef76a --- /dev/null +++ b/TestApp/DatePicker.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TestApp +{ + + + public partial class DatePicker + { + + /// <summary> + /// form1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/TestApp/Default.aspx b/TestApp/Default.aspx index f208b29..1a34b24 100644 --- a/TestApp/Default.aspx +++ b/TestApp/Default.aspx @@ -1,25 +1,31 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestApp.Default" %> -<%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.Dialog" TagPrefix="dialog" %> -<%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.Slider" TagPrefix="slider" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> + <script type="text/javascript"> + + + </script> </head> <body> <form id="form1" runat="server"> <div> - <dialog:JQDialog ID="JQDialog1" Title="kur" runat="server" AutoOpen="true" ShowAnimation="Explode" - HideAnimation="Explode"> - <Template> - <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar> - Kur</Template> - </dialog:JQDialog> + <ul> + <li><a href="#">Accordion</a></li> + <li><a href="#">AutoComplete</a></li> + <li><a href="#">Button</a></li> + <li><a href="#">DatePicker</a> </li> + <li><a href="#">Dialog</a></li> + <li><a href="#">Progressbar</a></li> + <li><a href="#">Slider</a></li> + <li><a href="#">Tabs</a></li> + </ul> </div> </form> </body> </html> diff --git a/TestApp/Default.aspx.designer.cs b/TestApp/Default.aspx.designer.cs index 38c6f0d..dcd1a89 100644 --- a/TestApp/Default.aspx.designer.cs +++ b/TestApp/Default.aspx.designer.cs @@ -1,33 +1,24 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace TestApp { public partial class Default { /// <summary> /// form1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// <summary> - /// JQDialog1 control. - /// </summary> - /// <remarks> - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// </remarks> - protected global::Atom.Web.UI.WebControls.Dialog.JQDialog JQDialog1; } } diff --git a/TestApp/Dialog.aspx b/TestApp/Dialog.aspx new file mode 100644 index 0000000..29c11f9 --- /dev/null +++ b/TestApp/Dialog.aspx @@ -0,0 +1,22 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Dialog.aspx.cs" Inherits="TestApp.WebForm4" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title></title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> + <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> + <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> + <script type="text/javascript"> + + + </script> +</head> +<body> + <form id="form1" runat="server"> + <div> + + </div> + </form> +</body> +</html> diff --git a/TestApp/Dialog.aspx.cs b/TestApp/Dialog.aspx.cs new file mode 100644 index 0000000..df2e8ee --- /dev/null +++ b/TestApp/Dialog.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace TestApp +{ + public partial class WebForm4 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/TestApp/Dialog.aspx.designer.cs b/TestApp/Dialog.aspx.designer.cs new file mode 100644 index 0000000..bc529bb --- /dev/null +++ b/TestApp/Dialog.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TestApp +{ + + + public partial class WebForm4 + { + + /// <summary> + /// form1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/TestApp/Progressbar.aspx b/TestApp/Progressbar.aspx new file mode 100644 index 0000000..74180e5 --- /dev/null +++ b/TestApp/Progressbar.aspx @@ -0,0 +1,22 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Progressbar.aspx.cs" Inherits="TestApp.Progressbar" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title></title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> + <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> + <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> + <script type="text/javascript"> + + + </script> +</head> +<body> + <form id="form1" runat="server"> + <div> + + </div> + </form> +</body> +</html> diff --git a/TestApp/Progressbar.aspx.cs b/TestApp/Progressbar.aspx.cs new file mode 100644 index 0000000..a066f80 --- /dev/null +++ b/TestApp/Progressbar.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace TestApp +{ + public partial class Progressbar : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/TestApp/Progressbar.aspx.designer.cs b/TestApp/Progressbar.aspx.designer.cs new file mode 100644 index 0000000..4fb691f --- /dev/null +++ b/TestApp/Progressbar.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TestApp +{ + + + public partial class Progressbar + { + + /// <summary> + /// form1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/TestApp/Slider.aspx b/TestApp/Slider.aspx new file mode 100644 index 0000000..5e76d13 --- /dev/null +++ b/TestApp/Slider.aspx @@ -0,0 +1,22 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Slider.aspx.cs" Inherits="TestApp.WebForm2" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title></title> <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> + <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> + <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> + <script type="text/javascript"> + + + </script> +</head> +<body> + <form id="form1" runat="server"> + <div> + + </div> + </form> +</body> +</html> diff --git a/TestApp/Slider.aspx.cs b/TestApp/Slider.aspx.cs new file mode 100644 index 0000000..44cdf2f --- /dev/null +++ b/TestApp/Slider.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace TestApp +{ + public partial class WebForm2 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/TestApp/Slider.aspx.designer.cs b/TestApp/Slider.aspx.designer.cs new file mode 100644 index 0000000..3109378 --- /dev/null +++ b/TestApp/Slider.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TestApp +{ + + + public partial class WebForm2 + { + + /// <summary> + /// form1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/TestApp/Tabs.aspx b/TestApp/Tabs.aspx new file mode 100644 index 0000000..295ced6 --- /dev/null +++ b/TestApp/Tabs.aspx @@ -0,0 +1,21 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Tabs.aspx.cs" Inherits="TestApp.WebForm3" %> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title></title> + <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> + <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> + <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> + <script type="text/javascript"> + + + </script> +</head> +<body> + <form id="form1" runat="server"> + <div> + </div> + </form> +</body> +</html> diff --git a/TestApp/Tabs.aspx.cs b/TestApp/Tabs.aspx.cs new file mode 100644 index 0000000..c9ed7f8 --- /dev/null +++ b/TestApp/Tabs.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace TestApp +{ + public partial class WebForm3 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/TestApp/Tabs.aspx.designer.cs b/TestApp/Tabs.aspx.designer.cs new file mode 100644 index 0000000..d203ec6 --- /dev/null +++ b/TestApp/Tabs.aspx.designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TestApp +{ + + + public partial class WebForm3 + { + + /// <summary> + /// form1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + } +} diff --git a/TestApp/TestApp.csproj b/TestApp/TestApp.csproj index eb5d93c..e01b076 100644 --- a/TestApp/TestApp.csproj +++ b/TestApp/TestApp.csproj @@ -1,212 +1,276 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{DE47D62D-661C-489D-AE25-1068D3E629FE}</ProjectGuid> <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>TestApp</RootNamespace> <AssemblyName>TestApp</AssemblyName> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="Microsoft.CSharp" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Core" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Web.Extensions" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Drawing" /> <Reference Include="System.Web" /> <Reference Include="System.Xml" /> <Reference Include="System.Configuration" /> <Reference Include="System.Web.Services" /> <Reference Include="System.EnterpriseServices" /> <Reference Include="System.Web.DynamicData" /> <Reference Include="System.Web.Entity" /> <Reference Include="System.Web.ApplicationServices" /> </ItemGroup> <ItemGroup> + <Content Include="AutoComplete.aspx" /> + <Content Include="Button.aspx" /> + <Content Include="DatePicker.aspx" /> <Content Include="Default.aspx" /> + <Content Include="Progressbar.aspx" /> <Content Include="Scripts\jqGridView.js" /> <Content Include="Scripts\jquery-1.4.1-vsdoc.js" /> <Content Include="Scripts\jquery-1.4.1.js" /> <Content Include="Scripts\jquery-1.4.1.min.js" /> <Content Include="Scripts\jquery-ui-1.8.custom.min.js" /> <Content Include="themes\base\images\ui-bg_flat_0_aaaaaa_40x100.png" /> <Content Include="themes\base\images\ui-bg_flat_75_ffffff_40x100.png" /> <Content Include="themes\base\images\ui-bg_glass_55_fbf9ee_1x400.png" /> <Content Include="themes\base\images\ui-bg_glass_65_ffffff_1x400.png" /> <Content Include="themes\base\images\ui-bg_glass_75_dadada_1x400.png" /> <Content Include="themes\base\images\ui-bg_glass_75_e6e6e6_1x400.png" /> <Content Include="themes\base\images\ui-bg_glass_95_fef1ec_1x400.png" /> <Content Include="themes\base\images\ui-bg_highlight-soft_75_cccccc_1x100.png" /> <Content Include="themes\base\images\ui-icons_222222_256x240.png" /> <Content Include="themes\base\images\ui-icons_2e83ff_256x240.png" /> <Content Include="themes\base\images\ui-icons_454545_256x240.png" /> <Content Include="themes\base\images\ui-icons_888888_256x240.png" /> <Content Include="themes\base\images\ui-icons_cd0a0a_256x240.png" /> <Content Include="themes\base\ui.accordion.css" /> <Content Include="themes\base\ui.all.css" /> <Content Include="themes\base\ui.base.css" /> <Content Include="themes\base\ui.core.css" /> <Content Include="themes\base\ui.datepicker.css" /> <Content Include="themes\base\ui.dialog.css" /> <Content Include="themes\base\ui.progressbar.css" /> <Content Include="themes\base\ui.resizable.css" /> <Content Include="themes\base\ui.slider.css" /> <Content Include="themes\base\ui.tabs.css" /> <Content Include="themes\base\ui.theme.css" /> <Content Include="themes\my_thmere\images\ui-bg_dots-medium_75_0fdb22_4x4.png" /> <Content Include="themes\my_thmere\images\ui-bg_flat_0_aaaaaa_40x100.png" /> <Content Include="themes\my_thmere\images\ui-bg_glass_55_e0ef34_1x400.png" /> <Content Include="themes\my_thmere\images\ui-bg_glass_65_ffffff_1x400.png" /> <Content Include="themes\my_thmere\images\ui-bg_glass_75_e6e6e6_1x400.png" /> <Content Include="themes\my_thmere\images\ui-bg_glow-ball_75_1c51ce_600x600.png" /> <Content Include="themes\my_thmere\images\ui-bg_highlight-soft_75_e71d1d_1x100.png" /> <Content Include="themes\my_thmere\images\ui-bg_inset-soft_95_fef1ec_1x100.png" /> <Content Include="themes\my_thmere\images\ui-icons_222222_256x240.png" /> <Content Include="themes\my_thmere\images\ui-icons_2e83ff_256x240.png" /> <Content Include="themes\my_thmere\images\ui-icons_454545_256x240.png" /> <Content Include="themes\my_thmere\images\ui-icons_888888_256x240.png" /> <Content Include="themes\my_thmere\images\ui-icons_cd0a0a_256x240.png" /> <Content Include="themes\my_thmere\jquery-ui-1.8rc3.custom.css" /> <Content Include="themes\my_thmere\jquery.ui.accordion.css" /> <Content Include="themes\my_thmere\jquery.ui.all.css" /> <Content Include="themes\my_thmere\jquery.ui.autocomplete.css" /> <Content Include="themes\my_thmere\jquery.ui.base.css" /> <Content Include="themes\my_thmere\jquery.ui.button.css" /> <Content Include="themes\my_thmere\jquery.ui.core.css" /> <Content Include="themes\my_thmere\jquery.ui.datepicker.css" /> <Content Include="themes\my_thmere\jquery.ui.dialog.css" /> <Content Include="themes\my_thmere\jquery.ui.progressbar.css" /> <Content Include="themes\my_thmere\jquery.ui.resizable.css" /> <Content Include="themes\my_thmere\jquery.ui.slider.css" /> <Content Include="themes\my_thmere\jquery.ui.tabs.css" /> <Content Include="themes\my_thmere\jquery.ui.theme.css" /> <Content Include="themes\office_blue\css\dpSyntaxHighlighter.css" /> <Content Include="themes\office_blue\css\gridview.css" /> <Content Include="themes\office_blue\flash\clipboard.swf" /> <Content Include="themes\office_blue\images\add.gif" /> <Content Include="themes\office_blue\images\ajax-loader.gif" /> <Content Include="themes\office_blue\images\asc.gif" /> <Content Include="themes\office_blue\images\delete.gif" /> <Content Include="themes\office_blue\images\desc.gif" /> <Content Include="themes\office_blue\images\dirty.gif" /> <Content Include="themes\office_blue\images\filter.gif" /> <Content Include="themes\office_blue\images\grid-hrow.gif" /> <Content Include="themes\office_blue\images\msg_unread.gif" /> <Content Include="themes\office_blue\images\rtg_email.gif" /> <Content Include="themes\office_blue\images\run.gif" /> <Content Include="themes\office_blue\images\save.gif" /> <Content Include="themes\office_blue\images\split.gif" /> <Content Include="themes\office_blue\images\tb-bg.gif" /> <Content Include="themes\office_blue\images\transparent.gif" /> <Content Include="themes\ui-lightness\images\ui-bg_diagonals-thick_18_b81900_40x40.png" /> <Content Include="themes\ui-lightness\images\ui-bg_diagonals-thick_20_666666_40x40.png" /> <Content Include="themes\ui-lightness\images\ui-bg_flat_10_000000_40x100.png" /> <Content Include="themes\ui-lightness\images\ui-bg_glass_100_f6f6f6_1x400.png" /> <Content Include="themes\ui-lightness\images\ui-bg_glass_100_fdf5ce_1x400.png" /> <Content Include="themes\ui-lightness\images\ui-bg_glass_65_ffffff_1x400.png" /> <Content Include="themes\ui-lightness\images\ui-bg_gloss-wave_35_f6a828_500x100.png" /> <Content Include="themes\ui-lightness\images\ui-bg_highlight-soft_100_eeeeee_1x100.png" /> <Content Include="themes\ui-lightness\images\ui-bg_highlight-soft_75_ffe45c_1x100.png" /> <Content Include="themes\ui-lightness\images\ui-icons_222222_256x240.png" /> <Content Include="themes\ui-lightness\images\ui-icons_228ef1_256x240.png" /> <Content Include="themes\ui-lightness\images\ui-icons_ef8c08_256x240.png" /> <Content Include="themes\ui-lightness\images\ui-icons_ffd27a_256x240.png" /> <Content Include="themes\ui-lightness\images\ui-icons_ffffff_256x240.png" /> <Content Include="themes\ui-lightness\jquery-ui-1.7.2.custom.css" /> <Content Include="themes\ui-lightness\ui.accordion.css" /> <Content Include="themes\ui-lightness\ui.all.css" /> <Content Include="themes\ui-lightness\ui.base.css" /> <Content Include="themes\ui-lightness\ui.core.css" /> <Content Include="themes\ui-lightness\ui.datepicker.css" /> <Content Include="themes\ui-lightness\ui.dialog.css" /> <Content Include="themes\ui-lightness\ui.progressbar.css" /> <Content Include="themes\ui-lightness\ui.resizable.css" /> <Content Include="themes\ui-lightness\ui.slider.css" /> <Content Include="themes\ui-lightness\ui.tabs.css" /> <Content Include="themes\ui-lightness\ui.theme.css" /> <Content Include="Web.config" /> <Content Include="Web.Debug.config"> <DependentUpon>Web.config</DependentUpon> </Content> <Content Include="Web.Release.config"> <DependentUpon>Web.config</DependentUpon> </Content> + <Content Include="Accordion.aspx" /> + <Content Include="Slider.aspx" /> + <Content Include="Tabs.aspx" /> + <Content Include="Dialog.aspx" /> </ItemGroup> <ItemGroup> + <Compile Include="AutoComplete.aspx.cs"> + <DependentUpon>AutoComplete.aspx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> + </Compile> + <Compile Include="AutoComplete.aspx.designer.cs"> + <DependentUpon>AutoComplete.aspx</DependentUpon> + </Compile> + <Compile Include="Button.aspx.cs"> + <DependentUpon>Button.aspx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> + </Compile> + <Compile Include="Button.aspx.designer.cs"> + <DependentUpon>Button.aspx</DependentUpon> + </Compile> + <Compile Include="DatePicker.aspx.cs"> + <DependentUpon>DatePicker.aspx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> + </Compile> + <Compile Include="DatePicker.aspx.designer.cs"> + <DependentUpon>DatePicker.aspx</DependentUpon> + </Compile> <Compile Include="Default.aspx.cs"> <DependentUpon>Default.aspx</DependentUpon> <SubType>ASPXCodeBehind</SubType> </Compile> <Compile Include="Default.aspx.designer.cs"> <DependentUpon>Default.aspx</DependentUpon> </Compile> + <Compile Include="Progressbar.aspx.cs"> + <DependentUpon>Progressbar.aspx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> + </Compile> + <Compile Include="Progressbar.aspx.designer.cs"> + <DependentUpon>Progressbar.aspx</DependentUpon> + </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Accordion.aspx.cs"> + <DependentUpon>Accordion.aspx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> + </Compile> + <Compile Include="Accordion.aspx.designer.cs"> + <DependentUpon>Accordion.aspx</DependentUpon> + </Compile> + <Compile Include="Slider.aspx.cs"> + <DependentUpon>Slider.aspx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> + </Compile> + <Compile Include="Slider.aspx.designer.cs"> + <DependentUpon>Slider.aspx</DependentUpon> + </Compile> + <Compile Include="Tabs.aspx.cs"> + <DependentUpon>Tabs.aspx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> + </Compile> + <Compile Include="Tabs.aspx.designer.cs"> + <DependentUpon>Tabs.aspx</DependentUpon> + </Compile> + <Compile Include="Dialog.aspx.cs"> + <DependentUpon>Dialog.aspx</DependentUpon> + <SubType>ASPXCodeBehind</SubType> + </Compile> + <Compile Include="Dialog.aspx.designer.cs"> + <DependentUpon>Dialog.aspx</DependentUpon> + </Compile> </ItemGroup> <ItemGroup> <Folder Include="Styles\" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Atom.Web\Atom.Web.csproj"> <Project>{E56668B1-FEE9-43C8-92B7-DAC1B568D29E}</Project> <Name>Atom.Web</Name> </ProjectReference> </ItemGroup> <ItemGroup> <None Include="themes\office_blue\images\Thumbs.db" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> <ProjectExtensions> <VisualStudio> <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> <WebProjectProperties> <UseIIS>False</UseIIS> <AutoAssignPort>True</AutoAssignPort> <DevelopmentServerPort>27960</DevelopmentServerPort> <DevelopmentServerVPath>/</DevelopmentServerVPath> <IISUrl> </IISUrl> <NTLMAuthentication>False</NTLMAuthentication> <UseCustomServer>False</UseCustomServer> <CustomServerUrl> </CustomServerUrl> <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> </WebProjectProperties> </FlavorProperties> </VisualStudio> </ProjectExtensions> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> \ No newline at end of file
sila/AtomProject
472edbf1557ac4e7376e153a945ccb18c13d1f0f
add int and bool properties with startup script
diff --git a/Atom.Web/DatePicker/JQDatePicker.cs b/Atom.Web/DatePicker/JQDatePicker.cs index b9bb631..7e96266 100644 --- a/Atom.Web/DatePicker/JQDatePicker.cs +++ b/Atom.Web/DatePicker/JQDatePicker.cs @@ -1,867 +1,975 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI; using System.ComponentModel; using System.Web; using System.Security.Permissions; using System.Web.UI.WebControls; namespace Atom.Web.UI.WebControls.DatePicker { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), Designer(typeof(DatePickerDesigner)), ToolboxData("<{0}:JQDatePicker runat=\"server\"> </{0}:JQDatePicker>") ] public class JQDatePicker : WebControl { private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("var " + this.UniqueID + "; "); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat(this.UniqueID + " = $('#" + this.UniqueID + "');"); - - + startupScript.AppendFormat(this.UniqueID + ".datepicker({{"); + if (!this.Enabled) + { + startupScript.AppendFormat(" disabled: true,"); + } + if (this.AutoSize) + { + startupScript.AppendFormat(" autoSize: true,"); + } + if (this.ButtonImageOnly) + { + startupScript.AppendFormat(" buttonImageOnly: true,"); + } + if (this.ChangeMonth) + { + startupScript.AppendFormat(" changeMonth: true,"); + } + if (this.ChangeYear) + { + startupScript.AppendFormat(" changeYear: true,"); + } + if (!this.ConstrainInput) + { + startupScript.AppendFormat(" constrainInput: false,"); + } + if (this.GotoCurrent) + { + startupScript.AppendFormat(" gotoCurrent: true,"); + } + if (this.HideIfNoPrevNext) + { + startupScript.AppendFormat(" hideIfNoPrevNext: true,"); + } + if (this.IsRTL) + { + startupScript.AppendFormat(" isRTL: true,"); + } + if (this.NavigationAsDateFormat) + { + startupScript.AppendFormat(" navigationAsDateFormat: true,"); + } + if (this.SelectOtherMonths) + { + startupScript.AppendFormat(" selectOtherMonths: true,"); + } + if (this.ShowButtonPanel) + { + startupScript.AppendFormat(" showButtonPanel: true,"); + } + if (this.ShowMonthAfterYear) + { + startupScript.AppendFormat(" showMonthAfterYear: true,"); + } + if (this.ShowWeek) + { + startupScript.AppendFormat(" showWeek: true,"); + } + if (this.ShowOtherMonths) + { + startupScript.AppendFormat(" showOtherMonths: true,"); + } + if (this.FirstDay != 0) + { + startupScript.AppendFormat(" firstDay: {0},", this.FirstDay); + } + if (this.StepMonths != 1) + { + startupScript.AppendFormat(" stepMonths: {0},", this.StepMonths); + } + if (this.ShowCurrentAtPos != 0) + { + startupScript.AppendFormat(" showCurrentAtPos: {0},", this.ShowCurrentAtPos); + } startupScript.AppendFormat("}})"); + if ((this.Mode == DatePickerMode.Calendar) && (this.Draggable)) + { + startupScript.AppendFormat(" .draggable()"); + } + startupScript.AppendFormat(";"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } protected override void Render(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); - - + if (this.Mode == DatePickerMode.DatePicker) + { + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); + writer.RenderBeginTag(HtmlTextWriterTag.Input); + writer.RenderEndTag(); + } + else + { + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + writer.RenderEndTag(); + } } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } //properties #region bool [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool AutoSize { get { object autoSize = ViewState["AutoSizeViewState"]; return (autoSize == null) ? false : Convert.ToBoolean(autoSize); } set { ViewState["AutoSizeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ButtonImageOnly { get { object buttonImageOnly = ViewState["ButtonImageOnlyViewState"]; return (buttonImageOnly == null) ? false : Convert.ToBoolean(buttonImageOnly); } set { ViewState["ButtonImageOnlyViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ChangeMonth { get { object changeMonth = ViewState["ChangeMonthViewState"]; return (changeMonth == null) ? false : Convert.ToBoolean(changeMonth); } set { ViewState["ChangeMonthViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ChangeYear { get { object changeYear = ViewState["ChangeYearViewState"]; return (changeYear == null) ? false : Convert.ToBoolean(changeYear); } set { ViewState["ChangeYearViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool ConstrainInput { get { object changeYear = ViewState["ConstrainInputViewState"]; return (changeYear == null) ? true : Convert.ToBoolean(changeYear); } set { ViewState["ConstrainInputViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool GotoCurrent { get { object gotoCurrent = ViewState["GotoCurrentViewState"]; return (gotoCurrent == null) ? false : Convert.ToBoolean(gotoCurrent); } set { ViewState["GotoCurrentViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool HideIfNoPrevNext { get { object hideIfNoPrevNext = ViewState["HideIfNoPrevNextViewState"]; return (hideIfNoPrevNext == null) ? false : Convert.ToBoolean(hideIfNoPrevNext); } set { ViewState["HideIfNoPrevNextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool IsRTL { get { object rtl = ViewState["IsRTLViewState"]; return (rtl == null) ? false : Convert.ToBoolean(rtl); } set { ViewState["IsRTLViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool NavigationAsDateFormat { get { object navigationAsDateFormat = ViewState["NavigationAsDateFormatViewState"]; return (navigationAsDateFormat == null) ? false : Convert.ToBoolean(navigationAsDateFormat); } set { ViewState["NavigationAsDateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool SelectOtherMonths { get { object selectOtherMonths = ViewState["SelectOtherMonthsViewState"]; return (selectOtherMonths == null) ? false : Convert.ToBoolean(selectOtherMonths); } set { ViewState["SelectOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowButtonPanel { get { object showButtonPanel = ViewState["ShowButtonPanelViewState"]; return (showButtonPanel == null) ? false : Convert.ToBoolean(showButtonPanel); } set { ViewState["ShowButtonPanelViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowMonthAfterYear { get { object showMonthAfterYear = ViewState["ShowMonthAfterYearViewState"]; return (showMonthAfterYear == null) ? false : Convert.ToBoolean(showMonthAfterYear); } set { ViewState["ShowMonthAfterYearViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowWeek { get { object showWeek = ViewState["ShowWeekViewState"]; return (showWeek == null) ? false : Convert.ToBoolean(showWeek); } set { ViewState["ShowWeekViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowOtherMonths { get { object showOtherMonths = ViewState["ShowOtherMonthsViewState"]; return (showOtherMonths == null) ? false : Convert.ToBoolean(showOtherMonths); } set { ViewState["ShowOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Draggable { get { object draggable = ViewState["DraggableViewState"]; return (draggable == null) ? false : Convert.ToBoolean(draggable); } set { ViewState["DraggableViewState"] = value; } } #endregion #region str [ Category("Behavior"), Description(""), DefaultValue("") ] public string AltField { get { object autoSize = ViewState["AltFieldViewState"]; return (autoSize == null) ? string.Empty : autoSize.ToString(); } set { ViewState["AltFieldViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string AltFormat { get { object altFormat = ViewState["AltFormatViewState"]; return (altFormat == null) ? string.Empty : altFormat.ToString(); } set { ViewState["AltFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string AppendText { get { object appendText = ViewState["AppendTextViewState"]; return (appendText == null) ? string.Empty : appendText.ToString(); } set { ViewState["AppendTextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string ButtonImage { get { object buttonImage = ViewState["ButtonImageViewState"]; return (buttonImage == null) ? string.Empty : buttonImage.ToString(); } set { ViewState["ButtonImageViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue("...") ] public string ButtonText { get { object buttonText = ViewState["ButtonTextViewState"]; - return (buttonText == null) ? string.Empty : buttonText.ToString(); + return (buttonText == null) ? "..." : buttonText.ToString(); } set { ViewState["ButtonTextViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue("Done") ] public string CloseText { get { object closeText = ViewState["CloseTextViewState"]; - return (closeText == null) ? string.Empty : closeText.ToString(); + return (closeText == null) ? "Done" : closeText.ToString(); } set { ViewState["CloseTextViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue("Today") ] public string CurrentText { get { object currentText = ViewState["CurrentTextViewState"]; - return (currentText == null) ? string.Empty : currentText.ToString(); + return (currentText == null) ? "Today" : currentText.ToString(); } set { ViewState["CurrentTextViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue("mm/dd/yy") ] public string DateFormat { get { object dateFormat = ViewState["DateFormatViewState"]; - return (dateFormat == null) ? string.Empty : dateFormat.ToString(); + return (dateFormat == null) ? "mm/dd/yy" : dateFormat.ToString(); } set { ViewState["DateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue("Wk") ] public string WeekHeader { get { object weekHeader = ViewState["WeekHeaderViewState"]; - return (weekHeader == null) ? string.Empty : weekHeader.ToString(); + return (weekHeader == null) ? "Wk" : weekHeader.ToString(); } set { ViewState["WeekHeaderViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue("c-10:c+10") ] public string YearRange { get { object yearRange = ViewState["YearRangeViewState"]; - return (yearRange == null) ? string.Empty : yearRange.ToString(); + return (yearRange == null) ? "c-10:c+10" : yearRange.ToString(); } set { ViewState["YearRangeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string YearSuffix { get { object yearSuffix = ViewState["YearSuffixViewState"]; return (yearSuffix == null) ? string.Empty : yearSuffix.ToString(); } set { ViewState["YearSuffixViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue("Next") ] - public string ShowOn + public string NextText { get { - object showOn = ViewState["ShowOnViewState"]; - return (showOn == null) ? string.Empty : showOn.ToString(); + object nextText = ViewState["NextTextViewState"]; + return (nextText == null) ? "Next" : nextText.ToString(); } set { - ViewState["ShowOnViewState"] = value; + ViewState["NextTextViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue("Prev") ] - public string NextText + public string PrevText { get { - object nextText = ViewState["NextTextViewState"]; - return (nextText == null) ? string.Empty : nextText.ToString(); + object prevText = ViewState["PrevTextViewState"]; + return (prevText == null) ? "Prev" : prevText.ToString(); } set { - ViewState["NextTextViewState"] = value; + ViewState["PrevTextViewState"] = value; } } + + //enum [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue(DatePickerShowOn.Focus) ] - public string PrevText + public DatePickerShowOn ShowOn { get { - object prevText = ViewState["PrevTextViewState"]; - return (prevText == null) ? string.Empty : prevText.ToString(); + object showOn = ViewState["ShowOnViewState"]; + return (showOn == null) ? DatePickerShowOn.Focus : (DatePickerShowOn)showOn; } set { - ViewState["PrevTextViewState"] = value; + ViewState["ShowOnViewState"] = value; } } - - //enum [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue(DatePickerDuration.Normal) ] - public string Duration + public DatePickerDuration Duration { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object duration = ViewState["DurationViewState"]; + return (duration == null) ? DatePickerDuration.Normal : (DatePickerDuration)duration; + } + set + { + ViewState["DurationViewState"] = value; + } } [ Category("Behavior"), Description(""), - DefaultValue("") + DefaultValue(DatePickerAnimation.Show) ] - public string ShowAnimation + public DatePickerAnimation ShowAnimation { get { - object yearSuffix = ViewState["YearSuffixViewState"]; - return (yearSuffix == null) ? string.Empty : yearSuffix.ToString(); + object showAnimation = ViewState["ShowAnimationViewState"]; + return (showAnimation == null) ? DatePickerAnimation.Show : (DatePickerAnimation)showAnimation; } set { - ViewState["YearSuffixViewState"] = value; + ViewState["ShowAnimationViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + DefaultValue(DatePickerMode.DatePicker) + ] + public DatePickerMode Mode + { + get + { + object mode = ViewState["ModeViewState"]; + return (mode == null) ? DatePickerMode.DatePicker : (DatePickerMode)mode; + } + set + { + ViewState["ModeViewState"] = value; } } #endregion #region int [ Category("Behavior"), Description(""), DefaultValue(0) ] public int FirstDay { get { object firstDay = ViewState["FirstDayViewState"]; return (firstDay == null) ? 0 : Convert.ToInt32(firstDay); } set { ViewState["FirstDayViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(1) ] public int StepMonths { get { object stepMonths = ViewState["StepMonthsViewState"]; return (stepMonths == null) ? 1 : Convert.ToInt32(stepMonths); } set { ViewState["StepMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(0) ] public int ShowCurrentAtPos { get { object showCurrentAtPos = ViewState["ShowCurrentAtPosViewState"]; return (showCurrentAtPos == null) ? 0 : Convert.ToInt32(showCurrentAtPos); } set { ViewState["ShowCurrentAtPosViewState"] = value; } } #endregion - #region arr public string DayNames { get { return ""; } set { ViewState["ViewState"] = value; } } public string DayNamesMin { get { return ""; } set { ViewState["ViewState"] = value; } } public string DayNamesShort { get { return ""; } set { ViewState["ViewState"] = value; } } public string DefaultDate { get { return ""; } set { ViewState["ViewState"] = value; } } public string MaxDate { get { return ""; } set { ViewState["ViewState"] = value; } } public string MinDate { get { return ""; } set { ViewState["ViewState"] = value; } } public string MonthNames { get { return ""; } set { ViewState["ViewState"] = value; } } public string MonthNamesShort { get { return ""; } set { ViewState["ViewState"] = value; } } public string NumberOfMonths { get { return ""; } set { ViewState["ViewState"] = value; } } public string ShortYearCutoff { get { return ""; } set { ViewState["ViewState"] = value; } } public string ShowOptions { get { return ""; } set { ViewState["ViewState"] = value; } } #endregion - #region inherit properties [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } #endregion - } }
sila/AtomProject
59481bd4d1b251e945e72dfdca732be76a9521b6
add calendar tagprefix namespace
diff --git a/Atom.Web/Properties/AssemblyInfo.cs b/Atom.Web/Properties/AssemblyInfo.cs index d2af537..631c6d8 100644 --- a/Atom.Web/Properties/AssemblyInfo.cs +++ b/Atom.Web/Properties/AssemblyInfo.cs @@ -1,44 +1,45 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Web.UI; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Atom.Web")] [assembly: TagPrefix("Atom.Web.UI.WebControls", "atom")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Accordion", "accordion")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Progressbar", "progressbar")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Tabs", "tabs")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Dialog", "dialog")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Button", "button")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Slider", "slider")] +[assembly: TagPrefix("Atom.Web.UI.WebControls.DatePicker", "calendar")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Atom.Web")] [assembly: AssemblyCopyright("Copyright © 2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("4312a669-223e-4bf6-8c8d-c31acb3c5a1f")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
sila/AtomProject
4736b07f81a25a7150f217632519beacc4820377
add ShowOn enum
diff --git a/Atom.Web/DatePicker/DatePickerShowOn.cs b/Atom.Web/DatePicker/DatePickerShowOn.cs new file mode 100644 index 0000000..711003d --- /dev/null +++ b/Atom.Web/DatePicker/DatePickerShowOn.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.DatePicker +{ + public enum DatePickerShowOn + { + Focus, + Button, + Both + } +}
sila/AtomProject
5415351ab606a9b47ff6bd630021adcc023265e0
add Show item
diff --git a/Atom.Web/DatePicker/DatePickerAnimation.cs b/Atom.Web/DatePicker/DatePickerAnimation.cs index a393284..7cbb985 100644 --- a/Atom.Web/DatePicker/DatePickerAnimation.cs +++ b/Atom.Web/DatePicker/DatePickerAnimation.cs @@ -1,26 +1,27 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Atom.Web.UI.WebControls.DatePicker { public enum DatePickerAnimation { None, Blind, + Show, Bounce, Clip, Drop, Explode, Fold, Highlight, Puff, Pulsate, Scale, Shake, Size, Slide, Transfer } }
sila/AtomProject
c0f9330644a0a678a8a9b66d69659709e19ca4b6
change name AnimationType to AnimationDuration
diff --git a/Atom.Web/Accordion/Animation.cs b/Atom.Web/Accordion/AccordionDuration.cs similarity index 80% rename from Atom.Web/Accordion/Animation.cs rename to Atom.Web/Accordion/AccordionDuration.cs index 0fb0ac3..971b078 100644 --- a/Atom.Web/Accordion/Animation.cs +++ b/Atom.Web/Accordion/AccordionDuration.cs @@ -1,14 +1,14 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Atom.Web.UI.WebControls.Accordion { - public enum Animation + public enum AccordionDuration { Slide, Bounceslide, None, } } diff --git a/Atom.Web/Accordion/Design/AccordionDesigner.cs b/Atom.Web/Accordion/Design/AccordionDesigner.cs index 04a2bb7..bb21c15 100644 --- a/Atom.Web/Accordion/Design/AccordionDesigner.cs +++ b/Atom.Web/Accordion/Design/AccordionDesigner.cs @@ -1,146 +1,146 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI.Design; using System.ComponentModel.Design; using System.ComponentModel; namespace Atom.Web.UI.WebControls.Accordion { public class AccordionDesigner : ControlDesigner { private DesignerActionListCollection _actionList = null; //public bool _isDirty; public override DesignerActionListCollection ActionLists { get { if (this._actionList == null) { this._actionList = new DesignerActionListCollection(); this._actionList.AddRange(base.ActionLists); this._actionList.Add(new ActionList(this)); } return this._actionList; } } public void AddNewItem() { JQAccordion acc = (JQAccordion)this.Component; acc.Items.Add(new Item("NewHeader_" + acc.Items.Count)); Tag.SetDirty(true); } public override string GetDesignTimeHtml() { return base.CreatePlaceHolderDesignTimeHtml(); } } public class ActionList : DesignerActionList { private AccordionDesigner _parent; private DesignerActionItemCollection _items; public ActionList(AccordionDesigner parent) : base(parent.Component) { this._parent = parent; } public override DesignerActionItemCollection GetSortedActionItems() { if (this._items == null) { this._items = new DesignerActionItemCollection(); this._items.Add(new DesignerActionMethodItem(this, "AddNewItem", "Add new item", "", true)); this._items.Add(new DesignerActionPropertyItem("FillSpace", "FillSpace", "")); this._items.Add(new DesignerActionPropertyItem("Collapsible", "Collapsible", "")); this._items.Add(new DesignerActionPropertyItem("Resizable", "Resizable", "")); this._items.Add(new DesignerActionPropertyItem("ChangeType", "ChangeType", "")); this._items.Add(new DesignerActionPropertyItem("AnimationType", "Animation Type", "")); } return this._items; } public void AddNewItem() { _parent.AddNewItem(); } public bool FillSpace { get { JQAccordion acc = (JQAccordion)_parent.Component; return acc.FillSpace; } set { JQAccordion acc = (JQAccordion)_parent.Component; TypeDescriptor.GetProperties(acc)["FillSpace"].SetValue(acc, value); } } public bool Resizable { get { JQAccordion acc = (JQAccordion)_parent.Component; return acc.Resizable; } set { JQAccordion acc = (JQAccordion)_parent.Component; TypeDescriptor.GetProperties(acc)["Resizable"].SetValue(acc, value); TypeDescriptor.GetProperties(acc)["FillSpace"].SetValue(acc, value); } } public bool Collapsible { get { JQAccordion acc = (JQAccordion)_parent.Component; return acc.Collapsible; } set { JQAccordion acc = (JQAccordion)_parent.Component; TypeDescriptor.GetProperties(acc)["Collapsible"].SetValue(acc, value); } } public ItemChangeType ChangeType { get { JQAccordion acc = (JQAccordion)_parent.Component; return acc.ChangeType; } set { JQAccordion acc = (JQAccordion)_parent.Component; TypeDescriptor.GetProperties(acc)["ChangeType"].SetValue(acc, value); } } - public Animation AnimationType + public AccordionDuration AnimationType { get { JQAccordion acc = (JQAccordion)_parent.Component; return acc.AnimationType; } set { JQAccordion acc = (JQAccordion)_parent.Component; TypeDescriptor.GetProperties(acc)["AnimationType"].SetValue(acc, value); } } } } diff --git a/Atom.Web/Accordion/JQAccordion.cs b/Atom.Web/Accordion/JQAccordion.cs index d44c77a..ebec699 100644 --- a/Atom.Web/Accordion/JQAccordion.cs +++ b/Atom.Web/Accordion/JQAccordion.cs @@ -1,835 +1,835 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI.WebControls; using System.Web; using System.Security.Permissions; using System.Web.UI; using System.ComponentModel; using System.Drawing.Design; using Atom.Web.UI.WebControls.Accordion; namespace Atom.Web.UI.WebControls.Accordion // System.Wen.UI.DropDownList - Baev.Web.UI { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty("Items"), ParseChildren(true, "Items"), Designer(typeof(AccordionDesigner)), ToolboxData("<{0}:JQAccordion runat=\"server\"> </{0}:JQAccordion>") ] public class JQAccordion : WebControl, IPostBackEventHandler { //MS convention: //Fields //Events //Methods //Properties //Fields #region Fields private int _selectedIndex; private int _selectedOldIndex; private List<Item> _itemList; private static readonly object EventSelectedIndexChanged = new object(); private static readonly object EventSelectedIndexChanging = new object(); public delegate void AccordionChangingEventHandler(object sender, AccordionChangingEventArgs e); public delegate void AccordionChangedEventHandler(object sender, AccordionChangedEventArgs e); #endregion [ Category("Action"), Description("OnSelectedItemIndexChanging") ] public event AccordionChangingEventHandler SelectedIndexChanging { add { Events.AddHandler(EventSelectedIndexChanging, value); } remove { Events.RemoveHandler(EventSelectedIndexChanging, value); } } [ Category("Action"), Description("OnSelectedItemIndexChanged") ] public event AccordionChangedEventHandler SelectedIndexChanged { add { Events.AddHandler(EventSelectedIndexChanged, value); } remove { Events.RemoveHandler(EventSelectedIndexChanged, value); } } //Methods #region Methods [ Category("Action"), Description("") ] protected virtual void OnSelectedIndexChanging(AccordionChangingEventArgs e) { AccordionChangingEventHandler eventHandler = (AccordionChangingEventHandler)Events[EventSelectedIndexChanging]; if (eventHandler != null) { this.SelectedIndex = e.OldIndex; eventHandler(this, e); if (!e.Cancel) { this.SelectedIndex = e.NewIndex; this.OnSelectedIndexChanged(new AccordionChangedEventArgs(e.NewIndex, e.OldIndex, this.SelectedItem, this)); } } } [ Category("Action"), Description("") ] protected virtual void OnSelectedIndexChanged(AccordionChangedEventArgs e) { AccordionChangedEventHandler eventHandler = (AccordionChangedEventHandler)Events[EventSelectedIndexChanged]; if (eventHandler != null) { this.SelectedIndex = e.NewIndex; eventHandler(this, e); } } protected override void OnPreRender(EventArgs e) { //Page.RegisterRequiresPostBack(this); string _clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string _clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); if ((!string.IsNullOrEmpty(this.IconSelectedUrl)) || (!string.IsNullOrEmpty(this.IconUrl))) { Page.ClientScript.RegisterClientScriptBlock(typeof(Page), this.UniqueID + "startupstyle", RenderStartupStyle()); } base.OnPreRender(e); } protected override void RenderContents(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Value, "selectedindex:" + this.SelectedIndex.ToString()); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); if (this.Resizable) { writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "accResizer"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "ui-widget-content"); writer.RenderBeginTag(HtmlTextWriterTag.Div); } writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "accordion"); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (Item item in this.Items) { writer.RenderBeginTag(HtmlTextWriterTag.H3); writer.AddAttribute("index", this.Items.IndexOf(item).ToString()); writer.AddAttribute("href", "#"); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.Write(item.Header); writer.RenderEndTag(); writer.RenderEndTag(); //render item content writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (Control control in item.Controls) { control.RenderControl(writer); } writer.RenderEndTag(); } writer.RenderEndTag(); if (this.Resizable) { writer.RenderEndTag(); } //base.RenderContents(writer); } //clear span tag protected override void Render(HtmlTextWriter writer) { this.RenderContents(writer); } private string RenderStartupStyle() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<style type=\"text/css\">"); if (!string.IsNullOrEmpty(this.IconSelectedUrl)) { startupScript.AppendFormat("." + this.UniqueID + "IconSelectedStyle{{"); startupScript.AppendFormat("background-image: url(" + this.IconSelectedUrl + ") !important;"); startupScript.AppendFormat("}}"); } if (!string.IsNullOrEmpty(this.IconUrl)) { startupScript.AppendFormat("." + this.UniqueID + "IconStyle{{"); startupScript.AppendFormat("background-image: url(" + this.IconUrl + ") !important;"); startupScript.AppendFormat("}}"); } startupScript.AppendFormat("</style>"); return startupScript.ToString(); } private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("var " + this.UniqueID + "; "); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat("var acc" + this.UniqueID + " = $('#" + this.UniqueID + "accordion'); " + this.UniqueID + "=acc" + this.UniqueID + ";"); startupScript.AppendFormat("acc" + this.UniqueID + ".accordion({{"); //Event //changestart startupScript.AppendFormat(" changestart: function(event, ui) {{ $('#" + this.UniqueID + "hiddenValue').val('selectedindex:'+ui.options.active); "); if (Events[EventSelectedIndexChanging] != null) { startupScript.AppendFormat(" __doPostBack('" + this.UniqueID + "', 'selectedindexchanging:'+ui.options.active+':'+ui.oldHeader.children('a#').attr('index')); "); } startupScript.AppendFormat("}}, "); //change if (Events[EventSelectedIndexChanged] != null) { if (Events[EventSelectedIndexChanging] == null) { startupScript.AppendFormat(" changestart: function(event, ui) {{ __doPostBack('" + this.UniqueID + "', 'selectedindexchanged:'+ui.options.active+':'+ui.oldHeader.children('a#').attr('index'));}}, "); } } //AnimationType - if (this.AnimationType == Animation.None) + if (this.AnimationType == AccordionDuration.None) { startupScript.AppendFormat("animated: false, "); } - if (this.AnimationType == Animation.Bounceslide) + if (this.AnimationType == AccordionDuration.Bounceslide) { startupScript.AppendFormat("animated: 'bounceslide', "); } - if (this.AnimationType == Animation.Slide) + if (this.AnimationType == AccordionDuration.Slide) { startupScript.AppendFormat("animated: 'slide', "); } //ItemChangeType if (this.ChangeType == ItemChangeType.MouseClick) { startupScript.AppendFormat("event: 'click', "); } if (this.ChangeType == ItemChangeType.MouseHover) { startupScript.AppendFormat("event: 'mouseover',"); } //Icons startupScript.AppendFormat("icons:{{"); if (!string.IsNullOrEmpty(this.IconUrl)) { startupScript.AppendFormat(" 'header': '" + this.UniqueID + "IconStyle', "); } if (!string.IsNullOrEmpty(this.IconSelectedUrl)) { startupScript.AppendFormat(" 'headerSelected': '" + this.UniqueID + "IconSelectedStyle' "); } else { startupScript.AppendFormat(" 'headerSelected': '" + this.UniqueID + "IconStyle', "); } startupScript.AppendFormat("}}, "); //SelectItem //startupScript.AppendFormat(" active: {0}, ", this.SelectedIndex); startupScript.AppendFormat(" active: parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1]), "); //Default:false if (this.FillSpace) { startupScript.AppendFormat("fillSpace: {0}, ", this.FillSpace.ToString().ToLower()); } //Default:false if (this.Collapsible) { startupScript.AppendFormat("collapsible: {0}, ", this.Collapsible.ToString().ToLower()); } //Default:false if (this.Navigation) { startupScript.AppendFormat("navigation: {0}, ", this.Navigation.ToString().ToLower()); } //add event with if statement //Default:true if (!this.AutoHeight) { startupScript.AppendFormat("autoHeight: {0}, ", this.AutoHeight.ToString().ToLower()); } startupScript.AppendFormat("}}); "); //Default:true if (!this.Enabled) { startupScript.AppendFormat("acc" + this.UniqueID + ".accordion('disable');"); } if (this.Resizable) { startupScript.AppendFormat("$('#" + this.UniqueID + "accResizer" + "').resizable({{"); startupScript.AppendFormat("resize: function() {{ acc" + this.UniqueID + ".accordion('resize');}},"); startupScript.AppendFormat("minHeight: {0},", this.MinHeight.ToString()); startupScript.AppendFormat("minWidth: {0},", this.MinWidth.ToString()); startupScript.AppendFormat("maxHeight: {0},", this.MaxHeight.ToString()); startupScript.AppendFormat("maxWidth: {0},", this.MaxWidth.ToString()); startupScript.AppendFormat("}});"); } //SelectItem //startupScript.AppendFormat("acc" + this.UniqueID + ".accordion('activate', " + this.SelectedIndex + ");"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); //if (this.Page.Header.Controls.Add(new LiteralControl("<link rel=" } public void RaisePostBackEvent(string eventArgument) { if (eventArgument != null) { if (eventArgument.StartsWith("selectedindexchanging")) { string[] values = eventArgument.Split(':'); int selectedIndex = Convert.ToInt32(values[1]); int selectedOldIndex = Convert.ToInt32(values[2]); AccordionChangingEventArgs args = new AccordionChangingEventArgs(selectedIndex, selectedOldIndex); this.OnSelectedIndexChanging(args); } if (eventArgument.StartsWith("selectedindexchanged")) { string[] values = eventArgument.Split(':'); int selectedIndex = Convert.ToInt32(values[1]); int selectedOldIndex = Convert.ToInt32(values[2]); AccordionChangedEventArgs args = new AccordionChangedEventArgs(selectedIndex, selectedOldIndex, this.SelectedItem, this); this.OnSelectedIndexChanged(args); } } } void IPostBackEventHandler.RaisePostBackEvent(string eventArgument) { this.RaisePostBackEvent(eventArgument); } public virtual void ClearSelection() { foreach (Item item in this.Items) { item.Selected = false; } } protected override void OnInit(EventArgs e) { string hiddenValue = Page.Request.Params[this.UniqueID + "hiddenValue"]; if ((!string.IsNullOrEmpty(hiddenValue)) && (hiddenValue.StartsWith("selectedindex:"))) { this.SelectedIndex = Convert.ToInt32(hiddenValue.Split(':')[1]); } if (this.Resizable) { if (!this.FillSpace) { throw new ArgumentException("Please set FillSpace=\"True\""); } } bool isSelected = false; foreach (Item item in this.Items) { if (item.Selected) { if (isSelected) { throw new ArgumentException("MultipleSelectionOfItems"); } isSelected = true; this._selectedIndex = this._itemList.IndexOf(item); } } base.OnInit(e); } #endregion //Properties #region Properties [ Category("Behavior"), Description(""), DefaultValue(0) ] public int MinHeight { get { object minHeight = ViewState["MinHeightViewState"]; return (minHeight == null) ? 0 : Convert.ToInt32(minHeight); } set { ViewState["MinHeightViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public int MinWidth { get { object minWidth = ViewState["MinWidthViewState"]; return (minWidth == null) ? 0 : Convert.ToInt32(minWidth); } set { ViewState["MinWidthViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public int MaxHeight { get { object maxHeight = ViewState["MaxHeightViewState"]; return (maxHeight == null) ? 0 : Convert.ToInt32(maxHeight); } set { ViewState["MaxHeightViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public int MaxWidth { get { object maxWidth = ViewState["MaxWidthViewState"]; return (maxWidth == null) ? 0 : Convert.ToInt32(maxWidth); } set { ViewState["MaxWidthViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool AutoHeight { get { object autoHeightValue = ViewState["AutoHeightViewState"]; return (autoHeightValue == null) ? true : (bool)autoHeightValue; } set { ViewState["AutoHeightViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public string IconUrl { get { object icon = ViewState["IconUrlViewState"]; return (icon == null) ? string.Empty : icon.ToString(); } set { ViewState["IconUrlViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public string IconSelectedUrl { get { object iconSelected = ViewState["IconSelectedUrlViewState"]; return (iconSelected == null) ? string.Empty : iconSelected.ToString(); } set { ViewState["IconSelectedUrlViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Collapsible { get { object collapsibleValue = ViewState["CollapsibleViewState"]; return (collapsibleValue == null) ? false : (bool)collapsibleValue; } set { ViewState["CollapsibleViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Navigation { get { object navigationValue = ViewState["NavigationViewState"]; return (navigationValue == null) ? false : (bool)navigationValue; } set { ViewState["NavigationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(ItemChangeType.MouseClick) ] public ItemChangeType ChangeType { get { object fillSpaceValue = (object)ViewState["ItemChangeTypeViewState"]; return (fillSpaceValue == null) ? ItemChangeType.MouseClick : (ItemChangeType)fillSpaceValue; } set { ViewState["ItemChangeTypeViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue(Animation.None) + DefaultValue(AccordionDuration.None) ] - public Animation AnimationType + public AccordionDuration AnimationType { get { object fillSpaceValue = (object)ViewState["AnimationTypeViewState"]; - return (fillSpaceValue == null) ? Animation.None : (Animation)fillSpaceValue; + return (fillSpaceValue == null) ? AccordionDuration.None : (AccordionDuration)fillSpaceValue; } set { ViewState["AnimationTypeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool FillSpace { get { object fillSpaceValue = (object)ViewState["FillSpaceViewState"]; return (fillSpaceValue == null) ? false : (bool)fillSpaceValue; } set { ViewState["FillSpaceViewState"] = value; } } [ Category("Behavior"), Description(""), DesignerSerializationVisibility( DesignerSerializationVisibility.Content), Editor(typeof(ItemCollectionEditor), typeof(UITypeEditor)), PersistenceMode(PersistenceMode.InnerDefaultProperty) ] public List<Item> Items { get { if (_itemList == null) { _itemList = new List<Item>(); } return _itemList; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Category(""), Description("") ] public int SelectedIndex { get { return this._selectedIndex; } set { this.ClearSelection(); this._itemList[value].Selected = true; this._selectedIndex = value; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Category(""), Description("") ] public Item SelectedItem { get { int selectedIndex = this.SelectedIndex; if (selectedIndex >= 0) { return this._itemList[selectedIndex]; } return null; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Resizable { get { object resizableValue = (object)ViewState["ResizableViewState"]; return (resizableValue == null) ? false : (bool)resizableValue; } set { ViewState["ResizableViewState"] = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } #endregion } } diff --git a/Atom.Web/Atom.Web.csproj b/Atom.Web/Atom.Web.csproj index b8ca360..e88c8e1 100644 --- a/Atom.Web/Atom.Web.csproj +++ b/Atom.Web/Atom.Web.csproj @@ -1,103 +1,105 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{E56668B1-FEE9-43C8-92B7-DAC1B568D29E}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Atom.Web.UI.WebControls</RootNamespace> <AssemblyName>Atom.Web</AssemblyName> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <Nonshipping>true</Nonshipping> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Design" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Drawing" /> <Reference Include="System.Web" /> </ItemGroup> <ItemGroup> - <Compile Include="Accordion\Animation.cs" /> + <Compile Include="Accordion\AccordionDuration.cs" /> <Compile Include="Accordion\Design\AccordionDesigner.cs" /> <Compile Include="Accordion\EventArgs\AccordionChangedEventArgs.cs" /> <Compile Include="Accordion\EventArgs\AccordionChangingEventArgs.cs" /> <Compile Include="Accordion\Item.cs" /> <Compile Include="Accordion\ItemChangeType.cs" /> <Compile Include="Accordion\ItemCollectionEditor.cs" /> <Compile Include="Accordion\JQAccordion.cs" /> <Compile Include="AutoComplete\JQAutoComplete.cs" /> <Compile Include="Button\ButtonType.cs" /> <Compile Include="Button\Design\ButtonDesigner.cs" /> <Compile Include="Button\JQButton.cs" /> + <Compile Include="DatePicker\DatePickerAnimation.cs" /> + <Compile Include="DatePicker\DatePickerDuration.cs" /> + <Compile Include="DatePicker\DatePickerMode.cs" /> <Compile Include="DatePicker\Design\DatePickerDesigner.cs" /> <Compile Include="DatePicker\JQDatePicker.cs" /> <Compile Include="Dialog\Design\DialogDesigner.cs" /> - <Compile Include="Dialog\DialogHideAnimation.cs" /> + <Compile Include="Dialog\DialogAnimation.cs" /> <Compile Include="Dialog\DialogPosition.cs" /> - <Compile Include="Dialog\DialogShowAnimation.cs" /> <Compile Include="Dialog\JQDialog.cs" /> <Compile Include="Progressbar\Design\ProgressbarDesigner.cs" /> <Compile Include="Progressbar\EventArgs\ProgressbarValueChangedEventArgs.cs" /> <Compile Include="Progressbar\JQProgressbar.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Slider\Design\SliderDesigner.cs" /> <Compile Include="Slider\JQSlider.cs" /> - <Compile Include="Slider\SliderAnimation.cs" /> + <Compile Include="Slider\SliderDuration.cs" /> <Compile Include="Slider\SliderOrientation.cs" /> <Compile Include="Slider\SliderRange.cs" /> - <Compile Include="Tabs\AnimationType.cs" /> + <Compile Include="Tabs\TabAnimationType.cs" /> <Compile Include="Tabs\Design\TabsDesigner.cs" /> <Compile Include="Tabs\EventArgs\TabsChangedEventArgs.cs" /> <Compile Include="Tabs\EventArgs\TabsChangingEventArgs.cs" /> <Compile Include="Tabs\EventArgs\TabsRemovedEventArgs.cs" /> <Compile Include="Tabs\EventArgs\TabsRemovingEventArgs.cs" /> <Compile Include="Tabs\JqTabs.cs" /> <Compile Include="Tabs\Tab.cs" /> - <Compile Include="Tabs\TabAnimationSpeed.cs" /> + <Compile Include="Tabs\TabDuration.cs" /> <Compile Include="Tabs\TabChangeType.cs" /> <Compile Include="Tabs\TabCollectionEditor.cs" /> <Compile Include="Tabs\TabOrientation.cs" /> </ItemGroup> <ItemGroup> <Folder Include="AutoComplete\Design\" /> <Folder Include="AutoComplete\EventArgs\" /> <Folder Include="Button\EventArgs\" /> <Folder Include="DatePicker\EventArgs\" /> <Folder Include="Dialog\EventArgs\" /> <Folder Include="Slider\EventArgs\" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> \ No newline at end of file diff --git a/Atom.Web/DatePicker/JQDatePicker.cs b/Atom.Web/DatePicker/JQDatePicker.cs index 4cab703..b9bb631 100644 --- a/Atom.Web/DatePicker/JQDatePicker.cs +++ b/Atom.Web/DatePicker/JQDatePicker.cs @@ -1,642 +1,867 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI; using System.ComponentModel; using System.Web; using System.Security.Permissions; using System.Web.UI.WebControls; namespace Atom.Web.UI.WebControls.DatePicker { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), Designer(typeof(DatePickerDesigner)), ToolboxData("<{0}:JQDatePicker runat=\"server\"> </{0}:JQDatePicker>") ] public class JQDatePicker : WebControl { private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("var " + this.UniqueID + "; "); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat(this.UniqueID + " = $('#" + this.UniqueID + "');"); + + startupScript.AppendFormat("}})"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } protected override void Render(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } - //properties + #region bool - - - //bool [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool AutoSize { get { object autoSize = ViewState["AutoSizeViewState"]; return (autoSize == null) ? false : Convert.ToBoolean(autoSize); } set { ViewState["AutoSizeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ButtonImageOnly { get { object buttonImageOnly = ViewState["ButtonImageOnlyViewState"]; return (buttonImageOnly == null) ? false : Convert.ToBoolean(buttonImageOnly); } set { ViewState["ButtonImageOnlyViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ChangeMonth { get { object changeMonth = ViewState["ChangeMonthViewState"]; return (changeMonth == null) ? false : Convert.ToBoolean(changeMonth); } set { ViewState["ChangeMonthViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ChangeYear { get { object changeYear = ViewState["ChangeYearViewState"]; return (changeYear == null) ? false : Convert.ToBoolean(changeYear); } set { ViewState["ChangeYearViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool ConstrainInput { get { object changeYear = ViewState["ConstrainInputViewState"]; return (changeYear == null) ? true : Convert.ToBoolean(changeYear); } set { ViewState["ConstrainInputViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool GotoCurrent { get { object gotoCurrent = ViewState["GotoCurrentViewState"]; return (gotoCurrent == null) ? false : Convert.ToBoolean(gotoCurrent); } set { ViewState["GotoCurrentViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool HideIfNoPrevNext { get { object hideIfNoPrevNext = ViewState["HideIfNoPrevNextViewState"]; return (hideIfNoPrevNext == null) ? false : Convert.ToBoolean(hideIfNoPrevNext); } set { ViewState["HideIfNoPrevNextViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool IsRTL { get { object rtl = ViewState["IsRTLViewState"]; return (rtl == null) ? false : Convert.ToBoolean(rtl); } set { ViewState["IsRTLViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool NavigationAsDateFormat { get { object navigationAsDateFormat = ViewState["NavigationAsDateFormatViewState"]; return (navigationAsDateFormat == null) ? false : Convert.ToBoolean(navigationAsDateFormat); } set { ViewState["NavigationAsDateFormatViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool SelectOtherMonths { get { object selectOtherMonths = ViewState["SelectOtherMonthsViewState"]; return (selectOtherMonths == null) ? false : Convert.ToBoolean(selectOtherMonths); } set { ViewState["SelectOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowButtonPanel { get { object showButtonPanel = ViewState["ShowButtonPanelViewState"]; return (showButtonPanel == null) ? false : Convert.ToBoolean(showButtonPanel); } set { ViewState["ShowButtonPanelViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowMonthAfterYear { get { object showMonthAfterYear = ViewState["ShowMonthAfterYearViewState"]; return (showMonthAfterYear == null) ? false : Convert.ToBoolean(showMonthAfterYear); } set { ViewState["ShowMonthAfterYearViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowWeek { get { object showWeek = ViewState["ShowWeekViewState"]; return (showWeek == null) ? false : Convert.ToBoolean(showWeek); } set { ViewState["ShowWeekViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool ShowOtherMonths { get { object showOtherMonths = ViewState["ShowOtherMonthsViewState"]; return (showOtherMonths == null) ? false : Convert.ToBoolean(showOtherMonths); } set { ViewState["ShowOtherMonthsViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Draggable { get { object draggable = ViewState["DraggableViewState"]; return (draggable == null) ? false : Convert.ToBoolean(draggable); } set { ViewState["DraggableViewState"] = value; } } - //str + #endregion + #region str + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string AltField { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object autoSize = ViewState["AltFieldViewState"]; + return (autoSize == null) ? string.Empty : autoSize.ToString(); + } + set + { + ViewState["AltFieldViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string AltFormat { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object altFormat = ViewState["AltFormatViewState"]; + return (altFormat == null) ? string.Empty : altFormat.ToString(); + } + set + { + ViewState["AltFormatViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string AppendText { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object appendText = ViewState["AppendTextViewState"]; + return (appendText == null) ? string.Empty : appendText.ToString(); + } + set + { + ViewState["AppendTextViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string ButtonImage { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object buttonImage = ViewState["ButtonImageViewState"]; + return (buttonImage == null) ? string.Empty : buttonImage.ToString(); + } + set + { + ViewState["ButtonImageViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string ButtonText { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object buttonText = ViewState["ButtonTextViewState"]; + return (buttonText == null) ? string.Empty : buttonText.ToString(); + } + set + { + ViewState["ButtonTextViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string CloseText { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object closeText = ViewState["CloseTextViewState"]; + return (closeText == null) ? string.Empty : closeText.ToString(); + } + set + { + ViewState["CloseTextViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string CurrentText { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object currentText = ViewState["CurrentTextViewState"]; + return (currentText == null) ? string.Empty : currentText.ToString(); + } + set + { + ViewState["CurrentTextViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string DateFormat { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object dateFormat = ViewState["DateFormatViewState"]; + return (dateFormat == null) ? string.Empty : dateFormat.ToString(); + } + set + { + ViewState["DateFormatViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string WeekHeader { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object weekHeader = ViewState["WeekHeaderViewState"]; + return (weekHeader == null) ? string.Empty : weekHeader.ToString(); + } + set + { + ViewState["WeekHeaderViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string YearRange { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object yearRange = ViewState["YearRangeViewState"]; + return (yearRange == null) ? string.Empty : yearRange.ToString(); + } + set + { + ViewState["YearRangeViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string YearSuffix { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object yearSuffix = ViewState["YearSuffixViewState"]; + return (yearSuffix == null) ? string.Empty : yearSuffix.ToString(); + } + set + { + ViewState["YearSuffixViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string ShowOn { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object showOn = ViewState["ShowOnViewState"]; + return (showOn == null) ? string.Empty : showOn.ToString(); + } + set + { + ViewState["ShowOnViewState"] = value; + } } - public string ShowAnimation + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public string NextText { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object nextText = ViewState["NextTextViewState"]; + return (nextText == null) ? string.Empty : nextText.ToString(); + } + set + { + ViewState["NextTextViewState"] = value; + } } - public string NextText + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public string PrevText { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object prevText = ViewState["PrevTextViewState"]; + return (prevText == null) ? string.Empty : prevText.ToString(); + } + set + { + ViewState["PrevTextViewState"] = value; + } } + + //enum + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] public string Duration { get { return ""; } set { ViewState["ViewState"] = value; } } - public string PrevText + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public string ShowAnimation { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object yearSuffix = ViewState["YearSuffixViewState"]; + return (yearSuffix == null) ? string.Empty : yearSuffix.ToString(); + } + set + { + ViewState["YearSuffixViewState"] = value; + } } - - //int + #endregion + #region int + [ + Category("Behavior"), + Description(""), + DefaultValue(0) + ] public int FirstDay { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object firstDay = ViewState["FirstDayViewState"]; + return (firstDay == null) ? 0 : Convert.ToInt32(firstDay); + } + set + { + ViewState["FirstDayViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(1) + ] public int StepMonths { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object stepMonths = ViewState["StepMonthsViewState"]; + return (stepMonths == null) ? 1 : Convert.ToInt32(stepMonths); + } + set + { + ViewState["StepMonthsViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(0) + ] public int ShowCurrentAtPos { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object showCurrentAtPos = ViewState["ShowCurrentAtPosViewState"]; + return (showCurrentAtPos == null) ? 0 : Convert.ToInt32(showCurrentAtPos); + } + set + { + ViewState["ShowCurrentAtPosViewState"] = value; + } } + #endregion + + #region arr - //arr public string DayNames { get { return ""; } set { ViewState["ViewState"] = value; } } public string DayNamesMin { get { return ""; } set { ViewState["ViewState"] = value; } } public string DayNamesShort { get { return ""; } set { ViewState["ViewState"] = value; } } public string DefaultDate { get { return ""; } set { ViewState["ViewState"] = value; } } public string MaxDate { get { return ""; } set { ViewState["ViewState"] = value; } } public string MinDate { get { return ""; } set { ViewState["ViewState"] = value; } } public string MonthNames { get { return ""; } set { ViewState["ViewState"] = value; } } public string MonthNamesShort { get { return ""; } set { ViewState["ViewState"] = value; } } public string NumberOfMonths { get { return ""; } set { ViewState["ViewState"] = value; } } public string ShortYearCutoff { get { return ""; } set { ViewState["ViewState"] = value; } } public string ShowOptions { get { return ""; } set { ViewState["ViewState"] = value; } } - + #endregion #region inherit properties [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } #endregion } } diff --git a/Atom.Web/Dialog/DialogHideAnimation.cs b/Atom.Web/Dialog/DialogHideAnimation.cs deleted file mode 100644 index c9d1ebf..0000000 --- a/Atom.Web/Dialog/DialogHideAnimation.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Atom.Web.UI.WebControls.Dialog -{ - public enum DialogHideAnimation - { - None, - Blind, - Bounce, - Clip, - Drop, - Explode, - Fold, - Highlight, - Puff, - Pulsate, - Scale, - Shake, - Size, - Slide, - Transfer, - } -} diff --git a/Atom.Web/Dialog/DialogShowAnimation.cs b/Atom.Web/Dialog/DialogShowAnimation.cs deleted file mode 100644 index 5434cc0..0000000 --- a/Atom.Web/Dialog/DialogShowAnimation.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Atom.Web.UI.WebControls.Dialog -{ - public enum DialogShowAnimation - { - None, - Blind, - Bounce, - Clip, - Drop, - Explode, - Fold, - Highlight, - Puff, - Pulsate, - Scale, - Shake, - Size, - Slide, - Transfer - - } -} diff --git a/Atom.Web/Slider/JQSlider.cs b/Atom.Web/Slider/JQSlider.cs index 20f4177..0a85fe5 100644 --- a/Atom.Web/Slider/JQSlider.cs +++ b/Atom.Web/Slider/JQSlider.cs @@ -1,388 +1,388 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI; using System.ComponentModel; using System.Web; using System.Security.Permissions; using Atom.Web.UI.WebControls.Dialog; using System.Web.UI.WebControls; namespace Atom.Web.UI.WebControls.Slider { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty(""), Designer(typeof(SliderDesigner)), ToolboxData("<{0}:JQSlider runat=\"server\"> </{0}:JQSlider>") ] public class JQSlider : WebControl { protected override void Render(HtmlTextWriter writer) { this.RenderContents(writer); } protected override void RenderContents(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Value, "selectedtab:"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderEndTag(); base.RenderContents(writer); } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat("var " + this.UniqueID + " = $('#" + this.UniqueID + "');"); startupScript.AppendFormat(this.UniqueID + ".slider({{"); startupScript.AppendFormat(" max: {0},", this.MaxValue); startupScript.AppendFormat(" min: {0},", this.MinValue); startupScript.AppendFormat(" animate: '{0}',", this.Animation.ToString().ToLower()); startupScript.AppendFormat(" orientation: '{0}',", this.Orientation.ToString().ToLower()); startupScript.AppendFormat(" range: {0},", this.Range.ToString().ToLower()); startupScript.AppendFormat(" step: {0},", this.Step); if (!string.IsNullOrEmpty(this.RangeValue.ToString())) { startupScript.AppendFormat(" value: {0},", this.Value); } else { startupScript.AppendFormat(" values: [{0},{1}],", this.Value, this.RangeValue); } if (!this.Enabled) { startupScript.AppendFormat(" disabled: true,"); } startupScript.AppendFormat("}})"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue(100) ] public int MaxValue { get { object max = ViewState["MaxValueViewState"]; return (max == null) ? 100 : Convert.ToInt32(max); } set { ViewState["MaxValueViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(0) ] public int MinValue { get { object mix = ViewState["MixValueViewState"]; return (mix == null) ? 0 : Convert.ToInt32(mix); } set { ViewState["MixValueViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(0) ] public int Value { get { object val = (object)ViewState["ValueViewState"]; return (val == null) ? 0 : Convert.ToInt32(val); } set { ViewState["ValueViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("Value") ] public int RangeValue { get { object rangeValue = (object)ViewState["RangeValueViewState"]; return (rangeValue == null) ? this.Value : Convert.ToInt32(rangeValue); } set { ViewState["RangeValueViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(1) ] public int Step { get { object step = (object)ViewState["StepTypeViewState"]; return (step == null) ? 1 : Convert.ToInt32(step); } set { ViewState["StepTypeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(SliderOrientation.Horizontal) ] public SliderOrientation Orientation { get { object orientation = (object)ViewState["OrientationViewState"]; return (orientation == null) ? SliderOrientation.Horizontal : (SliderOrientation)orientation; } set { ViewState["OrientationViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue(SliderAnimation.Normal) + DefaultValue(SliderDuration.Normal) ] - public SliderAnimation Animation + public SliderDuration Animation { get { object animation = (object)ViewState["AnimationViewState"]; - return (animation == null) ? SliderAnimation.Normal : (SliderAnimation)animation; + return (animation == null) ? SliderDuration.Normal : (SliderDuration)animation; } set { ViewState["AnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(SliderRange.False) ] public SliderRange Range { get { object range = (object)ViewState["RangeViewState"]; return (range == null) ? SliderRange.False : (SliderRange)range; } set { ViewState["RangeViewState"] = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } } } diff --git a/Atom.Web/Slider/SliderAnimation.cs b/Atom.Web/Slider/SliderDuration.cs similarity index 80% rename from Atom.Web/Slider/SliderAnimation.cs rename to Atom.Web/Slider/SliderDuration.cs index 9001690..560ce7e 100644 --- a/Atom.Web/Slider/SliderAnimation.cs +++ b/Atom.Web/Slider/SliderDuration.cs @@ -1,14 +1,14 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Atom.Web.UI.WebControls.Slider { - public enum SliderAnimation + public enum SliderDuration { Slow, Normal, Fast } } diff --git a/Atom.Web/Tabs/JqTabs.cs b/Atom.Web/Tabs/JqTabs.cs index 29c57ed..2b78b7a 100644 --- a/Atom.Web/Tabs/JqTabs.cs +++ b/Atom.Web/Tabs/JqTabs.cs @@ -1,896 +1,896 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.Web.UI; using System.Security.Permissions; using System.Web; using System.Web.UI.WebControls; using System.Drawing.Design; namespace Atom.Web.UI.WebControls.Tabs { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty("Tabs"), ParseChildren(true, "Tabs"), Designer(typeof(TabsDesigner)), ToolboxData("<{0}:JQTabs runat=\"server\"> </{0}:JQTabs>") ] public class JQTabs : WebControl, IPostBackEventHandler { private int _selectedIndex; private int _selectedOldIndex; private List<Tab> _tabsList; private static readonly object EventSelectedIndexChanged = new object(); private static readonly object EventSelectedIndexChanging = new object(); private static readonly object EventTabRemoving = new object(); private static readonly object EventTabRemoved = new object(); private static readonly object EventTabMoved = new object(); public delegate void TabsChangingEventHandler(object sender, TabsChangingEventArgs e); public delegate void TabsChangedEventHandler(object sender, TabsChangedEventArgs e); public delegate void TabsRemovingEventHandler(object sender, TabsRemovingEventArgs e); public delegate void TabsRemovedEventHandler(object sender, TabsRemovedEventArgs e); public delegate void TabsMovedEventHandler(object sender, EventArgs e); [ Category("Action"), Description("OnSelectedItemIndexChanging") ] public event TabsChangingEventHandler SelectedIndexChanging { add { Events.AddHandler(EventSelectedIndexChanging, value); } remove { Events.RemoveHandler(EventSelectedIndexChanging, value); } } [ Category("Action"), Description("OnSelectedItemIndexChanged") ] public event TabsChangedEventHandler SelectedIndexChanged { add { Events.AddHandler(EventSelectedIndexChanged, value); } remove { Events.RemoveHandler(EventSelectedIndexChanged, value); } } [ Category("Action"), Description("OnTabRemoving") ] public event TabsRemovingEventHandler TabRemoving { add { Events.AddHandler(EventTabRemoving, value); } remove { Events.RemoveHandler(EventTabRemoving, value); } } [ Category("Action"), Description("OnTabRemoved") ] public event TabsRemovedEventHandler TabRemoved { add { Events.AddHandler(EventTabRemoved, value); } remove { Events.RemoveHandler(EventTabRemoved, value); } } [ Category("Action"), Description("OnTabMoved") ] public event EventHandler TabMoved { add { Events.AddHandler(EventTabMoved, value); } remove { Events.RemoveHandler(EventTabMoved, value); } } //Methods [ Category("Action"), Description("") ] protected virtual void OnSelectedIndexChanging(TabsChangingEventArgs e) { TabsChangingEventHandler eventHandler = (TabsChangingEventHandler)Events[EventSelectedIndexChanging]; if (eventHandler != null) { this.SelectedIndex = e.OldIndex; eventHandler(this, e); if (!e.Cancel) { this.OnSelectedIndexChanged(new TabsChangedEventArgs(e.NewIndex, e.OldIndex, this.SelectedTab, this)); } } } [ Category("Action"), Description("") ] protected virtual void OnSelectedIndexChanged(TabsChangedEventArgs e) { TabsChangedEventHandler eventHandler = (TabsChangedEventHandler)Events[EventSelectedIndexChanged]; if (eventHandler != null) { this.SelectedIndex = e.TabIndex; eventHandler(this, e); } } [ Category("Action"), Description("") ] protected virtual void OnTabRemoving(TabsRemovingEventArgs e) { TabsRemovingEventHandler eventHandler = (TabsRemovingEventHandler)Events[EventTabRemoving]; if (eventHandler != null) { eventHandler(this, e); if (!e.Cancel) { this.OnTabRemoved(new TabsRemovedEventArgs(e.TabIndex, e.CurrentTab, e.JQTabs)); } } } [ Category("Action"), Description("") ] protected virtual void OnTabRemoved(TabsRemovedEventArgs e) { TabsRemovedEventHandler eventHandler = (TabsRemovedEventHandler)Events[EventTabRemoved]; if (eventHandler != null) { this._tabsList.RemoveAt(e.TabIndex); eventHandler(this, e); } } [ Category("Action"), Description("") ] protected virtual void OnTabMoved(EventArgs e) { EventHandler eventHandler = (EventHandler)Events[EventTabMoved]; if (eventHandler != null) { eventHandler(this, e); } } protected override void OnPreRender(EventArgs e) { string _clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string _clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); Page.ClientScript.RegisterClientScriptBlock(typeof(Page), this.UniqueID + "startupstyle", RenderStartupStyle()); base.OnPreRender(e); } protected override void OnInit(EventArgs e) { string hiddenValue = Page.Request.Params[this.UniqueID + "hiddenValue"]; if ((!string.IsNullOrEmpty(hiddenValue)) && (hiddenValue.StartsWith("selectedtab:"))) { this.SelectedIndex = Convert.ToInt32(hiddenValue.Split(':')[1]); } base.OnInit(e); } private string RenderStartupStyle() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<style type=\"text/css\">"); if (this.TabAppearanceType == TabOrientation.Bottom) { startupScript.AppendFormat(".tabs-bottom {{ position: relative; }} "); startupScript.AppendFormat(".tabs-bottom .ui-tabs-panel {{ height: 140px; overflow: auto; }} "); startupScript.AppendFormat(".tabs-bottom .ui-tabs-nav {{ position: absolute !important; left: 0; bottom: 0; right:0; padding: 0 0.2em 0.2em 0; }} "); startupScript.AppendFormat(".tabs-bottom .ui-tabs-nav li {{ margin-top: -2px !important; margin-bottom: 1px !important; border-top: none; border-bottom-width: 1px; }}"); startupScript.AppendFormat(".ui-tabs-selected {{ margin-top: -3px !important; }}"); } if (this.TabAppearanceType == TabOrientation.Vertical) { startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav {{ padding: .2em .1em .2em .2em; float: left; width: 12em; }}"); startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav li {{ clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }}"); startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav li a {{ display:block; }}"); startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav li.ui-tabs-selected {{ padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }}"); startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-panel {{ padding: 1em; float: right; width: 40em;}}"); } if (this.TabsRemove) { if (string.IsNullOrEmpty(this.CloseIconUrl)) { startupScript.AppendFormat("#" + this.UniqueID + " li .ui-icon-close {{float: left; margin: 0.4em 0.2em 0 0;}}"); } else { startupScript.AppendFormat("#" + this.UniqueID + " li .ui-icon-close {{float: left; margin: 0.4em 0.2em 0 0; background-image:url('" + this.CloseIconUrl + "')!important; background-position:center;}}"); } } startupScript.AppendFormat("</style>"); return startupScript.ToString(); } private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat("var " + this.UniqueID + " = $('#" + this.UniqueID + "'); "); //tab appearance if (this.TabAppearanceType == TabOrientation.Bottom) { startupScript.AppendFormat(this.UniqueID + ".attr('class','tabs-bottom');"); } startupScript.AppendFormat(this.UniqueID + ".tabs({{"); //events //remove startupScript.AppendFormat(" remove: function(event, ui) {{ "); if (Events[EventTabRemoving] != null) { startupScript.AppendFormat(" __doPostBack('" + this.UniqueID + "','tabremoving:'+$(ui.tab).attr('href').split('-')[1]); "); } if (Events[EventTabRemoved] != null) { if (Events[EventTabRemoving] == null) { startupScript.AppendFormat(" __doPostBack('" + this.UniqueID + "','tabremoved:'+$(ui.tab).attr('href').split('-')[1]); "); } } startupScript.AppendFormat(" }},"); //select startupScript.AppendFormat(" select: function(event, ui){{ $('#" + this.UniqueID + "hiddenValue').val('selectedtab:'+$(ui.panel).attr('id').split('-')[1]); "); if (Events[EventSelectedIndexChanging] != null) { startupScript.AppendFormat(" __doPostBack('" + this.UniqueID + "','selectedindexchanging:'+parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1])+':'+$('#" + this.UniqueID + "').tabs('option', 'selected'));"); } if (Events[EventSelectedIndexChanged] != null) { if (Events[EventSelectedIndexChanging] == null) { startupScript.AppendFormat("__doPostBack('" + this.UniqueID + "','selectedindexchanged:'+parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1])+':'+$('#" + this.UniqueID + "').tabs('option', 'selected'));"); } } startupScript.AppendFormat(" }},"); //tabs remove if (this.TabsRemove) { startupScript.AppendFormat(" tabTemplate:\"<li><a href='#{{href}}'>#{{label}}</a> <span class='ui-icon ui-icon-close'>Remove Tab</span></li>\","); } //collapsible if (this.Collapsible) { startupScript.AppendFormat("collapsible: {0},", this.Collapsible.ToString().ToLower()); } //animation and animation speed - if (this.Animate == AnimationType.Content) + if (this.Animate == TabAnimationType.Content) { startupScript.AppendFormat(" fx:{{opacity: 'toggle' ,duration: {0} }},", this.AnimationSpeed.ToString().ToLower()); } - if (this.Animate == AnimationType.Height) + if (this.Animate == TabAnimationType.Height) { startupScript.AppendFormat(" fx:{{height: 'toggle' ,duration: {0} }},", this.AnimationSpeed.ToString().ToLower()); } - if (this.Animate == AnimationType.HeightAndContent) + if (this.Animate == TabAnimationType.HeightAndContent) { startupScript.AppendFormat(" fx:{{height: 'toggle', opacity: 'toggle' ,duration: {0} }},", this.AnimationSpeed.ToString().ToLower()); } //tab change type if (this.ChangeType == TabChangeType.MouseHover) { startupScript.AppendFormat(" event: 'mouseover',"); } //selected tab startupScript.AppendFormat(" selected: parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1]), "); startupScript.AppendFormat("}})"); //tab appearance if (this.TabAppearanceType == TabOrientation.Top) { startupScript.AppendFormat(";"); } if (this.TabAppearanceType == TabOrientation.Bottom) { startupScript.AppendFormat(";"); startupScript.AppendFormat(" $('.tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *')"); startupScript.AppendFormat(".removeClass('ui-corner-all ui-corner-top')"); startupScript.AppendFormat(".addClass('ui-corner-bottom'); "); } if (this.TabAppearanceType == TabOrientation.Vertical) { startupScript.AppendFormat(".addClass('ui-tabs-vertical ui-helper-clearfix'); $('#" + this.UniqueID + " li').removeClass('ui-corner-top').addClass('ui-corner-left'); "); } //tab remove js code if (this.TabsRemove) { startupScript.AppendFormat("$('#" + this.UniqueID + " span.ui-icon-close').live('click', function() {{"); startupScript.AppendFormat("var index = $('li'," + this.UniqueID + ").index($(this).parent());"); startupScript.AppendFormat(this.UniqueID + ".tabs('remove', index);}});"); } //tabs moving if (this.TabsMoving) { startupScript.AppendFormat("$('#" + this.UniqueID + "').find('.ui-tabs-nav').sortable({{ "); if (Events[EventTabMoved] != null) { startupScript.AppendFormat("stop: function(event, ui) {{ var oldPostion=$(ui.item).children('a').attr('href').split('-')[1];"); startupScript.AppendFormat("var newPostion=$(" + this.UniqueID + ").tabs().find('.ui-tabs-nav li').sortable('toArray').index(ui.item);"); startupScript.AppendFormat("__doPostBack('" + this.UniqueID + "','tabmoved:'+oldPostion+':'+newPostion);}},"); } //moving orientation if (this.TabAppearanceType == TabOrientation.Vertical) { startupScript.AppendFormat(" axis:'y'}})"); } else { startupScript.AppendFormat(" axis:'x'}})"); } } startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } //clear span tag protected override void Render(HtmlTextWriter writer) { this.RenderContents(writer); } protected override void RenderContents(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Value, "selectedtab:" + this.SelectedIndex.ToString()); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderBeginTag(HtmlTextWriterTag.Ul); foreach (Tab tab in this._tabsList) { writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.AddAttribute(HtmlTextWriterAttribute.Href, "#" + this.UniqueID + "-" + this.Tabs.IndexOf(tab).ToString()); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.Write(tab.Header); writer.RenderEndTag(); if (this.TabsRemove) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "ui-icon ui-icon-close"); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write("Remove Tab"); writer.RenderEndTag(); } writer.RenderEndTag(); } writer.RenderEndTag(); foreach (Tab tab in this._tabsList) { writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "-" + this.Tabs.IndexOf(tab).ToString()); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (Control control in tab.Controls) { control.RenderControl(writer); } writer.RenderEndTag(); } writer.RenderEndTag(); base.RenderContents(writer); } public virtual void ClearSelection() { foreach (Tab item in this._tabsList) { item.Selected = false; } } #region IPostBackEventHandler Members public void RaisePostBackEvent(string eventArgument) { if (eventArgument != null) { //selecting event if (eventArgument.StartsWith("selectedindexchanging")) { string[] values = eventArgument.Split(':'); int newIndex = Convert.ToInt32(values[1]); int oldIndex = Convert.ToInt32(values[2]); TabsChangingEventArgs args = new TabsChangingEventArgs(newIndex, oldIndex, this.SelectedTab, this); this.OnSelectedIndexChanging(args); } //selected event if (eventArgument.StartsWith("selectedindexchanged")) { string[] values = eventArgument.Split(':'); int index = Convert.ToInt32(values[1]); int oldIndex = Convert.ToInt32(values[2]); TabsChangedEventArgs args = new TabsChangedEventArgs(index, oldIndex, this.SelectedTab, this); this.OnSelectedIndexChanged(args); } //removing event if (eventArgument.StartsWith("tabremoving")) { string[] values = eventArgument.Split(':'); int tabIndex = Convert.ToInt32(values[1]); TabsRemovingEventArgs args = new TabsRemovingEventArgs(tabIndex, this.Tabs[tabIndex], this); this.OnTabRemoving(args); } //removed event if (eventArgument.StartsWith("tabremoved")) { string[] values = eventArgument.Split(':'); int tabIndex = Convert.ToInt32(values[1]); TabsRemovedEventArgs args = new TabsRemovedEventArgs(tabIndex, this.Tabs[tabIndex], this); this.OnTabRemoved(args); } //moved event if (eventArgument.StartsWith("tabmoved")) { string[] values = eventArgument.Split(':'); int oldPosition = Convert.ToInt32(values[1]); int newPosition = Convert.ToInt32(values[2]); ReorderTabItems(oldPosition, newPosition); this.OnTabMoved(new EventArgs()); } } } private void ReorderTabItems(int oldPosition, int newPosition) { Tab temp = this._tabsList[oldPosition]; this._tabsList[oldPosition] = this._tabsList[newPosition]; this._tabsList[newPosition] = temp; } void IPostBackEventHandler.RaisePostBackEvent(string eventArgument) { this.RaisePostBackEvent(eventArgument); } #endregion //Properties [ Category("Behavior"), Description(""), DesignerSerializationVisibility( DesignerSerializationVisibility.Content), Editor(typeof(TabCollectionEditor), typeof(UITypeEditor)), PersistenceMode(PersistenceMode.InnerDefaultProperty) ] public List<Tab> Tabs { get { if (this._tabsList == null) { this._tabsList = new List<Tab>(); } return _tabsList; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Category(""), Description("") ] public int SelectedIndex { get { return this._selectedIndex; } set { this.ClearSelection(); this._tabsList[value].Selected = true; this._selectedIndex = value; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Category(""), Description("") ] public Tab SelectedTab { get { int selectedIndex = this.SelectedIndex; if (selectedIndex >= 0) { return this._tabsList[selectedIndex]; } return null; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public string CloseIconUrl { get { object icon = ViewState["CloseIconUrlViewState"]; return (icon == null) ? string.Empty : icon.ToString(); } set { ViewState["CloseIconUrlViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue(AnimationType.None) + DefaultValue(TabAnimationType.None) ] - public AnimationType Animate + public TabAnimationType Animate { get { object animation = (object)ViewState["AnimateViewState"]; - return (animation == null) ? AnimationType.None : (AnimationType)animation; + return (animation == null) ? TabAnimationType.None : (TabAnimationType)animation; } set { ViewState["AnimateViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(TabOrientation.Top) ] public TabOrientation TabAppearanceType { get { object appearance = (object)ViewState["TabAppearanceTypeViewState"]; return (appearance == null) ? TabOrientation.Top : (TabOrientation)appearance; } set { ViewState["TabAppearanceTypeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(TabChangeType.MouseClick) ] public TabChangeType ChangeType { get { object changeType = (object)ViewState["TabChangeTypeViewState"]; return (changeType == null) ? TabChangeType.MouseClick : (TabChangeType)changeType; } set { ViewState["TabChangeTypeViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue(TabAnimation.Normal) + DefaultValue(TabDuration.Normal) ] - public TabAnimation AnimationSpeed + public TabDuration AnimationSpeed { get { object animationSpeed = (object)ViewState["AnimationSpeedViewState"]; - return (animationSpeed == null) ? TabAnimation.Normal : (TabAnimation)animationSpeed; + return (animationSpeed == null) ? TabDuration.Normal : (TabDuration)animationSpeed; } set { ViewState["AnimationSpeedViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Collapsible { get { object collapsible = (object)ViewState["CollapsibleViewState"]; return (collapsible == null) ? false : (bool)collapsible; } set { ViewState["CollapsibleViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool TabsRemove { get { object tabsRemove = (object)ViewState["TabsRemoveViewState"]; return (tabsRemove == null) ? false : (bool)tabsRemove; } set { ViewState["TabsRemoveViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool TabsMoving { get { object tabsMoving = (object)ViewState["TabsMovingViewState"]; return (tabsMoving == null) ? false : (bool)tabsMoving; } set { ViewState["TabsMovingViewState"] = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } } } diff --git a/Atom.Web/Tabs/TabAnimationSpeed.cs b/Atom.Web/Tabs/TabAnimationSpeed.cs deleted file mode 100644 index b7e2c76..0000000 --- a/Atom.Web/Tabs/TabAnimationSpeed.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Atom.Web.UI.WebControls.Tabs -{ - public enum TabAnimationSpeed - { - Slow, - Normal, - Fast - } -} diff --git a/Atom.Web/Tabs/AnimationType.cs b/Atom.Web/Tabs/TabAnimationType.cs similarity index 81% rename from Atom.Web/Tabs/AnimationType.cs rename to Atom.Web/Tabs/TabAnimationType.cs index 6f7c7b2..358f7c5 100644 --- a/Atom.Web/Tabs/AnimationType.cs +++ b/Atom.Web/Tabs/TabAnimationType.cs @@ -1,15 +1,15 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Atom.Web.UI.WebControls.Tabs { - public enum AnimationType + public enum TabAnimationType { None, Height, Content, HeightAndContent } } diff --git a/Atom.Web/Tabs/TabAnimation.cs b/Atom.Web/Tabs/TabDuration.cs similarity index 81% rename from Atom.Web/Tabs/TabAnimation.cs rename to Atom.Web/Tabs/TabDuration.cs index f6c5e75..29d2ddc 100644 --- a/Atom.Web/Tabs/TabAnimation.cs +++ b/Atom.Web/Tabs/TabDuration.cs @@ -1,14 +1,14 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Atom.Web.UI.WebControls.Tabs { - public enum TabAnimation + public enum TabDuration { Slow, Normal, Fast } }
sila/AtomProject
15cd2ee8d0bb9b65af71db13ef63b66671ae9545
add datepicker duration enum
diff --git a/Atom.Web/DatePicker/DatePickerDuration.cs b/Atom.Web/DatePicker/DatePickerDuration.cs new file mode 100644 index 0000000..e020289 --- /dev/null +++ b/Atom.Web/DatePicker/DatePickerDuration.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.DatePicker +{ + public enum DatePickerDuration + { + Slow, + Normal, + Fast + } +}
sila/AtomProject
a09661eb019b6c11c4c8e09e0682227db48b623b
add show animation animation
diff --git a/Atom.Web/DatePicker/DatePickerAnimation.cs b/Atom.Web/DatePicker/DatePickerAnimation.cs new file mode 100644 index 0000000..a393284 --- /dev/null +++ b/Atom.Web/DatePicker/DatePickerAnimation.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.DatePicker +{ + public enum DatePickerAnimation + { + None, + Blind, + Bounce, + Clip, + Drop, + Explode, + Fold, + Highlight, + Puff, + Pulsate, + Scale, + Shake, + Size, + Slide, + Transfer + } +}
sila/AtomProject
40ec39a34c10dd174d36b751fb851a4f5697f43d
add DatePickerMode enum for different rendering
diff --git a/Atom.Web/DatePicker/DatePickerMode.cs b/Atom.Web/DatePicker/DatePickerMode.cs new file mode 100644 index 0000000..a8a8094 --- /dev/null +++ b/Atom.Web/DatePicker/DatePickerMode.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.DatePicker +{ + public enum DatePickerMode + { + Calendar, + DatePicker + } +}
sila/AtomProject
659f404c7b586fb98ca516409974787736edab11
add merge show and hide animation
diff --git a/Atom.Web/Dialog/DialogAnimation.cs b/Atom.Web/Dialog/DialogAnimation.cs new file mode 100644 index 0000000..9776cb3 --- /dev/null +++ b/Atom.Web/Dialog/DialogAnimation.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Dialog +{ + public enum DialogAnimation + { + None, + Blind, + Bounce, + Clip, + Drop, + Explode, + Fold, + Highlight, + Puff, + Pulsate, + Scale, + Shake, + Size, + Slide, + Transfer + } +} diff --git a/Atom.Web/Dialog/JQDialog.cs b/Atom.Web/Dialog/JQDialog.cs index bac8ff1..77c0e37 100644 --- a/Atom.Web/Dialog/JQDialog.cs +++ b/Atom.Web/Dialog/JQDialog.cs @@ -1,633 +1,633 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI.WebControls; using System.ComponentModel; using System.Web.UI; using System.Web; using System.Security.Permissions; namespace Atom.Web.UI.WebControls.Dialog { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty(""), ParseChildren(true), PersistChildren(false), Designer(typeof(DialogDesigner)), ToolboxData("<{0}:JQDialog runat=\"server\"> </{0}:JQDialog>") ] public class JQDialog : WebControl, INamingContainer { private ITemplate _template; //Methods protected override void CreateChildControls() { Controls.Clear(); if (Template != null) { Template.InstantiateIn(this); } } protected override void Render(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); writer.AddAttribute(HtmlTextWriterAttribute.Title, this.Title); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (Control control in this.Controls) { control.RenderControl(writer); } writer.RenderEndTag(); } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("var " + this.UniqueID + "; "); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat(this.UniqueID + " = $('#" + this.UniqueID + "');"); startupScript.AppendFormat(this.UniqueID + ".dialog({{"); if (!this.AutoOpen) { startupScript.AppendFormat(" autoOpen: false,"); } if (!this.CloseOnEsc) { startupScript.AppendFormat(" closeOnEscape: false,"); } if (!this.Draggable) { startupScript.AppendFormat(" draggable: false,"); } - if (this.HideAnimation != DialogHideAnimation.None) + if (this.HideAnimation != DialogAnimation.None) { startupScript.AppendFormat(" hide: '{0}',", this.HideAnimation.ToString().ToLower()); } if (!string.IsNullOrEmpty(this.Height.ToString())) { startupScript.AppendFormat(" height: {0},", this.Height); } if (!string.IsNullOrEmpty(this.Width.ToString())) { startupScript.AppendFormat(" width: {0},", this.Width); } if (!string.IsNullOrEmpty(this.MaxHeight.ToString())) { startupScript.AppendFormat(" maxHeight: {0},", this.MaxHeight); } if (!string.IsNullOrEmpty(this.MaxWidth.ToString())) { startupScript.AppendFormat(" maxWidth: {0},", this.MaxWidth); } if (!string.IsNullOrEmpty(this.MinHeight.ToString())) { startupScript.AppendFormat(" minHeight: {0},", this.MinHeight); } if (!string.IsNullOrEmpty(this.MinWidth.ToString())) { startupScript.AppendFormat(" minWidth: {0},", this.MinWidth); } if (this.Modal) { startupScript.AppendFormat(" modal: true,"); } //postion if ((this.Position == DialogPosition.Center) || (this.Position == DialogPosition.Bottom) || (this.Position == DialogPosition.Top) || (this.Position == DialogPosition.Left) || (this.Position == DialogPosition.Right)) { startupScript.AppendFormat(" position: '{0}',", this.Position.ToString().ToLower()); } else { if (this.Position == DialogPosition.CenterLeft) { startupScript.AppendFormat(" position: ['center','left'],"); } if (this.Position == DialogPosition.CenterRight) { startupScript.AppendFormat(" position: ['center','right'],"); } if (this.Position == DialogPosition.BottomLeft) { startupScript.AppendFormat(" position: ['bottom','left'],"); } if (this.Position == DialogPosition.BottomRight) { startupScript.AppendFormat(" position: ['bottom','right'],"); } if (this.Position == DialogPosition.TopLeft) { startupScript.AppendFormat(" position: ['top','left'],"); } if (this.Position == DialogPosition.TopRight) { startupScript.AppendFormat(" position: ['top','right'],"); } } if (!this.Resizable) { startupScript.AppendFormat(" resizable: false"); } - if (this.ShowAnimation != DialogShowAnimation.None) + if (this.ShowAnimation != DialogAnimation.None) { startupScript.AppendFormat(" show: '{0}',", this.ShowAnimation.ToString().ToLower()); } if (!this.Stack) { startupScript.AppendFormat(" stack: false"); } startupScript.AppendFormat(" title: '{0}',", this.Title); startupScript.AppendFormat(" zIndex: {0},", this.ZIndex); if (!this.Enabled) { startupScript.AppendFormat(" disabled: true,"); } startupScript.AppendFormat("}})"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } [ Browsable(false), DesignerSerializationVisibility( DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty) ] public ITemplate Template { get { return this._template; } set { this._template = value; } } [ Category("Behavior"), Description(""), - DefaultValue(DialogShowAnimation.None) + DefaultValue(DialogAnimation.None) ] - public DialogShowAnimation ShowAnimation + public DialogAnimation ShowAnimation { get { object show = ViewState["ShowAnimationViewState"]; - return (show == null) ? DialogShowAnimation.None : (DialogShowAnimation)show; + return (show == null) ? DialogAnimation.None : (DialogAnimation)show; } set { ViewState["ShowAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue(DialogHideAnimation.None) + DefaultValue(DialogAnimation.None) ] - public DialogHideAnimation HideAnimation + public DialogAnimation HideAnimation { get { object hide = ViewState["HideAnimationViewState"]; - return (hide == null) ? DialogHideAnimation.None : (DialogHideAnimation)hide; + return (hide == null) ? DialogAnimation.None : (DialogAnimation)hide; } set { ViewState["HideAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(1000) ] public int ZIndex { get { object zIndex = ViewState["ZIndexViewState"]; return (zIndex == null) ? 1000 : Convert.ToInt32(zIndex); } set { ViewState["ZIndexViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool AutoOpen { get { object autoOpen = ViewState["AutoOpenViewState"]; return (autoOpen == null) ? true : Convert.ToBoolean(autoOpen); } set { ViewState["AutoOpenViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool CloseOnEsc { get { object closeOnEsc = ViewState["CloseOnEscViewState"]; return (closeOnEsc == null) ? true : Convert.ToBoolean(closeOnEsc); } set { ViewState["CloseOnEscViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool Draggable { get { object draggable = ViewState["DraggableViewState"]; return (draggable == null) ? true : Convert.ToBoolean(draggable); } set { ViewState["DraggableViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Modal { get { object modal = ViewState["ModalViewState"]; return (modal == null) ? false : Convert.ToBoolean(modal); } set { ViewState["ModalViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool Resizable { get { object resizable = ViewState["ResizableViewState"]; return (resizable == null) ? true : Convert.ToBoolean(resizable); } set { ViewState["ResizableViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool Stack { get { object stack = ViewState["StackViewState"]; return (stack == null) ? true : Convert.ToBoolean(stack); } set { ViewState["StackViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DialogPosition.Center) ] public DialogPosition Position { get { object position = ViewState["PostionViewState"]; return (position == null) ? DialogPosition.Center : (DialogPosition)position; } set { ViewState["PostionViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string Title { get { object title = ViewState["TitleViewState"]; return (title == null) ? "" : title.ToString(); } set { ViewState["TitleViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MaxHeight { get { object maxHeight = ViewState["MaxHeightViewState"]; return (maxHeight == null) ? Unit.Empty : (Unit)maxHeight; } set { ViewState["MaxHeightViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MaxWidth { get { object maxWidth = ViewState["MaxWidthViewState"]; return (maxWidth == null) ? Unit.Empty : (Unit)maxWidth; } set { ViewState["MaxWidthViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MinHeight { get { object minHeight = ViewState["MinHeightViewState"]; return (minHeight == null) ? Unit.Empty : (Unit)minHeight; } set { ViewState["MinHeightViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MinWidth { get { object minWidth = ViewState["MinWidthViewState"]; return (minWidth == null) ? Unit.Empty : (Unit)minWidth; } set { ViewState["MinWidthViewState"] = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } } }
sila/AtomProject
f953d0d02dfce910f9cb085e1a4aada6b0ebbe2f
change name to TabAnimation
diff --git a/Atom.Web/Tabs/JqTabs.cs b/Atom.Web/Tabs/JqTabs.cs index e4908a5..29c57ed 100644 --- a/Atom.Web/Tabs/JqTabs.cs +++ b/Atom.Web/Tabs/JqTabs.cs @@ -164,733 +164,733 @@ namespace Atom.Web.UI.WebControls.Tabs { TabsRemovingEventHandler eventHandler = (TabsRemovingEventHandler)Events[EventTabRemoving]; if (eventHandler != null) { eventHandler(this, e); if (!e.Cancel) { this.OnTabRemoved(new TabsRemovedEventArgs(e.TabIndex, e.CurrentTab, e.JQTabs)); } } } [ Category("Action"), Description("") ] protected virtual void OnTabRemoved(TabsRemovedEventArgs e) { TabsRemovedEventHandler eventHandler = (TabsRemovedEventHandler)Events[EventTabRemoved]; if (eventHandler != null) { this._tabsList.RemoveAt(e.TabIndex); eventHandler(this, e); } } [ Category("Action"), Description("") ] protected virtual void OnTabMoved(EventArgs e) { EventHandler eventHandler = (EventHandler)Events[EventTabMoved]; if (eventHandler != null) { eventHandler(this, e); } } protected override void OnPreRender(EventArgs e) { string _clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string _clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); Page.ClientScript.RegisterClientScriptBlock(typeof(Page), this.UniqueID + "startupstyle", RenderStartupStyle()); base.OnPreRender(e); } protected override void OnInit(EventArgs e) { string hiddenValue = Page.Request.Params[this.UniqueID + "hiddenValue"]; if ((!string.IsNullOrEmpty(hiddenValue)) && (hiddenValue.StartsWith("selectedtab:"))) { this.SelectedIndex = Convert.ToInt32(hiddenValue.Split(':')[1]); } base.OnInit(e); } private string RenderStartupStyle() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<style type=\"text/css\">"); if (this.TabAppearanceType == TabOrientation.Bottom) { startupScript.AppendFormat(".tabs-bottom {{ position: relative; }} "); startupScript.AppendFormat(".tabs-bottom .ui-tabs-panel {{ height: 140px; overflow: auto; }} "); startupScript.AppendFormat(".tabs-bottom .ui-tabs-nav {{ position: absolute !important; left: 0; bottom: 0; right:0; padding: 0 0.2em 0.2em 0; }} "); startupScript.AppendFormat(".tabs-bottom .ui-tabs-nav li {{ margin-top: -2px !important; margin-bottom: 1px !important; border-top: none; border-bottom-width: 1px; }}"); startupScript.AppendFormat(".ui-tabs-selected {{ margin-top: -3px !important; }}"); } if (this.TabAppearanceType == TabOrientation.Vertical) { startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav {{ padding: .2em .1em .2em .2em; float: left; width: 12em; }}"); startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav li {{ clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }}"); startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav li a {{ display:block; }}"); startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav li.ui-tabs-selected {{ padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }}"); startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-panel {{ padding: 1em; float: right; width: 40em;}}"); } if (this.TabsRemove) { if (string.IsNullOrEmpty(this.CloseIconUrl)) { startupScript.AppendFormat("#" + this.UniqueID + " li .ui-icon-close {{float: left; margin: 0.4em 0.2em 0 0;}}"); } else { startupScript.AppendFormat("#" + this.UniqueID + " li .ui-icon-close {{float: left; margin: 0.4em 0.2em 0 0; background-image:url('" + this.CloseIconUrl + "')!important; background-position:center;}}"); } } startupScript.AppendFormat("</style>"); return startupScript.ToString(); } private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat("var " + this.UniqueID + " = $('#" + this.UniqueID + "'); "); //tab appearance if (this.TabAppearanceType == TabOrientation.Bottom) { startupScript.AppendFormat(this.UniqueID + ".attr('class','tabs-bottom');"); } startupScript.AppendFormat(this.UniqueID + ".tabs({{"); //events //remove startupScript.AppendFormat(" remove: function(event, ui) {{ "); if (Events[EventTabRemoving] != null) { startupScript.AppendFormat(" __doPostBack('" + this.UniqueID + "','tabremoving:'+$(ui.tab).attr('href').split('-')[1]); "); } if (Events[EventTabRemoved] != null) { if (Events[EventTabRemoving] == null) { startupScript.AppendFormat(" __doPostBack('" + this.UniqueID + "','tabremoved:'+$(ui.tab).attr('href').split('-')[1]); "); } } startupScript.AppendFormat(" }},"); //select startupScript.AppendFormat(" select: function(event, ui){{ $('#" + this.UniqueID + "hiddenValue').val('selectedtab:'+$(ui.panel).attr('id').split('-')[1]); "); if (Events[EventSelectedIndexChanging] != null) { startupScript.AppendFormat(" __doPostBack('" + this.UniqueID + "','selectedindexchanging:'+parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1])+':'+$('#" + this.UniqueID + "').tabs('option', 'selected'));"); } if (Events[EventSelectedIndexChanged] != null) { if (Events[EventSelectedIndexChanging] == null) { startupScript.AppendFormat("__doPostBack('" + this.UniqueID + "','selectedindexchanged:'+parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1])+':'+$('#" + this.UniqueID + "').tabs('option', 'selected'));"); } } startupScript.AppendFormat(" }},"); //tabs remove if (this.TabsRemove) { startupScript.AppendFormat(" tabTemplate:\"<li><a href='#{{href}}'>#{{label}}</a> <span class='ui-icon ui-icon-close'>Remove Tab</span></li>\","); } //collapsible if (this.Collapsible) { startupScript.AppendFormat("collapsible: {0},", this.Collapsible.ToString().ToLower()); } //animation and animation speed if (this.Animate == AnimationType.Content) { startupScript.AppendFormat(" fx:{{opacity: 'toggle' ,duration: {0} }},", this.AnimationSpeed.ToString().ToLower()); } if (this.Animate == AnimationType.Height) { startupScript.AppendFormat(" fx:{{height: 'toggle' ,duration: {0} }},", this.AnimationSpeed.ToString().ToLower()); } if (this.Animate == AnimationType.HeightAndContent) { startupScript.AppendFormat(" fx:{{height: 'toggle', opacity: 'toggle' ,duration: {0} }},", this.AnimationSpeed.ToString().ToLower()); } //tab change type if (this.ChangeType == TabChangeType.MouseHover) { startupScript.AppendFormat(" event: 'mouseover',"); } //selected tab startupScript.AppendFormat(" selected: parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1]), "); startupScript.AppendFormat("}})"); //tab appearance if (this.TabAppearanceType == TabOrientation.Top) { startupScript.AppendFormat(";"); } if (this.TabAppearanceType == TabOrientation.Bottom) { startupScript.AppendFormat(";"); startupScript.AppendFormat(" $('.tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *')"); startupScript.AppendFormat(".removeClass('ui-corner-all ui-corner-top')"); startupScript.AppendFormat(".addClass('ui-corner-bottom'); "); } if (this.TabAppearanceType == TabOrientation.Vertical) { startupScript.AppendFormat(".addClass('ui-tabs-vertical ui-helper-clearfix'); $('#" + this.UniqueID + " li').removeClass('ui-corner-top').addClass('ui-corner-left'); "); } //tab remove js code if (this.TabsRemove) { startupScript.AppendFormat("$('#" + this.UniqueID + " span.ui-icon-close').live('click', function() {{"); startupScript.AppendFormat("var index = $('li'," + this.UniqueID + ").index($(this).parent());"); startupScript.AppendFormat(this.UniqueID + ".tabs('remove', index);}});"); } //tabs moving if (this.TabsMoving) { startupScript.AppendFormat("$('#" + this.UniqueID + "').find('.ui-tabs-nav').sortable({{ "); if (Events[EventTabMoved] != null) { startupScript.AppendFormat("stop: function(event, ui) {{ var oldPostion=$(ui.item).children('a').attr('href').split('-')[1];"); startupScript.AppendFormat("var newPostion=$(" + this.UniqueID + ").tabs().find('.ui-tabs-nav li').sortable('toArray').index(ui.item);"); startupScript.AppendFormat("__doPostBack('" + this.UniqueID + "','tabmoved:'+oldPostion+':'+newPostion);}},"); } //moving orientation if (this.TabAppearanceType == TabOrientation.Vertical) { startupScript.AppendFormat(" axis:'y'}})"); } else { startupScript.AppendFormat(" axis:'x'}})"); } } startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } //clear span tag protected override void Render(HtmlTextWriter writer) { this.RenderContents(writer); } protected override void RenderContents(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Value, "selectedtab:" + this.SelectedIndex.ToString()); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderBeginTag(HtmlTextWriterTag.Ul); foreach (Tab tab in this._tabsList) { writer.RenderBeginTag(HtmlTextWriterTag.Li); writer.AddAttribute(HtmlTextWriterAttribute.Href, "#" + this.UniqueID + "-" + this.Tabs.IndexOf(tab).ToString()); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.Write(tab.Header); writer.RenderEndTag(); if (this.TabsRemove) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "ui-icon ui-icon-close"); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write("Remove Tab"); writer.RenderEndTag(); } writer.RenderEndTag(); } writer.RenderEndTag(); foreach (Tab tab in this._tabsList) { writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "-" + this.Tabs.IndexOf(tab).ToString()); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (Control control in tab.Controls) { control.RenderControl(writer); } writer.RenderEndTag(); } writer.RenderEndTag(); base.RenderContents(writer); } public virtual void ClearSelection() { foreach (Tab item in this._tabsList) { item.Selected = false; } } #region IPostBackEventHandler Members public void RaisePostBackEvent(string eventArgument) { if (eventArgument != null) { //selecting event if (eventArgument.StartsWith("selectedindexchanging")) { string[] values = eventArgument.Split(':'); int newIndex = Convert.ToInt32(values[1]); int oldIndex = Convert.ToInt32(values[2]); TabsChangingEventArgs args = new TabsChangingEventArgs(newIndex, oldIndex, this.SelectedTab, this); this.OnSelectedIndexChanging(args); } //selected event if (eventArgument.StartsWith("selectedindexchanged")) { string[] values = eventArgument.Split(':'); int index = Convert.ToInt32(values[1]); int oldIndex = Convert.ToInt32(values[2]); TabsChangedEventArgs args = new TabsChangedEventArgs(index, oldIndex, this.SelectedTab, this); this.OnSelectedIndexChanged(args); } //removing event if (eventArgument.StartsWith("tabremoving")) { string[] values = eventArgument.Split(':'); int tabIndex = Convert.ToInt32(values[1]); TabsRemovingEventArgs args = new TabsRemovingEventArgs(tabIndex, this.Tabs[tabIndex], this); this.OnTabRemoving(args); } //removed event if (eventArgument.StartsWith("tabremoved")) { string[] values = eventArgument.Split(':'); int tabIndex = Convert.ToInt32(values[1]); TabsRemovedEventArgs args = new TabsRemovedEventArgs(tabIndex, this.Tabs[tabIndex], this); this.OnTabRemoved(args); } //moved event if (eventArgument.StartsWith("tabmoved")) { string[] values = eventArgument.Split(':'); int oldPosition = Convert.ToInt32(values[1]); int newPosition = Convert.ToInt32(values[2]); ReorderTabItems(oldPosition, newPosition); this.OnTabMoved(new EventArgs()); } } } private void ReorderTabItems(int oldPosition, int newPosition) { Tab temp = this._tabsList[oldPosition]; this._tabsList[oldPosition] = this._tabsList[newPosition]; this._tabsList[newPosition] = temp; } void IPostBackEventHandler.RaisePostBackEvent(string eventArgument) { this.RaisePostBackEvent(eventArgument); } #endregion //Properties [ Category("Behavior"), Description(""), DesignerSerializationVisibility( DesignerSerializationVisibility.Content), Editor(typeof(TabCollectionEditor), typeof(UITypeEditor)), PersistenceMode(PersistenceMode.InnerDefaultProperty) ] public List<Tab> Tabs { get { if (this._tabsList == null) { this._tabsList = new List<Tab>(); } return _tabsList; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Category(""), Description("") ] public int SelectedIndex { get { return this._selectedIndex; } set { this.ClearSelection(); this._tabsList[value].Selected = true; this._selectedIndex = value; } } [ Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), Category(""), Description("") ] public Tab SelectedTab { get { int selectedIndex = this.SelectedIndex; if (selectedIndex >= 0) { return this._tabsList[selectedIndex]; } return null; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public string CloseIconUrl { get { object icon = ViewState["CloseIconUrlViewState"]; return (icon == null) ? string.Empty : icon.ToString(); } set { ViewState["CloseIconUrlViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(AnimationType.None) ] public AnimationType Animate { get { object animation = (object)ViewState["AnimateViewState"]; return (animation == null) ? AnimationType.None : (AnimationType)animation; } set { ViewState["AnimateViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(TabOrientation.Top) ] public TabOrientation TabAppearanceType { get { object appearance = (object)ViewState["TabAppearanceTypeViewState"]; return (appearance == null) ? TabOrientation.Top : (TabOrientation)appearance; } set { ViewState["TabAppearanceTypeViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(TabChangeType.MouseClick) ] public TabChangeType ChangeType { get { object changeType = (object)ViewState["TabChangeTypeViewState"]; return (changeType == null) ? TabChangeType.MouseClick : (TabChangeType)changeType; } set { ViewState["TabChangeTypeViewState"] = value; } } [ Category("Behavior"), Description(""), - DefaultValue(TabAnimationSpeed.Normal) + DefaultValue(TabAnimation.Normal) ] - public TabAnimationSpeed AnimationSpeed + public TabAnimation AnimationSpeed { get { object animationSpeed = (object)ViewState["AnimationSpeedViewState"]; - return (animationSpeed == null) ? TabAnimationSpeed.Normal : (TabAnimationSpeed)animationSpeed; + return (animationSpeed == null) ? TabAnimation.Normal : (TabAnimation)animationSpeed; } set { ViewState["AnimationSpeedViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Collapsible { get { object collapsible = (object)ViewState["CollapsibleViewState"]; return (collapsible == null) ? false : (bool)collapsible; } set { ViewState["CollapsibleViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool TabsRemove { get { object tabsRemove = (object)ViewState["TabsRemoveViewState"]; return (tabsRemove == null) ? false : (bool)tabsRemove; } set { ViewState["TabsRemoveViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool TabsMoving { get { object tabsMoving = (object)ViewState["TabsMovingViewState"]; return (tabsMoving == null) ? false : (bool)tabsMoving; } set { ViewState["TabsMovingViewState"] = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } } } diff --git a/Atom.Web/Tabs/TabAnimation.cs b/Atom.Web/Tabs/TabAnimation.cs new file mode 100644 index 0000000..f6c5e75 --- /dev/null +++ b/Atom.Web/Tabs/TabAnimation.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Tabs +{ + public enum TabAnimation + { + Slow, + Normal, + Fast + } +}
sila/AtomProject
16b05b9c8bb8dee7613837a4dbc7b6d1cf66b4d5
imnplement bool properties
diff --git a/Atom.Web/DatePicker/JQDatePicker.cs b/Atom.Web/DatePicker/JQDatePicker.cs index 0cb9aec..4cab703 100644 --- a/Atom.Web/DatePicker/JQDatePicker.cs +++ b/Atom.Web/DatePicker/JQDatePicker.cs @@ -1,469 +1,642 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI; using System.ComponentModel; using System.Web; using System.Security.Permissions; using System.Web.UI.WebControls; namespace Atom.Web.UI.WebControls.DatePicker { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), Designer(typeof(DatePickerDesigner)), ToolboxData("<{0}:JQDatePicker runat=\"server\"> </{0}:JQDatePicker>") ] public class JQDatePicker : WebControl { private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("var " + this.UniqueID + "; "); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat(this.UniqueID + " = $('#" + this.UniqueID + "');"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } protected override void Render(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } //properties - //[ - //Category("Behavior"), - //Description(""), - //DefaultValue("") - //] - //public string Range - //{ - // get - // { - // object range = (object)ViewState["ViewState"]; - // return (range == null) ? "" : range.ToString(); - // } - // set - // { - // ViewState["ViewState"] = value; - // } - //} + + //bool + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool AutoSize { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object autoSize = ViewState["AutoSizeViewState"]; + return (autoSize == null) ? false : Convert.ToBoolean(autoSize); + } + set + { + ViewState["AutoSizeViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool ButtonImageOnly { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object buttonImageOnly = ViewState["ButtonImageOnlyViewState"]; + return (buttonImageOnly == null) ? false : Convert.ToBoolean(buttonImageOnly); + } + set + { + ViewState["ButtonImageOnlyViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool ChangeMonth { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object changeMonth = ViewState["ChangeMonthViewState"]; + return (changeMonth == null) ? false : Convert.ToBoolean(changeMonth); + } + set + { + ViewState["ChangeMonthViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool ChangeYear { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object changeYear = ViewState["ChangeYearViewState"]; + return (changeYear == null) ? false : Convert.ToBoolean(changeYear); + } + set + { + ViewState["ChangeYearViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(true) + ] public bool ConstrainInput { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object changeYear = ViewState["ConstrainInputViewState"]; + return (changeYear == null) ? true : Convert.ToBoolean(changeYear); + } + set + { + ViewState["ConstrainInputViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool GotoCurrent { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object gotoCurrent = ViewState["GotoCurrentViewState"]; + return (gotoCurrent == null) ? false : Convert.ToBoolean(gotoCurrent); + } + set + { + ViewState["GotoCurrentViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool HideIfNoPrevNext { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object hideIfNoPrevNext = ViewState["HideIfNoPrevNextViewState"]; + return (hideIfNoPrevNext == null) ? false : Convert.ToBoolean(hideIfNoPrevNext); + } + set + { + ViewState["HideIfNoPrevNextViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool IsRTL { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object rtl = ViewState["IsRTLViewState"]; + return (rtl == null) ? false : Convert.ToBoolean(rtl); + } + set + { + ViewState["IsRTLViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool NavigationAsDateFormat { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object navigationAsDateFormat = ViewState["NavigationAsDateFormatViewState"]; + return (navigationAsDateFormat == null) ? false : Convert.ToBoolean(navigationAsDateFormat); + } + set + { + ViewState["NavigationAsDateFormatViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool SelectOtherMonths { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object selectOtherMonths = ViewState["SelectOtherMonthsViewState"]; + return (selectOtherMonths == null) ? false : Convert.ToBoolean(selectOtherMonths); + } + set + { + ViewState["SelectOtherMonthsViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool ShowButtonPanel { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object showButtonPanel = ViewState["ShowButtonPanelViewState"]; + return (showButtonPanel == null) ? false : Convert.ToBoolean(showButtonPanel); + } + set + { + ViewState["ShowButtonPanelViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool ShowMonthAfterYear { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object showMonthAfterYear = ViewState["ShowMonthAfterYearViewState"]; + return (showMonthAfterYear == null) ? false : Convert.ToBoolean(showMonthAfterYear); + } + set + { + ViewState["ShowMonthAfterYearViewState"] = value; + } } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] public bool ShowWeek { - get { return ""; } - set { ViewState["ViewState"] = value; } + get + { + object showWeek = ViewState["ShowWeekViewState"]; + return (showWeek == null) ? false : Convert.ToBoolean(showWeek); + } + set + { + ViewState["ShowWeekViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool ShowOtherMonths + { + get + { + object showOtherMonths = ViewState["ShowOtherMonthsViewState"]; + return (showOtherMonths == null) ? false : Convert.ToBoolean(showOtherMonths); + } + set + { + ViewState["ShowOtherMonthsViewState"] = value; + } } - public bool ShowOtherMonths { get; set; } - public bool Draggable { get; set; } - + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool Draggable + { + get + { + object draggable = ViewState["DraggableViewState"]; + return (draggable == null) ? false : Convert.ToBoolean(draggable); + } + set + { + ViewState["DraggableViewState"] = value; + } + } + //str public string AltField { get { return ""; } set { ViewState["ViewState"] = value; } } public string AltFormat { get { return ""; } set { ViewState["ViewState"] = value; } } public string AppendText { get { return ""; } set { ViewState["ViewState"] = value; } } public string ButtonImage { get { return ""; } set { ViewState["ViewState"] = value; } } public string ButtonText { get { return ""; } set { ViewState["ViewState"] = value; } } public string CloseText { get { return ""; } set { ViewState["ViewState"] = value; } } public string CurrentText { get { return ""; } set { ViewState["ViewState"] = value; } } public string DateFormat { get { return ""; } set { ViewState["ViewState"] = value; } } public string WeekHeader { get { return ""; } set { ViewState["ViewState"] = value; } } public string YearRange { get { return ""; } set { ViewState["ViewState"] = value; } } public string YearSuffix { get { return ""; } set { ViewState["ViewState"] = value; } } public string ShowOn { get { return ""; } set { ViewState["ViewState"] = value; } } public string ShowAnimation { get { return ""; } set { ViewState["ViewState"] = value; } } public string NextText { get { return ""; } set { ViewState["ViewState"] = value; } } public string Duration { get { return ""; } set { ViewState["ViewState"] = value; } } public string PrevText { get { return ""; } set { ViewState["ViewState"] = value; } } //int public int FirstDay { get { return ""; } set { ViewState["ViewState"] = value; } } public int StepMonths { get { return ""; } set { ViewState["ViewState"] = value; } } public int ShowCurrentAtPos { get { return ""; } set { ViewState["ViewState"] = value; } } - + //arr public string DayNames { get { return ""; } set { ViewState["ViewState"] = value; } } public string DayNamesMin { get { return ""; } set { ViewState["ViewState"] = value; } } public string DayNamesShort { get { return ""; } set { ViewState["ViewState"] = value; } } public string DefaultDate { get { return ""; } set { ViewState["ViewState"] = value; } } public string MaxDate { get { return ""; } set { ViewState["ViewState"] = value; } } public string MinDate { get { return ""; } set { ViewState["ViewState"] = value; } } public string MonthNames { get { return ""; } set { ViewState["ViewState"] = value; } } public string MonthNamesShort { get { return ""; } set { ViewState["ViewState"] = value; } } public string NumberOfMonths { get { return ""; } set { ViewState["ViewState"] = value; } } public string ShortYearCutoff { get { return ""; } set { ViewState["ViewState"] = value; } } public string ShowOptions { get { return ""; } set { ViewState["ViewState"] = value; } } #region inherit properties [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } #endregion } }
sila/AtomProject
54bab2f77c0f33d8e475a052d37daae8ea5c0a7f
add properties
diff --git a/Atom.Web/DatePicker/JQDatePicker.cs b/Atom.Web/DatePicker/JQDatePicker.cs index b784a63..0cb9aec 100644 --- a/Atom.Web/DatePicker/JQDatePicker.cs +++ b/Atom.Web/DatePicker/JQDatePicker.cs @@ -1,218 +1,469 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI; using System.ComponentModel; using System.Web; using System.Security.Permissions; using System.Web.UI.WebControls; namespace Atom.Web.UI.WebControls.DatePicker { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), Designer(typeof(DatePickerDesigner)), ToolboxData("<{0}:JQDatePicker runat=\"server\"> </{0}:JQDatePicker>") ] public class JQDatePicker : WebControl { private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("var " + this.UniqueID + "; "); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat(this.UniqueID + " = $('#" + this.UniqueID + "');"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } protected override void Render(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); - - - + + + } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } + //properties + + //[ + //Category("Behavior"), + //Description(""), + //DefaultValue("") + //] + //public string Range + //{ + // get + // { + // object range = (object)ViewState["ViewState"]; + // return (range == null) ? "" : range.ToString(); + // } + // set + // { + // ViewState["ViewState"] = value; + // } + //} + //bool + public bool AutoSize + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool ButtonImageOnly + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool ChangeMonth + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool ChangeYear + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool ConstrainInput + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool GotoCurrent + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool HideIfNoPrevNext + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool IsRTL + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool NavigationAsDateFormat + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool SelectOtherMonths + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool ShowButtonPanel + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool ShowMonthAfterYear + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool ShowWeek + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public bool ShowOtherMonths { get; set; } + public bool Draggable { get; set; } + + //str + public string AltField + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string AltFormat + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string AppendText + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string ButtonImage + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string ButtonText + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string CloseText + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string CurrentText + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string DateFormat + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string WeekHeader + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string YearRange + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string YearSuffix + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string ShowOn + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string ShowAnimation + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string NextText + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string Duration + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string PrevText + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + + //int + public int FirstDay + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public int StepMonths + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public int ShowCurrentAtPos + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + + //arr + public string DayNames + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string DayNamesMin + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string DayNamesShort + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string DefaultDate + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string MaxDate + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string MinDate + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string MonthNames + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string MonthNamesShort + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string NumberOfMonths + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string ShortYearCutoff + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + public string ShowOptions + { + get { return ""; } + set { ViewState["ViewState"] = value; } + } + + + + #region inherit properties + [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } + + #endregion + } }
sila/AtomProject
8994df4a631cd54074a3d827341c1420cb7e46ad
solution is fix
diff --git a/Atom.Web/Atom.Web.csproj b/Atom.Web/Atom.Web.csproj index 409f1e6..b8ca360 100644 --- a/Atom.Web/Atom.Web.csproj +++ b/Atom.Web/Atom.Web.csproj @@ -1,103 +1,103 @@ <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{E56668B1-FEE9-43C8-92B7-DAC1B568D29E}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>Atom.Web.UI.WebControls</RootNamespace> <AssemblyName>Atom.Web</AssemblyName> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <Nonshipping>true</Nonshipping> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Design" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Drawing" /> <Reference Include="System.Web" /> </ItemGroup> <ItemGroup> <Compile Include="Accordion\Animation.cs" /> <Compile Include="Accordion\Design\AccordionDesigner.cs" /> <Compile Include="Accordion\EventArgs\AccordionChangedEventArgs.cs" /> <Compile Include="Accordion\EventArgs\AccordionChangingEventArgs.cs" /> <Compile Include="Accordion\Item.cs" /> <Compile Include="Accordion\ItemChangeType.cs" /> <Compile Include="Accordion\ItemCollectionEditor.cs" /> <Compile Include="Accordion\JQAccordion.cs" /> <Compile Include="AutoComplete\JQAutoComplete.cs" /> <Compile Include="Button\ButtonType.cs" /> <Compile Include="Button\Design\ButtonDesigner.cs" /> <Compile Include="Button\JQButton.cs" /> - <Compile Include="DatePicker\JQDataPicker.cs" /> + <Compile Include="DatePicker\Design\DatePickerDesigner.cs" /> + <Compile Include="DatePicker\JQDatePicker.cs" /> <Compile Include="Dialog\Design\DialogDesigner.cs" /> <Compile Include="Dialog\DialogHideAnimation.cs" /> <Compile Include="Dialog\DialogPosition.cs" /> <Compile Include="Dialog\DialogShowAnimation.cs" /> <Compile Include="Dialog\JQDialog.cs" /> <Compile Include="Progressbar\Design\ProgressbarDesigner.cs" /> <Compile Include="Progressbar\EventArgs\ProgressbarValueChangedEventArgs.cs" /> <Compile Include="Progressbar\JQProgressbar.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Slider\Design\SliderDesigner.cs" /> <Compile Include="Slider\JQSlider.cs" /> <Compile Include="Slider\SliderAnimation.cs" /> <Compile Include="Slider\SliderOrientation.cs" /> <Compile Include="Slider\SliderRange.cs" /> <Compile Include="Tabs\AnimationType.cs" /> <Compile Include="Tabs\Design\TabsDesigner.cs" /> <Compile Include="Tabs\EventArgs\TabsChangedEventArgs.cs" /> <Compile Include="Tabs\EventArgs\TabsChangingEventArgs.cs" /> <Compile Include="Tabs\EventArgs\TabsRemovedEventArgs.cs" /> <Compile Include="Tabs\EventArgs\TabsRemovingEventArgs.cs" /> <Compile Include="Tabs\JqTabs.cs" /> <Compile Include="Tabs\Tab.cs" /> <Compile Include="Tabs\TabAnimationSpeed.cs" /> <Compile Include="Tabs\TabChangeType.cs" /> <Compile Include="Tabs\TabCollectionEditor.cs" /> <Compile Include="Tabs\TabOrientation.cs" /> </ItemGroup> <ItemGroup> <Folder Include="AutoComplete\Design\" /> <Folder Include="AutoComplete\EventArgs\" /> <Folder Include="Button\EventArgs\" /> - <Folder Include="DatePicker\Design\" /> <Folder Include="DatePicker\EventArgs\" /> <Folder Include="Dialog\EventArgs\" /> <Folder Include="Slider\EventArgs\" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> \ No newline at end of file
sila/AtomProject
c2ac54233d4de327bf5af2762012a7179d0fa16e
change name form DataPicker
diff --git a/Atom.Web/DatePicker/JQDatePicker.cs b/Atom.Web/DatePicker/JQDatePicker.cs new file mode 100644 index 0000000..d697efc --- /dev/null +++ b/Atom.Web/DatePicker/JQDatePicker.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI; +using System.ComponentModel; +using System.Web; +using System.Security.Permissions; + +namespace Atom.Web.UI.WebControls.DatePicker +{ + [ + AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + Designer(typeof(DatePickerDesigner)), + ToolboxData("<{0}:JQDatePicker runat=\"server\"> </{0}:JQDatePicker>") + ] + public class JQDatePicker + { + } +}
sila/AtomProject
c0a91c0d24a0a38ded67ac2eadf6ca2cbefffd8c
add date picker designer
diff --git a/Atom.Web/DatePicker/Design/DatePickerDesigner.cs b/Atom.Web/DatePicker/Design/DatePickerDesigner.cs new file mode 100644 index 0000000..a36e874 --- /dev/null +++ b/Atom.Web/DatePicker/Design/DatePickerDesigner.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI.Design; + +namespace Atom.Web.UI.WebControls.DatePicker +{ + class DatePickerDesigner : ControlDesigner + { + public override string GetDesignTimeHtml() + { + return base.CreatePlaceHolderDesignTimeHtml(); + } + } +}
sila/AtomProject
87643a2e6eed6df98be5c7132bcc6082e2fee7b3
[!]FIX double rendering template content
diff --git a/Atom.Web/Dialog/JQDialog.cs b/Atom.Web/Dialog/JQDialog.cs index 48bd3e7..48ae271 100644 --- a/Atom.Web/Dialog/JQDialog.cs +++ b/Atom.Web/Dialog/JQDialog.cs @@ -1,573 +1,566 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI.WebControls; using System.ComponentModel; using System.Web.UI; using System.Web; using System.Security.Permissions; namespace Atom.Web.UI.WebControls.Dialog { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty(""), ParseChildren(true), PersistChildren(false), Designer(typeof(DialogDesigner)), ToolboxData("<{0}:JQDialog runat=\"server\"> </{0}:JQDialog>") ] public class JQDialog : WebControl, INamingContainer { private ITemplate _template; //Methods protected override void CreateChildControls() { Controls.Clear(); if (Template != null) { Template.InstantiateIn(this); } } //clear span tag protected override void Render(HtmlTextWriter writer) - { - this.RenderContents(writer); - } - - protected override void RenderContents(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); writer.AddAttribute(HtmlTextWriterAttribute.Title, this.Title); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (Control control in this.Controls) { control.RenderControl(writer); } writer.RenderEndTag(); - - base.RenderContents(writer); } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("var " + this.UniqueID + "; "); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat(this.UniqueID + " = $('#" + this.UniqueID + "');"); startupScript.AppendFormat(this.UniqueID + ".dialog({{"); if (!this.AutoOpen) { startupScript.AppendFormat(" autoOpen: false,"); } if (!this.CloseOnEsc) { startupScript.AppendFormat(" closeOnEscape: false,"); } if (!this.Draggable) { startupScript.AppendFormat(" draggable: false,"); } if (this.HideAnimation != DialogHideAnimation.None) { startupScript.AppendFormat(" hide: '{0}',", this.HideAnimation.ToString().ToLower()); } if (!string.IsNullOrEmpty(this.Height.ToString())) { startupScript.AppendFormat(" height: {0},", this.Height); } if (!string.IsNullOrEmpty(this.Width.ToString())) { startupScript.AppendFormat(" width: {0},", this.Width); } if (!string.IsNullOrEmpty(this.MaxHeight.ToString())) { startupScript.AppendFormat(" maxHeight: {0},", this.MaxHeight); } if (!string.IsNullOrEmpty(this.MaxWidth.ToString())) { startupScript.AppendFormat(" maxWidth: {0},", this.MaxWidth); } if (!string.IsNullOrEmpty(this.MinHeight.ToString())) { startupScript.AppendFormat(" minHeight: {0},", this.MinHeight); } if (!string.IsNullOrEmpty(this.MinWidth.ToString())) { startupScript.AppendFormat(" minWidth: {0},", this.MinWidth); } if (this.Modal) { startupScript.AppendFormat(" modal: true,"); } //postion if ((this.Position == DialogPosition.Center) || (this.Position == DialogPosition.Bottom) || (this.Position == DialogPosition.Top) || (this.Position == DialogPosition.Left) || (this.Position == DialogPosition.Right)) { startupScript.AppendFormat(" position: '{0}',", this.Position.ToString().ToLower()); } else { if (this.Position == DialogPosition.CenterLeft) { startupScript.AppendFormat(" position: ['center','left'],"); } if (this.Position == DialogPosition.CenterRight) { startupScript.AppendFormat(" position: ['center','right'],"); } if (this.Position == DialogPosition.BottomLeft) { startupScript.AppendFormat(" position: ['bottom','left'],"); } if (this.Position == DialogPosition.BottomRight) { startupScript.AppendFormat(" position: ['bottom','right'],"); } if (this.Position == DialogPosition.TopLeft) { startupScript.AppendFormat(" position: ['top','left'],"); } if (this.Position == DialogPosition.TopRight) { startupScript.AppendFormat(" position: ['top','right'],"); } } if (!this.Resizable) { startupScript.AppendFormat(" resizable: false"); } if (this.ShowAnimation != DialogShowAnimation.None) { startupScript.AppendFormat(" show: '{0}',", this.ShowAnimation.ToString().ToLower()); } if (!this.Stack) { startupScript.AppendFormat(" stack: false"); } startupScript.AppendFormat(" title: '{0}',", this.Title); startupScript.AppendFormat(" zIndex: {0},", this.ZIndex); if (!this.Enabled) { startupScript.AppendFormat(" disabled: true,"); } startupScript.AppendFormat("}})"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } [ Browsable(false), DesignerSerializationVisibility( DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty) ] public ITemplate Template { get { return this._template; } set { this._template = value; } } [ Category("Behavior"), Description(""), DefaultValue(DialogShowAnimation.None) ] public DialogShowAnimation ShowAnimation { get { object show = ViewState["ShowAnimationViewState"]; return (show == null) ? DialogShowAnimation.None : (DialogShowAnimation)show; } set { ViewState["ShowAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DialogHideAnimation.None) ] public DialogHideAnimation HideAnimation { get { object hide = ViewState["HideAnimationViewState"]; return (hide == null) ? DialogHideAnimation.None : (DialogHideAnimation)hide; } set { ViewState["HideAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(1000) ] public int ZIndex { get { object zIndex = ViewState["ZIndexViewState"]; return (zIndex == null) ? 1000 : Convert.ToInt32(zIndex); } set { ViewState["ZIndexViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool AutoOpen { get { object autoOpen = ViewState["AutoOpenViewState"]; return (autoOpen == null) ? true : Convert.ToBoolean(autoOpen); } set { ViewState["AutoOpenViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool CloseOnEsc { get { object closeOnEsc = ViewState["CloseOnEscViewState"]; return (closeOnEsc == null) ? true : Convert.ToBoolean(closeOnEsc); } set { ViewState["CloseOnEscViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool Draggable { get { object draggable = ViewState["DraggableViewState"]; return (draggable == null) ? true : Convert.ToBoolean(draggable); } set { ViewState["DraggableViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Modal { get { object modal = ViewState["ModalViewState"]; return (modal == null) ? false : Convert.ToBoolean(modal); } set { ViewState["ModalViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool Resizable { get { object resizable = ViewState["ResizableViewState"]; return (resizable == null) ? true : Convert.ToBoolean(resizable); } set { ViewState["ResizableViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool Stack { get { object stack = ViewState["StackViewState"]; return (stack == null) ? true : Convert.ToBoolean(stack); } set { ViewState["StackViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DialogPosition.Center) ] public DialogPosition Position { get { object position = ViewState["PostionViewState"]; return (position == null) ? DialogPosition.Center : (DialogPosition)position; } set { ViewState["PostionViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string Title { get { object title = ViewState["TitleViewState"]; return (title == null) ? "" : title.ToString(); } set { ViewState["TitleViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MaxHeight { get { object maxHeight = ViewState["MaxHeightViewState"]; return (maxHeight == null) ? Unit.Empty : (Unit)maxHeight; } set { ViewState["MaxHeightViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MaxWidth { get { object maxWidth = ViewState["MaxWidthViewState"]; return (maxWidth == null) ? Unit.Empty : (Unit)maxWidth; } set { ViewState["MaxWidthViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MinHeight { get { object minHeight = ViewState["MinHeightViewState"]; return (minHeight == null) ? Unit.Empty : (Unit)minHeight; } set { ViewState["MinHeightViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MinWidth { get { object minWidth = ViewState["MinWidthViewState"]; return (minWidth == null) ? Unit.Empty : (Unit)minWidth; } set { ViewState["MinWidthViewState"] = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [
sila/AtomProject
92a3edfb38cde937e638bf0db4b7dcfddd7a01a7
add client side visibility and hidden input fielad
diff --git a/Atom.Web/Dialog/JQDialog.cs b/Atom.Web/Dialog/JQDialog.cs index f926ca0..9d382d0 100644 --- a/Atom.Web/Dialog/JQDialog.cs +++ b/Atom.Web/Dialog/JQDialog.cs @@ -1,617 +1,635 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI.WebControls; using System.ComponentModel; using System.Web.UI; using System.Web; using System.Security.Permissions; namespace Atom.Web.UI.WebControls.Dialog { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty(""), Designer(typeof(DialogDesigner)), ToolboxData("<{0}:JQDialog runat=\"server\"> </{0}:JQDialog>") ] - public class JQDialog : WebControl + public class JQDialog : WebControl, INamingContainer { - private string _header; - public string Header - { - get { return _header; } - set { _header = value; } - } - private ITemplate _temlpate; - [ - Browsable(false), - DesignerSerializationVisibility( - DesignerSerializationVisibility.Content), - PersistenceMode(PersistenceMode.InnerProperty) - ] - public ITemplate Template - { - get { return _temlpate; } - set { _temlpate = value; } - } //Methods protected override void CreateChildControls() { Controls.Clear(); if (Template != null) Template.InstantiateIn(this); } - + //clear span tag protected override void Render(HtmlTextWriter writer) { this.RenderContents(writer); } protected override void RenderContents(HtmlTextWriter writer) { - writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "dialog"); - writer.AddAttribute(HtmlTextWriterAttribute.Title, this.Header); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); + writer.RenderBeginTag(HtmlTextWriterTag.Input); + writer.RenderEndTag(); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Title, this.Title); writer.RenderBeginTag(HtmlTextWriterTag.Div); + foreach (Control control in this.Controls) { control.RenderControl(writer); } writer.RenderEndTag(); base.RenderContents(writer); } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); + startupScript.AppendFormat("var " + this.UniqueID + "; "); startupScript.AppendFormat("$(document).ready(function() {{ "); - startupScript.AppendFormat("var dialog" + this.UniqueID + " = $('#" + this.UniqueID + "dialog');"); - startupScript.AppendFormat("dialog" + this.UniqueID + ".dialog({{"); + startupScript.AppendFormat(this.UniqueID + " = $('#" + this.UniqueID + "');"); + startupScript.AppendFormat(this.UniqueID + ".dialog({{"); if (!this.AutoOpen) { startupScript.AppendFormat(" autoOpen: false,"); } if (!this.CloseOnEsc) { startupScript.AppendFormat(" closeOnEscape: false,"); } - startupScript.AppendFormat(" closeText: true,"); - - startupScript.AppendFormat(" dialogClass: true,"); - if (!this.Draggable) { startupScript.AppendFormat(" draggable: false,"); } if (this.HideAnimation != DialogHideAnimation.None) { startupScript.AppendFormat(" hide: '{0}',", this.HideAnimation.ToString().ToLower()); } - startupScript.AppendFormat(" height: {0},", this.Height); - startupScript.AppendFormat(" maxHeight: {0},", this.MaxHeight); - startupScript.AppendFormat(" maxWidth: {0},", this.MaxWidth); - startupScript.AppendFormat(" minHeight: {0},", this.MinHeight); - startupScript.AppendFormat(" minWidth: {0},", this.MinWidth); + if (!string.IsNullOrEmpty(this.Height.ToString())) + { + startupScript.AppendFormat(" height: {0},", this.Height); + } + if (!string.IsNullOrEmpty(this.Width.ToString())) + { + startupScript.AppendFormat(" width: {0},", this.Width); + } + if (!string.IsNullOrEmpty(this.MaxHeight.ToString())) + { + startupScript.AppendFormat(" maxHeight: {0},", this.MaxHeight); + } + if (!string.IsNullOrEmpty(this.MaxWidth.ToString())) + { + startupScript.AppendFormat(" maxWidth: {0},", this.MaxWidth); + } + if (!string.IsNullOrEmpty(this.MinHeight.ToString())) + { + startupScript.AppendFormat(" minHeight: {0},", this.MinHeight); + } + if (!string.IsNullOrEmpty(this.MinWidth.ToString())) + { + startupScript.AppendFormat(" minWidth: {0},", this.MinWidth); + } if (this.Modal) { startupScript.AppendFormat(" modal: true,"); } //postion if ((this.Position == DialogPosition.Center) || (this.Position == DialogPosition.Bottom) || (this.Position == DialogPosition.Top) || (this.Position == DialogPosition.Left) || (this.Position == DialogPosition.Right)) { startupScript.AppendFormat(" position: '{0}',", this.Position.ToString().ToLower()); } else { if (this.Position == DialogPosition.CenterLeft) { startupScript.AppendFormat(" position: ['center','left'],"); } if (this.Position == DialogPosition.CenterRight) { startupScript.AppendFormat(" position: ['center','right'],"); } if (this.Position == DialogPosition.BottomLeft) { startupScript.AppendFormat(" position: ['bottom','left'],"); } if (this.Position == DialogPosition.BottomRight) { startupScript.AppendFormat(" position: ['bottom','right'],"); } if (this.Position == DialogPosition.TopLeft) { startupScript.AppendFormat(" position: ['top','left'],"); } if (this.Position == DialogPosition.TopRight) { startupScript.AppendFormat(" position: ['top','right'],"); } } if (!this.Resizable) { startupScript.AppendFormat(" resizable: false"); } if (this.ShowAnimation != DialogShowAnimation.None) { startupScript.AppendFormat(" show: '{0}',", this.ShowAnimation.ToString().ToLower()); } if (!this.Stack) { startupScript.AppendFormat(" stack: false"); } - startupScript.AppendFormat(" title: '{0}'", this.Title); - startupScript.AppendFormat(" width: {0}", this.Width); - startupScript.AppendFormat(" zIndex: {0}", this.ZIndex); + startupScript.AppendFormat(" title: '{0}',", this.Title); + startupScript.AppendFormat(" zIndex: {0},", this.ZIndex); if (!this.Enabled) { - startupScript.AppendFormat(" disabled: true"); + startupScript.AppendFormat(" disabled: true,"); } startupScript.AppendFormat("}})"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } + + + + [ + Browsable(false), + DesignerSerializationVisibility( + DesignerSerializationVisibility.Content), + PersistenceMode(PersistenceMode.InnerProperty) + ] + public ITemplate Template + { + get { return this._temlpate; } + set { this._temlpate = value; } + } + [ Category("Behavior"), Description(""), DefaultValue(DialogShowAnimation.None) ] public DialogShowAnimation ShowAnimation { get { object show = ViewState["ShowAnimationViewState"]; return (show == null) ? DialogShowAnimation.None : (DialogShowAnimation)show; } set { ViewState["ShowAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DialogHideAnimation.None) ] public DialogHideAnimation HideAnimation { get { object hide = ViewState["HideAnimationViewState"]; return (hide == null) ? DialogHideAnimation.None : (DialogHideAnimation)hide; } set { ViewState["HideAnimationViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(1000) ] public int ZIndex { get { object zIndex = ViewState["ZIndexViewState"]; return (zIndex == null) ? 1000 : Convert.ToInt32(zIndex); } set { ViewState["ZIndexViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool AutoOpen { get { object autoOpen = ViewState["AutoOpenViewState"]; return (autoOpen == null) ? true : Convert.ToBoolean(autoOpen); } set { ViewState["AutoOpenViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool CloseOnEsc { get { object closeOnEsc = ViewState["CloseOnEscViewState"]; return (closeOnEsc == null) ? true : Convert.ToBoolean(closeOnEsc); } set { ViewState["CloseOnEscViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool Draggable { get { object draggable = ViewState["DraggableViewState"]; return (draggable == null) ? true : Convert.ToBoolean(draggable); } set { ViewState["DraggableViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(false) ] public bool Modal { get { object modal = ViewState["ModalViewState"]; return (modal == null) ? false : Convert.ToBoolean(modal); } set { ViewState["ModalViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool Resizable { get { object resizable = ViewState["ResizableViewState"]; return (resizable == null) ? true : Convert.ToBoolean(resizable); } set { ViewState["ResizableViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(true) ] public bool Stack { get { object stack = ViewState["StackViewState"]; return (stack == null) ? true : Convert.ToBoolean(stack); } set { ViewState["StackViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue(DialogPosition.Center) ] public DialogPosition Position { get { object position = ViewState["PostionViewState"]; return (position == null) ? DialogPosition.Center : (DialogPosition)position; } set { ViewState["PostionViewState"] = value; } } [ Category("Behavior"), Description(""), DefaultValue("") ] public string Title { get { object title = ViewState["TitleViewState"]; return (title == null) ? "" : title.ToString(); } set { ViewState["TitleViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MaxHeight { get { object maxHeight = ViewState["MaxHeightViewState"]; return (maxHeight == null) ? Unit.Empty : (Unit)maxHeight; } set { ViewState["MaxHeightViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MaxWidth { get { object maxWidth = ViewState["MaxWidthViewState"]; return (maxWidth == null) ? Unit.Empty : (Unit)maxWidth; } set { ViewState["MaxWidthViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MinHeight { get { object minHeight = ViewState["MinHeightViewState"]; return (minHeight == null) ? Unit.Empty : (Unit)minHeight; } set { ViewState["MinHeightViewState"] = value; } } [ Category("Behavior"), Description(""), UrlProperty(""), DefaultValue("") ] public Unit MinWidth { get { object minWidth = ViewState["MinWidthViewState"]; return (minWidth == null) ? Unit.Empty : (Unit)minWidth; } set { ViewState["MinWidthViewState"] = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } } }
sila/AtomProject
bd28c75ec7ed32b76566a19ae03f039d0f8a466e
implment show/hide animation
diff --git a/Atom.Web/Dialog/DialogHideAnimation.cs b/Atom.Web/Dialog/DialogHideAnimation.cs new file mode 100644 index 0000000..c9d1ebf --- /dev/null +++ b/Atom.Web/Dialog/DialogHideAnimation.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Dialog +{ + public enum DialogHideAnimation + { + None, + Blind, + Bounce, + Clip, + Drop, + Explode, + Fold, + Highlight, + Puff, + Pulsate, + Scale, + Shake, + Size, + Slide, + Transfer, + } +} diff --git a/Atom.Web/Dialog/DialogShowAnimation.cs b/Atom.Web/Dialog/DialogShowAnimation.cs new file mode 100644 index 0000000..5434cc0 --- /dev/null +++ b/Atom.Web/Dialog/DialogShowAnimation.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Dialog +{ + public enum DialogShowAnimation + { + None, + Blind, + Bounce, + Clip, + Drop, + Explode, + Fold, + Highlight, + Puff, + Pulsate, + Scale, + Shake, + Size, + Slide, + Transfer + + } +} diff --git a/Atom.Web/Dialog/JQDialog.cs b/Atom.Web/Dialog/JQDialog.cs index dad8f40..f926ca0 100644 --- a/Atom.Web/Dialog/JQDialog.cs +++ b/Atom.Web/Dialog/JQDialog.cs @@ -1,473 +1,617 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI.WebControls; using System.ComponentModel; using System.Web.UI; using System.Web; using System.Security.Permissions; namespace Atom.Web.UI.WebControls.Dialog { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty(""), Designer(typeof(DialogDesigner)), ToolboxData("<{0}:JQDialog runat=\"server\"> </{0}:JQDialog>") ] public class JQDialog : WebControl { private string _header; public string Header { get { return _header; } set { _header = value; } } private ITemplate _temlpate; [ Browsable(false), DesignerSerializationVisibility( DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty) ] public ITemplate Template { get { return _temlpate; } set { _temlpate = value; } } //Methods protected override void CreateChildControls() { Controls.Clear(); if (Template != null) Template.InstantiateIn(this); } //clear span tag protected override void Render(HtmlTextWriter writer) { this.RenderContents(writer); } protected override void RenderContents(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "dialog"); writer.AddAttribute(HtmlTextWriterAttribute.Title, this.Header); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (Control control in this.Controls) { control.RenderControl(writer); } writer.RenderEndTag(); base.RenderContents(writer); } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat("var dialog" + this.UniqueID + " = $('#" + this.UniqueID + "dialog');"); startupScript.AppendFormat("dialog" + this.UniqueID + ".dialog({{"); if (!this.AutoOpen) { - startupScript.AppendFormat(" autoOpen: false"); + startupScript.AppendFormat(" autoOpen: false,"); } + if (!this.CloseOnEsc) { - startupScript.AppendFormat(" closeOnEscape: false"); + startupScript.AppendFormat(" closeOnEscape: false,"); } - startupScript.AppendFormat(" closeText: true"); - startupScript.AppendFormat(" dialogClass: true"); + + startupScript.AppendFormat(" closeText: true,"); + + startupScript.AppendFormat(" dialogClass: true,"); + if (!this.Draggable) { - startupScript.AppendFormat(" draggable: false"); + startupScript.AppendFormat(" draggable: false,"); } - startupScript.AppendFormat(" height: true"); - startupScript.AppendFormat(" hide: true"); - startupScript.AppendFormat(" height: true"); - startupScript.AppendFormat(" maxHeight: true"); - startupScript.AppendFormat(" maxWidth: true"); - startupScript.AppendFormat(" minHeight: true"); - startupScript.AppendFormat(" minWidth: true"); + + if (this.HideAnimation != DialogHideAnimation.None) + { + startupScript.AppendFormat(" hide: '{0}',", this.HideAnimation.ToString().ToLower()); + } + startupScript.AppendFormat(" height: {0},", this.Height); + startupScript.AppendFormat(" maxHeight: {0},", this.MaxHeight); + startupScript.AppendFormat(" maxWidth: {0},", this.MaxWidth); + startupScript.AppendFormat(" minHeight: {0},", this.MinHeight); + startupScript.AppendFormat(" minWidth: {0},", this.MinWidth); if (this.Modal) { - startupScript.AppendFormat(" modal: true"); + startupScript.AppendFormat(" modal: true,"); } //postion if ((this.Position == DialogPosition.Center) || (this.Position == DialogPosition.Bottom) || (this.Position == DialogPosition.Top) || (this.Position == DialogPosition.Left) || (this.Position == DialogPosition.Right)) { - startupScript.AppendFormat(" position: '{0}'", this.Position.ToString().ToLower()); + startupScript.AppendFormat(" position: '{0}',", this.Position.ToString().ToLower()); } - if (this.Position == DialogPosition.CenterLeft) + else { + if (this.Position == DialogPosition.CenterLeft) + { startupScript.AppendFormat(" position: ['center','left'],"); } - } - if (this.Position == DialogPosition.CenterRight) { } - if (this.Position == DialogPosition.BottomLeft) { } - if (this.Position == DialogPosition.BottomRight) { } - if (this.Position == DialogPosition.TopLeft) { } - if (this.Position == DialogPosition.TopRight) { } + if (this.Position == DialogPosition.CenterRight) + { startupScript.AppendFormat(" position: ['center','right'],"); } + if (this.Position == DialogPosition.BottomLeft) + { startupScript.AppendFormat(" position: ['bottom','left'],"); } + + if (this.Position == DialogPosition.BottomRight) + { startupScript.AppendFormat(" position: ['bottom','right'],"); } + + if (this.Position == DialogPosition.TopLeft) + { startupScript.AppendFormat(" position: ['top','left'],"); } + + if (this.Position == DialogPosition.TopRight) + { startupScript.AppendFormat(" position: ['top','right'],"); } + + } if (!this.Resizable) { startupScript.AppendFormat(" resizable: false"); } - startupScript.AppendFormat(" show: true"); + if (this.ShowAnimation != DialogShowAnimation.None) + { + startupScript.AppendFormat(" show: '{0}',", this.ShowAnimation.ToString().ToLower()); + } + if (!this.Stack) { startupScript.AppendFormat(" stack: false"); } startupScript.AppendFormat(" title: '{0}'", this.Title); - startupScript.AppendFormat(" width: true"); - startupScript.AppendFormat(" zIndex: true"); + startupScript.AppendFormat(" width: {0}", this.Width); + startupScript.AppendFormat(" zIndex: {0}", this.ZIndex); if (!this.Enabled) { startupScript.AppendFormat(" disabled: true"); } startupScript.AppendFormat("}})"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } [ Category("Behavior"), Description(""), - UrlProperty(""), + DefaultValue(DialogShowAnimation.None) + ] + public DialogShowAnimation ShowAnimation + { + get + { + object show = ViewState["ShowAnimationViewState"]; + return (show == null) ? DialogShowAnimation.None : (DialogShowAnimation)show; + } + set + { + ViewState["ShowAnimationViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(DialogHideAnimation.None) + ] + public DialogHideAnimation HideAnimation + { + get + { + object hide = ViewState["HideAnimationViewState"]; + return (hide == null) ? DialogHideAnimation.None : (DialogHideAnimation)hide; + } + set + { + ViewState["HideAnimationViewState"] = value; + } + } + + + [ + Category("Behavior"), + Description(""), + DefaultValue(1000) + ] + public int ZIndex + { + get + { + object zIndex = ViewState["ZIndexViewState"]; + return (zIndex == null) ? 1000 : Convert.ToInt32(zIndex); + } + set + { + ViewState["ZIndexViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), DefaultValue(true) ] public bool AutoOpen { get { object autoOpen = ViewState["AutoOpenViewState"]; return (autoOpen == null) ? true : Convert.ToBoolean(autoOpen); } set { ViewState["AutoOpenViewState"] = value; } } [ Category("Behavior"), Description(""), - UrlProperty(""), DefaultValue(true) ] public bool CloseOnEsc { get { object closeOnEsc = ViewState["CloseOnEscViewState"]; return (closeOnEsc == null) ? true : Convert.ToBoolean(closeOnEsc); } set { ViewState["CloseOnEscViewState"] = value; } } [ Category("Behavior"), Description(""), - UrlProperty(""), DefaultValue(true) ] public bool Draggable { get { object draggable = ViewState["DraggableViewState"]; return (draggable == null) ? true : Convert.ToBoolean(draggable); } set { ViewState["DraggableViewState"] = value; } } [ Category("Behavior"), Description(""), - UrlProperty(""), DefaultValue(false) ] public bool Modal { get { object modal = ViewState["ModalViewState"]; return (modal == null) ? false : Convert.ToBoolean(modal); } set { ViewState["ModalViewState"] = value; } } [ Category("Behavior"), Description(""), - UrlProperty(""), DefaultValue(true) ] public bool Resizable { get { object resizable = ViewState["ResizableViewState"]; return (resizable == null) ? true : Convert.ToBoolean(resizable); } set { ViewState["ResizableViewState"] = value; } } [ Category("Behavior"), Description(""), - UrlProperty(""), DefaultValue(true) ] public bool Stack { get { object stack = ViewState["StackViewState"]; return (stack == null) ? true : Convert.ToBoolean(stack); } set { ViewState["StackViewState"] = value; } } [ Category("Behavior"), Description(""), - UrlProperty(""), DefaultValue(DialogPosition.Center) ] public DialogPosition Position { get { object position = ViewState["PostionViewState"]; return (position == null) ? DialogPosition.Center : (DialogPosition)position; } set { ViewState["PostionViewState"] = value; } } [ Category("Behavior"), Description(""), - UrlProperty(""), DefaultValue("") ] public string Title { get { object title = ViewState["TitleViewState"]; return (title == null) ? "" : title.ToString(); } set { ViewState["TitleViewState"] = value; } } + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue("") + ] + public Unit MaxHeight + { + get + { + object maxHeight = ViewState["MaxHeightViewState"]; + return (maxHeight == null) ? Unit.Empty : (Unit)maxHeight; + } + set + { + ViewState["MaxHeightViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue("") + ] + public Unit MaxWidth + { + get + { + object maxWidth = ViewState["MaxWidthViewState"]; + return (maxWidth == null) ? Unit.Empty : (Unit)maxWidth; + } + set + { + ViewState["MaxWidthViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue("") + ] + public Unit MinHeight + { + get + { + object minHeight = ViewState["MinHeightViewState"]; + return (minHeight == null) ? Unit.Empty : (Unit)minHeight; + } + set + { + ViewState["MinHeightViewState"] = value; + } + } + + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue("") + ] + public Unit MinWidth + { + get + { + object minWidth = ViewState["MinWidthViewState"]; + return (minWidth == null) ? Unit.Empty : (Unit)minWidth; + } + set + { + ViewState["MinWidthViewState"] = value; + } + } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BackColor { get { return base.BackColor; } set { base.BackColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override FontInfo Font { get { return base.Font; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override bool EnableTheming { get { return base.EnableTheming; } set { base.EnableTheming = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string ToolTip { get { return base.ToolTip; } set { base.ToolTip = value; } } [ EditorBrowsable(EditorBrowsableState.Never), Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string SkinID { get { return base.SkinID; } set { base.SkinID = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override System.Drawing.Color ForeColor { get { return base.ForeColor; } set { base.ForeColor = value; } } [ EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) ] public override string CssClass { get { return base.CssClass; } set { base.CssClass = value; } } } }
sila/AtomProject
caefe76bc6b976eb7fbbd39196c0caca3999cca2
add startup js script and dialog properties
diff --git a/Atom.Web/Dialog/JQDialog.cs b/Atom.Web/Dialog/JQDialog.cs index 8ab2190..dad8f40 100644 --- a/Atom.Web/Dialog/JQDialog.cs +++ b/Atom.Web/Dialog/JQDialog.cs @@ -1,100 +1,473 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.UI.WebControls; using System.ComponentModel; using System.Web.UI; using System.Web; using System.Security.Permissions; namespace Atom.Web.UI.WebControls.Dialog { [ AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty(""), Designer(typeof(DialogDesigner)), ToolboxData("<{0}:JQDialog runat=\"server\"> </{0}:JQDialog>") ] public class JQDialog : WebControl { private string _header; public string Header { get { return _header; } set { _header = value; } } private ITemplate _temlpate; [ Browsable(false), DesignerSerializationVisibility( DesignerSerializationVisibility.Content), PersistenceMode(PersistenceMode.InnerProperty) ] public ITemplate Template { get { return _temlpate; } set { _temlpate = value; } } //Methods protected override void CreateChildControls() { Controls.Clear(); if (Template != null) Template.InstantiateIn(this); } //clear span tag protected override void Render(HtmlTextWriter writer) { this.RenderContents(writer); } protected override void RenderContents(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "dialog"); writer.AddAttribute(HtmlTextWriterAttribute.Title, this.Header); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (Control control in this.Controls) { control.RenderControl(writer); } writer.RenderEndTag(); base.RenderContents(writer); } protected override void OnPreRender(EventArgs e) { string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); base.OnPreRender(e); } private string RenderStartupJavaScript() { StringBuilder startupScript = new StringBuilder(); startupScript.AppendFormat("<script type=\"text/javascript\">"); startupScript.AppendFormat("$(document).ready(function() {{ "); startupScript.AppendFormat("var dialog" + this.UniqueID + " = $('#" + this.UniqueID + "dialog');"); startupScript.AppendFormat("dialog" + this.UniqueID + ".dialog({{"); - startupScript.AppendFormat(" autoOpen: true"); + if (!this.AutoOpen) + { + startupScript.AppendFormat(" autoOpen: false"); + } + if (!this.CloseOnEsc) + { + startupScript.AppendFormat(" closeOnEscape: false"); + } + startupScript.AppendFormat(" closeText: true"); + startupScript.AppendFormat(" dialogClass: true"); + if (!this.Draggable) + { + startupScript.AppendFormat(" draggable: false"); + } + startupScript.AppendFormat(" height: true"); + startupScript.AppendFormat(" hide: true"); + startupScript.AppendFormat(" height: true"); + startupScript.AppendFormat(" maxHeight: true"); + startupScript.AppendFormat(" maxWidth: true"); + startupScript.AppendFormat(" minHeight: true"); + startupScript.AppendFormat(" minWidth: true"); + if (this.Modal) + { + startupScript.AppendFormat(" modal: true"); + } + //postion + if ((this.Position == DialogPosition.Center) + || (this.Position == DialogPosition.Bottom) + || (this.Position == DialogPosition.Top) + || (this.Position == DialogPosition.Left) + || (this.Position == DialogPosition.Right)) + { + startupScript.AppendFormat(" position: '{0}'", this.Position.ToString().ToLower()); + } + if (this.Position == DialogPosition.CenterLeft) + { + + } + if (this.Position == DialogPosition.CenterRight) { } + if (this.Position == DialogPosition.BottomLeft) { } + if (this.Position == DialogPosition.BottomRight) { } + if (this.Position == DialogPosition.TopLeft) { } + if (this.Position == DialogPosition.TopRight) { } + + if (!this.Resizable) + { + startupScript.AppendFormat(" resizable: false"); + } + startupScript.AppendFormat(" show: true"); + if (!this.Stack) + { + startupScript.AppendFormat(" stack: false"); + } + startupScript.AppendFormat(" title: '{0}'", this.Title); + startupScript.AppendFormat(" width: true"); + startupScript.AppendFormat(" zIndex: true"); + + if (!this.Enabled) + { + startupScript.AppendFormat(" disabled: true"); + } startupScript.AppendFormat("}})"); startupScript.AppendFormat("}})"); startupScript.AppendFormat("</script>"); return startupScript.ToString(); } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue(true) + ] + public bool AutoOpen + { + get + { + object autoOpen = ViewState["AutoOpenViewState"]; + return (autoOpen == null) ? true : Convert.ToBoolean(autoOpen); + } + set + { + ViewState["AutoOpenViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue(true) + ] + public bool CloseOnEsc + { + get + { + object closeOnEsc = ViewState["CloseOnEscViewState"]; + return (closeOnEsc == null) ? true : Convert.ToBoolean(closeOnEsc); + } + set + { + ViewState["CloseOnEscViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue(true) + ] + public bool Draggable + { + get + { + object draggable = ViewState["DraggableViewState"]; + return (draggable == null) ? true : Convert.ToBoolean(draggable); + } + set + { + ViewState["DraggableViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue(false) + ] + public bool Modal + { + get + { + object modal = ViewState["ModalViewState"]; + return (modal == null) ? false : Convert.ToBoolean(modal); + } + set + { + ViewState["ModalViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue(true) + ] + public bool Resizable + { + get + { + object resizable = ViewState["ResizableViewState"]; + return (resizable == null) ? true : Convert.ToBoolean(resizable); + } + set + { + ViewState["ResizableViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue(true) + ] + public bool Stack + { + get + { + object stack = ViewState["StackViewState"]; + return (stack == null) ? true : Convert.ToBoolean(stack); + } + set + { + ViewState["StackViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue(DialogPosition.Center) + ] + public DialogPosition Position + { + get + { + object position = ViewState["PostionViewState"]; + return (position == null) ? DialogPosition.Center : (DialogPosition)position; + } + set + { + ViewState["PostionViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue("") + ] + public string Title + { + get + { + object title = ViewState["TitleViewState"]; + return (title == null) ? "" : title.ToString(); + } + set + { + ViewState["TitleViewState"] = value; + } + } + + + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BackColor + { + get + { + return base.BackColor; + } + set + { + base.BackColor = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override BorderStyle BorderStyle + { + get + { + return base.BorderStyle; + } + set + { + base.BorderStyle = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override Unit BorderWidth + { + get + { + return base.BorderWidth; + } + set + { + base.BorderWidth = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BorderColor + { + get + { + return base.BorderColor; + } + set + { + base.BorderColor = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override FontInfo Font + { + get + { + return base.Font; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override bool EnableTheming + { + get + { + return base.EnableTheming; + } + set + { + base.EnableTheming = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string ToolTip + { + get + { + return base.ToolTip; + } + set + { + base.ToolTip = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string SkinID + { + get + { + return base.SkinID; + } + set + { + base.SkinID = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color ForeColor + { + get + { + return base.ForeColor; + } + set + { + base.ForeColor = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string CssClass + { + get + { + return base.CssClass; + } + set + { + base.CssClass = value; + } + } + + } }
sila/AtomProject
e1eb57ce9faca9766ce5799781d63b9955cb8ab3
add dialog postion enum
diff --git a/Atom.Web/Dialog/DialogPosition.cs b/Atom.Web/Dialog/DialogPosition.cs new file mode 100644 index 0000000..67f6423 --- /dev/null +++ b/Atom.Web/Dialog/DialogPosition.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Dialog +{ + public enum DialogPosition + { + Center, + CenterLeft, + CenterRight, + Left, + Right, + Top, + TopLeft, + TopRight, + Bottom, + BottomLeft, + BottomRight, + } +}
sila/AtomProject
b2e96f88472d25a11e5514f456692ba72498ffb1
add default aspx test file
diff --git a/TestApp/Default.aspx b/TestApp/Default.aspx new file mode 100644 index 0000000..da52ab1 --- /dev/null +++ b/TestApp/Default.aspx @@ -0,0 +1,19 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestApp.Default" %> + +<%@ Register Assembly="Atom.Web" Namespace="Atom.Web.UI.WebControls.Slider" TagPrefix="slider" %> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title></title> + <link href="themes/base/ui.all.css" rel="stylesheet" type="text/css" /> + <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> + <script src="Scripts/jquery-ui-1.8.custom.min.js" type="text/javascript"></script> +</head> +<body> + <form id="form1" runat="server"> + <div> + <slider:JQSlider ID="JQSlider1" runat="server" Value="0" /> + </div> + </form> +</body> +</html> diff --git a/TestApp/Default.aspx.cs b/TestApp/Default.aspx.cs new file mode 100644 index 0000000..929cd52 --- /dev/null +++ b/TestApp/Default.aspx.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace TestApp +{ + public partial class Default : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/TestApp/Default.aspx.designer.cs b/TestApp/Default.aspx.designer.cs new file mode 100644 index 0000000..ea99b7b --- /dev/null +++ b/TestApp/Default.aspx.designer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TestApp { + + + public partial class Default { + + /// <summary> + /// form1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// <summary> + /// JQSlider1 control. + /// </summary> + /// <remarks> + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// </remarks> + protected global::Atom.Web.UI.WebControls.Slider.JQSlider JQSlider1; + } +}
sila/AtomProject
80130ccb31db56a1b979e2071028470d52f41f65
add enums of slider
diff --git a/Atom.Web/Slider/SliderAnimation.cs b/Atom.Web/Slider/SliderAnimation.cs new file mode 100644 index 0000000..9001690 --- /dev/null +++ b/Atom.Web/Slider/SliderAnimation.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Slider +{ + public enum SliderAnimation + { + Slow, + Normal, + Fast + } +} diff --git a/Atom.Web/Slider/SliderOrientation.cs b/Atom.Web/Slider/SliderOrientation.cs new file mode 100644 index 0000000..0cb9900 --- /dev/null +++ b/Atom.Web/Slider/SliderOrientation.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Slider +{ + public enum SliderOrientation + { + Horizontal, + Vertical + } +} diff --git a/Atom.Web/Slider/SliderRange.cs b/Atom.Web/Slider/SliderRange.cs new file mode 100644 index 0000000..2de4323 --- /dev/null +++ b/Atom.Web/Slider/SliderRange.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Slider +{ + public enum SliderRange + { + True, + False, + Min, + Max + } +}
sila/AtomProject
ccf9435ce53e1d7d2bef70137a212a9ea89cd62d
add implmentation of startup JS script
diff --git a/Atom.Web/Slider/JQSlider.cs b/Atom.Web/Slider/JQSlider.cs index 310f7b9..582e159 100644 --- a/Atom.Web/Slider/JQSlider.cs +++ b/Atom.Web/Slider/JQSlider.cs @@ -1,11 +1,388 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using System.Web.UI; +using System.ComponentModel; +using System.Web; +using System.Security.Permissions; +using Atom.Web.UI.WebControls.Dialog; +using System.Web.UI.WebControls; namespace Atom.Web.UI.WebControls.Slider { - public class JQSlider + + [ + AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + DefaultProperty(""), + Designer(typeof(SliderDesigner)), + ToolboxData("<{0}:JQSlider runat=\"server\"> </{0}:JQSlider>") + ] + public class JQSlider : WebControl { + protected override void Render(HtmlTextWriter writer) + { + this.RenderContents(writer); + } + + protected override void RenderContents(HtmlTextWriter writer) + { + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Value, "selectedtab:"); + writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); + writer.RenderBeginTag(HtmlTextWriterTag.Input); + writer.RenderEndTag(); + + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + writer.RenderEndTag(); + + + base.RenderContents(writer); + } + + protected override void OnPreRender(EventArgs e) + { + string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); + string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); + + Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); + + base.OnPreRender(e); + } + + private string RenderStartupJavaScript() + { + StringBuilder startupScript = new StringBuilder(); + + startupScript.AppendFormat("<script type=\"text/javascript\">"); + startupScript.AppendFormat("$(document).ready(function() {{ "); + startupScript.AppendFormat("var " + this.UniqueID + " = $('#" + this.UniqueID + "');"); + startupScript.AppendFormat(this.UniqueID + ".slider({{"); + + startupScript.AppendFormat(" max: {0},", this.MaxValue); + startupScript.AppendFormat(" min: {0},", this.MinValue); + startupScript.AppendFormat(" animate: {0},", this.Animation.ToString().ToLower()); + startupScript.AppendFormat(" orientation: {0},", this.Orientation.ToString().ToLower()); + startupScript.AppendFormat(" range: {0},", this.Range.ToString().ToLower()); + startupScript.AppendFormat(" step: {0},", this.Step); + + if (string.IsNullOrEmpty(this.RangeValue.ToString())) + { + startupScript.AppendFormat(" value: {0},", this.Value); + } + else + { + startupScript.AppendFormat(" values: [{0},{1}],", this.Value, this.RangeValue); + } + if (this.Enabled) + { + startupScript.AppendFormat(" disabled: true,"); + } + startupScript.AppendFormat("}})"); + startupScript.AppendFormat("}})"); + startupScript.AppendFormat("</script>"); + + return startupScript.ToString(); + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue(100) + ] + public int MaxValue + { + get + { + object max = ViewState["MaxValueViewState"]; + return (max == null) ? 0 : Convert.ToInt32(max); + } + set + { + ViewState["MaxValueViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(0) + ] + public int MinValue + { + get + { + object mix = ViewState["MixValueViewState"]; + return (mix == null) ? 0 : Convert.ToInt32(mix); + } + set + { + ViewState["MixValueViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(0) + ] + public int Value + { + get + { + object val = (object)ViewState["ValueViewState"]; + return (val == null) ? 0 : Convert.ToInt32(val); + } + set + { + ViewState["ValueViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue("Value") + ] + public int RangeValue + { + get + { + object rangeValue = (object)ViewState["RangeValueViewState"]; + return (rangeValue == null) ? this.Value : Convert.ToInt32(rangeValue); + } + set + { + ViewState["RangeValueViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(1) + ] + public int Step + { + get + { + object step = (object)ViewState["StepTypeViewState"]; + return (step == null) ? 1 : Convert.ToInt32(step); + } + set + { + ViewState["StepTypeViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(SliderOrientation.Horizontal) + ] + public SliderOrientation Orientation + { + get + { + object orientation = (object)ViewState["OrientationViewState"]; + return (orientation == null) ? SliderOrientation.Horizontal : (SliderOrientation)orientation; + } + set + { + ViewState["OrientationViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(SliderAnimation.Normal) + ] + public SliderAnimation Animation + { + get + { + object animation = (object)ViewState["AnimationViewState"]; + return (animation == null) ? SliderAnimation.Normal : (SliderAnimation)animation; + } + set + { + ViewState["AnimationViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(SliderRange.False) + ] + public SliderRange Range + { + get + { + object range = (object)ViewState["RangeViewState"]; + return (range == null) ? SliderRange.False : (SliderRange)range; + } + set + { + ViewState["RangeViewState"] = value; + } + } + + + + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BackColor + { + get + { + return base.BackColor; + } + set + { + base.BackColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override BorderStyle BorderStyle + { + get + { + return base.BorderStyle; + } + set + { + base.BorderStyle = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override Unit BorderWidth + { + get + { + return base.BorderWidth; + } + set + { + base.BorderWidth = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BorderColor + { + get + { + return base.BorderColor; + } + set + { + base.BorderColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override FontInfo Font + { + get + { + return base.Font; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override bool EnableTheming + { + get + { + return base.EnableTheming; + } + set + { + base.EnableTheming = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string ToolTip + { + get + { + return base.ToolTip; + } + set + { + base.ToolTip = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string SkinID + { + get + { + return base.SkinID; + } + set + { + base.SkinID = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color ForeColor + { + get + { + return base.ForeColor; + } + set + { + base.ForeColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string CssClass + { + get + { + return base.CssClass; + } + set + { + base.CssClass = value; + } + } } + }
sila/AtomProject
f513e7c81a19ef0e7244082a20193584078f53b8
add slider designer
diff --git a/Atom.Web/Slider/Design/SliderDesigner.cs b/Atom.Web/Slider/Design/SliderDesigner.cs new file mode 100644 index 0000000..c3b54bf --- /dev/null +++ b/Atom.Web/Slider/Design/SliderDesigner.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI.Design; + +namespace Atom.Web.UI.WebControls.Slider +{ + + class SliderDesigner : ControlDesigner + { + public override string GetDesignTimeHtml() + { + return base.CreatePlaceHolderDesignTimeHtml(); + } + } +}
sila/AtomProject
f7b2a4bc8ac573fdbe8c6f69e19a6e811d419739
add slider tab
diff --git a/Atom.Web/Properties/AssemblyInfo.cs b/Atom.Web/Properties/AssemblyInfo.cs index b20af0d..d2af537 100644 --- a/Atom.Web/Properties/AssemblyInfo.cs +++ b/Atom.Web/Properties/AssemblyInfo.cs @@ -1,43 +1,44 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Web.UI; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Atom.Web")] [assembly: TagPrefix("Atom.Web.UI.WebControls", "atom")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Accordion", "accordion")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Progressbar", "progressbar")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Tabs", "tabs")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Dialog", "dialog")] [assembly: TagPrefix("Atom.Web.UI.WebControls.Button", "button")] +[assembly: TagPrefix("Atom.Web.UI.WebControls.Slider", "slider")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Atom.Web")] [assembly: AssemblyCopyright("Copyright © 2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("4312a669-223e-4bf6-8c8d-c31acb3c5a1f")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
sila/AtomProject
f5636d814f4f15ee4c5e404774dba4078cd22d67
add theme
diff --git a/TestApp/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png b/TestApp/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 0000000..5b5dab2 Binary files /dev/null and b/TestApp/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/TestApp/themes/base/images/ui-bg_flat_75_ffffff_40x100.png b/TestApp/themes/base/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 0000000..ac8b229 Binary files /dev/null and b/TestApp/themes/base/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/TestApp/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png b/TestApp/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 0000000..ad3d634 Binary files /dev/null and b/TestApp/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/TestApp/themes/base/images/ui-bg_glass_65_ffffff_1x400.png b/TestApp/themes/base/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000..42ccba2 Binary files /dev/null and b/TestApp/themes/base/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/TestApp/themes/base/images/ui-bg_glass_75_dadada_1x400.png b/TestApp/themes/base/images/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 0000000..5a46b47 Binary files /dev/null and b/TestApp/themes/base/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/TestApp/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png b/TestApp/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 0000000..86c2baa Binary files /dev/null and b/TestApp/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/TestApp/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png b/TestApp/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 0000000..4443fdc Binary files /dev/null and b/TestApp/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/TestApp/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/TestApp/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 0000000..7c9fa6c Binary files /dev/null and b/TestApp/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/TestApp/themes/base/images/ui-icons_222222_256x240.png b/TestApp/themes/base/images/ui-icons_222222_256x240.png new file mode 100644 index 0000000..ee039dc Binary files /dev/null and b/TestApp/themes/base/images/ui-icons_222222_256x240.png differ diff --git a/TestApp/themes/base/images/ui-icons_2e83ff_256x240.png b/TestApp/themes/base/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000..45e8928 Binary files /dev/null and b/TestApp/themes/base/images/ui-icons_2e83ff_256x240.png differ diff --git a/TestApp/themes/base/images/ui-icons_454545_256x240.png b/TestApp/themes/base/images/ui-icons_454545_256x240.png new file mode 100644 index 0000000..7ec70d1 Binary files /dev/null and b/TestApp/themes/base/images/ui-icons_454545_256x240.png differ diff --git a/TestApp/themes/base/images/ui-icons_888888_256x240.png b/TestApp/themes/base/images/ui-icons_888888_256x240.png new file mode 100644 index 0000000..5ba708c Binary files /dev/null and b/TestApp/themes/base/images/ui-icons_888888_256x240.png differ diff --git a/TestApp/themes/base/images/ui-icons_cd0a0a_256x240.png b/TestApp/themes/base/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000..7930a55 Binary files /dev/null and b/TestApp/themes/base/images/ui-icons_cd0a0a_256x240.png differ diff --git a/TestApp/themes/base/ui.accordion.css b/TestApp/themes/base/ui.accordion.css new file mode 100644 index 0000000..ee1b1b6 --- /dev/null +++ b/TestApp/themes/base/ui.accordion.css @@ -0,0 +1,9 @@ +/* Accordion +----------------------------------*/ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } +.ui-accordion .ui-accordion-content-active { display: block; } \ No newline at end of file diff --git a/TestApp/themes/base/ui.all.css b/TestApp/themes/base/ui.all.css new file mode 100644 index 0000000..543e4c3 --- /dev/null +++ b/TestApp/themes/base/ui.all.css @@ -0,0 +1,2 @@ +@import "ui.base.css"; +@import "ui.theme.css"; diff --git a/TestApp/themes/base/ui.base.css b/TestApp/themes/base/ui.base.css new file mode 100644 index 0000000..d716095 --- /dev/null +++ b/TestApp/themes/base/ui.base.css @@ -0,0 +1,8 @@ +@import url("ui.core.css"); +@import url("ui.resizable.css"); +@import url("ui.accordion.css"); +@import url("ui.dialog.css"); +@import url("ui.slider.css"); +@import url("ui.tabs.css"); +@import url("ui.datepicker.css"); +@import url("ui.progressbar.css"); \ No newline at end of file diff --git a/TestApp/themes/base/ui.core.css b/TestApp/themes/base/ui.core.css new file mode 100644 index 0000000..c2f18f2 --- /dev/null +++ b/TestApp/themes/base/ui.core.css @@ -0,0 +1,37 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } \ No newline at end of file diff --git a/TestApp/themes/base/ui.datepicker.css b/TestApp/themes/base/ui.datepicker.css new file mode 100644 index 0000000..567f8c9 --- /dev/null +++ b/TestApp/themes/base/ui.datepicker.css @@ -0,0 +1,62 @@ +/* Datepicker +----------------------------------*/ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +} \ No newline at end of file diff --git a/TestApp/themes/base/ui.dialog.css b/TestApp/themes/base/ui.dialog.css new file mode 100644 index 0000000..2997595 --- /dev/null +++ b/TestApp/themes/base/ui.dialog.css @@ -0,0 +1,13 @@ +/* Dialog +----------------------------------*/ +.ui-dialog { position: relative; padding: .2em; width: 300px; } +.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } diff --git a/TestApp/themes/base/ui.progressbar.css b/TestApp/themes/base/ui.progressbar.css new file mode 100644 index 0000000..bc0939e --- /dev/null +++ b/TestApp/themes/base/ui.progressbar.css @@ -0,0 +1,4 @@ +/* Progressbar +----------------------------------*/ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/TestApp/themes/base/ui.resizable.css b/TestApp/themes/base/ui.resizable.css new file mode 100644 index 0000000..44efeb2 --- /dev/null +++ b/TestApp/themes/base/ui.resizable.css @@ -0,0 +1,13 @@ +/* Resizable +----------------------------------*/ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file diff --git a/TestApp/themes/base/ui.slider.css b/TestApp/themes/base/ui.slider.css new file mode 100644 index 0000000..4c56218 --- /dev/null +++ b/TestApp/themes/base/ui.slider.css @@ -0,0 +1,17 @@ +/* Slider +----------------------------------*/ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } \ No newline at end of file diff --git a/TestApp/themes/base/ui.tabs.css b/TestApp/themes/base/ui.tabs.css new file mode 100644 index 0000000..3ca6b9a --- /dev/null +++ b/TestApp/themes/base/ui.tabs.css @@ -0,0 +1,11 @@ +/* Tabs +----------------------------------*/ +.ui-tabs { padding: .2em; zoom: 1; } +.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } +.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/TestApp/themes/base/ui.theme.css b/TestApp/themes/base/ui.theme.css new file mode 100644 index 0000000..73ed788 --- /dev/null +++ b/TestApp/themes/base/ui.theme.css @@ -0,0 +1,245 @@ + + +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://jqueryui.com/themeroller/ +*/ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; } +.ui-widget-content a { color: #222222/*{fcContent}*/; } +.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; } +.ui-widget-header a { color: #222222/*{fcHeader}*/; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; outline: none; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; outline: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; outline: none; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; outline: none; } +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; outline: none; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; outline: none; text-decoration: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636/*{fcHighlight}*/; } +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; } +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a/*{fcError}*/; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a/*{fcError}*/; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; } +.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file diff --git a/TestApp/themes/my_thmere/images/ui-bg_dots-medium_75_0fdb22_4x4.png b/TestApp/themes/my_thmere/images/ui-bg_dots-medium_75_0fdb22_4x4.png new file mode 100644 index 0000000..beaafbc Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-bg_dots-medium_75_0fdb22_4x4.png differ diff --git a/TestApp/themes/my_thmere/images/ui-bg_flat_0_aaaaaa_40x100.png b/TestApp/themes/my_thmere/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 0000000..5b5dab2 Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/TestApp/themes/my_thmere/images/ui-bg_glass_55_e0ef34_1x400.png b/TestApp/themes/my_thmere/images/ui-bg_glass_55_e0ef34_1x400.png new file mode 100644 index 0000000..4423589 Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-bg_glass_55_e0ef34_1x400.png differ diff --git a/TestApp/themes/my_thmere/images/ui-bg_glass_65_ffffff_1x400.png b/TestApp/themes/my_thmere/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000..42ccba2 Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/TestApp/themes/my_thmere/images/ui-bg_glass_75_e6e6e6_1x400.png b/TestApp/themes/my_thmere/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 0000000..86c2baa Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/TestApp/themes/my_thmere/images/ui-bg_glow-ball_75_1c51ce_600x600.png b/TestApp/themes/my_thmere/images/ui-bg_glow-ball_75_1c51ce_600x600.png new file mode 100644 index 0000000..7b1e17b Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-bg_glow-ball_75_1c51ce_600x600.png differ diff --git a/TestApp/themes/my_thmere/images/ui-bg_highlight-soft_75_e71d1d_1x100.png b/TestApp/themes/my_thmere/images/ui-bg_highlight-soft_75_e71d1d_1x100.png new file mode 100644 index 0000000..8839a8b Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-bg_highlight-soft_75_e71d1d_1x100.png differ diff --git a/TestApp/themes/my_thmere/images/ui-bg_inset-soft_95_fef1ec_1x100.png b/TestApp/themes/my_thmere/images/ui-bg_inset-soft_95_fef1ec_1x100.png new file mode 100644 index 0000000..0e05810 Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-bg_inset-soft_95_fef1ec_1x100.png differ diff --git a/TestApp/themes/my_thmere/images/ui-icons_222222_256x240.png b/TestApp/themes/my_thmere/images/ui-icons_222222_256x240.png new file mode 100644 index 0000000..ee039dc Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-icons_222222_256x240.png differ diff --git a/TestApp/themes/my_thmere/images/ui-icons_2e83ff_256x240.png b/TestApp/themes/my_thmere/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000..45e8928 Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-icons_2e83ff_256x240.png differ diff --git a/TestApp/themes/my_thmere/images/ui-icons_454545_256x240.png b/TestApp/themes/my_thmere/images/ui-icons_454545_256x240.png new file mode 100644 index 0000000..7ec70d1 Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-icons_454545_256x240.png differ diff --git a/TestApp/themes/my_thmere/images/ui-icons_888888_256x240.png b/TestApp/themes/my_thmere/images/ui-icons_888888_256x240.png new file mode 100644 index 0000000..5ba708c Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-icons_888888_256x240.png differ diff --git a/TestApp/themes/my_thmere/images/ui-icons_cd0a0a_256x240.png b/TestApp/themes/my_thmere/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000..7930a55 Binary files /dev/null and b/TestApp/themes/my_thmere/images/ui-icons_cd0a0a_256x240.png differ diff --git a/TestApp/themes/my_thmere/jquery-ui-1.8rc3.custom.css b/TestApp/themes/my_thmere/jquery-ui-1.8rc3.custom.css new file mode 100644 index 0000000..054dfad --- /dev/null +++ b/TestApp/themes/my_thmere/jquery-ui-1.8rc3.custom.css @@ -0,0 +1,479 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* +* jQuery UI CSS Framework +* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=new%20roman&fwDefault=normal&fsDefault=1.1em&cornerRadius=11px&bgColorHeader=e71d1d&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=1c51ce&bgTextureContent=21_glow_ball.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=0fdb22&bgTextureHover=10_dots_medium.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=e0ef34&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=05_inset_soft.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +*/ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: new roman; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: new roman; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #1c51ce url(images/ui-bg_glow-ball_75_1c51ce_600x600.png) 50% 35% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #e71d1d url(images/ui-bg_highlight-soft_75_e71d1d_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999; background: #0fdb22 url(images/ui-bg_dots-medium_75_0fdb22_4x4.png) 50% 50% repeat; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1; background: #e0ef34 url(images/ui-bg_glass_55_e0ef34_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_inset-soft_95_fef1ec_1x100.png) 50% bottom repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 11px; -webkit-border-top-left-radius: 11px; border-top-left-radius: 11px; } +.ui-corner-tr { -moz-border-radius-topright: 11px; -webkit-border-top-right-radius: 11px; border-top-right-radius: 11px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 11px; -webkit-border-bottom-left-radius: 11px; border-bottom-left-radius: 11px; } +.ui-corner-br { -moz-border-radius-bottomright: 11px; -webkit-border-bottom-right-radius: 11px; border-bottom-right-radius: 11px; } +.ui-corner-top { -moz-border-radius-topleft: 11px; -webkit-border-top-left-radius: 11px; border-top-left-radius: 11px; -moz-border-radius-topright: 11px; -webkit-border-top-right-radius: 11px; border-top-right-radius: 11px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 11px; -webkit-border-bottom-left-radius: 11px; border-bottom-left-radius: 11px; -moz-border-radius-bottomright: 11px; -webkit-border-bottom-right-radius: 11px; border-bottom-right-radius: 11px; } +.ui-corner-right { -moz-border-radius-topright: 11px; -webkit-border-top-right-radius: 11px; border-top-right-radius: 11px; -moz-border-radius-bottomright: 11px; -webkit-border-bottom-right-radius: 11px; border-bottom-right-radius: 11px; } +.ui-corner-left { -moz-border-radius-topleft: 11px; -webkit-border-top-left-radius: 11px; border-top-left-radius: 11px; -moz-border-radius-bottomleft: 11px; -webkit-border-bottom-left-radius: 11px; border-bottom-left-radius: 11px; } +.ui-corner-all { -moz-border-radius: 11px; -webkit-border-radius: 11px; border-radius: 11px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* Resizable +----------------------------------*/ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Accordion +----------------------------------*/ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; }/* Autocomplete +----------------------------------*/ +.ui-autocomplete { position: absolute; cursor: default; } +.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* Menu +----------------------------------*/ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + margin: -1px; +} +/* Button +----------------------------------*/ + +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3em; } +button.ui-button-icons-only { width: 3.2em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 1.8em; } +.ui-button-text-icons .ui-button-text { padding-right: 1.8em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon .ui-icon-primary, .ui-button-text-icons .ui-icon-primary, .ui-button-icons-only .ui-icon-primary { left: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-button-set { margin-right: 7px; } +.ui-button-set .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ + + + + + +/* Dialog +----------------------------------*/ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* Slider +----------------------------------*/ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs +----------------------------------*/ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* Datepicker +----------------------------------*/ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* Progressbar +----------------------------------*/ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/TestApp/themes/my_thmere/jquery.ui.accordion.css b/TestApp/themes/my_thmere/jquery.ui.accordion.css new file mode 100644 index 0000000..acd7f5e --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.accordion.css @@ -0,0 +1,10 @@ +/* Accordion +----------------------------------*/ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } \ No newline at end of file diff --git a/TestApp/themes/my_thmere/jquery.ui.all.css b/TestApp/themes/my_thmere/jquery.ui.all.css new file mode 100644 index 0000000..6ee0fdf --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.all.css @@ -0,0 +1,2 @@ +@import "jquery.ui.base.css"; +@import "jquery.ui.theme.css"; diff --git a/TestApp/themes/my_thmere/jquery.ui.autocomplete.css b/TestApp/themes/my_thmere/jquery.ui.autocomplete.css new file mode 100644 index 0000000..ebb59c5 --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.autocomplete.css @@ -0,0 +1,34 @@ +/* Autocomplete +----------------------------------*/ +.ui-autocomplete { position: absolute; cursor: default; } +.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* Menu +----------------------------------*/ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + margin: -1px; +} diff --git a/TestApp/themes/my_thmere/jquery.ui.base.css b/TestApp/themes/my_thmere/jquery.ui.base.css new file mode 100644 index 0000000..4011708 --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.base.css @@ -0,0 +1,10 @@ +@import url("jquery.ui.core.css"); +@import url("jquery.ui.resizable.css"); +@import url("jquery.ui.accordion.css"); +@import url("jquery.ui.autocomplete.css"); +@import url("jquery.ui.button.css"); +@import url("jquery.ui.dialog.css"); +@import url("jquery.ui.slider.css"); +@import url("jquery.ui.tabs.css"); +@import url("jquery.ui.datepicker.css"); +@import url("jquery.ui.progressbar.css"); \ No newline at end of file diff --git a/TestApp/themes/my_thmere/jquery.ui.button.css b/TestApp/themes/my_thmere/jquery.ui.button.css new file mode 100644 index 0000000..1bf48a9 --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.button.css @@ -0,0 +1,35 @@ +/* Button +----------------------------------*/ + +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3em; } +button.ui-button-icons-only { width: 3.2em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 1.8em; } +.ui-button-text-icons .ui-button-text { padding-right: 1.8em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon .ui-icon-primary, .ui-button-text-icons .ui-icon-primary, .ui-button-icons-only .ui-icon-primary { left: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-button-set { margin-right: 7px; } +.ui-button-set .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ + + + + + diff --git a/TestApp/themes/my_thmere/jquery.ui.core.css b/TestApp/themes/my_thmere/jquery.ui.core.css new file mode 100644 index 0000000..b3e8193 --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.core.css @@ -0,0 +1,37 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } diff --git a/TestApp/themes/my_thmere/jquery.ui.datepicker.css b/TestApp/themes/my_thmere/jquery.ui.datepicker.css new file mode 100644 index 0000000..a1116e6 --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.datepicker.css @@ -0,0 +1,61 @@ +/* Datepicker +----------------------------------*/ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +} \ No newline at end of file diff --git a/TestApp/themes/my_thmere/jquery.ui.dialog.css b/TestApp/themes/my_thmere/jquery.ui.dialog.css new file mode 100644 index 0000000..29c4dde --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.dialog.css @@ -0,0 +1,13 @@ +/* Dialog +----------------------------------*/ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } diff --git a/TestApp/themes/my_thmere/jquery.ui.progressbar.css b/TestApp/themes/my_thmere/jquery.ui.progressbar.css new file mode 100644 index 0000000..bc0939e --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.progressbar.css @@ -0,0 +1,4 @@ +/* Progressbar +----------------------------------*/ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/TestApp/themes/my_thmere/jquery.ui.resizable.css b/TestApp/themes/my_thmere/jquery.ui.resizable.css new file mode 100644 index 0000000..366643b --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.resizable.css @@ -0,0 +1,13 @@ +/* Resizable +----------------------------------*/ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file diff --git a/TestApp/themes/my_thmere/jquery.ui.slider.css b/TestApp/themes/my_thmere/jquery.ui.slider.css new file mode 100644 index 0000000..07c6f4e --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.slider.css @@ -0,0 +1,17 @@ +/* Slider +----------------------------------*/ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } \ No newline at end of file diff --git a/TestApp/themes/my_thmere/jquery.ui.tabs.css b/TestApp/themes/my_thmere/jquery.ui.tabs.css new file mode 100644 index 0000000..729758f --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.tabs.css @@ -0,0 +1,11 @@ +/* Tabs +----------------------------------*/ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/TestApp/themes/my_thmere/jquery.ui.theme.css b/TestApp/themes/my_thmere/jquery.ui.theme.css new file mode 100644 index 0000000..46221fd --- /dev/null +++ b/TestApp/themes/my_thmere/jquery.ui.theme.css @@ -0,0 +1,249 @@ + + +/* +* jQuery UI CSS Framework +* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=new%20roman&fwDefault=normal&fsDefault=1.1em&cornerRadius=11px&bgColorHeader=e71d1d&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=1c51ce&bgTextureContent=21_glow_ball.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=0fdb22&bgTextureHover=10_dots_medium.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=e0ef34&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=05_inset_soft.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px +*/ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: new roman; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: new roman; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #1c51ce url(images/ui-bg_glow-ball_75_1c51ce_600x600.png) 50% 35% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #e71d1d url(images/ui-bg_highlight-soft_75_e71d1d_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #999999; background: #0fdb22 url(images/ui-bg_dots-medium_75_0fdb22_4x4.png) 50% 50% repeat; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1; background: #e0ef34 url(images/ui-bg_glass_55_e0ef34_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_inset-soft_95_fef1ec_1x100.png) 50% bottom repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 11px; -webkit-border-top-left-radius: 11px; border-top-left-radius: 11px; } +.ui-corner-tr { -moz-border-radius-topright: 11px; -webkit-border-top-right-radius: 11px; border-top-right-radius: 11px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 11px; -webkit-border-bottom-left-radius: 11px; border-bottom-left-radius: 11px; } +.ui-corner-br { -moz-border-radius-bottomright: 11px; -webkit-border-bottom-right-radius: 11px; border-bottom-right-radius: 11px; } +.ui-corner-top { -moz-border-radius-topleft: 11px; -webkit-border-top-left-radius: 11px; border-top-left-radius: 11px; -moz-border-radius-topright: 11px; -webkit-border-top-right-radius: 11px; border-top-right-radius: 11px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 11px; -webkit-border-bottom-left-radius: 11px; border-bottom-left-radius: 11px; -moz-border-radius-bottomright: 11px; -webkit-border-bottom-right-radius: 11px; border-bottom-right-radius: 11px; } +.ui-corner-right { -moz-border-radius-topright: 11px; -webkit-border-top-right-radius: 11px; border-top-right-radius: 11px; -moz-border-radius-bottomright: 11px; -webkit-border-bottom-right-radius: 11px; border-bottom-right-radius: 11px; } +.ui-corner-left { -moz-border-radius-topleft: 11px; -webkit-border-top-left-radius: 11px; border-top-left-radius: 11px; -moz-border-radius-bottomleft: 11px; -webkit-border-bottom-left-radius: 11px; border-bottom-left-radius: 11px; } +.ui-corner-all { -moz-border-radius: 11px; -webkit-border-radius: 11px; border-radius: 11px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; } \ No newline at end of file diff --git a/TestApp/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/TestApp/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png new file mode 100644 index 0000000..954e22d Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/TestApp/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png new file mode 100644 index 0000000..64ece57 Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/TestApp/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png new file mode 100644 index 0000000..abdc010 Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/TestApp/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png new file mode 100644 index 0000000..9b383f4 Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/TestApp/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png new file mode 100644 index 0000000..a23baad Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/TestApp/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000..42ccba2 Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/TestApp/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png new file mode 100644 index 0000000..39d5824 Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/TestApp/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png new file mode 100644 index 0000000..f127367 Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/TestApp/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png new file mode 100644 index 0000000..359397a Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-icons_222222_256x240.png b/TestApp/themes/ui-lightness/images/ui-icons_222222_256x240.png new file mode 100644 index 0000000..ee039dc Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-icons_222222_256x240.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-icons_228ef1_256x240.png b/TestApp/themes/ui-lightness/images/ui-icons_228ef1_256x240.png new file mode 100644 index 0000000..10e3631 Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-icons_228ef1_256x240.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png b/TestApp/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png new file mode 100644 index 0000000..35bb8ef Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png b/TestApp/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png new file mode 100644 index 0000000..baebb63 Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png differ diff --git a/TestApp/themes/ui-lightness/images/ui-icons_ffffff_256x240.png b/TestApp/themes/ui-lightness/images/ui-icons_ffffff_256x240.png new file mode 100644 index 0000000..bef5178 Binary files /dev/null and b/TestApp/themes/ui-lightness/images/ui-icons_ffffff_256x240.png differ diff --git a/TestApp/themes/ui-lightness/jquery-ui-1.7.2.custom.css b/TestApp/themes/ui-lightness/jquery-ui-1.7.2.custom.css new file mode 100644 index 0000000..9d7aa08 --- /dev/null +++ b/TestApp/themes/ui-lightness/jquery-ui-1.7.2.custom.css @@ -0,0 +1,406 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + + +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px +*/ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } +.ui-widget-content a { color: #333333; } +.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } +.ui-widget-header a { color: #ffffff; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; outline: none; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; outline: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; outline: none; } +.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; outline: none; } +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; outline: none; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; outline: none; text-decoration: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } +.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; }/* Accordion +----------------------------------*/ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } +.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker +----------------------------------*/ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* Dialog +----------------------------------*/ +.ui-dialog { position: relative; padding: .2em; width: 300px; } +.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* Progressbar +----------------------------------*/ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable +----------------------------------*/ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider +----------------------------------*/ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs +----------------------------------*/ +.ui-tabs { padding: .2em; zoom: 1; } +.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } +.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/TestApp/themes/ui-lightness/ui.accordion.css b/TestApp/themes/ui-lightness/ui.accordion.css new file mode 100644 index 0000000..ee1b1b6 --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.accordion.css @@ -0,0 +1,9 @@ +/* Accordion +----------------------------------*/ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } +.ui-accordion .ui-accordion-content-active { display: block; } \ No newline at end of file diff --git a/TestApp/themes/ui-lightness/ui.all.css b/TestApp/themes/ui-lightness/ui.all.css new file mode 100644 index 0000000..543e4c3 --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.all.css @@ -0,0 +1,2 @@ +@import "ui.base.css"; +@import "ui.theme.css"; diff --git a/TestApp/themes/ui-lightness/ui.base.css b/TestApp/themes/ui-lightness/ui.base.css new file mode 100644 index 0000000..d716095 --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.base.css @@ -0,0 +1,8 @@ +@import url("ui.core.css"); +@import url("ui.resizable.css"); +@import url("ui.accordion.css"); +@import url("ui.dialog.css"); +@import url("ui.slider.css"); +@import url("ui.tabs.css"); +@import url("ui.datepicker.css"); +@import url("ui.progressbar.css"); \ No newline at end of file diff --git a/TestApp/themes/ui-lightness/ui.core.css b/TestApp/themes/ui-lightness/ui.core.css new file mode 100644 index 0000000..c2f18f2 --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.core.css @@ -0,0 +1,37 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } \ No newline at end of file diff --git a/TestApp/themes/ui-lightness/ui.datepicker.css b/TestApp/themes/ui-lightness/ui.datepicker.css new file mode 100644 index 0000000..567f8c9 --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.datepicker.css @@ -0,0 +1,62 @@ +/* Datepicker +----------------------------------*/ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +} \ No newline at end of file diff --git a/TestApp/themes/ui-lightness/ui.dialog.css b/TestApp/themes/ui-lightness/ui.dialog.css new file mode 100644 index 0000000..2997595 --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.dialog.css @@ -0,0 +1,13 @@ +/* Dialog +----------------------------------*/ +.ui-dialog { position: relative; padding: .2em; width: 300px; } +.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } diff --git a/TestApp/themes/ui-lightness/ui.progressbar.css b/TestApp/themes/ui-lightness/ui.progressbar.css new file mode 100644 index 0000000..bc0939e --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.progressbar.css @@ -0,0 +1,4 @@ +/* Progressbar +----------------------------------*/ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/TestApp/themes/ui-lightness/ui.resizable.css b/TestApp/themes/ui-lightness/ui.resizable.css new file mode 100644 index 0000000..44efeb2 --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.resizable.css @@ -0,0 +1,13 @@ +/* Resizable +----------------------------------*/ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file diff --git a/TestApp/themes/ui-lightness/ui.slider.css b/TestApp/themes/ui-lightness/ui.slider.css new file mode 100644 index 0000000..4c56218 --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.slider.css @@ -0,0 +1,17 @@ +/* Slider +----------------------------------*/ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } \ No newline at end of file diff --git a/TestApp/themes/ui-lightness/ui.tabs.css b/TestApp/themes/ui-lightness/ui.tabs.css new file mode 100644 index 0000000..3ca6b9a --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.tabs.css @@ -0,0 +1,11 @@ +/* Tabs +----------------------------------*/ +.ui-tabs { padding: .2em; zoom: 1; } +.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } +.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/TestApp/themes/ui-lightness/ui.theme.css b/TestApp/themes/ui-lightness/ui.theme.css new file mode 100644 index 0000000..7dfd141 --- /dev/null +++ b/TestApp/themes/ui-lightness/ui.theme.css @@ -0,0 +1,247 @@ + + + + +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px +*/ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } +.ui-widget-content a { color: #333333; } +.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } +.ui-widget-header a { color: #ffffff; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; outline: none; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; outline: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; outline: none; } +.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; outline: none; } +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; outline: none; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; outline: none; text-decoration: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } +.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; } \ No newline at end of file
sila/AtomProject
43c12863a729385c850432468c7032383d7a9182
aditional information
diff --git a/Doc.txt b/Doc.txt new file mode 100644 index 0000000..9424259 --- /dev/null +++ b/Doc.txt @@ -0,0 +1,22 @@ +Accordion tag structure + +<Accordion> + <Item> + <Header Text="Text" TargetURL="google.com"/> + <Template> + //content + </Template> + </Item> + <Item> + <Header/> + <Template> + //content + </Template> + </Item> +</Accordion> + +++++++++++++++++++++++ +Desinger + + -Smart tag + 1) add new item \ No newline at end of file diff --git a/EventsNotes.txt b/EventsNotes.txt new file mode 100644 index 0000000..31f6ffe --- /dev/null +++ b/EventsNotes.txt @@ -0,0 +1,230 @@ +This is sample server control that illustrate server event handlering: + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace EventControl +{ + [DefaultProperty("Text")] + [ToolboxData("<{0}:EventControl runat=server></{0}:EventControl>")] + public class EventControl : WebControl, IPostBackEventHandler + { + protected override void RenderContents(HtmlTextWriter writer) + { + writer.AddAttribute(HtmlTextWriterAttribute.Style, "width:100px; height:100px; background-color:Red;"); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID + "_Red"); + + writer.RenderBeginTag(HtmlTextWriterTag.Div); + writer.RenderEndTag(); + + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID + "_Blue"); + writer.AddAttribute(HtmlTextWriterAttribute.Style, "width:100px; height:100px; background-color:Blue; "); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + writer.RenderEndTag(); + + writer.AddAttribute(HtmlTextWriterAttribute.Style, "width:100px; height:100px; text-align: center; background-color:Yellow; "); + writer.AddAttribute(HtmlTextWriterAttribute.Id, "Hover"); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + writer.Write("HOVER"); + writer.RenderEndTag(); + + base.RenderContents(writer); + + } + + private string clientPostBackScript; + private string clientPostBackHyperlink; + + private static readonly object EventClickRed = new object(); + private static readonly object EventClickBlue = new object(); + private static readonly object EventMouseHoverIn = new object(); + private static readonly object EventMouseHoverOut = new object(); + + public event EventHandler ClickRed + { + add + { + Events.AddHandler(EventClickRed, value); + } + remove + { + Events.RemoveHandler(EventClickRed, value); + } + } + public event EventHandler ClickBlue + { + add + { + Events.AddHandler(EventClickBlue, value); + } + remove + { + Events.RemoveHandler(EventClickBlue, value); + } + } + public event EventHandler MouseHoverIn + { + add + { + Events.AddHandler(EventMouseHoverIn, value); + } + remove + { + Events.RemoveHandler(EventMouseHoverIn, value); + } + } + public event EventHandler MouseHoverOut + { + add + { + Events.AddHandler(EventMouseHoverOut, value); + } + remove + { + Events.RemoveHandler(EventMouseHoverOut, value); + } + } + + [Category("Action")] + protected virtual void OnClickRed(EventArgs e) + { + EventHandler clickRedHandler = (EventHandler)Events[EventClickRed]; + if (clickRedHandler != null) + { + clickRedHandler(this, e); + } + } + [Category("Action")] + protected virtual void OnClickBlue(EventArgs e) + { + EventHandler clickBlueHandler = (EventHandler)Events[EventClickBlue]; + if (clickBlueHandler != null) + { + clickBlueHandler(this, e); + } + } + [Category("Action")] + protected virtual void OnMouseHoverIn(EventArgs e) + { + EventHandler eventHandler = (EventHandler)Events[EventMouseHoverIn]; + if (eventHandler != null) + { + eventHandler(this, e); + } + + } + [Category("Action")] + protected virtual void OnMouseHoverOut(EventArgs e) + { + EventHandler eventHandler = (EventHandler)Events[EventMouseHoverOut]; + if (eventHandler != null) + { + eventHandler(this, e); + } + } + + protected override void OnPreRender(EventArgs e) + { + clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); + clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); + base.OnPreRender(e); + + } + + + + public void RaisePostBackEvent(string eventArgument) + { + + if (eventArgument == "OnClickRed") + { + this.OnClickRed(EventArgs.Empty); + } + if (eventArgument == "OnClickBlue") + { + this.OnClickBlue(EventArgs.Empty); + } + if (eventArgument == "OnMouseHoverIn") + { + this.OnMouseHoverIn(EventArgs.Empty); + } + if (eventArgument == "OnMouseHoverOut") + { + this.OnMouseHoverOut(EventArgs.Empty); + } + } + } + +} +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +Test app +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + + +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> + +<%@ Register Assembly="ServerControl2" Namespace="EventControl" TagPrefix="cc1" %> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head runat="server"> + <title>Untitled Page</title> + + <script src="jquery-1.3.2.js" type="text/javascript"></script> + + <script src="jquery-1.3.2-vsdoc.js" type="text/javascript"></script> + + <script type="text/javascript"> + $(document).ready(function Fn() + { + $("#" + "<%=EventControl1.ClientID%>" + "_Red").click(function Red() + { + + //alert("Red"); + __doPostBack("EventControl1", "OnClickRed"); + }) + + $("#" + "<%=EventControl1.ClientID%>" + "_Blue").click(function Blue() + { + //alert("Blue"); + __doPostBack("EventControl1", "OnClickBlue"); + + }) + $("#Hover").hover(function Hover() + { + __doPostBack("EventControl1", "OnMouseHoverIn"); + // debugger + }, + function Out() + { + __doPostBack("EventControl1", "OnMouseHoverOut"); + // debugger + }) + }); + + + </script> + +</head> +<body> + <form id="form1" runat="server"> + <div> + <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label><br /> + <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label><br /> + <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label><br /> + <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br /> + <cc1:EventControl ID="EventControl1" runat="server" OnClickBlue="EventControl1_ClickBlue" + OnClickRed="EventControl1_ClickRed" OnMouseHoverIn="EventControl1_MouseHoverIn" + OnMouseHoverOut="EventControl1_MouseHoverOut" /> + </div> + </form> +</body> +</html> + + diff --git a/TempNotes.txt b/TempNotes.txt new file mode 100644 index 0000000..aa94be2 --- /dev/null +++ b/TempNotes.txt @@ -0,0 +1,156 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.ComponentModel.Design; +using System.Drawing.Design; +using System.Collections; +using System.Security.Permissions; +using System.Web.UI.Design; + + +namespace TemplateControls +{ + [AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), DefaultProperty("Contacts"), ParseChildren(true, "Contacts"), ToolboxData( + "<{0}:QuickContacts runat=\"server\"> </{0}:QuickContacts>")] + public class QuickContacts : WebControl + { + private List<Contact> contactsList; + + [ + Category("Behavior"), + Description("The contacts collection"), + DesignerSerializationVisibility( + DesignerSerializationVisibility.Content), + Editor(typeof(ContactCollectionEditor), typeof(UITypeEditor)), + PersistenceMode(PersistenceMode.InnerDefaultProperty) + ] + public List<Contact> Contacts + { + get + { + if (contactsList == null) + { + contactsList = new List<Contact>(); + } + return contactsList; + } + } + + protected override void RenderContents( + HtmlTextWriter writer) + { + writer.Write("<table border=1><tr><td>"); + foreach (Contact item in this.contactsList) + { + writer.Write(item.Name); + foreach (Control cont in item.Controls) + { + writer.Write("<table border=1><tr><td>"); + cont.RenderControl(writer); + writer.Write("</td></tr></table>"); + } + + } + writer.Write("</td></tr></table>"); + } + + } + [ToolboxItem(false)] + public class Contact : Control, INamingContainer + { + private string nameValue; + private ITemplate pSimpleTemplate; + + [ + Browsable(false), + DesignerSerializationVisibility( + DesignerSerializationVisibility.Content), + PersistenceMode(PersistenceMode.InnerProperty) + ] + public ITemplate SimpleTemplate + { + get { return pSimpleTemplate; } + set { pSimpleTemplate = value; } + } + protected override void CreateChildControls() + { + Controls.Clear(); + + if (SimpleTemplate != null) + SimpleTemplate.InstantiateIn(this); + } + + + //public Contact() + // : this(String.Empty) + //{ + //} + + //public Contact(string name) + //{ + // nameValue = name; + //} + + [ + Category("Behavior"), + DefaultValue(""), + Description("Name of contact"), + NotifyParentProperty(true), + ] + public String Name + { + get + { + return nameValue; + } + set + { + nameValue = value; + } + } + + + } + public class ContactCollectionEditor : CollectionEditor + { + public ContactCollectionEditor(Type type) + : base(type) + { + } + + protected override bool CanSelectMultipleInstances() + { + return false; + } + + protected override Type CreateCollectionItemType() + { + return typeof(Contact); + } + } + + + +} + + + + + + + + + + + + + + + + +
sila/AtomProject
9d39391f7746fd9222649987b8d1499da4eea91b
assebmly info
diff --git a/Atom.Web/Properties/AssemblyInfo.cs b/Atom.Web/Properties/AssemblyInfo.cs index f359bd8..b20af0d 100644 --- a/Atom.Web/Properties/AssemblyInfo.cs +++ b/Atom.Web/Properties/AssemblyInfo.cs @@ -1,36 +1,43 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Web.UI; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Atom.Web")] +[assembly: TagPrefix("Atom.Web.UI.WebControls", "atom")] +[assembly: TagPrefix("Atom.Web.UI.WebControls.Accordion", "accordion")] +[assembly: TagPrefix("Atom.Web.UI.WebControls.Progressbar", "progressbar")] +[assembly: TagPrefix("Atom.Web.UI.WebControls.Tabs", "tabs")] +[assembly: TagPrefix("Atom.Web.UI.WebControls.Dialog", "dialog")] +[assembly: TagPrefix("Atom.Web.UI.WebControls.Button", "button")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Atom.Web")] [assembly: AssemblyCopyright("Copyright © 2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("4312a669-223e-4bf6-8c8d-c31acb3c5a1f")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
sila/AtomProject
257ad2efed70049d59ffa203057ae91bfd9f53d8
add datepicer
diff --git a/Atom.Web/DatePicker/JQDataPicker.cs b/Atom.Web/DatePicker/JQDataPicker.cs new file mode 100644 index 0000000..7c5ecc5 --- /dev/null +++ b/Atom.Web/DatePicker/JQDataPicker.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.DatePicker +{ + public class JQDataPicker + { + } +}
sila/AtomProject
7f887e95b0cdcc267ef336de7b6cd6bf62d90a95
add autocomplete
diff --git a/Atom.Web/AutoComplete/JQAutoComplete.cs b/Atom.Web/AutoComplete/JQAutoComplete.cs new file mode 100644 index 0000000..5be7392 --- /dev/null +++ b/Atom.Web/AutoComplete/JQAutoComplete.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.AutoComplete +{ + public class JQAutoComplete + { + } +}
sila/AtomProject
719b2e67d1470512a7c7e3bc4ae681759d10fc3d
add button
diff --git a/Atom.Web/Button/ButtonType.cs b/Atom.Web/Button/ButtonType.cs new file mode 100644 index 0000000..0b9c859 --- /dev/null +++ b/Atom.Web/Button/ButtonType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Button +{ + public enum ButtonType + { + Button, + Radio, + Checkbox, + Split, + } +} diff --git a/Atom.Web/Button/JQButton.cs b/Atom.Web/Button/JQButton.cs new file mode 100644 index 0000000..ff07631 --- /dev/null +++ b/Atom.Web/Button/JQButton.cs @@ -0,0 +1,480 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Security.Permissions; +using System.ComponentModel; +using System.Web.UI; +using System.Web.UI.WebControls; +using Atom.Web.UI.WebControls.Button.Desing; + +namespace Atom.Web.UI.WebControls.Button +{ + [ + AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + DefaultProperty(""), + Designer(typeof(ButtonDesigner)), + ToolboxData("<{0}:JQButton runat=\"server\"> </{0}:JQButton>") + ] + public class JQButton : WebControl, IButtonControl, IPostBackEventHandler + { + //MS convention: + //Fields + //Events + //Methods + //Properties + + //Fields + private static readonly object EventClick = new object(); + + //Events + protected override void OnPreRender(EventArgs e) + { + string clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); + string clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); + + Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); + + base.OnPreRender(e); + } + protected virtual void OnClick(EventArgs e) + { + EventHandler clickEvent = (EventHandler)Events[EventClick]; + if (clickEvent != null) + { + clickEvent(this, e); + } + } + + //Methods + //clear span tag + protected override void Render(HtmlTextWriter writer) + { + this.RenderContents(writer); + } + + protected override void RenderContents(HtmlTextWriter writer) + { + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "button"); + writer.RenderBeginTag(HtmlTextWriterTag.A); + writer.RenderEndTag(); + + base.RenderContents(writer); + } + private string RenderStartupJavaScript() + { + StringBuilder startupScript = new StringBuilder(); + + startupScript.AppendFormat("<script type=\"text/javascript\">"); + startupScript.AppendFormat("$(document).ready(function() {{ "); + startupScript.AppendFormat("var button" + this.UniqueID + " = $('#" + this.UniqueID + "button');"); + startupScript.AppendFormat("button" + this.UniqueID + ".button({{"); + + //Default:false + if (this.TextVisible) + { + startupScript.AppendFormat("text: {0},", this.TextVisible.ToString().ToLower()); + } + + startupScript.AppendFormat("label: '{0}',", this.Text); + startupScript.AppendFormat("}}) "); + + if (Events[EventClick] != null) + { + startupScript.AppendFormat(".click(function(){{ " + Page.GetPostBackEventReference(this, "click") + "}})"); + } + else + { + startupScript.AppendFormat("; "); + + } + + //Default:true + if (!this.Enabled) + { + startupScript.AppendFormat("button" + this.UniqueID + ".button('disable');"); + } + + startupScript.AppendFormat("}})"); + startupScript.AppendFormat("</script>"); + + return startupScript.ToString(); + } + public event EventHandler Click + { + add + { + Events.AddHandler(EventClick, value); + } + remove + { + Events.RemoveHandler(EventClick, value); + } + } + public void RaisePostBackEvent(string eventArgument) + { + this.OnClick(EventArgs.Empty); + } + void IPostBackEventHandler.RaisePostBackEvent(string eventArgument) + { + this.RaisePostBackEvent(eventArgument); + } + + + //Properties + //icons url properties + [ + Category("Behavior"), + Description(""), + DefaultValue(ButtonType.Button) + ] + public ButtonType ButtonTypes + { + get + { + object buttonTypeVisibleValue = ViewState["ButtonTypeViewState"]; + return (buttonTypeVisibleValue == null) ? ButtonType.Button : (ButtonType)buttonTypeVisibleValue; + } + set + { + ViewState["ButtonTypeViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + DefaultValue(true) + ] + public bool TextVisible + { + get + { + object textVisibleValue = ViewState["TextVisibleViewState"]; + return (textVisibleValue == null) ? true : (bool)textVisibleValue; + } + set + { + ViewState["TextVisibleViewState"] = value; + } + } + [ + Category("Behavior"), + Description(""), + DefaultValue("") + ] + public string Text + { + get + { + object textValue = ViewState["TextViewState"]; + return (textValue == null) ? string.Empty : (string)textValue; + } + set + { + ViewState["TextViewState"] = value; + } + } + + #region inherit properties visibility + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string CssClass + { + get + { + return base.CssClass; + } + set + { + base.CssClass = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BackColor + { + get + { + return base.BackColor; + } + set + { + base.BackColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override BorderStyle BorderStyle + { + get + { + return base.BorderStyle; + } + set + { + base.BorderStyle = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override Unit BorderWidth + { + get + { + return base.BorderWidth; + } + set + { + base.BorderWidth = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BorderColor + { + get + { + return base.BorderColor; + } + set + { + base.BorderColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override FontInfo Font + { + get + { + return base.Font; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override bool EnableTheming + { + get + { + return base.EnableTheming; + } + set + { + base.EnableTheming = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string ToolTip + { + get + { + return base.ToolTip; + } + set + { + base.ToolTip = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string SkinID + { + get + { + return base.SkinID; + } + set + { + base.SkinID = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color ForeColor + { + get + { + return base.ForeColor; + } + set + { + base.ForeColor = value; + } + } + #endregion + + #region IButtonControl Members + + public bool CausesValidation + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public event CommandEventHandler Command; + + public string CommandArgument + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public string CommandName + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public string PostBackUrl + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + public string ValidationGroup + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + bool IButtonControl.CausesValidation + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + event EventHandler IButtonControl.Click + { + add { throw new NotImplementedException(); } + remove { throw new NotImplementedException(); } + } + + event CommandEventHandler IButtonControl.Command + { + add { throw new NotImplementedException(); } + remove { throw new NotImplementedException(); } + } + + string IButtonControl.CommandArgument + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + string IButtonControl.CommandName + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + string IButtonControl.PostBackUrl + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + string IButtonControl.Text + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + string IButtonControl.ValidationGroup + { + get + { + throw new NotImplementedException(); + } + set + { + throw new NotImplementedException(); + } + } + + #endregion + } +} \ No newline at end of file
sila/AtomProject
ca749c751e6020eda404085601e90c99cd2c5765
add progresbar
diff --git a/Atom.Web/Progressbar/Design/ProgressbarDesigner.cs b/Atom.Web/Progressbar/Design/ProgressbarDesigner.cs new file mode 100644 index 0000000..1127355 --- /dev/null +++ b/Atom.Web/Progressbar/Design/ProgressbarDesigner.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI.Design; +using System.ComponentModel.Design; +using System.ComponentModel; + +namespace Atom.Web.UI.WebControls.Progressbar +{ + public class ProgressbarDesigner : ControlDesigner + { + private DesignerActionListCollection _actionList = null; + + public override DesignerActionListCollection ActionLists + { + get + { + if (this._actionList == null) + { + this._actionList = new DesignerActionListCollection(); + this._actionList.AddRange(base.ActionLists); + this._actionList.Add(new ActionList(this)); + } + return this._actionList; + } + } + public override string GetDesignTimeHtml() + { + return base.CreatePlaceHolderDesignTimeHtml(); + } + + } + + public class ActionList : DesignerActionList + { + private ProgressbarDesigner _parent; + private DesignerActionItemCollection _items; + + public ActionList(ProgressbarDesigner parent) + : base(parent.Component) + { + this._parent = parent; + } + + public override DesignerActionItemCollection GetSortedActionItems() + { + if (this._items == null) + { + this._items = new DesignerActionItemCollection(); + + this._items.Add(new DesignerActionPropertyItem("Value", "Value", "")); + this._items.Add(new DesignerActionPropertyItem("Resizable", "Resizable", "")); + + //this._items.Add(new DesignerActionMethodItem(this, "Value", "Value", true)); + //this._items.Add(new DesignerActionMethodItem(this, "Resizable", "Resizable", true)); + //_items.Add(new DesignerActionTextItem("TextItem", "")); + // this._items.Add(new DesignerActionPropertyItem("Resizable", "Resizable1")); + //this._items.Add(new DesignerActionTextItem("Value", "Value")); + } + return this._items; + } + public bool Resizable + { + get + { + JQProgressbar progressbar = (JQProgressbar)_parent.Component; + + return progressbar.Resizable; + } + set + { + JQProgressbar progressbar = (JQProgressbar)_parent.Component; + + TypeDescriptor.GetProperties(progressbar)["Resizable"].SetValue(progressbar, value); + } + } + public int Value + { + get + { + JQProgressbar progressbar = (JQProgressbar)_parent.Component; + + return progressbar.Value; + } + set + { + JQProgressbar progressbar = (JQProgressbar)_parent.Component; + + TypeDescriptor.GetProperties(progressbar)["Value"].SetValue(progressbar, value); + } + } + + //private void Resizable() + //{ + // JQProgressbar progressbar = (JQProgressbar)_parent.Component; + // PropertyDescriptor propDesc = TypeDescriptor.GetProperties(progressbar)["Resizable"]; + // bool value = (bool)propDesc.GetValue(progressbar); + // propDesc.SetValue(progressbar, !value); + //} + //private void Value() + //{ + // JQProgressbar progressbar = (JQProgressbar)_parent.Component; + // PropertyDescriptor propDesc = TypeDescriptor.GetProperties(progressbar)["Value"]; + // propDesc.SetValue(progressbar, 50); + //} + } +} diff --git a/Atom.Web/Progressbar/EventArgs/ProgressbarValueChangedEventArgs.cs b/Atom.Web/Progressbar/EventArgs/ProgressbarValueChangedEventArgs.cs new file mode 100644 index 0000000..801fa99 --- /dev/null +++ b/Atom.Web/Progressbar/EventArgs/ProgressbarValueChangedEventArgs.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Security.Permissions; + +namespace Atom.Web.UI.WebControls.Progressbar +{ + [ + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) + ] + public class ProgressbarValueChangedEventArgs : EventArgs + { + public int Value + { + get + { + return this.Progressbar.Value; + } + set + { + this.Progressbar.Value = value; + } + } + public JQProgressbar Progressbar { get; set; } + + public ProgressbarValueChangedEventArgs(int value, JQProgressbar progressbar) + { + this.Progressbar = progressbar; + this.Value = value; + } + } +} diff --git a/Atom.Web/Progressbar/JQProgressbar.cs b/Atom.Web/Progressbar/JQProgressbar.cs new file mode 100644 index 0000000..1c2e836 --- /dev/null +++ b/Atom.Web/Progressbar/JQProgressbar.cs @@ -0,0 +1,191 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Security.Permissions; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.ComponentModel; + +namespace Atom.Web.UI.WebControls.Progressbar +{ + [ + AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + Designer(typeof(ProgressbarDesigner)), + DesignerAttribute(typeof(ProgressbarDesigner)), + ToolboxData("<{0}:JQProgressbar runat=\"server\"> </{0}:JQProgressbar>") + ] + public class JQProgressbar : WebControl, IPostBackEventHandler + { + private static readonly object EventValueChanged = new object(); + + public delegate void ProgressbarValueChangedEventHandler(object sender, ProgressbarValueChangedEventArgs e); + + [ + Category("Action"), + Description("OnSelectedItemIndexChanging") + ] + public event ProgressbarValueChangedEventHandler ValueChanged + { + add + { + Events.AddHandler(EventValueChanged, value); + } + remove + { + Events.RemoveHandler(EventValueChanged, value); + } + } + + [ + Category("Action"), + Description("") + ] + protected virtual void OnValueChanged(ProgressbarValueChangedEventArgs e) + { + ProgressbarValueChangedEventHandler eventHandler = (ProgressbarValueChangedEventHandler)Events[EventValueChanged]; + if (eventHandler != null) + { + eventHandler(this, e); + } + } + protected override void OnInit(EventArgs e) + { + string hiddenValue = Page.Request.Params[this.UniqueID + "hiddenValue"]; + + if ((!string.IsNullOrEmpty(hiddenValue)) && (hiddenValue.StartsWith("progressbarValue:"))) + { + this.Value = Convert.ToInt32(hiddenValue.Split(':')[1]); + } + + base.OnInit(e); + } + + protected override void OnPreRender(EventArgs e) + { + string _clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); + string _clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); + + Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); + + base.OnPreRender(e); + } + + private string RenderStartupJavaScript() + { + StringBuilder startupScript = new StringBuilder(); + + startupScript.AppendFormat("<script type=\"text/javascript\">"); + startupScript.AppendFormat("var " + this.UniqueID + ";"); + startupScript.AppendFormat("$(document).ready(function() {{ "); + startupScript.AppendFormat("var progressbar" + this.UniqueID + " = $('#" + this.UniqueID + "progressbar'); " + this.UniqueID + "= progressbar" + this.UniqueID + ";"); + startupScript.AppendFormat("progressbar" + this.UniqueID + ".progressbar({{"); + startupScript.AppendFormat("value: parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1]), "); + //Event + startupScript.AppendFormat(" change: function(event, ui) {{ $('#" + this.UniqueID + "hiddenValue').val('progressbarValue:'+ progressbar"+this.UniqueID+".progressbar('option', 'value')); "); + if (Events[EventValueChanged] != null) + { + startupScript.AppendFormat("__doPostBack('" + this.UniqueID + "', 'selectedvaluechanged:'+ progressbar" + this.UniqueID + ".progressbar('option', 'value')); "); + } + startupScript.AppendFormat("}}, "); + startupScript.AppendFormat("}}); "); + //Resizeble + if (this.Resizable) + { + startupScript.AppendFormat("progressbar" + this.UniqueID + ".resizable();"); + } + startupScript.AppendFormat("}}); "); + + //Default:true + if (!this.Enabled) + { + startupScript.AppendFormat("progressbar" + this.UniqueID + ".progressbar('disable');"); + } + + startupScript.AppendFormat("</script>"); + + return startupScript.ToString(); + + } + + //clear span tag + protected override void Render(HtmlTextWriter writer) + { + this.RenderContents(writer); + } + + protected override void RenderContents(HtmlTextWriter writer) + { + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Value, "progressbarValue:" + this.Value.ToString()); + writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); + writer.RenderBeginTag(HtmlTextWriterTag.Input); + writer.RenderEndTag(); + + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "progressbar"); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + writer.RenderEndTag(); + + base.RenderContents(writer); + } + + public void RaisePostBackEvent(string eventArgument) + { + if (eventArgument != null) + { + if (eventArgument.StartsWith("selectedvaluechanged")) + { + string[] values = eventArgument.Split(':'); + + this.Value = Convert.ToInt32(values[1]); + + ProgressbarValueChangedEventArgs args = new ProgressbarValueChangedEventArgs(this.Value, this); + this.OnValueChanged(args); + } + } + } + + void IPostBackEventHandler.RaisePostBackEvent(string eventArgument) + { + this.RaisePostBackEvent(eventArgument); + } + [ + Category("Behavior"), + Description(""), + DefaultValue(0) + ] + public int Value + { + get + { + object progressValue = (object)ViewState["ValueViewState"]; + return (progressValue == null) ? 0 : Convert.ToInt32(progressValue); + } + set + { + ViewState["ValueViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool Resizable + { + get + { + object resizable = (object)ViewState["ResizableViewState"]; + return (resizable == null) ? false : (bool)resizable; + } + set + { + ViewState["ResizableViewState"] = value; + } + } + } +}
sila/AtomProject
bf80492c2ea1b3e7744adf4ef498c2ab5b9f0f79
add slider control
diff --git a/Atom.Web/Slider/JQSlider.cs b/Atom.Web/Slider/JQSlider.cs new file mode 100644 index 0000000..310f7b9 --- /dev/null +++ b/Atom.Web/Slider/JQSlider.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Slider +{ + public class JQSlider + { + } +}
sila/AtomProject
141c8a479b5499b2d65f0cf23e12d631227c0942
add tabs contol
diff --git a/Atom.Web/Tabs/AnimationType.cs b/Atom.Web/Tabs/AnimationType.cs new file mode 100644 index 0000000..6f7c7b2 --- /dev/null +++ b/Atom.Web/Tabs/AnimationType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Tabs +{ + public enum AnimationType + { + None, + Height, + Content, + HeightAndContent + } +} diff --git a/Atom.Web/Tabs/Design/TabsDesigner.cs b/Atom.Web/Tabs/Design/TabsDesigner.cs new file mode 100644 index 0000000..20287fa --- /dev/null +++ b/Atom.Web/Tabs/Design/TabsDesigner.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI.Design; + +namespace Atom.Web.UI.WebControls.Tabs +{ + class TabsDesigner : ControlDesigner + { + public override string GetDesignTimeHtml() + { + return base.CreatePlaceHolderDesignTimeHtml(); + } + } +} diff --git a/Atom.Web/Tabs/EventArgs/TabsChangedEventArgs.cs b/Atom.Web/Tabs/EventArgs/TabsChangedEventArgs.cs new file mode 100644 index 0000000..c9e5230 --- /dev/null +++ b/Atom.Web/Tabs/EventArgs/TabsChangedEventArgs.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Security.Permissions; + +namespace Atom.Web.UI.WebControls.Tabs +{ + [ + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) + ] + public class TabsChangedEventArgs : EventArgs + { + public int TabIndex { get; set; } + public int OldIndex { get; set; } + public Tab CurrentTab { get; set; } + public JQTabs JQTabs { get; set; } + + public TabsChangedEventArgs(int tabIndex,int oldIndex, Tab currentTab, JQTabs jqTabs) + { + this.TabIndex = tabIndex; + this.OldIndex = oldIndex; + this.CurrentTab = currentTab; + this.JQTabs = jqTabs; + } + } +} diff --git a/Atom.Web/Tabs/EventArgs/TabsChangingEventArgs.cs b/Atom.Web/Tabs/EventArgs/TabsChangingEventArgs.cs new file mode 100644 index 0000000..ac7ace2 --- /dev/null +++ b/Atom.Web/Tabs/EventArgs/TabsChangingEventArgs.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Security.Permissions; +using System.ComponentModel; + +namespace Atom.Web.UI.WebControls.Tabs +{ + [ + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) + ] + public class TabsChangingEventArgs : CancelEventArgs + { + public int NewIndex { get; set; } + public int OldIndex { get; set; } + public Tab CurrentTab { get; set; } + public JQTabs JQTabs { get; set; } + + public TabsChangingEventArgs(int newIndex, int oldIndex, Tab currentTab, JQTabs jqTabs) + { + this.NewIndex = newIndex; + this.OldIndex = oldIndex; + this.CurrentTab = currentTab; + this.JQTabs = jqTabs; + } + } +} diff --git a/Atom.Web/Tabs/EventArgs/TabsRemovedEventArgs.cs b/Atom.Web/Tabs/EventArgs/TabsRemovedEventArgs.cs new file mode 100644 index 0000000..6609635 --- /dev/null +++ b/Atom.Web/Tabs/EventArgs/TabsRemovedEventArgs.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Security.Permissions; + +namespace Atom.Web.UI.WebControls.Tabs +{ + [ + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) + ] + public class TabsRemovedEventArgs : EventArgs + { + public int TabIndex { get; set; } + public Tab CurrentTab { get; set; } + public JQTabs JQTabs { get; set; } + + public TabsRemovedEventArgs(int tabIndex, Tab currentTab, JQTabs jqTabs) + { + this.TabIndex = tabIndex; + this.CurrentTab = currentTab; + this.JQTabs = jqTabs; + } + + } +} diff --git a/Atom.Web/Tabs/EventArgs/TabsRemovingEventArgs.cs b/Atom.Web/Tabs/EventArgs/TabsRemovingEventArgs.cs new file mode 100644 index 0000000..3922d5f --- /dev/null +++ b/Atom.Web/Tabs/EventArgs/TabsRemovingEventArgs.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Security.Permissions; +using System.ComponentModel; + +namespace Atom.Web.UI.WebControls.Tabs +{ + [ + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) + ] + public class TabsRemovingEventArgs : CancelEventArgs + { + public int TabIndex { get; set; } + public Tab CurrentTab { get; set; } + public JQTabs JQTabs { get; set; } + + public TabsRemovingEventArgs(int tabIndex, Tab currentTab, JQTabs jqTabs) + { + this.TabIndex = tabIndex; + this.CurrentTab = currentTab; + this.JQTabs = jqTabs; + } + public TabsRemovingEventArgs() { } + } +} diff --git a/Atom.Web/Tabs/JqTabs.cs b/Atom.Web/Tabs/JqTabs.cs new file mode 100644 index 0000000..e4908a5 --- /dev/null +++ b/Atom.Web/Tabs/JqTabs.cs @@ -0,0 +1,896 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ComponentModel; +using System.Web.UI; +using System.Security.Permissions; +using System.Web; +using System.Web.UI.WebControls; +using System.Drawing.Design; + +namespace Atom.Web.UI.WebControls.Tabs +{ + [ + AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + DefaultProperty("Tabs"), + ParseChildren(true, "Tabs"), + Designer(typeof(TabsDesigner)), + ToolboxData("<{0}:JQTabs runat=\"server\"> </{0}:JQTabs>") + ] + public class JQTabs : WebControl, IPostBackEventHandler + { + private int _selectedIndex; + private int _selectedOldIndex; + private List<Tab> _tabsList; + + private static readonly object EventSelectedIndexChanged = new object(); + private static readonly object EventSelectedIndexChanging = new object(); + + private static readonly object EventTabRemoving = new object(); + private static readonly object EventTabRemoved = new object(); + + private static readonly object EventTabMoved = new object(); + + + public delegate void TabsChangingEventHandler(object sender, TabsChangingEventArgs e); + public delegate void TabsChangedEventHandler(object sender, TabsChangedEventArgs e); + + public delegate void TabsRemovingEventHandler(object sender, TabsRemovingEventArgs e); + public delegate void TabsRemovedEventHandler(object sender, TabsRemovedEventArgs e); + + public delegate void TabsMovedEventHandler(object sender, EventArgs e); + + + + [ + Category("Action"), + Description("OnSelectedItemIndexChanging") + ] + public event TabsChangingEventHandler SelectedIndexChanging + { + add + { + Events.AddHandler(EventSelectedIndexChanging, value); + } + remove + { + Events.RemoveHandler(EventSelectedIndexChanging, value); + } + } + [ + Category("Action"), + Description("OnSelectedItemIndexChanged") + ] + public event TabsChangedEventHandler SelectedIndexChanged + { + add + { + Events.AddHandler(EventSelectedIndexChanged, value); + } + remove + { + Events.RemoveHandler(EventSelectedIndexChanged, value); + } + } + [ + Category("Action"), + Description("OnTabRemoving") + ] + public event TabsRemovingEventHandler TabRemoving + { + add + { + Events.AddHandler(EventTabRemoving, value); + } + remove + { + Events.RemoveHandler(EventTabRemoving, value); + } + } + [ + Category("Action"), + Description("OnTabRemoved") + ] + public event TabsRemovedEventHandler TabRemoved + { + add + { + Events.AddHandler(EventTabRemoved, value); + } + remove + { + Events.RemoveHandler(EventTabRemoved, value); + } + } + [ + Category("Action"), + Description("OnTabMoved") + ] + public event EventHandler TabMoved + { + add + { + Events.AddHandler(EventTabMoved, value); + } + remove + { + Events.RemoveHandler(EventTabMoved, value); + } + } + + + + + //Methods + [ + Category("Action"), + Description("") + ] + protected virtual void OnSelectedIndexChanging(TabsChangingEventArgs e) + { + TabsChangingEventHandler eventHandler = (TabsChangingEventHandler)Events[EventSelectedIndexChanging]; + if (eventHandler != null) + { + this.SelectedIndex = e.OldIndex; + eventHandler(this, e); + if (!e.Cancel) + { + this.OnSelectedIndexChanged(new TabsChangedEventArgs(e.NewIndex, e.OldIndex, this.SelectedTab, this)); + } + } + } + + [ + Category("Action"), + Description("") + ] + protected virtual void OnSelectedIndexChanged(TabsChangedEventArgs e) + { + TabsChangedEventHandler eventHandler = (TabsChangedEventHandler)Events[EventSelectedIndexChanged]; + if (eventHandler != null) + { + this.SelectedIndex = e.TabIndex; + eventHandler(this, e); + } + } + + [ + Category("Action"), + Description("") + ] + protected virtual void OnTabRemoving(TabsRemovingEventArgs e) + { + TabsRemovingEventHandler eventHandler = (TabsRemovingEventHandler)Events[EventTabRemoving]; + if (eventHandler != null) + { + eventHandler(this, e); + if (!e.Cancel) + { + this.OnTabRemoved(new TabsRemovedEventArgs(e.TabIndex, e.CurrentTab, e.JQTabs)); + } + } + } + [ + Category("Action"), + Description("") + ] + protected virtual void OnTabRemoved(TabsRemovedEventArgs e) + { + TabsRemovedEventHandler eventHandler = (TabsRemovedEventHandler)Events[EventTabRemoved]; + if (eventHandler != null) + { + this._tabsList.RemoveAt(e.TabIndex); + eventHandler(this, e); + } + } + [ + Category("Action"), + Description("") + ] + protected virtual void OnTabMoved(EventArgs e) + { + EventHandler eventHandler = (EventHandler)Events[EventTabMoved]; + if (eventHandler != null) + { + eventHandler(this, e); + } + } + + protected override void OnPreRender(EventArgs e) + { + + string _clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); + string _clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); + + Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); + + Page.ClientScript.RegisterClientScriptBlock(typeof(Page), this.UniqueID + "startupstyle", RenderStartupStyle()); + + + base.OnPreRender(e); + } + protected override void OnInit(EventArgs e) + { + string hiddenValue = Page.Request.Params[this.UniqueID + "hiddenValue"]; + + if ((!string.IsNullOrEmpty(hiddenValue)) && (hiddenValue.StartsWith("selectedtab:"))) + { + this.SelectedIndex = Convert.ToInt32(hiddenValue.Split(':')[1]); + } + + base.OnInit(e); + } + private string RenderStartupStyle() + { + StringBuilder startupScript = new StringBuilder(); + + startupScript.AppendFormat("<style type=\"text/css\">"); + if (this.TabAppearanceType == TabOrientation.Bottom) + { + startupScript.AppendFormat(".tabs-bottom {{ position: relative; }} "); + startupScript.AppendFormat(".tabs-bottom .ui-tabs-panel {{ height: 140px; overflow: auto; }} "); + startupScript.AppendFormat(".tabs-bottom .ui-tabs-nav {{ position: absolute !important; left: 0; bottom: 0; right:0; padding: 0 0.2em 0.2em 0; }} "); + startupScript.AppendFormat(".tabs-bottom .ui-tabs-nav li {{ margin-top: -2px !important; margin-bottom: 1px !important; border-top: none; border-bottom-width: 1px; }}"); + startupScript.AppendFormat(".ui-tabs-selected {{ margin-top: -3px !important; }}"); + } + if (this.TabAppearanceType == TabOrientation.Vertical) + { + startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav {{ padding: .2em .1em .2em .2em; float: left; width: 12em; }}"); + startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav li {{ clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }}"); + startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav li a {{ display:block; }}"); + startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-nav li.ui-tabs-selected {{ padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }}"); + startupScript.AppendFormat(".ui-tabs-vertical .ui-tabs-panel {{ padding: 1em; float: right; width: 40em;}}"); + } + if (this.TabsRemove) + { + if (string.IsNullOrEmpty(this.CloseIconUrl)) + { + startupScript.AppendFormat("#" + this.UniqueID + " li .ui-icon-close {{float: left; margin: 0.4em 0.2em 0 0;}}"); + } + else + { + startupScript.AppendFormat("#" + this.UniqueID + " li .ui-icon-close {{float: left; margin: 0.4em 0.2em 0 0; background-image:url('" + + this.CloseIconUrl + "')!important; background-position:center;}}"); + } + } + startupScript.AppendFormat("</style>"); + + return startupScript.ToString(); + } + + private string RenderStartupJavaScript() + { + StringBuilder startupScript = new StringBuilder(); + + startupScript.AppendFormat("<script type=\"text/javascript\">"); + startupScript.AppendFormat("$(document).ready(function() {{ "); + startupScript.AppendFormat("var " + this.UniqueID + " = $('#" + this.UniqueID + "'); "); + //tab appearance + if (this.TabAppearanceType == TabOrientation.Bottom) + { + startupScript.AppendFormat(this.UniqueID + ".attr('class','tabs-bottom');"); + } + startupScript.AppendFormat(this.UniqueID + ".tabs({{"); + //events + //remove + startupScript.AppendFormat(" remove: function(event, ui) {{ "); + if (Events[EventTabRemoving] != null) + { + startupScript.AppendFormat(" __doPostBack('" + + this.UniqueID + "','tabremoving:'+$(ui.tab).attr('href').split('-')[1]); "); + } + if (Events[EventTabRemoved] != null) + { + if (Events[EventTabRemoving] == null) + { + startupScript.AppendFormat(" __doPostBack('" + + this.UniqueID + "','tabremoved:'+$(ui.tab).attr('href').split('-')[1]); "); + } + } + startupScript.AppendFormat(" }},"); + //select + startupScript.AppendFormat(" select: function(event, ui){{ $('#" + + this.UniqueID + "hiddenValue').val('selectedtab:'+$(ui.panel).attr('id').split('-')[1]); "); + if (Events[EventSelectedIndexChanging] != null) + { + startupScript.AppendFormat(" __doPostBack('" + this.UniqueID + "','selectedindexchanging:'+parseInt($('#" + + this.UniqueID + "hiddenValue').val().split(':')[1])+':'+$('#" + + this.UniqueID + "').tabs('option', 'selected'));"); + } + if (Events[EventSelectedIndexChanged] != null) + { + if (Events[EventSelectedIndexChanging] == null) + { + startupScript.AppendFormat("__doPostBack('" + this.UniqueID + "','selectedindexchanged:'+parseInt($('#" + + this.UniqueID + "hiddenValue').val().split(':')[1])+':'+$('#" + + this.UniqueID + "').tabs('option', 'selected'));"); + } + } + startupScript.AppendFormat(" }},"); + //tabs remove + if (this.TabsRemove) + { + startupScript.AppendFormat(" tabTemplate:\"<li><a href='#{{href}}'>#{{label}}</a> <span class='ui-icon ui-icon-close'>Remove Tab</span></li>\","); + } + //collapsible + if (this.Collapsible) + { + startupScript.AppendFormat("collapsible: {0},", this.Collapsible.ToString().ToLower()); + } + //animation and animation speed + if (this.Animate == AnimationType.Content) + { + startupScript.AppendFormat(" fx:{{opacity: 'toggle' ,duration: {0} }},", this.AnimationSpeed.ToString().ToLower()); + } + if (this.Animate == AnimationType.Height) + { + startupScript.AppendFormat(" fx:{{height: 'toggle' ,duration: {0} }},", this.AnimationSpeed.ToString().ToLower()); + } + if (this.Animate == AnimationType.HeightAndContent) + { + startupScript.AppendFormat(" fx:{{height: 'toggle', opacity: 'toggle' ,duration: {0} }},", this.AnimationSpeed.ToString().ToLower()); + } + //tab change type + if (this.ChangeType == TabChangeType.MouseHover) + { + startupScript.AppendFormat(" event: 'mouseover',"); + } + //selected tab + startupScript.AppendFormat(" selected: parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1]), "); + startupScript.AppendFormat("}})"); + + //tab appearance + if (this.TabAppearanceType == TabOrientation.Top) + { + startupScript.AppendFormat(";"); + } + if (this.TabAppearanceType == TabOrientation.Bottom) + { + startupScript.AppendFormat(";"); + startupScript.AppendFormat(" $('.tabs-bottom .ui-tabs-nav, .tabs-bottom .ui-tabs-nav > *')"); + startupScript.AppendFormat(".removeClass('ui-corner-all ui-corner-top')"); + startupScript.AppendFormat(".addClass('ui-corner-bottom'); "); + } + if (this.TabAppearanceType == TabOrientation.Vertical) + { + startupScript.AppendFormat(".addClass('ui-tabs-vertical ui-helper-clearfix'); $('#" + + this.UniqueID + " li').removeClass('ui-corner-top').addClass('ui-corner-left'); "); + } + //tab remove js code + if (this.TabsRemove) + { + startupScript.AppendFormat("$('#" + this.UniqueID + " span.ui-icon-close').live('click', function() {{"); + startupScript.AppendFormat("var index = $('li'," + this.UniqueID + ").index($(this).parent());"); + startupScript.AppendFormat(this.UniqueID + ".tabs('remove', index);}});"); + } + + //tabs moving + if (this.TabsMoving) + { + startupScript.AppendFormat("$('#" + this.UniqueID + "').find('.ui-tabs-nav').sortable({{ "); + + if (Events[EventTabMoved] != null) + { + startupScript.AppendFormat("stop: function(event, ui) {{ var oldPostion=$(ui.item).children('a').attr('href').split('-')[1];"); + startupScript.AppendFormat("var newPostion=$(" + this.UniqueID + ").tabs().find('.ui-tabs-nav li').sortable('toArray').index(ui.item);"); + startupScript.AppendFormat("__doPostBack('" + this.UniqueID + "','tabmoved:'+oldPostion+':'+newPostion);}},"); + } + + //moving orientation + if (this.TabAppearanceType == TabOrientation.Vertical) + { + startupScript.AppendFormat(" axis:'y'}})"); + } + else + { + startupScript.AppendFormat(" axis:'x'}})"); + } + } + + startupScript.AppendFormat("}})"); + startupScript.AppendFormat("</script>"); + + return startupScript.ToString(); + } + //clear span tag + protected override void Render(HtmlTextWriter writer) + { + this.RenderContents(writer); + } + protected override void RenderContents(HtmlTextWriter writer) + { + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Value, "selectedtab:" + this.SelectedIndex.ToString()); + writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); + writer.RenderBeginTag(HtmlTextWriterTag.Input); + writer.RenderEndTag(); + + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + + writer.RenderBeginTag(HtmlTextWriterTag.Ul); + foreach (Tab tab in this._tabsList) + { + writer.RenderBeginTag(HtmlTextWriterTag.Li); + writer.AddAttribute(HtmlTextWriterAttribute.Href, "#" + this.UniqueID + "-" + this.Tabs.IndexOf(tab).ToString()); + writer.RenderBeginTag(HtmlTextWriterTag.A); + + writer.Write(tab.Header); + + writer.RenderEndTag(); + if (this.TabsRemove) + { + writer.AddAttribute(HtmlTextWriterAttribute.Class, "ui-icon ui-icon-close"); + writer.RenderBeginTag(HtmlTextWriterTag.Span); + writer.Write("Remove Tab"); + writer.RenderEndTag(); + } + writer.RenderEndTag(); + + } + writer.RenderEndTag(); + + foreach (Tab tab in this._tabsList) + { + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "-" + this.Tabs.IndexOf(tab).ToString()); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + foreach (Control control in tab.Controls) + { + control.RenderControl(writer); + } + writer.RenderEndTag(); + } + writer.RenderEndTag(); + + + base.RenderContents(writer); + } + + public virtual void ClearSelection() + { + foreach (Tab item in this._tabsList) + { + item.Selected = false; + } + } + + #region IPostBackEventHandler Members + + public void RaisePostBackEvent(string eventArgument) + { + if (eventArgument != null) + { + //selecting event + if (eventArgument.StartsWith("selectedindexchanging")) + { + string[] values = eventArgument.Split(':'); + + int newIndex = Convert.ToInt32(values[1]); + int oldIndex = Convert.ToInt32(values[2]); + + TabsChangingEventArgs args = new TabsChangingEventArgs(newIndex, oldIndex, this.SelectedTab, this); + this.OnSelectedIndexChanging(args); + } + //selected event + if (eventArgument.StartsWith("selectedindexchanged")) + { + string[] values = eventArgument.Split(':'); + + int index = Convert.ToInt32(values[1]); + int oldIndex = Convert.ToInt32(values[2]); + + TabsChangedEventArgs args = new TabsChangedEventArgs(index, oldIndex, this.SelectedTab, this); + this.OnSelectedIndexChanged(args); + } + //removing event + if (eventArgument.StartsWith("tabremoving")) + { + string[] values = eventArgument.Split(':'); + int tabIndex = Convert.ToInt32(values[1]); + + TabsRemovingEventArgs args = new TabsRemovingEventArgs(tabIndex, this.Tabs[tabIndex], this); + this.OnTabRemoving(args); + } + //removed event + if (eventArgument.StartsWith("tabremoved")) + { + string[] values = eventArgument.Split(':'); + int tabIndex = Convert.ToInt32(values[1]); + TabsRemovedEventArgs args = new TabsRemovedEventArgs(tabIndex, this.Tabs[tabIndex], this); + this.OnTabRemoved(args); + } + //moved event + if (eventArgument.StartsWith("tabmoved")) + { + string[] values = eventArgument.Split(':'); + + int oldPosition = Convert.ToInt32(values[1]); + int newPosition = Convert.ToInt32(values[2]); + + ReorderTabItems(oldPosition, newPosition); + + this.OnTabMoved(new EventArgs()); + } + } + } + + private void ReorderTabItems(int oldPosition, int newPosition) + { + Tab temp = this._tabsList[oldPosition]; + this._tabsList[oldPosition] = this._tabsList[newPosition]; + this._tabsList[newPosition] = temp; + } + + + + void IPostBackEventHandler.RaisePostBackEvent(string eventArgument) + { + this.RaisePostBackEvent(eventArgument); + } + + #endregion + + //Properties + [ + Category("Behavior"), + Description(""), + DesignerSerializationVisibility( + DesignerSerializationVisibility.Content), + Editor(typeof(TabCollectionEditor), typeof(UITypeEditor)), + PersistenceMode(PersistenceMode.InnerDefaultProperty) + ] + public List<Tab> Tabs + { + get + { + if (this._tabsList == null) + { + this._tabsList = new List<Tab>(); + } + return _tabsList; + } + } + + [ + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + Category(""), + Description("") + ] + public int SelectedIndex + { + get + { + return this._selectedIndex; + } + set + { + this.ClearSelection(); + this._tabsList[value].Selected = true; + this._selectedIndex = value; + } + } + + [ + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + Category(""), + Description("") + ] + public Tab SelectedTab + { + get + { + int selectedIndex = this.SelectedIndex; + if (selectedIndex >= 0) + { + return this._tabsList[selectedIndex]; + } + return null; + } + } + + + + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue("") + ] + public string CloseIconUrl + { + get + { + object icon = ViewState["CloseIconUrlViewState"]; + return (icon == null) ? string.Empty : icon.ToString(); + } + set + { + ViewState["CloseIconUrlViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(AnimationType.None) + ] + public AnimationType Animate + { + get + { + object animation = (object)ViewState["AnimateViewState"]; + return (animation == null) ? AnimationType.None : (AnimationType)animation; + } + set + { + ViewState["AnimateViewState"] = value; + } + } + + + [ + Category("Behavior"), + Description(""), + DefaultValue(TabOrientation.Top) + ] + public TabOrientation TabAppearanceType + { + get + { + object appearance = (object)ViewState["TabAppearanceTypeViewState"]; + return (appearance == null) ? TabOrientation.Top : (TabOrientation)appearance; + } + set + { + ViewState["TabAppearanceTypeViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(TabChangeType.MouseClick) + ] + public TabChangeType ChangeType + { + get + { + object changeType = (object)ViewState["TabChangeTypeViewState"]; + return (changeType == null) ? TabChangeType.MouseClick : (TabChangeType)changeType; + } + set + { + ViewState["TabChangeTypeViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(TabAnimationSpeed.Normal) + ] + public TabAnimationSpeed AnimationSpeed + { + get + { + object animationSpeed = (object)ViewState["AnimationSpeedViewState"]; + return (animationSpeed == null) ? TabAnimationSpeed.Normal : (TabAnimationSpeed)animationSpeed; + } + set + { + ViewState["AnimationSpeedViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool Collapsible + { + get + { + object collapsible = (object)ViewState["CollapsibleViewState"]; + return (collapsible == null) ? false : (bool)collapsible; + } + set + { + ViewState["CollapsibleViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool TabsRemove + { + get + { + object tabsRemove = (object)ViewState["TabsRemoveViewState"]; + return (tabsRemove == null) ? false : (bool)tabsRemove; + } + set + { + ViewState["TabsRemoveViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool TabsMoving + { + get + { + object tabsMoving = (object)ViewState["TabsMovingViewState"]; + return (tabsMoving == null) ? false : (bool)tabsMoving; + } + set + { + ViewState["TabsMovingViewState"] = value; + } + } + + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BackColor + { + get + { + return base.BackColor; + } + set + { + base.BackColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override BorderStyle BorderStyle + { + get + { + return base.BorderStyle; + } + set + { + base.BorderStyle = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override Unit BorderWidth + { + get + { + return base.BorderWidth; + } + set + { + base.BorderWidth = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BorderColor + { + get + { + return base.BorderColor; + } + set + { + base.BorderColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override FontInfo Font + { + get + { + return base.Font; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override bool EnableTheming + { + get + { + return base.EnableTheming; + } + set + { + base.EnableTheming = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string ToolTip + { + get + { + return base.ToolTip; + } + set + { + base.ToolTip = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string SkinID + { + get + { + return base.SkinID; + } + set + { + base.SkinID = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color ForeColor + { + get + { + return base.ForeColor; + } + set + { + base.ForeColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string CssClass + { + get + { + return base.CssClass; + } + set + { + base.CssClass = value; + } + } + } + + +} diff --git a/Atom.Web/Tabs/Tab.cs b/Atom.Web/Tabs/Tab.cs new file mode 100644 index 0000000..859bc08 --- /dev/null +++ b/Atom.Web/Tabs/Tab.cs @@ -0,0 +1,186 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Drawing.Design; +using System.Web.UI; +using System.ComponentModel; + +namespace Atom.Web.UI.WebControls.Tabs +{ + [ + ToolboxItem(false) + ] + public class Tab : Control, INamingContainer + { + //Fields + private string _header; + private bool _selected; + private bool _enable; + + + private string _url; + private ITemplate _temlpate; + + + //Methods + protected override void CreateChildControls() + { + Controls.Clear(); + + if (Template != null) + Template.InstantiateIn(this); + } + + + //Properties + [ + Browsable(false), + DesignerSerializationVisibility( + DesignerSerializationVisibility.Content), + PersistenceMode(PersistenceMode.InnerProperty) + ] + public ITemplate Template + { + get { return _temlpate; } + set { _temlpate = value; } + } + + [ + Category("Behavior"), + DefaultValue(""), + Description(""), + NotifyParentProperty(true), + ] + public string Header + { + get + { + return _header; + } + set + { + _header = value; + } + } + [ + Category("Behavior"), + DefaultValue(""), + Description(""), + NotifyParentProperty(true), + ] + public bool Enable + { + get + { + return this._enable; + } + set + { + this._enable = value; + } + } + + [ + Category("Behavior"), + DefaultValue(false), + Description(""), + NotifyParentProperty(true), + ] + public bool Selected + { + get + { + return this._selected; + } + set + { + this._selected = value; + } + } + + + + [ + Category("Behavior"), + DefaultValue(""), + Description(""), + NotifyParentProperty(true), + ] + public string URL + { + get + { + return _url; + } + set + { + _url = value; + } + } + + + //[EditorBrowsable(EditorBrowsableState.Never)] + //[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + //public override string ID + //{ + // get + // { + // return base.ID; + // } + // set + // { + // base.ID = value; + // } + //} + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override bool EnableViewState + { + get + { + return base.EnableViewState; + } + set + { + base.EnableViewState = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string ID + { + get + { + return base.ID; + } + set + { + base.ID = value; + } + } + + [ + Browsable(false), + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override bool Visible + { + get + { + return base.Visible; + } + set + { + base.Visible = value; + } + } + } +} diff --git a/Atom.Web/Tabs/TabAnimationSpeed.cs b/Atom.Web/Tabs/TabAnimationSpeed.cs new file mode 100644 index 0000000..b7e2c76 --- /dev/null +++ b/Atom.Web/Tabs/TabAnimationSpeed.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Tabs +{ + public enum TabAnimationSpeed + { + Slow, + Normal, + Fast + } +} diff --git a/Atom.Web/Tabs/TabChangeType.cs b/Atom.Web/Tabs/TabChangeType.cs new file mode 100644 index 0000000..c632e0b --- /dev/null +++ b/Atom.Web/Tabs/TabChangeType.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Tabs +{ + public enum TabChangeType + { + MouseClick, + MouseHover + } +} diff --git a/Atom.Web/Tabs/TabCollectionEditor.cs b/Atom.Web/Tabs/TabCollectionEditor.cs new file mode 100644 index 0000000..b55a8e0 --- /dev/null +++ b/Atom.Web/Tabs/TabCollectionEditor.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ComponentModel.Design; + +namespace Atom.Web.UI.WebControls.Tabs +{ + public class TabCollectionEditor : CollectionEditor + { + public TabCollectionEditor(Type type) + : base(type) + { + } + + protected override bool CanSelectMultipleInstances() + { + return false; + } + + protected override Type CreateCollectionItemType() + { + return typeof(Tab); + } + } +} diff --git a/Atom.Web/Tabs/TabOrientation.cs b/Atom.Web/Tabs/TabOrientation.cs new file mode 100644 index 0000000..fb36c7c --- /dev/null +++ b/Atom.Web/Tabs/TabOrientation.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Tabs +{ + public enum TabOrientation + { + Top, + Bottom, + Vertical + } +}
sila/AtomProject
e897b0d1bdc413201a935a3e9bfe785c35add1d5
add accordion contol
diff --git a/Atom.Web/Accordion/Animation.cs b/Atom.Web/Accordion/Animation.cs new file mode 100644 index 0000000..0fb0ac3 --- /dev/null +++ b/Atom.Web/Accordion/Animation.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Accordion +{ + public enum Animation + { + Slide, + Bounceslide, + None, + } +} diff --git a/Atom.Web/Accordion/Design/AccordionDesigner.cs b/Atom.Web/Accordion/Design/AccordionDesigner.cs new file mode 100644 index 0000000..04a2bb7 --- /dev/null +++ b/Atom.Web/Accordion/Design/AccordionDesigner.cs @@ -0,0 +1,146 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI.Design; +using System.ComponentModel.Design; +using System.ComponentModel; + +namespace Atom.Web.UI.WebControls.Accordion +{ + public class AccordionDesigner : ControlDesigner + { + private DesignerActionListCollection _actionList = null; + //public bool _isDirty; + + public override DesignerActionListCollection ActionLists + { + get + { + + if (this._actionList == null) + { + this._actionList = new DesignerActionListCollection(); + this._actionList.AddRange(base.ActionLists); + this._actionList.Add(new ActionList(this)); + } + + return this._actionList; + } + } + + public void AddNewItem() + { + JQAccordion acc = (JQAccordion)this.Component; + acc.Items.Add(new Item("NewHeader_" + acc.Items.Count)); + Tag.SetDirty(true); + } + + public override string GetDesignTimeHtml() + { + return base.CreatePlaceHolderDesignTimeHtml(); + } + } + public class ActionList : DesignerActionList + { + private AccordionDesigner _parent; + private DesignerActionItemCollection _items; + + public ActionList(AccordionDesigner parent) + : base(parent.Component) + { + this._parent = parent; + } + + public override DesignerActionItemCollection GetSortedActionItems() + { + if (this._items == null) + { + this._items = new DesignerActionItemCollection(); + + this._items.Add(new DesignerActionMethodItem(this, "AddNewItem", "Add new item", "", true)); + this._items.Add(new DesignerActionPropertyItem("FillSpace", "FillSpace", "")); + this._items.Add(new DesignerActionPropertyItem("Collapsible", "Collapsible", "")); + this._items.Add(new DesignerActionPropertyItem("Resizable", "Resizable", "")); + this._items.Add(new DesignerActionPropertyItem("ChangeType", "ChangeType", "")); + this._items.Add(new DesignerActionPropertyItem("AnimationType", "Animation Type", "")); + } + return this._items; + } + + public void AddNewItem() + { + _parent.AddNewItem(); + } + + public bool FillSpace + { + get + { + JQAccordion acc = (JQAccordion)_parent.Component; + return acc.FillSpace; + } + set + { + JQAccordion acc = (JQAccordion)_parent.Component; + TypeDescriptor.GetProperties(acc)["FillSpace"].SetValue(acc, value); + } + } + public bool Resizable + { + get + { + JQAccordion acc = (JQAccordion)_parent.Component; + return acc.Resizable; + } + set + { + JQAccordion acc = (JQAccordion)_parent.Component; + + TypeDescriptor.GetProperties(acc)["Resizable"].SetValue(acc, value); + TypeDescriptor.GetProperties(acc)["FillSpace"].SetValue(acc, value); + } + } + public bool Collapsible + { + get + { + JQAccordion acc = (JQAccordion)_parent.Component; + return acc.Collapsible; + } + set + { + JQAccordion acc = (JQAccordion)_parent.Component; + TypeDescriptor.GetProperties(acc)["Collapsible"].SetValue(acc, value); + } + } + public ItemChangeType ChangeType + { + get + { + JQAccordion acc = (JQAccordion)_parent.Component; + return acc.ChangeType; + } + set + { + JQAccordion acc = (JQAccordion)_parent.Component; + TypeDescriptor.GetProperties(acc)["ChangeType"].SetValue(acc, value); + } + } + public Animation AnimationType + { + get + { + JQAccordion acc = (JQAccordion)_parent.Component; + return acc.AnimationType; + } + set + { + JQAccordion acc = (JQAccordion)_parent.Component; + TypeDescriptor.GetProperties(acc)["AnimationType"].SetValue(acc, value); + } + } + + + } +} diff --git a/Atom.Web/Accordion/EventArgs/AccordionChangedEventArgs.cs b/Atom.Web/Accordion/EventArgs/AccordionChangedEventArgs.cs new file mode 100644 index 0000000..99a983d --- /dev/null +++ b/Atom.Web/Accordion/EventArgs/AccordionChangedEventArgs.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web; +using System.Security.Permissions; + +namespace Atom.Web.UI.WebControls.Accordion +{ + [ + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) + ] + public class AccordionChangedEventArgs : EventArgs + { + public int NewIndex { get; set; } + public int OldIndex { get; set; } + public Item CurrentItem { get; set; } + + public AccordionChangedEventArgs(int newIndex, int oldIndex, Item currentItem, JQAccordion accordion) + { + this.NewIndex = newIndex; + this.OldIndex = oldIndex; + this.CurrentItem = currentItem; + } + } +} diff --git a/Atom.Web/Accordion/EventArgs/AccordionChangingEventArgs.cs b/Atom.Web/Accordion/EventArgs/AccordionChangingEventArgs.cs new file mode 100644 index 0000000..be2f1cf --- /dev/null +++ b/Atom.Web/Accordion/EventArgs/AccordionChangingEventArgs.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ComponentModel; +using System.Web; +using System.Security.Permissions; + +namespace Atom.Web.UI.WebControls.Accordion +{ + [ + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal) + ] + public class AccordionChangingEventArgs : CancelEventArgs + { + public int NewIndex { get; set; } + public int OldIndex { get; set; } + // public JQAccordion Accordion { get; set; } + + public AccordionChangingEventArgs(int newIndex, int oldIndex)//, JQAccordion accordion) + { + // this.Accordion = accordion; + this.NewIndex = newIndex; + this.OldIndex = oldIndex; + } + } +} diff --git a/Atom.Web/Accordion/Item.cs b/Atom.Web/Accordion/Item.cs new file mode 100644 index 0000000..7bc2cc5 --- /dev/null +++ b/Atom.Web/Accordion/Item.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI; +using System.ComponentModel; + +namespace Atom.Web.UI.WebControls.Accordion +{ + [ + ToolboxItem(false) + ] + public class Item : Control, INamingContainer + { + //Fields + private string _header; + private bool _selected; + private ITemplate _temlpate; + // private string _url; + + //Methods + public Item() { } + + public Item(string header) + { + this._header = header; + } + + protected override void CreateChildControls() + { + Controls.Clear(); + + if (Template != null) + Template.InstantiateIn(this); + } + + //Properties + [ + Browsable(false), + DesignerSerializationVisibility( + DesignerSerializationVisibility.Content), + PersistenceMode(PersistenceMode.InnerProperty) + ] + public ITemplate Template + { + get { return _temlpate; } + set { _temlpate = value; } + } + + [ + Category("Behavior"), + DefaultValue(""), + Description(""), + NotifyParentProperty(true), + ] + public string Header + { + get + { + return _header; + } + set + { + _header = value; + } + } + + [ + Category("Behavior"), + DefaultValue(false), + Description(""), + NotifyParentProperty(true), + ] + public bool Selected + { + get + { + return this._selected; + } + set + { + this._selected = value; + } + } + + //[ + //Category("Behavior"), + //DefaultValue(""), + //Description(""), + //NotifyParentProperty(true), + //] + //public string URL + //{ + // get + // { + // return _url; + // } + // set + // { + // _url = value; + // } + //} + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override bool EnableViewState + { + get + { + return base.EnableViewState; + } + set + { + base.EnableViewState = value; + } + } + + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string ID + { + get + { + return base.ID; + } + set + { + base.ID = value; + } + } + + [ + Browsable(false), + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override bool Visible + { + get + { + return base.Visible; + } + set + { + base.Visible = value; + } + } + } +} diff --git a/Atom.Web/Accordion/ItemChangeType.cs b/Atom.Web/Accordion/ItemChangeType.cs new file mode 100644 index 0000000..d9409a4 --- /dev/null +++ b/Atom.Web/Accordion/ItemChangeType.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Atom.Web.UI.WebControls.Accordion +{ + public enum ItemChangeType + { + MouseClick, + MouseHover + } +} diff --git a/Atom.Web/Accordion/ItemCollectionEditor.cs b/Atom.Web/Accordion/ItemCollectionEditor.cs new file mode 100644 index 0000000..10100bf --- /dev/null +++ b/Atom.Web/Accordion/ItemCollectionEditor.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ComponentModel.Design; + +namespace Atom.Web.UI.WebControls.Accordion +{ + public class ItemCollectionEditor : CollectionEditor + { + public ItemCollectionEditor(Type type) + : base(type) + { + } + + protected override bool CanSelectMultipleInstances() + { + return false; + } + + protected override Type CreateCollectionItemType() + { + return typeof(Item); + } + } +} diff --git a/Atom.Web/Accordion/JQAccordion.cs b/Atom.Web/Accordion/JQAccordion.cs new file mode 100644 index 0000000..d44c77a --- /dev/null +++ b/Atom.Web/Accordion/JQAccordion.cs @@ -0,0 +1,835 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI.WebControls; +using System.Web; +using System.Security.Permissions; +using System.Web.UI; +using System.ComponentModel; +using System.Drawing.Design; +using Atom.Web.UI.WebControls.Accordion; + +namespace Atom.Web.UI.WebControls.Accordion // System.Wen.UI.DropDownList - Baev.Web.UI +{ + [ + AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal), + AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), + DefaultProperty("Items"), + ParseChildren(true, "Items"), + Designer(typeof(AccordionDesigner)), + ToolboxData("<{0}:JQAccordion runat=\"server\"> </{0}:JQAccordion>") + ] + public class JQAccordion : WebControl, IPostBackEventHandler + { + //MS convention: + //Fields + //Events + //Methods + //Properties + + + //Fields + #region Fields + + private int _selectedIndex; + private int _selectedOldIndex; + private List<Item> _itemList; + private static readonly object EventSelectedIndexChanged = new object(); + private static readonly object EventSelectedIndexChanging = new object(); + + public delegate void AccordionChangingEventHandler(object sender, AccordionChangingEventArgs e); + public delegate void AccordionChangedEventHandler(object sender, AccordionChangedEventArgs e); + + #endregion + + [ + Category("Action"), + Description("OnSelectedItemIndexChanging") + ] + public event AccordionChangingEventHandler SelectedIndexChanging + { + add + { + Events.AddHandler(EventSelectedIndexChanging, value); + } + remove + { + Events.RemoveHandler(EventSelectedIndexChanging, value); + } + } + [ + Category("Action"), + Description("OnSelectedItemIndexChanged") + ] + public event AccordionChangedEventHandler SelectedIndexChanged + { + add + { + Events.AddHandler(EventSelectedIndexChanged, value); + } + remove + { + Events.RemoveHandler(EventSelectedIndexChanged, value); + } + } + + //Methods + #region Methods + + [ + Category("Action"), + Description("") + ] + protected virtual void OnSelectedIndexChanging(AccordionChangingEventArgs e) + { + AccordionChangingEventHandler eventHandler = (AccordionChangingEventHandler)Events[EventSelectedIndexChanging]; + if (eventHandler != null) + { + this.SelectedIndex = e.OldIndex; + eventHandler(this, e); + + if (!e.Cancel) + { + this.SelectedIndex = e.NewIndex; + this.OnSelectedIndexChanged(new AccordionChangedEventArgs(e.NewIndex, e.OldIndex, this.SelectedItem, this)); + } + } + } + + [ + Category("Action"), + Description("") + ] + protected virtual void OnSelectedIndexChanged(AccordionChangedEventArgs e) + { + AccordionChangedEventHandler eventHandler = (AccordionChangedEventHandler)Events[EventSelectedIndexChanged]; + if (eventHandler != null) + { + this.SelectedIndex = e.NewIndex; + eventHandler(this, e); + } + } + + protected override void OnPreRender(EventArgs e) + { + //Page.RegisterRequiresPostBack(this); + string _clientPostBackHyperlink = Page.GetPostBackClientHyperlink(this, string.Empty); + string _clientPostBackScript = Page.GetPostBackClientEvent(this, string.Empty); + + Page.ClientScript.RegisterStartupScript(typeof(Page), this.UniqueID + "startupscript", RenderStartupJavaScript()); + + if ((!string.IsNullOrEmpty(this.IconSelectedUrl)) || (!string.IsNullOrEmpty(this.IconUrl))) + { + Page.ClientScript.RegisterClientScriptBlock(typeof(Page), this.UniqueID + "startupstyle", RenderStartupStyle()); + } + + base.OnPreRender(e); + } + + protected override void RenderContents(HtmlTextWriter writer) + { + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "hiddenValue"); + writer.AddAttribute(HtmlTextWriterAttribute.Value, "selectedindex:" + this.SelectedIndex.ToString()); + writer.AddAttribute(HtmlTextWriterAttribute.Type, "hidden"); + writer.RenderBeginTag(HtmlTextWriterTag.Input); + writer.RenderEndTag(); + + if (this.Resizable) + { + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "accResizer"); + writer.AddAttribute(HtmlTextWriterAttribute.Class, "ui-widget-content"); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + } + + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.UniqueID + "accordion"); + writer.RenderBeginTag(HtmlTextWriterTag.Div); + + foreach (Item item in this.Items) + { + writer.RenderBeginTag(HtmlTextWriterTag.H3); + writer.AddAttribute("index", this.Items.IndexOf(item).ToString()); + writer.AddAttribute("href", "#"); + writer.RenderBeginTag(HtmlTextWriterTag.A); + + writer.Write(item.Header); + + writer.RenderEndTag(); + writer.RenderEndTag(); + + //render item content + writer.RenderBeginTag(HtmlTextWriterTag.Div); + + foreach (Control control in item.Controls) + { + control.RenderControl(writer); + } + + writer.RenderEndTag(); + } + + writer.RenderEndTag(); + + if (this.Resizable) + { + writer.RenderEndTag(); + } + + //base.RenderContents(writer); + } + + //clear span tag + protected override void Render(HtmlTextWriter writer) + { + this.RenderContents(writer); + } + + private string RenderStartupStyle() + { + StringBuilder startupScript = new StringBuilder(); + startupScript.AppendFormat("<style type=\"text/css\">"); + + if (!string.IsNullOrEmpty(this.IconSelectedUrl)) + { + startupScript.AppendFormat("." + this.UniqueID + "IconSelectedStyle{{"); + startupScript.AppendFormat("background-image: url(" + this.IconSelectedUrl + ") !important;"); + startupScript.AppendFormat("}}"); + } + + if (!string.IsNullOrEmpty(this.IconUrl)) + { + startupScript.AppendFormat("." + this.UniqueID + "IconStyle{{"); + startupScript.AppendFormat("background-image: url(" + this.IconUrl + ") !important;"); + startupScript.AppendFormat("}}"); + } + + startupScript.AppendFormat("</style>"); + return startupScript.ToString(); + } + + private string RenderStartupJavaScript() + { + StringBuilder startupScript = new StringBuilder(); + + startupScript.AppendFormat("<script type=\"text/javascript\">"); + startupScript.AppendFormat("var " + this.UniqueID + "; "); + startupScript.AppendFormat("$(document).ready(function() {{ "); + startupScript.AppendFormat("var acc" + this.UniqueID + " = $('#" + this.UniqueID + "accordion'); " + this.UniqueID + "=acc" + this.UniqueID + ";"); + startupScript.AppendFormat("acc" + this.UniqueID + ".accordion({{"); + //Event + //changestart + startupScript.AppendFormat(" changestart: function(event, ui) {{ $('#" + this.UniqueID + "hiddenValue').val('selectedindex:'+ui.options.active); "); + if (Events[EventSelectedIndexChanging] != null) + { + startupScript.AppendFormat(" __doPostBack('" + this.UniqueID + "', 'selectedindexchanging:'+ui.options.active+':'+ui.oldHeader.children('a#').attr('index')); "); + } + startupScript.AppendFormat("}}, "); + //change + if (Events[EventSelectedIndexChanged] != null) + { + if (Events[EventSelectedIndexChanging] == null) + { + startupScript.AppendFormat(" changestart: function(event, ui) {{ __doPostBack('" + this.UniqueID + "', 'selectedindexchanged:'+ui.options.active+':'+ui.oldHeader.children('a#').attr('index'));}}, "); + } + } + //AnimationType + if (this.AnimationType == Animation.None) + { + startupScript.AppendFormat("animated: false, "); + } + if (this.AnimationType == Animation.Bounceslide) + { + startupScript.AppendFormat("animated: 'bounceslide', "); + } + if (this.AnimationType == Animation.Slide) + { + startupScript.AppendFormat("animated: 'slide', "); + } + //ItemChangeType + if (this.ChangeType == ItemChangeType.MouseClick) + { + startupScript.AppendFormat("event: 'click', "); + } + if (this.ChangeType == ItemChangeType.MouseHover) + { + startupScript.AppendFormat("event: 'mouseover',"); + } + //Icons + startupScript.AppendFormat("icons:{{"); + if (!string.IsNullOrEmpty(this.IconUrl)) + { + startupScript.AppendFormat(" 'header': '" + this.UniqueID + "IconStyle', "); + } + if (!string.IsNullOrEmpty(this.IconSelectedUrl)) + { + startupScript.AppendFormat(" 'headerSelected': '" + this.UniqueID + "IconSelectedStyle' "); + } + else + { + startupScript.AppendFormat(" 'headerSelected': '" + this.UniqueID + "IconStyle', "); + } + startupScript.AppendFormat("}}, "); + //SelectItem + //startupScript.AppendFormat(" active: {0}, ", this.SelectedIndex); + startupScript.AppendFormat(" active: parseInt($('#" + this.UniqueID + "hiddenValue').val().split(':')[1]), "); + //Default:false + if (this.FillSpace) + { + startupScript.AppendFormat("fillSpace: {0}, ", this.FillSpace.ToString().ToLower()); + } + //Default:false + if (this.Collapsible) + { + startupScript.AppendFormat("collapsible: {0}, ", this.Collapsible.ToString().ToLower()); + } + //Default:false + if (this.Navigation) + { + startupScript.AppendFormat("navigation: {0}, ", this.Navigation.ToString().ToLower()); + } + //add event with if statement + + //Default:true + if (!this.AutoHeight) + { + startupScript.AppendFormat("autoHeight: {0}, ", this.AutoHeight.ToString().ToLower()); + } + startupScript.AppendFormat("}}); "); + + //Default:true + if (!this.Enabled) + { + startupScript.AppendFormat("acc" + this.UniqueID + ".accordion('disable');"); + } + if (this.Resizable) + { + startupScript.AppendFormat("$('#" + this.UniqueID + "accResizer" + "').resizable({{"); + startupScript.AppendFormat("resize: function() {{ acc" + this.UniqueID + ".accordion('resize');}},"); + startupScript.AppendFormat("minHeight: {0},", this.MinHeight.ToString()); + startupScript.AppendFormat("minWidth: {0},", this.MinWidth.ToString()); + startupScript.AppendFormat("maxHeight: {0},", this.MaxHeight.ToString()); + startupScript.AppendFormat("maxWidth: {0},", this.MaxWidth.ToString()); + startupScript.AppendFormat("}});"); + } + //SelectItem + //startupScript.AppendFormat("acc" + this.UniqueID + ".accordion('activate', " + this.SelectedIndex + ");"); + startupScript.AppendFormat("}})"); + startupScript.AppendFormat("</script>"); + + return startupScript.ToString(); + + //if (this.Page.Header.Controls.Add(new LiteralControl("<link rel=" + } + + public void RaisePostBackEvent(string eventArgument) + { + if (eventArgument != null) + { + if (eventArgument.StartsWith("selectedindexchanging")) + { + string[] values = eventArgument.Split(':'); + + int selectedIndex = Convert.ToInt32(values[1]); + int selectedOldIndex = Convert.ToInt32(values[2]); + + AccordionChangingEventArgs args = new AccordionChangingEventArgs(selectedIndex, selectedOldIndex); + this.OnSelectedIndexChanging(args); + } + if (eventArgument.StartsWith("selectedindexchanged")) + { + string[] values = eventArgument.Split(':'); + + int selectedIndex = Convert.ToInt32(values[1]); + int selectedOldIndex = Convert.ToInt32(values[2]); + + AccordionChangedEventArgs args = new AccordionChangedEventArgs(selectedIndex, selectedOldIndex, this.SelectedItem, this); + this.OnSelectedIndexChanged(args); + } + } + } + + void IPostBackEventHandler.RaisePostBackEvent(string eventArgument) + { + this.RaisePostBackEvent(eventArgument); + } + + public virtual void ClearSelection() + { + foreach (Item item in this.Items) + { + item.Selected = false; + } + } + + protected override void OnInit(EventArgs e) + { + + string hiddenValue = Page.Request.Params[this.UniqueID + "hiddenValue"]; + + if ((!string.IsNullOrEmpty(hiddenValue)) && (hiddenValue.StartsWith("selectedindex:"))) + { + this.SelectedIndex = Convert.ToInt32(hiddenValue.Split(':')[1]); + } + + if (this.Resizable) + { + if (!this.FillSpace) + { + throw new ArgumentException("Please set FillSpace=\"True\""); + } + } + + bool isSelected = false; + foreach (Item item in this.Items) + { + if (item.Selected) + { + if (isSelected) + { + throw new ArgumentException("MultipleSelectionOfItems"); + } + isSelected = true; + this._selectedIndex = this._itemList.IndexOf(item); + } + } + + base.OnInit(e); + + } + + #endregion + + //Properties + #region Properties + + [ + Category("Behavior"), + Description(""), + DefaultValue(0) + ] + public int MinHeight + { + get + { + object minHeight = ViewState["MinHeightViewState"]; + return (minHeight == null) ? 0 : Convert.ToInt32(minHeight); + } + set { ViewState["MinHeightViewState"] = value; } + } + [ + Category("Behavior"), + Description(""), + DefaultValue(true) + ] + public int MinWidth + { + get + { + object minWidth = ViewState["MinWidthViewState"]; + return (minWidth == null) ? 0 : Convert.ToInt32(minWidth); + } + set { ViewState["MinWidthViewState"] = value; } + } + [ + Category("Behavior"), + Description(""), + DefaultValue(true) + ] + public int MaxHeight + { + get + { + object maxHeight = ViewState["MaxHeightViewState"]; + return (maxHeight == null) ? 0 : Convert.ToInt32(maxHeight); + } + set { ViewState["MaxHeightViewState"] = value; } + } + [ + Category("Behavior"), + Description(""), + DefaultValue(true) + ] + public int MaxWidth + { + get + { + object maxWidth = ViewState["MaxWidthViewState"]; + return (maxWidth == null) ? 0 : Convert.ToInt32(maxWidth); + } + set { ViewState["MaxWidthViewState"] = value; } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(true) + ] + public bool AutoHeight + { + get + { + object autoHeightValue = ViewState["AutoHeightViewState"]; + return (autoHeightValue == null) ? true : (bool)autoHeightValue; + } + set + { + ViewState["AutoHeightViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue("") + ] + public string IconUrl + { + get + { + object icon = ViewState["IconUrlViewState"]; + return (icon == null) ? string.Empty : icon.ToString(); + } + set + { + ViewState["IconUrlViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + UrlProperty(""), + DefaultValue("") + ] + public string IconSelectedUrl + { + get + { + object iconSelected = ViewState["IconSelectedUrlViewState"]; + return (iconSelected == null) ? string.Empty : iconSelected.ToString(); + } + set + { + ViewState["IconSelectedUrlViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool Collapsible + { + get + { + object collapsibleValue = ViewState["CollapsibleViewState"]; + return (collapsibleValue == null) ? false : (bool)collapsibleValue; + } + set + { + ViewState["CollapsibleViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool Navigation + { + get + { + object navigationValue = ViewState["NavigationViewState"]; + return (navigationValue == null) ? false : (bool)navigationValue; + } + set + { + ViewState["NavigationViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(ItemChangeType.MouseClick) + ] + public ItemChangeType ChangeType + { + get + { + object fillSpaceValue = (object)ViewState["ItemChangeTypeViewState"]; + return (fillSpaceValue == null) ? ItemChangeType.MouseClick : (ItemChangeType)fillSpaceValue; + } + set + { + ViewState["ItemChangeTypeViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(Animation.None) + ] + public Animation AnimationType + { + get + { + object fillSpaceValue = (object)ViewState["AnimationTypeViewState"]; + return (fillSpaceValue == null) ? Animation.None : (Animation)fillSpaceValue; + } + set + { + ViewState["AnimationTypeViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool FillSpace + { + get + { + object fillSpaceValue = (object)ViewState["FillSpaceViewState"]; + return (fillSpaceValue == null) ? false : (bool)fillSpaceValue; + } + set + { + ViewState["FillSpaceViewState"] = value; + } + } + + [ + Category("Behavior"), + Description(""), + DesignerSerializationVisibility( + DesignerSerializationVisibility.Content), + Editor(typeof(ItemCollectionEditor), typeof(UITypeEditor)), + PersistenceMode(PersistenceMode.InnerDefaultProperty) + ] + public List<Item> Items + { + get + { + if (_itemList == null) + { + _itemList = new List<Item>(); + } + return _itemList; + } + } + + [ + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + Category(""), + Description("") + ] + public int SelectedIndex + { + get + { + return this._selectedIndex; + } + set + { + this.ClearSelection(); + this._itemList[value].Selected = true; + this._selectedIndex = value; + } + } + + [ + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), + Category(""), + Description("") + ] + public Item SelectedItem + { + get + { + int selectedIndex = this.SelectedIndex; + if (selectedIndex >= 0) + { + return this._itemList[selectedIndex]; + } + return null; + } + } + + + [ + Category("Behavior"), + Description(""), + DefaultValue(false) + ] + public bool Resizable + { + get + { + object resizableValue = (object)ViewState["ResizableViewState"]; + return (resizableValue == null) ? false : (bool)resizableValue; + } + set + { + ViewState["ResizableViewState"] = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BackColor + { + get + { + return base.BackColor; + } + set + { + base.BackColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override BorderStyle BorderStyle + { + get + { + return base.BorderStyle; + } + set + { + base.BorderStyle = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override Unit BorderWidth + { + get + { + return base.BorderWidth; + } + set + { + base.BorderWidth = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color BorderColor + { + get + { + return base.BorderColor; + } + set + { + base.BorderColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override FontInfo Font + { + get + { + return base.Font; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override bool EnableTheming + { + get + { + return base.EnableTheming; + } + set + { + base.EnableTheming = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string ToolTip + { + get + { + return base.ToolTip; + } + set + { + base.ToolTip = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + Browsable(false), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string SkinID + { + get + { + return base.SkinID; + } + set + { + base.SkinID = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override System.Drawing.Color ForeColor + { + get + { + return base.ForeColor; + } + set + { + base.ForeColor = value; + } + } + [ + EditorBrowsable(EditorBrowsableState.Never), + DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden) + ] + public override string CssClass + { + get + { + return base.CssClass; + } + set + { + base.CssClass = value; + } + } + #endregion + } +}
ensaiosclinicos/clinicaltrials
717f24870946631558f540c38b4c5a0879fdbf97
remove condition that disable "/static/" when DEBUG=False, fix #80
diff --git a/clinicaltrials/urls.py b/clinicaltrials/urls.py index c838e27..b448911 100644 --- a/clinicaltrials/urls.py +++ b/clinicaltrials/urls.py @@ -1,48 +1,45 @@ from django.conf.urls.defaults import * -import utilities - from django.contrib import admin # Django admin UI admin.autodiscover() # Django admin UI urlpatterns = patterns('', # Repository application url(r'^rg/', include('clinicaltrials.repository.urls')), # Tickets application url(r'^ticket/', include('clinicaltrials.tickets.urls')), # Assistance application url(r'^assistance/', include('clinicaltrials.assistance.urls')), # Review application url(r'^', include('clinicaltrials.reviewapp.urls')), # Django admin UI and documentation url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^decs/', include('clinicaltrials.decsclient.urls')), # django-registration views url(r'^accounts/', include('registration.backends.default.urls')), # system diagnostic views (may be disabled in production) url(r'^diag/', include('clinicaltrials.diagnostic.urls')), ) from django.conf import settings -if settings.DEBUG: - # serve static files from develpment server - from django.views import static - urlpatterns += patterns('', - url(r'^static/(?P<path>.*)$', 'django.views.static.serve', - {'document_root': settings.MEDIA_ROOT}), - ) + +# serve static files from develpment server +urlpatterns += patterns('', + url(r'^static/(?P<path>.*)$', 'django.views.static.serve', + {'document_root': settings.MEDIA_ROOT}), +) if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += patterns('', url(r'^rosetta/', include('rosetta.urls')), )
ensaiosclinicos/clinicaltrials
db983ac3237c6d11df6a51459c21354980e23d1a
don't clone help buttons, refers #71
diff --git a/clinicaltrials/static/css/style.css b/clinicaltrials/static/css/style.css index cc0bed8..c0cfbfd 100644 --- a/clinicaltrials/static/css/style.css +++ b/clinicaltrials/static/css/style.css @@ -1,361 +1,360 @@ body { height: 100%; margin: 0; padding: 0; text-align: left; font: 78% "Verdana", "Arial", "sans-serif"; background:#cbcbcd; } h1, h2, label, legend, #content a { color: #296784; } /* STYLE for BORDERED MAIN BLOCKS */ #container, #top, #footer, #columns, .stepmenu-top, .stepmenu-bottom { border-color: #D4D4FF; } #container { margin: 0px; padding: 0; line-height: 1.7em; background: transparent url(/static/bg_header.png) repeat-x scroll 0 0; } /*TOP BANNER*/ #top { padding: 0; margin: 0; border-width: 0 0 1px; float: left; clear: both; width: 100%; height: 118px; } #banner div.logo a { text-decoration: none; color: #296784; } #banner div.logo, #top div.institutions { float: left; width: 40%; margin: 1em 0 0 10%; } #banner div.institutions { margin-top: 0em; } #top div.institutions ul li { float: left; width: 40%; text-align: right; } #top div.institutions ul span { display: none; } #top div.institutions ul li a { display: block; height: 89px; } #top div.institutions ul li.BIREME a { background: transparent url(/static/bireme.gif) no-repeat center right; } #top div.institutions ul li.FIOCRUZ a { background: transparent url(/static/fiocruz.gif) no-repeat center right; } #middle { background-color: #FFF; position: relative; float: left; width: 100%; clear: both; overflow: hidden; } #columns { position: relative; width: 100%; float: left; right: 81%; border-width: 0 1px 0 0; background:#ebecf0; } #rebracmenu, #workarea { position: relative; } #rebracmenu h2 { display: none; } /* GROUP STEPS NAVIGATION AND CONTENT */ #workarea { float: left; left: 100%; width: 81%; } #rebracmenu { float: left; width: 16%; left: 1%; } #rebracmenu #usermenu div { padding: 3em; border-bottom: 1px dotted #D4D4FF; line-height: 100%; text-align: center; } #rebracmenu #usermenu div * { text-transform: capitalize; font-weight: bold; } #rebracmenu ul { list-style-type: none; padding-left: 1em; } #rebracmenu li { text-transform: capitalize; margin-bottom: 0.5em; border-bottom: 1px dotted #D4D4FF; } /* STEPS NAVIGATION*/ .stepmenu { background: transparent url(/static/bg_stepmenu.png) repeat-x; float: left; width: 100%; clear: both; } .stepmenu ul { margin: 0; padding: 0 0 0 2em; list-style: none; } .stepmenu ul li { display: block; float: left; width: 9%; border: 1px solid transparent; text-align: center; } .stepmenu li.current { border: 1px inset white; } .stepmenu a { text-decoration: none; text-transform: capitalize; color: #0a5172; font-weight: bold; font-size:11px; } .stepmenu li:hover { text-decoration: underline; } .stepmenu-top { border-width: 0 0 1px; } .stepmenu-bottom { border-width: 1px 0 0; } /*MAIN CONTENT*/ #content { padding: 10px; } #content a:link, #content a:visited { text-decoration: none; background: inherit; } #content a:hover { text-decoration: underline; } #content h2 { padding: 0.2em 0; font-weight:normal; margin-top:30px; } /*FOOTER*/ #footer { clear: both; padding: 5px; margin-top: 5px; border-width: 1px 0 0; background:#f3f4f6; } #footer a:link, #footer a:visited { background: inherit; } #footer, #footer a { color:#666; } #footer a{ text-decoration:underline; } #footer { font-size:69%; } /*TYPOGRAPHY*/ p { margin: 20px; } blockquote { font-weight: bold; font-style: italic; } table.table { border-collapse: collapse; border-width: 0 0 1px 1px; width: 100%; - display: block; } table.table, table.table td, table.table th { color:#4a4c4e; } table.table td, table.table th { padding: 10px; } table.table th { background-color: #F1F4F7; color:#333; } table.table textarea { width: 100%; } table.table td.help div.issue { display: none; } table.trialsummary { width: 100%; } /* AJAX DeCS Tools */ td div.decstool { display: none; } td div select { display: block; } td select, td div.decstool input { width: 80%; } td.showdecs div.decstool { display: block; } .issue{ font-size:10px; color:#5d5d5d; } fieldset{ border: 1px solid #CCC; margin-bottom:30px; } label{ font-weight:normal; } ul li{ list-style:none; } legend{ font-weight:bold; } #content a.buttonadd { background:#527FA3 url(/static/add.png) no-repeat scroll right center; border:1px solid #EBECF0; color:#FFFFFF; padding:5px 2em 5px 1em; } /* BARRA GOVERNO FEDERAL */ .barra_MSaude { width: 100%; height: 30px; background:#ffcc00; } .barra_MSaude .barra1000 { width:100%; margin: 0 auto; } .barra_MSaude .barra1000 .minSaude a { width: 152px; height: 21px; float: left; margin: 1px; background: url(ms.gif) top left no-repeat; } .barra_MSaude .barra1000 .brasilGov a { margin: 1px; width: 96px; height: 21px; float: right; background: url(brasil.gif) top left no-repeat; } .barra_MSaude .barra1000 .minSaude, .barra_MSaude .barra1000 .form { float: left; } .barra_MSaude .barra1000 .form { margin: 2px 0px 0px 50px; } .barra_MSaude .barra1000 .form .pr{ background: #ffcc00 !important; font-size: 10px; } .barra_MSaude .barra1000 .brasilGov { float: right; } .barra_MSaude .barra1000 DIV a span { display: none; } diff --git a/clinicaltrials/static/js/submission.utils.js b/clinicaltrials/static/js/submission.utils.js index 50d5f69..b7c3ee7 100644 --- a/clinicaltrials/static/js/submission.utils.js +++ b/clinicaltrials/static/js/submission.utils.js @@ -1,125 +1,121 @@ /** * Clone form elements in Django forms. JQuery * is required by this function. */ function cloneMore(selector, type) { var newElement = $(selector).clone(true); + newElement.find('td.help').remove(); + newElement.find('td').attr('colspan','2'); + var total = $('#id_' + type + '-TOTAL_FORMS').val(); newElement.find(':input').each(function() { var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-'); var id = 'id_' + name; $(this).attr({'name': name, 'id': id}); if($(this).attr('type')!='hidden')$(this).val('').removeAttr('checked'); }); newElement.find('label').each(function() { var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-'); $(this).attr('for', newFor); }); - newElement.find('img[rel]').each(function() { - var newFor = $(this).attr('rel').replace('-' + (total-1) + '-','-' + total + '-'); - $(this).attr('rel', newFor); - }); - newElement.find('div[id]').each(function() { - var newFor = $(this).attr('id').replace('-' + (total-1) + '-','-' + total + '-'); - $(this).attr('id', newFor); - }); + total++; $('#id_' + type + '-TOTAL_FORMS').val(total); - newElement.css("display","none"); + newElement.css("display","table").hide(); $(selector).after(newElement); newElement.show("fast"); } /** * A utility to name and create form elements */ function make_decs_for(node){ var set = node.id.match(/[a-z]+-\d+/)[0]; // get django formset prefix return {'select':set+"-combodecs", 'div':set+'-decstools', 'input':set+'-searchfield', 'button':set+'-searchbutton', 'id':function(e){return 'id_'+ this[e];}, 'create':function(e){return $('<'+e+'>').attr('id',this.id(e)).attr('name',this[e]);}, 'set':set}; } /** * This is the callback for decsclient app */ function make_decstool_callback(decs){ return function(data){ for(var i=0; i<data.length;i++){ $("<option>").attr("value",data[i].fields.label) .html(data[i].fields.description) .appendTo('#'+decs.id('select')); } $('#'+decs.id('select')).change(function(evt){ decs = make_decs_for(evt.target); $("input#id_"+decs.set+"-code") .attr("value",this.value); $("input#id_"+decs.set+"-text") .attr("value",$(this).find("option[selected]").html()); }); } } /** * Extend the django form and insert decs elements */ function getterm_event(decsclient_url) { return function(){ this.parentNode.className = ""; if(this.value === 'DeCS'){ this.parentNode.className = "showdecs"; var decs = make_decs_for(this); if($('#'+decs.id('select')).length === 0){ decs.create('div') .attr('class','decstool') .appendTo(this.parentNode) .append(decs.create('select')); $.get(decsclient_url,'', make_decstool_callback(decs),"json"); } } } }; /** * Extend the django form and insert decs elements */ function search_event(decsclient_url,label) { return function(){ this.parentNode.className = ""; if(this.value === 'DeCS'){ this.parentNode.className = "showdecs"; var decs = make_decs_for(this); if($('#'+decs.id('input')).length === 0){ decs.create('div') .attr('class','decstool') .appendTo(this.parentNode) .append(decs.create('input')) .append(decs.create('button').html(label)); $('#'+decs.id('button')) .click(function(evt){ var decs = make_decs_for(evt.target); if($('#'+decs.id('select')).length === 0){ decs.create('select') .insertAfter(this); } $('#'+decs.id('select')).html(''); $.get(decsclient_url+$('#'+decs.id('input')).val(),'', make_decstool_callback(decs), 'json'); return false; }); } } } };
ensaiosclinicos/clinicaltrials
455a7bfb40f911bd1df8cc4b048aa172de3d8bb5
Script to copy files from bk folder to fixtures folder
diff --git a/clinicaltrials/tools/recoverbk.sh b/clinicaltrials/tools/recoverbk.sh new file mode 100755 index 0000000..18e5464 --- /dev/null +++ b/clinicaltrials/tools/recoverbk.sh @@ -0,0 +1,14 @@ +dir=`dirname $0`; +for i in `ls -1 $dir/bkp`; +do + appname=`cut -d'.' -f1 <<< $i`; + target="$dir/../$appname/fixtures/initial_data.json"; + + if [ -a "$target" ]; + then + echo cp $dir/bkp/$i $target; + cp $dir/bkp/$i $target; + fi +done +echo "" +echo "Dont't forget to syncdb"
ensaiosclinicos/clinicaltrials
31e7f8200481ba8d5b06908b340b2b97e95ca748
create a dir for 'bkp' is needed
diff --git a/clinicaltrials/tools/dumpall.sh b/clinicaltrials/tools/dumpall.sh index 780f132..587e380 100644 --- a/clinicaltrials/tools/dumpall.sh +++ b/clinicaltrials/tools/dumpall.sh @@ -1,16 +1,17 @@ #!/bin/bash +mkdir bkp ../manage.py dumpdata --indent=2 assistance > bkp/assistance.json ../manage.py dumpdata --indent=2 registration > bkp/registration.json ../manage.py dumpdata --indent=2 repository > bkp/repository.json ../manage.py dumpdata --indent=2 reviewapp > bkp/reviewapp.json ../manage.py dumpdata --indent=2 tickets > bkp/tickets.json ../manage.py dumpdata --indent=2 vocabulary > bkp/vocabulary.json ../manage.py dumpdata --indent=2 -e assistance -e registration -e repository -e reviewapp -e tickets -e vocabulary > bkp/other.json cd ../static/ tar czvf attachments.tgz attachments/ cd ../tools/ -mv ../static/attachments.tgz bkp/ +mv ../static/attachments.tgz bkp/ tar czvf bkp.tgz bkp/
ensaiosclinicos/clinicaltrials
4f02569c3c49c361df49efe43e37a148c2418aa8
added backup script; removed empty models.py from decsclient app
diff --git a/clinicaltrials/decsclient/models.py b/clinicaltrials/decsclient/models.py deleted file mode 100755 index 71a8362..0000000 --- a/clinicaltrials/decsclient/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/clinicaltrials/tools/dumpall.sh b/clinicaltrials/tools/dumpall.sh new file mode 100644 index 0000000..780f132 --- /dev/null +++ b/clinicaltrials/tools/dumpall.sh @@ -0,0 +1,16 @@ +#!/bin/bash +../manage.py dumpdata --indent=2 assistance > bkp/assistance.json +../manage.py dumpdata --indent=2 registration > bkp/registration.json +../manage.py dumpdata --indent=2 repository > bkp/repository.json +../manage.py dumpdata --indent=2 reviewapp > bkp/reviewapp.json +../manage.py dumpdata --indent=2 tickets > bkp/tickets.json +../manage.py dumpdata --indent=2 vocabulary > bkp/vocabulary.json +../manage.py dumpdata --indent=2 -e assistance -e registration -e repository -e reviewapp -e tickets -e vocabulary > bkp/other.json +cd ../static/ +tar czvf attachments.tgz attachments/ +cd ../tools/ +mv ../static/attachments.tgz bkp/ +tar czvf bkp.tgz bkp/ + + +
ensaiosclinicos/clinicaltrials
7488cfe0728bf896b2c81077fa889d12e587e716
fix partially the id for cluetip
diff --git a/clinicaltrials/repository/trds_forms.py b/clinicaltrials/repository/trds_forms.py index 8ce132e..eeb0c64 100644 --- a/clinicaltrials/repository/trds_forms.py +++ b/clinicaltrials/repository/trds_forms.py @@ -1,367 +1,367 @@ #coding: utf-8 from assistance.models import FieldHelp from vocabulary.models import CountryCode from repository.models import ClinicalTrial, Contact, Descriptor, Institution from repository.models import InterventionCode, Outcome, RecruitmentStatus from repository.models import StudyPhase, TrialSecondarySponsor from repository.models import TrialSupportSource import choices from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django import forms from django.forms.forms import BoundField, conditional_escape class ReviewModelForm(forms.ModelForm): def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row): "Helper function for outputting HTML. Used by as_table(), as_ul(), as_p()." top_errors = self.non_field_errors() # Errors that should be displayed above all fields. output, hidden_fields = [], [] for name, field in self.fields.items(): bf = BoundField(self, field, name) bf_errors = self.error_class([conditional_escape(error) for error in bf.errors]) # Escape and cache in local variable. if bf.is_hidden: if bf_errors: top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors]) hidden_fields.append(unicode(bf)) else: if errors_on_separate_row and bf_errors: output.append(error_row % force_unicode(bf_errors)) if bf.label: label = conditional_escape(force_unicode(bf.label)) # Only add the suffix if the label does not end in # punctuation. if self.label_suffix: if label[-1] not in ':?.!': label += self.label_suffix label = bf.label_tag(label) or '' else: label = '' if field.help_text: help_text = help_text_html % force_unicode(field.help_text) else: help_text = u'' form_name = self.__class__.__name__ #import pdb; pdb.set_trace() help_record, new = FieldHelp.objects.get_or_create(form=form_name, field=name) help_text = help_text + u' ' + force_unicode(help_record) help_text = help_text_html % help_text field_path = '%s.%s' % (form_name, name) issue_text = '%s #%s' % (field_path, self.instance.pk) output.append(normal_row % {'errors': force_unicode(bf_errors), 'label': force_unicode(label), 'field': unicode(bf), 'help_text': help_text, - 'help_id': 'help%s' % help_record.pk, + 'help_id': 'id_%s-help%s' % ((self.prefix or name),help_record.pk), 'issue': issue_text,}) if top_errors: output.insert(0, error_row % force_unicode(top_errors)) if hidden_fields: # Insert any hidden fields in the last row. str_hidden = u''.join(hidden_fields) if output: last_row = output[-1] # Chop off the trailing row_ender (e.g. '</td></tr>') and # insert the hidden fields. if not last_row.endswith(row_ender): # This can happen in the as_p() case (and possibly others # that users write): if there are only top errors, we may # not be able to conscript the last row for our purposes, # so insert a new, empty row. last_row = normal_row % {'errors': '', 'label': '', 'field': '', 'help_text': '', - 'help_id': 'help%s' % help_record.pk, + 'help_id': 'id_%s-help%s' % (self.prefix,help_record.pk), 'issue': '',} output.append(last_row) output[-1] = last_row[:-len(row_ender)] + str_hidden + row_ender else: # If there aren't any rows in the output, just append the # hidden fields. output.append(str_hidden) return mark_safe(u'\n'.join(output)) def as_table(self): "Returns this form rendered as HTML <tr>s -- excluding the <table></table>." normal_row = u''' <tr><th>%(label)s</th> <td>%(errors)s%(field)s</td> <td class="help"> <img src="/static/help.png" rel="#%(help_id)s"/> <div id="%(help_id)s" class="help">%(help_text)s</div> <div class="issue">%(issue)s</div> </td></tr> ''' return self._html_output(normal_row=normal_row, error_row=u'<tr><td colspan="3">%s</td></tr>', row_ender='</td></tr>', help_text_html=u'%s', errors_on_separate_row=False) # # Forms # #step1 class TrialIdentificationForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['scientific_title','scientific_acronym', 'public_title','acronym'] title = _('Trial Identification') # TRDS 10a scientific_title = forms.CharField(label=_('Scientific Title'), max_length=2000, widget=forms.Textarea) # TRDS 10b scientific_acronym = forms.CharField(required=False, label=_('Scientific Acronym'), max_length=255) # TRDS 9a public_title = forms.CharField(required=False, label=_('Public Title'), max_length=2000, widget=forms.Textarea) # TRDS 9b acronym = forms.CharField(required=False, label=_('Acronym'), max_length=255) class SecondaryIdForm(ReviewModelForm): title = _('Secondary Identifying Numbers') # this is just to inherit the custom _html_output and as_table methods #step2 class PrimarySponsorForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['primary_sponsor',] title = _('Primary Sponsor') #step2 class SecondarySponsorForm(ReviewModelForm): class Meta: model = TrialSecondarySponsor fields = ['institution','relation'] title = _('Secondary Sponsor(s)') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[1][0]) #step2 class SupportSourceForm(ReviewModelForm): class Meta: model = TrialSupportSource fields = ['institution','relation'] title = _('Source(s) of Monetary or Material Support') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[0][0]) class NewInstitution(ReviewModelForm): class Meta: model = Institution title = _('New Institution') #step3 class HealthConditionsForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['hc_freetext',] title = _('Health Condition(s) or Problem(s) Studied') # TRDS 12a hc_freetext = forms.CharField(label=_('Health Condition(s) or Problem(s)'), required=False, max_length=8000, widget=forms.Textarea) #step3 class DescriptorForm(ReviewModelForm): class Meta: model = Descriptor trial = forms.CharField(widget=forms.HiddenInput,required=False) class GeneralHealthDescriptorForm(DescriptorForm): title = _('General Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) class SpecificHealthDescriptorForm(DescriptorForm): title = _('Specific Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[1][0]) #step4 class InterventionDescriptorForm(DescriptorForm): title = _('Descriptor for Intervention(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[1][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) #step4 class InterventionForm(ReviewModelForm): title = _('Intervention(s)') class Meta: model = ClinicalTrial fields = ['i_freetext','i_code'] title = _('Intervention(s)') i_freetext = forms.CharField(label=_('Intervention(s)'), required=False, max_length=8000, widget=forms.Textarea) i_code = forms.ModelMultipleChoiceField(label=_("Intervention Code(s)"), queryset=InterventionCode.objects.all(), widget=forms.CheckboxSelectMultiple()) #step5 class RecruitmentForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['recruitment_status', 'recruitment_country','date_enrollment', 'target_sample_size', 'inclusion_criteria', 'gender', 'agemin_value', 'agemin_unit', 'agemax_value', 'agemax_unit', 'exclusion_criteria', ] title = _('Recruitment') # TRDS 18 recruitment_status = forms.ModelChoiceField(label=_('Recruitment Status'), queryset=RecruitmentStatus.objects.all()) recruitment_country = forms.ModelMultipleChoiceField( label=_('Recruitment Country'), queryset=CountryCode.objects.all()) # TRDS 16a,b (type_enrollment: anticipated or actual) date_enrollment = forms.CharField( # yyyy-mm or yyyy-mm-dd label=_('Date of First Enrollment'), max_length=10, required=False) # TRDS 17 target_sample_size = forms.IntegerField(label=_('Target Sample Size'), initial=0 , required=False) # TRDS 14a inclusion_criteria = forms.CharField(label=_('Inclusion Criteria'), required=False, max_length=8000, widget=forms.Textarea) # TRDS 14b gender = forms.ChoiceField(label=_('Gender (inclusion sex)'), choices=choices.INCLUSION_GENDER) # TRDS 14c agemin_value = forms.IntegerField(required=False, label=_('Inclusion Minimum Age')) agemin_unit = forms.ChoiceField(label=_('Minimum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14d agemax_value = forms.IntegerField(required=False, label=_('Inclusion Maximum Age')) agemax_unit = forms.ChoiceField(label=_('Maximum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14e exclusion_criteria = forms.CharField(label=_('Exclusion Criteria'),required=False, max_length=8000, widget=forms.Textarea,) #step6 class StudyTypeForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['study_design', 'expanded_access_program', 'purpose', 'intervention_assignment', 'number_of_arms', 'masking', 'allocation', 'phase'] title = _('Study Type') # TRDS 15b study_design = forms.CharField(label=_('Study Design'), required=False, max_length=1000, widget=forms.Textarea) expanded_access_program = forms.ChoiceField(label=_('Expandend Access Program'), choices=[(None,_('Unknown')), (True,_('Yes')), (False,_('No')),], widget=forms.RadioSelect) # TRDS 15c phase = forms.ModelChoiceField(label=_('Study Phase'), queryset=StudyPhase.objects.all()) #step7 class OutcomesForm(ReviewModelForm): class Meta: model = Outcome fields = ['interest','description'] title = _('Outcomes') #step8 class PublicContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Public Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[0][0], widget=forms.HiddenInput) #step8 class ScientificContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Scientific Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[1][0], widget=forms.HiddenInput) #step8 class SiteContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Site Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[2][0], widget=forms.HiddenInput) #step8-partof class ContactForm(ReviewModelForm): class Meta: model = Contact title = _('New Contact(s)') relation = forms.ChoiceField(widget=forms.RadioSelect, choices=choices.CONTACT_RELATION) firstname = forms.CharField(label=_('First Name'), max_length=50) middlename = forms.CharField(label=_('Middle Name'), max_length=50,required=False) lastname = forms.CharField(label=_('Last Name'), max_length=50) email = forms.EmailField(label=_('E-mail'), max_length=255) affiliation = forms.ModelChoiceField(Institution.objects.all(), _('Affiliation')) address = forms.CharField(label=_('Address'), max_length=255,required=False) city = forms.CharField(label=_('City'), max_length=255) country = forms.ModelChoiceField(CountryCode.objects.all(), _('Country')) zip = forms.CharField(label=_('Postal Code'), max_length=50) telephone = forms.CharField(label=_('Telephone'), max_length=255) \ No newline at end of file diff --git a/clinicaltrials/static/js/submission.utils.js b/clinicaltrials/static/js/submission.utils.js index 20a744e..50d5f69 100644 --- a/clinicaltrials/static/js/submission.utils.js +++ b/clinicaltrials/static/js/submission.utils.js @@ -1,117 +1,125 @@ /** * Clone form elements in Django forms. JQuery * is required by this function. */ function cloneMore(selector, type) { var newElement = $(selector).clone(true); var total = $('#id_' + type + '-TOTAL_FORMS').val(); newElement.find(':input').each(function() { var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-'); var id = 'id_' + name; $(this).attr({'name': name, 'id': id}); if($(this).attr('type')!='hidden')$(this).val('').removeAttr('checked'); }); newElement.find('label').each(function() { var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-'); $(this).attr('for', newFor); }); + newElement.find('img[rel]').each(function() { + var newFor = $(this).attr('rel').replace('-' + (total-1) + '-','-' + total + '-'); + $(this).attr('rel', newFor); + }); + newElement.find('div[id]').each(function() { + var newFor = $(this).attr('id').replace('-' + (total-1) + '-','-' + total + '-'); + $(this).attr('id', newFor); + }); total++; $('#id_' + type + '-TOTAL_FORMS').val(total); newElement.css("display","none"); $(selector).after(newElement); newElement.show("fast"); } /** * A utility to name and create form elements */ function make_decs_for(node){ var set = node.id.match(/[a-z]+-\d+/)[0]; // get django formset prefix return {'select':set+"-combodecs", 'div':set+'-decstools', 'input':set+'-searchfield', 'button':set+'-searchbutton', 'id':function(e){return 'id_'+ this[e];}, 'create':function(e){return $('<'+e+'>').attr('id',this.id(e)).attr('name',this[e]);}, 'set':set}; } /** * This is the callback for decsclient app */ function make_decstool_callback(decs){ return function(data){ for(var i=0; i<data.length;i++){ $("<option>").attr("value",data[i].fields.label) .html(data[i].fields.description) .appendTo('#'+decs.id('select')); } $('#'+decs.id('select')).change(function(evt){ decs = make_decs_for(evt.target); $("input#id_"+decs.set+"-code") .attr("value",this.value); $("input#id_"+decs.set+"-text") .attr("value",$(this).find("option[selected]").html()); }); } } /** * Extend the django form and insert decs elements */ function getterm_event(decsclient_url) { return function(){ this.parentNode.className = ""; if(this.value === 'DeCS'){ this.parentNode.className = "showdecs"; var decs = make_decs_for(this); if($('#'+decs.id('select')).length === 0){ decs.create('div') .attr('class','decstool') .appendTo(this.parentNode) .append(decs.create('select')); $.get(decsclient_url,'', make_decstool_callback(decs),"json"); } } } }; /** * Extend the django form and insert decs elements */ function search_event(decsclient_url,label) { return function(){ this.parentNode.className = ""; if(this.value === 'DeCS'){ this.parentNode.className = "showdecs"; var decs = make_decs_for(this); if($('#'+decs.id('input')).length === 0){ decs.create('div') .attr('class','decstool') .appendTo(this.parentNode) .append(decs.create('input')) .append(decs.create('button').html(label)); $('#'+decs.id('button')) .click(function(evt){ var decs = make_decs_for(evt.target); if($('#'+decs.id('select')).length === 0){ decs.create('select') .insertAfter(this); } $('#'+decs.id('select')).html(''); $.get(decsclient_url+$('#'+decs.id('input')).val(),'', make_decstool_callback(decs), 'json'); return false; }); } } } };
ensaiosclinicos/clinicaltrials
1734613d9af0337211f069b4a5ca210ff4e1931b
unecessary line causes 404 error
diff --git a/clinicaltrials/static/css/jquery.cluetip.css b/clinicaltrials/static/css/jquery.cluetip.css index 962e703..51d10f9 100644 --- a/clinicaltrials/static/css/jquery.cluetip.css +++ b/clinicaltrials/static/css/jquery.cluetip.css @@ -1,230 +1,230 @@ /* global */ #cluetip-close img { border: 0; } #cluetip-title { overflow: hidden; } #cluetip-title #cluetip-close { float: right; position: relative; } #cluetip-waitimage { width: 43px; height: 11px; position: absolute; - background-image: url(images/wait.gif); + /*background-image: url(images/wait.gif);*/ } .cluetip-arrows { display: none; position: absolute; top: 0; left: -11px; height: 22px; width: 11px; background-repeat: no-repeat; background-position: 0 0; } #cluetip-extra { display: none; } /*************************************** =cluetipClass: 'default' -------------------------------------- */ .cluetip-default { background-color: #d9d9c2; } .cluetip-default #cluetip-outer { position: relative; margin: 0; background-color: #d9d9c2; } .cluetip-default h3#cluetip-title { margin: 0 0 5px; padding: 8px 10px 4px; font-size: 1.1em; font-weight: normal; background-color: #87876a; color: #fff; } .cluetip-default #cluetip-title a { color: #d9d9c2; font-size: 0.95em; } .cluetip-default #cluetip-inner { padding: 10px; } .cluetip-default div#cluetip-close { text-align: right; margin: 0 5px 5px; color: #900; } /* default arrows */ .clue-right-default .cluetip-arrows { background-image: url(images/darrowleft.gif); } .clue-left-default .cluetip-arrows { background-image: url(images/darrowright.gif); left: 100%; margin-right: -11px; } .clue-top-default .cluetip-arrows { background-image: url(images/darrowdown.gif); top: 100%; left: 50%; margin-left: -11px; height: 11px; width: 22px; } .clue-bottom-default .cluetip-arrows { background-image: url(images/darrowup.gif); top: -11px; left: 50%; margin-left: -11px; height: 11px; width: 22px; } /*************************************** =cluetipClass: 'jtip' -------------------------------------- */ .cluetip-jtip { background-color: transparent; } .cluetip-jtip #cluetip-outer { border: 2px solid #ccc; position: relative; background-color: #fff; } .cluetip-jtip h3#cluetip-title { margin: 0 0 5px; padding: 2px 5px; font-size: 16px; font-weight: normal; background-color: #ccc; color: #333; } .cluetip-jtip #cluetip-inner { padding: 0 5px 5px; display: inline-block; } .cluetip-jtip div#cluetip-close { text-align: right; margin: 0 5px 5px; color: #900; } /* jtip arrows */ .clue-right-jtip .cluetip-arrows { background-image: url(images/arrowleft.gif); } .clue-left-jtip .cluetip-arrows { background-image: url(images/arrowright.gif); left: 100%; margin-right: -11px; } .clue-top-jtip .cluetip-arrows { background-image: url(images/arrowdown.gif); top: 100%; left: 50%; margin-left: -11px; height: 11px; width: 22px; } .clue-bottom-jtip .cluetip-arrows { background-image: url(images/arrowup.gif); top: -11px; left: 50%; margin-left: -11px; height: 11px; width: 22px; } /*************************************** =cluetipClass: 'rounded' -------------------------------------- */ .cluetip-rounded { background: transparent url(images/bl.gif) no-repeat 0 100%; margin-top: 10px; margin-left: 12px; } .cluetip-rounded #cluetip-outer { background: transparent url(images/tl.gif) no-repeat 0 0; margin-top: -12px; } .cluetip-rounded #cluetip-title { background-color: transparent; padding: 12px 12px 0; margin: 0 -12px 0 0; position: relative; } .cluetip-rounded #cluetip-extra { position: absolute; display: block; background: transparent url(images/tr.gif) no-repeat 100% 0; top: 0; right: 0; width: 12px; height: 30px; margin: -12px -12px 0 0; } .cluetip-rounded #cluetip-inner { background: url(images/br.gif) no-repeat 100% 100%; padding: 5px 12px 12px; margin: -18px -12px 0 0; position: relative; } .cluetip-rounded div#cluetip-close { text-align: right; margin: 0 5px 5px; color: #009; background: transparent; } .cluetip-rounded div#cluetip-close a { color: #777; } /* rounded arrows */ .clue-right-rounded .cluetip-arrows { background-image: url(images/rarrowleft.gif); } .clue-left-rounded .cluetip-arrows { background-image: url(images/rarrowright.gif); left: 100%; margin-left: 12px; } .clue-top-rounded .cluetip-arrows { background-image: url(images/rarrowdown.gif); top: 100%; left: 50%; margin-left: -11px; height: 11px; width: 22px; } .clue-bottom-rounded .cluetip-arrows { background-image: url(images/rarrowup.gif); top: -23px; left: 50%; margin-left: -11px; height: 11px; width: 22px; } /* stupid IE6 HasLayout hack */ .cluetip-rounded #cluetip-title, .cluetip-rounded #cluetip-inner { zoom: 1; } \ No newline at end of file
ensaiosclinicos/clinicaltrials
d3ab7fbe1ae4aca4087edb26bfde8b2cfdf24068
Provide a cool tooltip that enhance and complete #71
diff --git a/clinicaltrials/repository/templates/repository/step_2.html b/clinicaltrials/repository/templates/repository/step_2.html index 6bbcee2..20b8b80 100644 --- a/clinicaltrials/repository/templates/repository/step_2.html +++ b/clinicaltrials/repository/templates/repository/step_2.html @@ -1,79 +1,75 @@ {% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript"> $(document).ready(function() { $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: true }); // TODO: Replace absolute path $("div.g select") .change(getterm_event('{% url decs.getterm lang="en",code="" %}')) .each(function(){$(this).change();}); $("div.s select") .change(search_event( '{% url decs.search lang="en",term="" %}', '{% trans "Search terms" %}')) .each(function(){$(this).change();}); + + $('td.help img').cluetip({local:true, cursor: 'pointer',showTitle: false}); }); function new_institution(){ return window.open('{% url new_institution %}','n_i','status=0,location=0,height=375'); } // management_form.prefix </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> <input onclick="new_institution()" type="button" value="{% trans 'New Institution' %}"/> </div> </fieldset> {% endfor %} - - <br/> - - <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> - - {% if next_form_title %} - <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> - {% endif %} + + <input type="submit" value="{% trans "Save" %}"/> </form> {% endblock %} diff --git a/clinicaltrials/repository/templates/repository/step_3.html b/clinicaltrials/repository/templates/repository/step_3.html index 12599ae..a9fd453 100644 --- a/clinicaltrials/repository/templates/repository/step_3.html +++ b/clinicaltrials/repository/templates/repository/step_3.html @@ -1,67 +1,65 @@ {% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript" src="/static/js/submission.utils.js"></script> <script type="text/javascript"> $(document).ready(function() { // TODO: Replace absolute path $("div.g select") .change(getterm_event('{% url decs.getterm lang="en",code="" %}')) .each(function(){$(this).change();}); $("div.s select") .change(search_event( '{% url decs.search lang="en",term="" %}', '{% trans "Search terms" %}')) .each(function(){$(this).change();}); + + $('td.help img').cluetip({local:true, cursor: 'pointer',showTitle: false}); }); // management_form.prefix </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> {% endfor %} - </div> + </div> + <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> -</div> + </div> + </fieldset> {% endfor %} - - <br/> - - <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> - - {% if next_form_title %} - <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> - {% endif %} + + <input type="submit" value="{% trans "Save" %}"/> </form> {% endblock %} diff --git a/clinicaltrials/repository/templates/repository/step_4.html b/clinicaltrials/repository/templates/repository/step_4.html index ff8d275..285cd99 100644 --- a/clinicaltrials/repository/templates/repository/step_4.html +++ b/clinicaltrials/repository/templates/repository/step_4.html @@ -1,62 +1,59 @@ {% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript" src="/static/js/submission.utils.js"></script> <script type="text/javascript"> $(document).ready(function() { $("div.form select") .change(search_event( '{% url decs.search lang="en",term="" %}', '{% trans "Search terms" %}')) .each(function(){$(this).change();}); + $('td.help img').cluetip({local:true, cursor: 'pointer',showTitle: false}); }); // management_form.prefix </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> {% endfor %} - </div> + </div> + <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> -</div> + </div> + </fieldset> {% endfor %} - - <br/> - - <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> - - {% if next_form_title %} - <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> - {% endif %} + + <input type="submit" value="{% trans "Save" %}"/> </form> {% endblock %} diff --git a/clinicaltrials/repository/templates/repository/trial_form.html b/clinicaltrials/repository/templates/repository/trial_form.html index 4b9fade..3cdd5b0 100644 --- a/clinicaltrials/repository/templates/repository/trial_form.html +++ b/clinicaltrials/repository/templates/repository/trial_form.html @@ -1,63 +1,57 @@ {% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript"> $(document).ready(function() { $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: false }); + $('td.help img').cluetip({local:true, cursor: 'pointer',showTitle: false}); }); </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> </div> </fieldset> {% endfor %} - - <br/> - - <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> - - {% if next_form_title %} - <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> - {% endif %} + <input type="submit" value="{% trans "Save" %}"/> </form> {% endblock %} diff --git a/clinicaltrials/repository/trds_forms.py b/clinicaltrials/repository/trds_forms.py index 5c5437e..8ce132e 100644 --- a/clinicaltrials/repository/trds_forms.py +++ b/clinicaltrials/repository/trds_forms.py @@ -1,368 +1,367 @@ #coding: utf-8 from assistance.models import FieldHelp from vocabulary.models import CountryCode from repository.models import ClinicalTrial, Contact, Descriptor, Institution from repository.models import InterventionCode, Outcome, RecruitmentStatus from repository.models import StudyPhase, TrialSecondarySponsor from repository.models import TrialSupportSource import choices from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django import forms from django.forms.forms import BoundField, conditional_escape class ReviewModelForm(forms.ModelForm): def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row): "Helper function for outputting HTML. Used by as_table(), as_ul(), as_p()." top_errors = self.non_field_errors() # Errors that should be displayed above all fields. output, hidden_fields = [], [] for name, field in self.fields.items(): bf = BoundField(self, field, name) bf_errors = self.error_class([conditional_escape(error) for error in bf.errors]) # Escape and cache in local variable. if bf.is_hidden: if bf_errors: top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors]) hidden_fields.append(unicode(bf)) else: if errors_on_separate_row and bf_errors: output.append(error_row % force_unicode(bf_errors)) if bf.label: label = conditional_escape(force_unicode(bf.label)) # Only add the suffix if the label does not end in # punctuation. if self.label_suffix: if label[-1] not in ':?.!': label += self.label_suffix label = bf.label_tag(label) or '' else: label = '' if field.help_text: help_text = help_text_html % force_unicode(field.help_text) else: help_text = u'' form_name = self.__class__.__name__ #import pdb; pdb.set_trace() help_record, new = FieldHelp.objects.get_or_create(form=form_name, field=name) help_text = help_text + u' ' + force_unicode(help_record) help_text = help_text_html % help_text field_path = '%s.%s' % (form_name, name) issue_text = '%s #%s' % (field_path, self.instance.pk) output.append(normal_row % {'errors': force_unicode(bf_errors), 'label': force_unicode(label), 'field': unicode(bf), 'help_text': help_text, 'help_id': 'help%s' % help_record.pk, 'issue': issue_text,}) if top_errors: output.insert(0, error_row % force_unicode(top_errors)) if hidden_fields: # Insert any hidden fields in the last row. str_hidden = u''.join(hidden_fields) if output: last_row = output[-1] # Chop off the trailing row_ender (e.g. '</td></tr>') and # insert the hidden fields. if not last_row.endswith(row_ender): # This can happen in the as_p() case (and possibly others # that users write): if there are only top errors, we may # not be able to conscript the last row for our purposes, # so insert a new, empty row. last_row = normal_row % {'errors': '', 'label': '', 'field': '', 'help_text': '', + 'help_id': 'help%s' % help_record.pk, 'issue': '',} output.append(last_row) output[-1] = last_row[:-len(row_ender)] + str_hidden + row_ender else: # If there aren't any rows in the output, just append the # hidden fields. output.append(str_hidden) return mark_safe(u'\n'.join(output)) def as_table(self): "Returns this form rendered as HTML <tr>s -- excluding the <table></table>." normal_row = u''' <tr><th>%(label)s</th> <td>%(errors)s%(field)s</td> <td class="help"> - <img src="/static/help.png" - rel="%(help_id)s" - /> + <img src="/static/help.png" rel="#%(help_id)s"/> <div id="%(help_id)s" class="help">%(help_text)s</div> <div class="issue">%(issue)s</div> </td></tr> ''' return self._html_output(normal_row=normal_row, error_row=u'<tr><td colspan="3">%s</td></tr>', row_ender='</td></tr>', help_text_html=u'%s', errors_on_separate_row=False) # # Forms # #step1 class TrialIdentificationForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['scientific_title','scientific_acronym', 'public_title','acronym'] title = _('Trial Identification') # TRDS 10a scientific_title = forms.CharField(label=_('Scientific Title'), max_length=2000, widget=forms.Textarea) # TRDS 10b scientific_acronym = forms.CharField(required=False, label=_('Scientific Acronym'), max_length=255) # TRDS 9a public_title = forms.CharField(required=False, label=_('Public Title'), max_length=2000, widget=forms.Textarea) # TRDS 9b acronym = forms.CharField(required=False, label=_('Acronym'), max_length=255) class SecondaryIdForm(ReviewModelForm): title = _('Secondary Identifying Numbers') # this is just to inherit the custom _html_output and as_table methods #step2 class PrimarySponsorForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['primary_sponsor',] title = _('Primary Sponsor') #step2 class SecondarySponsorForm(ReviewModelForm): class Meta: model = TrialSecondarySponsor fields = ['institution','relation'] title = _('Secondary Sponsor(s)') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[1][0]) #step2 class SupportSourceForm(ReviewModelForm): class Meta: model = TrialSupportSource fields = ['institution','relation'] title = _('Source(s) of Monetary or Material Support') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[0][0]) class NewInstitution(ReviewModelForm): class Meta: model = Institution title = _('New Institution') #step3 class HealthConditionsForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['hc_freetext',] title = _('Health Condition(s) or Problem(s) Studied') # TRDS 12a hc_freetext = forms.CharField(label=_('Health Condition(s) or Problem(s)'), required=False, max_length=8000, widget=forms.Textarea) #step3 class DescriptorForm(ReviewModelForm): class Meta: model = Descriptor trial = forms.CharField(widget=forms.HiddenInput,required=False) class GeneralHealthDescriptorForm(DescriptorForm): title = _('General Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) class SpecificHealthDescriptorForm(DescriptorForm): title = _('Specific Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[1][0]) #step4 class InterventionDescriptorForm(DescriptorForm): title = _('Descriptor for Intervention(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[1][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) #step4 class InterventionForm(ReviewModelForm): title = _('Intervention(s)') class Meta: model = ClinicalTrial fields = ['i_freetext','i_code'] title = _('Intervention(s)') i_freetext = forms.CharField(label=_('Intervention(s)'), required=False, max_length=8000, widget=forms.Textarea) i_code = forms.ModelMultipleChoiceField(label=_("Intervention Code(s)"), queryset=InterventionCode.objects.all(), widget=forms.CheckboxSelectMultiple()) #step5 class RecruitmentForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['recruitment_status', 'recruitment_country','date_enrollment', 'target_sample_size', 'inclusion_criteria', 'gender', 'agemin_value', 'agemin_unit', 'agemax_value', 'agemax_unit', 'exclusion_criteria', ] title = _('Recruitment') # TRDS 18 recruitment_status = forms.ModelChoiceField(label=_('Recruitment Status'), queryset=RecruitmentStatus.objects.all()) recruitment_country = forms.ModelMultipleChoiceField( label=_('Recruitment Country'), queryset=CountryCode.objects.all()) # TRDS 16a,b (type_enrollment: anticipated or actual) date_enrollment = forms.CharField( # yyyy-mm or yyyy-mm-dd label=_('Date of First Enrollment'), max_length=10, required=False) # TRDS 17 target_sample_size = forms.IntegerField(label=_('Target Sample Size'), initial=0 , required=False) # TRDS 14a inclusion_criteria = forms.CharField(label=_('Inclusion Criteria'), required=False, max_length=8000, widget=forms.Textarea) # TRDS 14b gender = forms.ChoiceField(label=_('Gender (inclusion sex)'), choices=choices.INCLUSION_GENDER) # TRDS 14c agemin_value = forms.IntegerField(required=False, label=_('Inclusion Minimum Age')) agemin_unit = forms.ChoiceField(label=_('Minimum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14d agemax_value = forms.IntegerField(required=False, label=_('Inclusion Maximum Age')) agemax_unit = forms.ChoiceField(label=_('Maximum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14e exclusion_criteria = forms.CharField(label=_('Exclusion Criteria'),required=False, max_length=8000, widget=forms.Textarea,) #step6 class StudyTypeForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['study_design', 'expanded_access_program', 'purpose', 'intervention_assignment', 'number_of_arms', 'masking', 'allocation', 'phase'] title = _('Study Type') # TRDS 15b study_design = forms.CharField(label=_('Study Design'), required=False, max_length=1000, widget=forms.Textarea) expanded_access_program = forms.ChoiceField(label=_('Expandend Access Program'), choices=[(None,_('Unknown')), (True,_('Yes')), (False,_('No')),], widget=forms.RadioSelect) # TRDS 15c phase = forms.ModelChoiceField(label=_('Study Phase'), queryset=StudyPhase.objects.all()) #step7 class OutcomesForm(ReviewModelForm): class Meta: model = Outcome fields = ['interest','description'] title = _('Outcomes') #step8 class PublicContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Public Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[0][0], widget=forms.HiddenInput) #step8 class ScientificContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Scientific Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[1][0], widget=forms.HiddenInput) #step8 class SiteContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Site Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[2][0], widget=forms.HiddenInput) #step8-partof class ContactForm(ReviewModelForm): class Meta: model = Contact title = _('New Contact(s)') relation = forms.ChoiceField(widget=forms.RadioSelect, choices=choices.CONTACT_RELATION) firstname = forms.CharField(label=_('First Name'), max_length=50) middlename = forms.CharField(label=_('Middle Name'), max_length=50,required=False) lastname = forms.CharField(label=_('Last Name'), max_length=50) email = forms.EmailField(label=_('E-mail'), max_length=255) affiliation = forms.ModelChoiceField(Institution.objects.all(), _('Affiliation')) address = forms.CharField(label=_('Address'), max_length=255,required=False) city = forms.CharField(label=_('City'), max_length=255) country = forms.ModelChoiceField(CountryCode.objects.all(), _('Country')) zip = forms.CharField(label=_('Postal Code'), max_length=50) telephone = forms.CharField(label=_('Telephone'), max_length=255) \ No newline at end of file diff --git a/clinicaltrials/static/css/jquery.cluetip.css b/clinicaltrials/static/css/jquery.cluetip.css new file mode 100644 index 0000000..962e703 --- /dev/null +++ b/clinicaltrials/static/css/jquery.cluetip.css @@ -0,0 +1,230 @@ +/* global */ +#cluetip-close img { + border: 0; +} +#cluetip-title { + overflow: hidden; +} +#cluetip-title #cluetip-close { + float: right; + position: relative; +} +#cluetip-waitimage { + width: 43px; + height: 11px; + position: absolute; + background-image: url(images/wait.gif); +} +.cluetip-arrows { + display: none; + position: absolute; + top: 0; + left: -11px; + height: 22px; + width: 11px; + background-repeat: no-repeat; + background-position: 0 0; +} +#cluetip-extra { + display: none; +} +/*************************************** + =cluetipClass: 'default' +-------------------------------------- */ + +.cluetip-default { + background-color: #d9d9c2; +} +.cluetip-default #cluetip-outer { + position: relative; + margin: 0; + background-color: #d9d9c2; +} +.cluetip-default h3#cluetip-title { + margin: 0 0 5px; + padding: 8px 10px 4px; + font-size: 1.1em; + font-weight: normal; + background-color: #87876a; + color: #fff; +} +.cluetip-default #cluetip-title a { + color: #d9d9c2; + font-size: 0.95em; +} +.cluetip-default #cluetip-inner { + padding: 10px; +} +.cluetip-default div#cluetip-close { + text-align: right; + margin: 0 5px 5px; + color: #900; +} + +/* default arrows */ + +.clue-right-default .cluetip-arrows { + background-image: url(images/darrowleft.gif); +} +.clue-left-default .cluetip-arrows { + background-image: url(images/darrowright.gif); + left: 100%; + margin-right: -11px; +} +.clue-top-default .cluetip-arrows { + background-image: url(images/darrowdown.gif); + top: 100%; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} +.clue-bottom-default .cluetip-arrows { + background-image: url(images/darrowup.gif); + top: -11px; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} + +/*************************************** + =cluetipClass: 'jtip' +-------------------------------------- */ +.cluetip-jtip { + background-color: transparent; +} +.cluetip-jtip #cluetip-outer { + border: 2px solid #ccc; + position: relative; + background-color: #fff; +} + +.cluetip-jtip h3#cluetip-title { + margin: 0 0 5px; + padding: 2px 5px; + font-size: 16px; + font-weight: normal; + background-color: #ccc; + color: #333; +} + +.cluetip-jtip #cluetip-inner { + padding: 0 5px 5px; + display: inline-block; +} +.cluetip-jtip div#cluetip-close { + text-align: right; + margin: 0 5px 5px; + color: #900; +} + +/* jtip arrows */ + +.clue-right-jtip .cluetip-arrows { + background-image: url(images/arrowleft.gif); +} +.clue-left-jtip .cluetip-arrows { + background-image: url(images/arrowright.gif); + left: 100%; + margin-right: -11px; +} +.clue-top-jtip .cluetip-arrows { + background-image: url(images/arrowdown.gif); + top: 100%; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} +.clue-bottom-jtip .cluetip-arrows { + background-image: url(images/arrowup.gif); + top: -11px; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} + +/*************************************** + =cluetipClass: 'rounded' +-------------------------------------- */ + +.cluetip-rounded { + background: transparent url(images/bl.gif) no-repeat 0 100%; + margin-top: 10px; + margin-left: 12px; +} + +.cluetip-rounded #cluetip-outer { + background: transparent url(images/tl.gif) no-repeat 0 0; + margin-top: -12px; +} + +.cluetip-rounded #cluetip-title { + background-color: transparent; + padding: 12px 12px 0; + margin: 0 -12px 0 0; + position: relative; +} +.cluetip-rounded #cluetip-extra { + position: absolute; + display: block; + background: transparent url(images/tr.gif) no-repeat 100% 0; + top: 0; + right: 0; + width: 12px; + height: 30px; + margin: -12px -12px 0 0; +} +.cluetip-rounded #cluetip-inner { + background: url(images/br.gif) no-repeat 100% 100%; + padding: 5px 12px 12px; + margin: -18px -12px 0 0; + position: relative; +} + +.cluetip-rounded div#cluetip-close { + text-align: right; + margin: 0 5px 5px; + color: #009; + background: transparent; +} +.cluetip-rounded div#cluetip-close a { + color: #777; +} + +/* rounded arrows */ + +.clue-right-rounded .cluetip-arrows { + background-image: url(images/rarrowleft.gif); +} +.clue-left-rounded .cluetip-arrows { + background-image: url(images/rarrowright.gif); + left: 100%; + margin-left: 12px; +} +.clue-top-rounded .cluetip-arrows { + background-image: url(images/rarrowdown.gif); + top: 100%; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} +.clue-bottom-rounded .cluetip-arrows { + background-image: url(images/rarrowup.gif); + top: -23px; + left: 50%; + margin-left: -11px; + height: 11px; + width: 22px; +} + + + +/* stupid IE6 HasLayout hack */ +.cluetip-rounded #cluetip-title, +.cluetip-rounded #cluetip-inner { + zoom: 1; +} \ No newline at end of file diff --git a/clinicaltrials/static/css/style.css b/clinicaltrials/static/css/style.css index f0c59fb..cc0bed8 100644 --- a/clinicaltrials/static/css/style.css +++ b/clinicaltrials/static/css/style.css @@ -1,360 +1,361 @@ body { height: 100%; margin: 0; padding: 0; text-align: left; font: 78% "Verdana", "Arial", "sans-serif"; background:#cbcbcd; } h1, h2, label, legend, #content a { color: #296784; } /* STYLE for BORDERED MAIN BLOCKS */ #container, #top, #footer, #columns, .stepmenu-top, .stepmenu-bottom { border-color: #D4D4FF; } #container { margin: 0px; padding: 0; line-height: 1.7em; background: transparent url(/static/bg_header.png) repeat-x scroll 0 0; } /*TOP BANNER*/ #top { padding: 0; margin: 0; border-width: 0 0 1px; float: left; clear: both; width: 100%; height: 118px; } #banner div.logo a { text-decoration: none; color: #296784; } #banner div.logo, #top div.institutions { float: left; width: 40%; margin: 1em 0 0 10%; } #banner div.institutions { margin-top: 0em; } #top div.institutions ul li { float: left; width: 40%; text-align: right; } #top div.institutions ul span { display: none; } #top div.institutions ul li a { display: block; height: 89px; } #top div.institutions ul li.BIREME a { background: transparent url(/static/bireme.gif) no-repeat center right; } #top div.institutions ul li.FIOCRUZ a { background: transparent url(/static/fiocruz.gif) no-repeat center right; } #middle { background-color: #FFF; position: relative; float: left; width: 100%; clear: both; overflow: hidden; } #columns { position: relative; width: 100%; float: left; right: 81%; border-width: 0 1px 0 0; background:#ebecf0; } #rebracmenu, #workarea { position: relative; } #rebracmenu h2 { display: none; } /* GROUP STEPS NAVIGATION AND CONTENT */ #workarea { float: left; left: 100%; width: 81%; } #rebracmenu { float: left; width: 16%; left: 1%; } #rebracmenu #usermenu div { padding: 3em; border-bottom: 1px dotted #D4D4FF; line-height: 100%; text-align: center; } #rebracmenu #usermenu div * { text-transform: capitalize; font-weight: bold; } #rebracmenu ul { list-style-type: none; padding-left: 1em; } #rebracmenu li { text-transform: capitalize; margin-bottom: 0.5em; border-bottom: 1px dotted #D4D4FF; } /* STEPS NAVIGATION*/ .stepmenu { background: transparent url(/static/bg_stepmenu.png) repeat-x; float: left; width: 100%; clear: both; } .stepmenu ul { margin: 0; padding: 0 0 0 2em; list-style: none; } .stepmenu ul li { display: block; float: left; width: 9%; border: 1px solid transparent; text-align: center; } .stepmenu li.current { border: 1px inset white; } .stepmenu a { text-decoration: none; text-transform: capitalize; color: #0a5172; font-weight: bold; - font-size:11px; + font-size:11px; } .stepmenu li:hover { text-decoration: underline; } .stepmenu-top { border-width: 0 0 1px; } .stepmenu-bottom { border-width: 1px 0 0; } /*MAIN CONTENT*/ #content { padding: 10px; } #content a:link, #content a:visited { text-decoration: none; background: inherit; } #content a:hover { text-decoration: underline; } #content h2 { padding: 0.2em 0; - font-weight:normal; - margin-top:30px; + font-weight:normal; + margin-top:30px; } /*FOOTER*/ #footer { clear: both; padding: 5px; margin-top: 5px; border-width: 1px 0 0; background:#f3f4f6; } #footer a:link, #footer a:visited { background: inherit; } #footer, #footer a { -color:#666; + color:#666; } #footer a{ - text-decoration:underline; - } + text-decoration:underline; +} #footer { -font-size:69%; + font-size:69%; } /*TYPOGRAPHY*/ p { margin: 20px; } blockquote { font-weight: bold; font-style: italic; } table.table { border-collapse: collapse; border-width: 0 0 1px 1px; width: 100%; + display: block; } table.table, table.table td, table.table th { color:#4a4c4e; } table.table td, table.table th { padding: 10px; } table.table th { background-color: #F1F4F7; color:#333; } table.table textarea { width: 100%; } table.table td.help div.issue { display: none; } table.trialsummary { width: 100%; } /* AJAX DeCS Tools */ td div.decstool { display: none; } td div select { display: block; } td select, td div.decstool input { width: 80%; } td.showdecs div.decstool { display: block; } .issue{ font-size:10px; color:#5d5d5d; } fieldset{ border: 1px solid #CCC; margin-bottom:30px; } label{ font-weight:normal; } ul li{ list-style:none; } legend{ font-weight:bold; } #content a.buttonadd { -background:#527FA3 url(/static/add.png) no-repeat scroll right center; -border:1px solid #EBECF0; -color:#FFFFFF; -padding:5px 2em 5px 1em; + background:#527FA3 url(/static/add.png) no-repeat scroll right center; + border:1px solid #EBECF0; + color:#FFFFFF; + padding:5px 2em 5px 1em; } /* BARRA GOVERNO FEDERAL */ .barra_MSaude { width: 100%; height: 30px; background:#ffcc00; } .barra_MSaude .barra1000 { width:100%; margin: 0 auto; } .barra_MSaude .barra1000 .minSaude a { width: 152px; height: 21px; float: left; margin: 1px; background: url(ms.gif) top left no-repeat; } .barra_MSaude .barra1000 .brasilGov a { margin: 1px; width: 96px; height: 21px; float: right; background: url(brasil.gif) top left no-repeat; } .barra_MSaude .barra1000 .minSaude, .barra_MSaude .barra1000 .form { float: left; } .barra_MSaude .barra1000 .form { margin: 2px 0px 0px 50px; } .barra_MSaude .barra1000 .form .pr{ background: #ffcc00 !important; font-size: 10px; } .barra_MSaude .barra1000 .brasilGov { float: right; } .barra_MSaude .barra1000 DIV a span { display: none; } diff --git a/clinicaltrials/static/js/jquery.bgiframe.min.js b/clinicaltrials/static/js/jquery.bgiframe.min.js new file mode 100644 index 0000000..028b27d --- /dev/null +++ b/clinicaltrials/static/js/jquery.bgiframe.min.js @@ -0,0 +1,10 @@ +/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * $LastChangedDate: 2007-07-21 19:45:56 -0400 (Sat, 21 Jul 2007) $ + * $Rev: 2447 $ + * + * Version 2.1.1 + */ +(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery); \ No newline at end of file diff --git a/clinicaltrials/static/js/jquery.cluetip.min.js b/clinicaltrials/static/js/jquery.cluetip.min.js new file mode 100644 index 0000000..2c3cc0b --- /dev/null +++ b/clinicaltrials/static/js/jquery.cluetip.min.js @@ -0,0 +1,58 @@ +/* + * jQuery clueTip plugin + * Version 1.0.6 (January 13, 2010) + * @requires jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +/* + * + * Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/ + * + * Examples can be found at http://plugins.learningjquery.com/cluetip/demo/ + * +*/ +(function($){$.cluetip={version:'1.0.6'};var $cluetip,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$cluetipWait,$dropShadow,imgCount;$.fn.cluetip=function(js,options){if(typeof js=='object'){options=js;js=null;} +if(js=='destroy'){return this.removeData('thisInfo').unbind('.cluetip');} +return this.each(function(index){var link=this,$this=$(this);var opts=$.extend(true,{},$.fn.cluetip.defaults,options||{},$.metadata?$this.metadata():$.meta?$this.data():{});var cluetipContents=false;var cluezIndex=+opts.cluezIndex;$this.data('thisInfo',{title:link.title,zIndex:cluezIndex});var isActive=false,closeOnDelay=0;if(!$('#cluetip').length){$(['<div id="cluetip">','<div id="cluetip-outer">','<h3 id="cluetip-title"></h3>','<div id="cluetip-inner"></div>','</div>','<div id="cluetip-extra"></div>','<div id="cluetip-arrows" class="cluetip-arrows"></div>','</div>'].join('')) +[insertionType](insertionElement).hide();$cluetip=$('#cluetip').css({position:'absolute'});$cluetipOuter=$('#cluetip-outer').css({position:'relative',zIndex:cluezIndex});$cluetipInner=$('#cluetip-inner');$cluetipTitle=$('#cluetip-title');$cluetipArrows=$('#cluetip-arrows');$cluetipWait=$('<div id="cluetip-waitimage"></div>').css({position:'absolute'}).insertBefore($cluetip).hide();} +var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i<dropShadowSteps;i++){$dropShadow=$dropShadow.add($('<div></div>').css({zIndex:cluezIndex-1,opacity:.1,top:1+i,left:1+i}));} +$dropShadow.css({position:'absolute',backgroundColor:'#000'}).prependTo($cluetip);} +var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js){return true;} +if(opts.local&&opts.localPrefix){tipAttribute=opts.localPrefix+tipAttribute;} +if(opts.local&&opts.hideLocal){$(tipAttribute+':first').hide();} +var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight,defHeight=isNaN(parseInt(opts.height,10))?'auto':(/\D/g).test(opts.height)?opts.height:opts.height+'px';var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=parseInt(opts.width,10)||275,tipWidth=tipInnerWidth+(parseInt($cluetip.css('paddingLeft'),10)||0)+(parseInt($cluetip.css('paddingRight'),10)||0)+dropShadowSteps,linkWidth=this.offsetWidth,linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!='title')?$this.attr(opts.titleAttribute):'';if(opts.splitTitle){if(tipTitle==undefined){tipTitle='';} +tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift();} +if(opts.escapeTitle){tipTitle=tipTitle.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;');} +var localContent;function returnFalse(){return false;} +var activate=function(event){if(!opts.onActivate($this)){return false;} +isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr('href')){$this.css('cursor',opts.cursor);} +if(opts.hoverClass){$this.addClass(opts.hoverClass);} +linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if(link.tagName.toLowerCase()!='area'){sTop=$(document).scrollTop();winWidth=$(window).width();} +if(opts.positionBy=='fixed'){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX});}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if(link.tagName.toLowerCase()=='area'||opts.positionBy=='mouse'||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(' cluetip-'+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css('marginLeft'),10)+parseInt($cluetipInner.css('marginRight'),10):mouseX-(tipWidth/2);}else{posX=mouseX+lOffset;}} +var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!='bottomTop')?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0),zIndex:$this.data('thisInfo').zIndex});$cluetipArrows.css({zIndex:$this.data('thisInfo').zIndex+1});} +wHeight=$(window).height();if(js){if(typeof js=='function'){js=js.call(link);} +$cluetipInner.html(js);cluetipShow(pY);} +else if(tipParts){var tpl=tipParts.length;$cluetipInner.html(tpl?tipParts[0]:'');if(tpl>1){for(var i=1;i<tpl;i++){$cluetipInner.append('<div class="split-body">'+tipParts[i]+'</div>');}} +cluetipShow(pY);} +else if(!opts.local&&tipAttribute.indexOf('#')!==0){if(/\.(jpe?g|tiff?|gif|png)$/i.test(tipAttribute)){$cluetipInner.html('<img src="'+tipAttribute+'" alt="'+tipTitle+'" />');cluetipShow(pY);}else if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY);}else{var optionBeforeSend=opts.ajaxSettings.beforeSend,optionError=opts.ajaxSettings.error,optionSuccess=opts.ajaxSettings.success,optionComplete=opts.ajaxSettings.complete;var ajaxSettings={cache:false,url:tipAttribute,beforeSend:function(xhr){if(optionBeforeSend){optionBeforeSend.call(link,xhr,$cluetip,$cluetipInner);} +$cluetipOuter.children().empty();if(opts.waitImage){$cluetipWait.css({top:mouseY+20,left:mouseX+20,zIndex:$this.data('thisInfo').zIndex-1}).show();}},error:function(xhr,textStatus){if(isActive){if(optionError){optionError.call(link,xhr,textStatus,$cluetip,$cluetipInner);}else{$cluetipInner.html('<i>sorry, the contents could not be loaded</i>');}}},success:function(data,textStatus){cluetipContents=opts.ajaxProcess.call(link,data);if(isActive){if(optionSuccess){optionSuccess.call(link,data,textStatus,$cluetip,$cluetipInner);} +$cluetipInner.html(cluetipContents);}},complete:function(xhr,textStatus){if(optionComplete){optionComplete.call(link,xhr,textStatus,$cluetip,$cluetipInner);} +imgCount=$('#cluetip-inner img').length;if(imgCount&&!$.browser.opera){$('#cluetip-inner img').bind('load error',function(){imgCount--;if(imgCount<1){$cluetipWait.hide();if(isActive){cluetipShow(pY);}}});}else{$cluetipWait.hide();if(isActive){cluetipShow(pY);}}}};var ajaxMergedSettings=$.extend(true,{},opts.ajaxSettings,ajaxSettings);$.ajax(ajaxMergedSettings);}}else if(opts.local){var $localContent=$(tipAttribute+(/#\S+$/.test(tipAttribute)?'':':eq('+index+')')).clone(true).show();$cluetipInner.html($localContent);cluetipShow(pY);}};var cluetipShow=function(bpY){$cluetip.addClass('cluetip-'+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+'...';$cluetipInner.html($truncloaded);} +function doNothing(){};tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html('&nbsp;'):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('<div id="cluetip-close"><a href="#">'+opts.closeText+'</a></div>');(opts.closePosition=='bottom')?$closeLink.appendTo($cluetipInner):(opts.closePosition=='title')?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.bind('click.cluetip',function(){cluetipClose();return false;});if(opts.mouseOutClose){$cluetip.bind('mouseleave.cluetip',function(){cluetipClose();});}else{$cluetip.unbind('mouseleave.cluetip');}} +var direction='';$cluetipOuter.css({zIndex:$this.data('thisInfo').zIndex,overflow:defHeight=='auto'?'visible':'auto',height:defHeight});tipHeight=defHeight=='auto'?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=='fixed'){tipY=posY-opts.dropShadowSteps+tOffset;}else if((posX<mouseX&&Math.max(posX,0)+tipWidth>mouseX)||opts.positionBy=='bottomTop'){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction='top';}else{tipY=mouseY+tOffset;direction='bottom';}}else if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset;}else if($this.css('display')=='block'||link.tagName.toLowerCase()=='area'||opts.positionBy=="mouse"){tipY=bpY-tOffset;}else{tipY=posY-opts.dropShadowSteps;} +if(direction==''){posX<linkLeft?direction='left':direction='right';} +$cluetip.css({top:tipY+'px'}).removeClass().addClass('clue-'+direction+'-'+ctClass).addClass(' cluetip-'+ctClass);if(opts.arrows){var bgY=(posY-tipY-opts.dropShadowSteps);$cluetipArrows.css({top:(/(left|right)/.test(direction)&&posX>=0&&bgY>0)?bgY+'px':/(left|right)/.test(direction)?0:''}).show();}else{$cluetipArrows.hide();} +$dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.openSpeed||0);if(opts.dropShadow){$dropShadow.css({height:tipHeight,width:tipInnerWidth,zIndex:$this.data('thisInfo').zIndex-1}).show();} +if($.fn.bgiframe){$cluetip.bgiframe();} +if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose);} +opts.onShow.call(link,$cluetip,$cluetipInner);};var inactivate=function(event){isActive=false;$cluetipWait.hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay);} +if(opts.hoverClass){$this.removeClass(opts.hoverClass);}};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass();opts.onHide.call(link,$cluetip,$cluetipInner);$this.removeClass('cluetip-clicked');if(tipTitle){$this.attr(opts.titleAttribute,tipTitle);} +$this.css('cursor','');if(opts.arrows){$cluetipArrows.css({top:''});}};$(document).bind('hideCluetip',function(e){cluetipClose();});if((/click|toggle/).test(opts.activation)){$this.bind('click.cluetip',function(event){if($cluetip.is(':hidden')||!$this.is('.cluetip-clicked')){activate(event);$('.cluetip-clicked').removeClass('cluetip-clicked');$this.addClass('cluetip-clicked');}else{inactivate(event);} +this.blur();return false;});}else if(opts.activation=='focus'){$this.bind('focus.cluetip',function(event){activate(event);});$this.bind('blur.cluetip',function(event){inactivate(event);});}else{$this[opts.clickThrough?'unbind':'bind']('click',returnFalse);var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.bind('mousemove.cluetip',function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY});});}};if($.fn.hoverIntent&&opts.hoverIntent){$this.hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event);},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind('mousemove.cluetip');}});}else{$this.bind('mouseenter.cluetip',function(event){activate(event);mouseTracks(event);}).bind('mouseleave.cluetip',function(event){inactivate(event);$this.unbind('mousemove.cluetip');});} +$this.bind('mouseover.cluetip',function(event){$this.attr('title','');}).bind('mouseleave.cluetip',function(event){$this.attr('title',$this.data('thisInfo').title);});}});};$.fn.cluetip.defaults={width:275,height:'auto',cluezIndex:97,positionBy:'auto',topOffset:15,leftOffset:15,local:false,localPrefix:null,hideLocal:true,attribute:'rel',titleAttribute:'title',splitTitle:'',escapeTitle:false,showTitle:true,cluetipClass:'default',hoverClass:'',waitImage:true,cursor:'help',arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:'hover',clickThrough:false,tracking:false,delayedClose:0,closePosition:'top',closeText:'Close',truncate:0,fx:{open:'show',openSpeed:''},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true;},onShow:function(ct,ci){},onHide:function(ct,ci){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(/<(script|style|title)[^<]+<\/(script|style|title)>/gm,'').replace(/<(link|meta)[^>]+>/g,'');return data;},ajaxSettings:{dataType:'html'},debug:false};var insertionType='appendTo',insertionElement='body';$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType;} +if(options&&options.insertionElement){insertionElement=options.insertionElement;}};})(jQuery); \ No newline at end of file diff --git a/clinicaltrials/static/js/jquery.hoverIntent.js b/clinicaltrials/static/js/jquery.hoverIntent.js new file mode 100644 index 0000000..eb977c2 --- /dev/null +++ b/clinicaltrials/static/js/jquery.hoverIntent.js @@ -0,0 +1,114 @@ +/** +* hoverIntent is similar to jQuery's built-in "hover" function except that +* instead of firing the onMouseOver event immediately, hoverIntent checks +* to see if the user's mouse has slowed down (beneath the sensitivity +* threshold) before firing the onMouseOver event. +* +* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2 +* <http://cherne.net/brian/resources/jquery.hoverIntent.html> +* +* hoverIntent is currently available for use in all personal or commercial +* projects under both MIT and GPL licenses. This means that you can choose +* the license that best suits your project, and use it accordingly. +* +* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions +* $("ul li").hoverIntent( showNav , hideNav ); +* +* // advanced usage receives configuration object only +* $("ul li").hoverIntent({ +* sensitivity: 2, // number = sensitivity threshold (must be 1 or higher) +* interval: 50, // number = milliseconds of polling interval +* over: showNav, // function = onMouseOver callback (required) +* timeout: 100, // number = milliseconds delay before onMouseOut function call +* out: hideNav // function = onMouseOut callback (required) +* }); +* +* @param f onMouseOver function || An object with configuration options +* @param g onMouseOut function || Nothing (use configuration options object) +* @return The object (aka "this") that called hoverIntent, and the event object +* @author Brian Cherne <[email protected]> +* +* modified by Karl Swedberg. Namespaced events in order to work better with clueTip plugin +*/ +(function($) { + $.fn.hoverIntent = function(f,g) { + // default configuration options + var cfg = { + sensitivity: 7, + interval: 100, + timeout: 0 + }; + // override configuration options with user supplied object + cfg = $.extend(cfg, g ? { over: f, out: g } : f ); + + // instantiate variables + // cX, cY = current X and Y position of mouse, updated by mousemove event + // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval + var cX, cY, pX, pY; + + // A private function for getting mouse position + var track = function(ev) { + cX = ev.pageX; + cY = ev.pageY; + }; + + // A private function for comparing current and previous mouse position + var compare = function(ev,ob) { + ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); + // compare mouse positions to see if they've crossed the threshold + if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) { + $(ob).unbind("mousemove",track); + // set hoverIntent state to true (so mouseOut can be called) + ob.hoverIntent_s = 1; + return cfg.over.apply(ob,[ev]); + } else { + // set previous coordinates for next time + pX = cX; pY = cY; + // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) + ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); + } + }; + + // A private function for delaying the mouseOut function + var delay = function(ev,ob) { + ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); + ob.hoverIntent_s = 0; + return cfg.out.apply(ob,[ev]); + }; + + // A private function for handling mouse 'hovering' + var handleHover = function(e) { + // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut + var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; + while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } } + if ( p == this ) { return false; } + + // copy objects to be passed into t (required for event object to be passed in IE) + var ev = jQuery.extend({},e); + var ob = this; + + // cancel hoverIntent timer if it exists + if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } + + // else e.type == "onmouseover" + if (e.type == "mouseover") { + // set "previous" X and Y position based on initial entry point + pX = ev.pageX; pY = ev.pageY; + // update "current" X and Y position based on mousemove + $(ob).bind("mousemove.cluetip",track); + // start polling interval (self-calling timeout) to compare mouse coordinates over time + if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} + + // else e.type == "onmouseout" + } else { + // unbind expensive mousemove event + $(ob).unbind("mousemove.cluetip",track); + // if hoverIntent state is true, then call the mouseOut function after the specified delay + if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} + } + }; + + // bind the function to the two event listeners + return this.bind('mouseover.cluetip', handleHover).bind('mouseout.cluetip', handleHover); + }; +})(jQuery); \ No newline at end of file diff --git a/clinicaltrials/templates/base.html b/clinicaltrials/templates/base.html index 4fad4ec..021de56 100644 --- a/clinicaltrials/templates/base.html +++ b/clinicaltrials/templates/base.html @@ -1,116 +1,122 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> {% load i18n %} <head> <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"/> <title>{% block page_title %}{% trans "Clinical Trials Platform" %}{% endblock %}</title> <link rel="shortcut icon" href="/static/favicon.ico"/> <link rel="stylesheet" type="text/css" href="/static/css/asmselect/jquery.asmselect.css"/> + <link rel="stylesheet" type="text/css" href="/static/css/jquery.cluetip.css"/> + <link rel="stylesheet" type="text/css" href="/static/css/style.css"/> + <!-- fetch JS libraries from Google --> - <script type="text/javascript" type="text/javascript" - src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> - <script type="text/javascript" type="text/javascript" - src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script> + <script type="text/javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> + <script type="text/javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script> <script type="text/javascript" src="/static/js/asmselect/jquery.asmselect.js" type="text/javascript"></script> + + <script type="text/javascript" src="/static/js/jquery.bgiframe.min.js" type="text/javascript"></script> + <script type="text/javascript" src="/static/js/jquery.cluetip.min.js" type="text/javascript"></script> + <script type="text/javascript" src="/static/js/jquery.hoverIntent.js" type="text/javascript"></script> + <script type="text/javascript" src="/static/js/submission.utils.js"></script> </head> <body> <div id="container"> <div class="barra_MSaude"> <div class="barra1000"> <div class="minSaude"> <a href="http://www.saude.gov.br" title="Ministério da Saúde" target="_blank"> <span>{% trans 'Ministério da Saúde'%}</span> </a> </div> <div class="form"> <form method="post" action="/" id="govform" name="govform"> <select name="opcoes" class="pr"> <option>{% trans 'Destaques do governo' %}</option> <option value="http://www.brasil.gov.br">{% trans 'Portal do Governo Federal' %}</option> <option value="http://www.e.gov.br">{% trans 'Portal de Serviços do Governo' %}</option> <option value="http://www.radiobras.gov.br">{% trans 'Portal da Agência de Notícias' %}</option> <option value="http://www.previdenciasocial.gov.br">{% trans 'Reforma da Previdência' %}</option> <option value="http://www.fomezero.gov.br">{% trans 'Programa Fome Zero' %}</option> </select> </form> <script type="text/javascript">$('form#govform select option[value]').click(function(){window.open(this.value);});</script> </div> <div class="brasilGov"> <a href="http://www.brasil.gov.br" title="Governo Federal" target="_blank"> <span>{% trans 'Governo Federal' %}</span> </a> </div> </div> </div> <div id="top"> <div id="banner"> <div class="logo"> <h1> <!--a href="{% url reviewapp.home %}"><span>{% block headline %}{% trans "RBEC" %}{% endblock %}</span></a--> <a href="{% url reviewapp.home %}"><img alt="Registro Brasileiro de Ensaios Clínicos" src="/static/title.gif" border="none"/></a> </h1> </div> <div class="institutions"> <ul> <li class="BIREME"><a href="http://regional.bvsalud.org/php/index.php?lang=pt" title="Centro Latino-Americano e do Caribe de Informação em Ciências da Saúde" target="_blank"><span>BIREME</span></a></li> <li class="FIOCRUZ"><a href="http://www.fiocruz.br/cgi/cgilua.exe/sys/start.htm?tpl=home" title="Fundação Oswaldo Cruz" target="_blank"><span>FioCruz</span></a></li> </ul> </div> </div> </div> <div id="middle"> <div id="columns"> <div id="workarea"> {% block stepmenu_top %}{% endblock %} <div id="content"> {% block body %}{% endblock %} </div> {% block stepmenu_bottom %}{% endblock %} </div> <div id="rebracmenu"> <h2>{% trans "Options menu" %}</h2> <div id="usermenu"> {% if username %} <div> <span>{{username}}</span><br/> <a href="/accounts/logout">log out</a> </div> <ul> <li>Profile</li> <li>Dashboard</li> <li><a href="{% url reviewapp.userhome %}">{% trans 'Submissions' %}</a></li> <li>Issues</li> </ul> {% else %} <div><a href="/accounts/login" title="{% trans 'access with an existing account' %}">[{% trans 'login' %}]</a> <br />&nbsp;<br /> <a href="/accounts/register" title="{% trans 'create an account to submit trial records' %}">[{% trans 'register' %}]</a> </div> {% endif %} </div> <ul> <li>{% trans "News" %}</li> <li>{% trans "About" %}</li> <li>{% trans "Help" %}</li> </ul> </div> </div> </div> <div id="footer"> <p> <strong> BIREME - OPAS - OMS </strong><br/> Centro Latino-Americano e do Caribe de Informação em Ciências da Saúde <br/> Rua Botucatu, 862 - 04023-901 - São Paulo/SP - Brasil - Tel: (55 11) 5576-9800 - Fax: (55 11) 5575-8868 <br/> </p> </div> </div> </body> </html>
ensaiosclinicos/clinicaltrials
7ff96ed3c917fd566e1d4bec2dd55a23480bde92
Close script tag to avoid html parsing corruption.
diff --git a/clinicaltrials/templates/base.html b/clinicaltrials/templates/base.html index c761beb..4fad4ec 100644 --- a/clinicaltrials/templates/base.html +++ b/clinicaltrials/templates/base.html @@ -1,116 +1,116 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> {% load i18n %} <head> <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"/> <title>{% block page_title %}{% trans "Clinical Trials Platform" %}{% endblock %}</title> <link rel="shortcut icon" href="/static/favicon.ico"/> <link rel="stylesheet" type="text/css" href="/static/css/asmselect/jquery.asmselect.css"/> <link rel="stylesheet" type="text/css" href="/static/css/style.css"/> <!-- fetch JS libraries from Google --> <script type="text/javascript" type="text/javascript" - src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" /> + src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" type="text/javascript" - src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js" /> + src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js"></script> <script type="text/javascript" src="/static/js/asmselect/jquery.asmselect.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/submission.utils.js"></script> </head> <body> <div id="container"> <div class="barra_MSaude"> <div class="barra1000"> <div class="minSaude"> <a href="http://www.saude.gov.br" title="Ministério da Saúde" target="_blank"> <span>{% trans 'Ministério da Saúde'%}</span> </a> </div> <div class="form"> <form method="post" action="/" id="govform" name="govform"> <select name="opcoes" class="pr"> <option>{% trans 'Destaques do governo' %}</option> <option value="http://www.brasil.gov.br">{% trans 'Portal do Governo Federal' %}</option> <option value="http://www.e.gov.br">{% trans 'Portal de Serviços do Governo' %}</option> <option value="http://www.radiobras.gov.br">{% trans 'Portal da Agência de Notícias' %}</option> <option value="http://www.previdenciasocial.gov.br">{% trans 'Reforma da Previdência' %}</option> <option value="http://www.fomezero.gov.br">{% trans 'Programa Fome Zero' %}</option> </select> </form> <script type="text/javascript">$('form#govform select option[value]').click(function(){window.open(this.value);});</script> </div> <div class="brasilGov"> <a href="http://www.brasil.gov.br" title="Governo Federal" target="_blank"> <span>{% trans 'Governo Federal' %}</span> </a> </div> </div> </div> <div id="top"> <div id="banner"> <div class="logo"> <h1> <!--a href="{% url reviewapp.home %}"><span>{% block headline %}{% trans "RBEC" %}{% endblock %}</span></a--> <a href="{% url reviewapp.home %}"><img alt="Registro Brasileiro de Ensaios Clínicos" src="/static/title.gif" border="none"/></a> </h1> </div> <div class="institutions"> <ul> <li class="BIREME"><a href="http://regional.bvsalud.org/php/index.php?lang=pt" title="Centro Latino-Americano e do Caribe de Informação em Ciências da Saúde" target="_blank"><span>BIREME</span></a></li> <li class="FIOCRUZ"><a href="http://www.fiocruz.br/cgi/cgilua.exe/sys/start.htm?tpl=home" title="Fundação Oswaldo Cruz" target="_blank"><span>FioCruz</span></a></li> </ul> </div> </div> </div> <div id="middle"> <div id="columns"> <div id="workarea"> {% block stepmenu_top %}{% endblock %} <div id="content"> {% block body %}{% endblock %} </div> {% block stepmenu_bottom %}{% endblock %} </div> <div id="rebracmenu"> <h2>{% trans "Options menu" %}</h2> <div id="usermenu"> {% if username %} <div> <span>{{username}}</span><br/> <a href="/accounts/logout">log out</a> </div> <ul> <li>Profile</li> <li>Dashboard</li> <li><a href="{% url reviewapp.userhome %}">{% trans 'Submissions' %}</a></li> <li>Issues</li> </ul> {% else %} <div><a href="/accounts/login" title="{% trans 'access with an existing account' %}">[{% trans 'login' %}]</a> <br />&nbsp;<br /> <a href="/accounts/register" title="{% trans 'create an account to submit trial records' %}">[{% trans 'register' %}]</a> </div> {% endif %} </div> <ul> <li>{% trans "News" %}</li> <li>{% trans "About" %}</li> <li>{% trans "Help" %}</li> </ul> </div> </div> </div> <div id="footer"> <p> <strong> BIREME - OPAS - OMS </strong><br/> Centro Latino-Americano e do Caribe de Informação em Ciências da Saúde <br/> Rua Botucatu, 862 - 04023-901 - São Paulo/SP - Brasil - Tel: (55 11) 5576-9800 - Fax: (55 11) 5575-8868 <br/> </p> </div> </div> </body> </html>
ensaiosclinicos/clinicaltrials
fe60ce02ea554ea0b5da4cead69b77fe8b3141de
fix js bug in submission.utils.js and fix #66
diff --git a/clinicaltrials/repository/templates/repository/step_3.html b/clinicaltrials/repository/templates/repository/step_3.html index 1d57d44..12599ae 100644 --- a/clinicaltrials/repository/templates/repository/step_3.html +++ b/clinicaltrials/repository/templates/repository/step_3.html @@ -1,75 +1,67 @@ {% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript" src="/static/js/submission.utils.js"></script> <script type="text/javascript"> $(document).ready(function() { - - $("select[multiple]").asmSelect({ - addItemTarget: 'bottom', - animate: true, - highlight: true, - sortable: true - }); - // TODO: Replace absolute path $("div.g select") .change(getterm_event('{% url decs.getterm lang="en",code="" %}')) .each(function(){$(this).change();}); $("div.s select") .change(search_event( '{% url decs.search lang="en",term="" %}', '{% trans "Search terms" %}')) .each(function(){$(this).change();}); }); // management_form.prefix </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} <table class="table"> <col width="20%"/> <col width="75%"/> <col width="5%"/> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> </div> </fieldset> {% endfor %} <br/> <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> {% if next_form_title %} <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> {% endif %} </form> {% endblock %} diff --git a/clinicaltrials/repository/templates/repository/step_4.html b/clinicaltrials/repository/templates/repository/step_4.html new file mode 100644 index 0000000..ff8d275 --- /dev/null +++ b/clinicaltrials/repository/templates/repository/step_4.html @@ -0,0 +1,62 @@ +{% extends "repository/submission_step.html" %} +{% load i18n %} +{% block body %} + + <script type="text/javascript" src="/static/js/submission.utils.js"></script> + <script type="text/javascript"> + $(document).ready(function() { + $("div.form select") + .change(search_event( + '{% url decs.search lang="en",term="" %}', + '{% trans "Search terms" %}')) + .each(function(){$(this).change();}); + }); + // management_form.prefix + </script> + + <h2>{{ title }}</h2> + <form action="./" method="POST"> + {% for form in forms %} + <fieldset> + <legend>{% firstof form.title form.form.title %}</legend> + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> + {{ form.as_table }} + </table> + </fieldset> + {% endfor %} + + {% for formset in formsets %} + {{ formset.management_form }} + <fieldset> + <legend>{{ formset.form.title }}</legend> + + + <div class="{{formset.management_form.prefix}}"> + {% for form in formset.forms %} + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> + {{ form.as_table }} + </table> + {% endfor %} + </div> + <div style="text-align: center"> + <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> +</div> + </fieldset> + {% endfor %} + + <br/> + + <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> + + {% if next_form_title %} + <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> + {% endif %} + </form> + +{% endblock %} diff --git a/clinicaltrials/repository/views.py b/clinicaltrials/repository/views.py index c5906fc..0183be6 100644 --- a/clinicaltrials/repository/views.py +++ b/clinicaltrials/repository/views.py @@ -1,455 +1,455 @@ #coding: utf-8 from reviewapp.models import Attachment, Submission from reviewapp.trds_forms import ExistingAttachmentForm,NewAttachmentForm from repository.models import ClinicalTrial, Descriptor, TrialNumber from repository.models import TrialSecondarySponsor, TrialSupportSource, Outcome from repository.models import PublicContact, ScientificContact, SiteContact, Contact from repository.trds_forms import GeneralHealthDescriptorForm, PrimarySponsorForm from repository.trds_forms import SecondaryIdForm, SecondarySponsorForm from repository.trds_forms import SupportSourceForm, TrialIdentificationForm from repository.trds_forms import SpecificHealthDescriptorForm, HealthConditionsForm from repository.trds_forms import InterventionDescriptorForm, InterventionForm from repository.trds_forms import RecruitmentForm, StudyTypeForm, OutcomesForm from repository.trds_forms import PublicContactForm, ScientificContactForm from repository.trds_forms import ContactForm, NewInstitution, SiteContactForm import choices from django.core import serializers from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response, get_object_or_404 from django.utils.translation import ugettext_lazy as _ from django.forms.models import inlineformset_factory, modelformset_factory from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required EXTRA_FORMS = 1 TRIAL_FORMS = ['Trial Identification', 'Sponsors', 'Health Conditions', 'Interventions', 'Recruitment', 'Study Type', 'Outcomes', 'Contacts', 'Attachments'] @login_required def edit_trial_index(request, trial_pk): ''' start view ''' links = [] for i, name in enumerate(TRIAL_FORMS): data = dict(label=_(name)) data['url'] = reverse('step_' + str(i + 1), args=[trial_pk]) data['icon'] = '/media/img/admin/icon_alert.gif' data['msg'] = 'Blank fields' links.append(data) return render_to_response('repository/trial_index.html', {'username':request.user.username, 'trial_pk':trial_pk, 'links':links}) def full_view(request, trial_pk): ''' full view ''' ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) return render_to_response('repository/trds.html', {'fieldtable':ct.html_dump()}) @login_required def index(request): latest_clinicalTrials = ClinicalTrial.objects.all()[:5] t = loader.get_template('repository/latest_clinicalTrials.html') c = Context({ 'latest_clinicalTrials': latest_clinicalTrials, }) return HttpResponse(t.render(c)) @login_required def new_institution(request): if request.POST: new_institution = NewInstitution(request.POST) if new_institution.is_valid(): institution = new_institution.save() json = serializers.serialize('json',[institution]) return HttpResponse(json, mimetype='application/json'); else: new_institution = NewInstitution() return render_to_response('repository/new_institution.html', {'form':new_institution}) def step_list(trial_pk): import sys current_step = int( sys._getframe(1).f_code.co_name.replace('step_','') ) steps = [] for i in range(1,10): steps.append((reverse('step_%d'%i,args=[trial_pk]), i == current_step)) return steps @login_required def step_1(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = TrialIdentificationForm(request.POST, instance=ct) SecondaryIdSet = inlineformset_factory(ClinicalTrial, TrialNumber, form=SecondaryIdForm, extra=EXTRA_FORMS) secondary_forms = SecondaryIdSet(request.POST, instance=ct) if form.is_valid() and secondary_forms.is_valid(): form.save() secondary_forms.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_2",args=[trial_pk])) return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = TrialIdentificationForm(instance=ct) SecondaryIdSet = inlineformset_factory(ClinicalTrial, TrialNumber, form=SecondaryIdForm, extra=EXTRA_FORMS, can_delete=True) secondary_forms = SecondaryIdSet(instance=ct) forms = [form] formsets = [secondary_forms] return render_to_response('repository/trial_form.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[0], 'steps': step_list(trial_pk), 'next_form_title':_('Sponsors and Sources of Support')}) @login_required def step_2(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = PrimarySponsorForm(request.POST, instance=ct) SecondarySponsorSet = inlineformset_factory(ClinicalTrial, TrialSecondarySponsor, form=SecondarySponsorForm,extra=EXTRA_FORMS) SupportSourceSet = inlineformset_factory(ClinicalTrial, TrialSupportSource, form=SupportSourceForm,extra=EXTRA_FORMS) secondary_forms = SecondarySponsorSet(request.POST, instance=ct) sources_form = SupportSourceSet(request.POST, instance=ct) if form.is_valid() and secondary_forms.is_valid() and sources_form.is_valid(): form.save() secondary_forms.save() sources_form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_3",args=[trial_pk])) return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = PrimarySponsorForm(instance=ct) SecondarySponsorSet = inlineformset_factory(ClinicalTrial, TrialSecondarySponsor, form=SecondarySponsorForm,extra=EXTRA_FORMS, can_delete=True) SupportSourceSet = inlineformset_factory(ClinicalTrial, TrialSupportSource, form=SupportSourceForm,extra=EXTRA_FORMS,can_delete=True) secondary_forms = SecondarySponsorSet(instance=ct) sources_form = SupportSourceSet(instance=ct) # import pdb # pdb.set_trace() forms = [form] formsets = [secondary_forms,sources_form] return render_to_response('repository/step_2.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[1], 'steps': step_list(trial_pk), 'next_form_title':_('Health Conditions Form')}) @login_required def step_3(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) GeneralDescriptorSet = modelformset_factory(Descriptor, form=GeneralHealthDescriptorForm, extra=EXTRA_FORMS) SpecificDescriptorSet = modelformset_factory(Descriptor, form=SpecificHealthDescriptorForm, extra=EXTRA_FORMS) general_qs = Descriptor.objects.filter(trial=trial_pk, aspect=choices.TRIAL_ASPECT[0][0], level=choices.DESCRIPTOR_LEVEL[0][0]) specific_qs = Descriptor.objects.filter(trial=trial_pk, aspect=choices.TRIAL_ASPECT[0][0], level=choices.DESCRIPTOR_LEVEL[1][0]) if request.POST: form = HealthConditionsForm(request.POST, instance=ct) gdesc = GeneralDescriptorSet(request.POST,queryset=general_qs,prefix='g') sdesc = SpecificDescriptorSet(request.POST,queryset=specific_qs,prefix='s') if form.is_valid() and gdesc.is_valid() and sdesc.is_valid(): for cdata in gdesc.cleaned_data+sdesc.cleaned_data: cdata['trial'] = ct form.save() gdesc.save() sdesc.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_4",args=[trial_pk])) return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = HealthConditionsForm(instance=ct) gdesc = GeneralDescriptorSet(queryset=general_qs,prefix='g') sdesc = SpecificDescriptorSet(queryset=specific_qs,prefix='s') forms = [form] formsets = [gdesc, sdesc] return render_to_response('repository/step_3.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[2], 'steps': step_list(trial_pk), 'next_form_title':_('Interventions Form')}) @login_required def step_4(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) DescriptorFormSet = modelformset_factory(Descriptor, form=InterventionDescriptorForm, extra=EXTRA_FORMS) queryset = Descriptor.objects.filter(trial=trial_pk, aspect=choices.TRIAL_ASPECT[1][0], level=choices.DESCRIPTOR_LEVEL[0][0]) if request.POST: form = InterventionForm(request.POST, instance=ct) idesc = DescriptorFormSet(request.POST, queryset=queryset) if form.is_valid() and idesc.is_valid(): for cdata in idesc.cleaned_data: cdata['trial'] = ct idesc.save() form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_5",args=[trial_pk])) return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = InterventionForm(instance=ct) idesc = DescriptorFormSet(queryset=queryset) forms = [form] formsets = [idesc] - return render_to_response('repository/trial_form.html', + return render_to_response('repository/step_4.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[3], 'steps': step_list(trial_pk), 'next_form_title':_('Recruitment Form')}) @login_required def step_5(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = RecruitmentForm(request.POST, instance=ct) if form.is_valid(): form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_6",args=[trial_pk])) return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = RecruitmentForm(instance=ct) forms = [form] return render_to_response('repository/trial_form.html', {'forms':forms, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[4], 'steps': step_list(trial_pk), 'next_form_title':_('Study Type Form')}) @login_required def step_6(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = StudyTypeForm(request.POST, instance=ct) if form.is_valid(): form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_7",args=[trial_pk])) return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = StudyTypeForm(instance=ct) forms = [form] return render_to_response('repository/trial_form.html', {'forms':forms, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[5], 'steps': step_list(trial_pk), 'next_form_title':_('Outcomes Form')}) @login_required def step_7(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) OutcomesSet = inlineformset_factory(ClinicalTrial, Outcome, form=OutcomesForm,extra=EXTRA_FORMS) if request.POST: outcomes_formset = OutcomesSet(request.POST, instance=ct) if outcomes_formset.is_valid(): outcomes_formset.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_8",args=[trial_pk])) return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: outcomes_formset = OutcomesSet(instance=ct) formsets = [outcomes_formset] return render_to_response('repository/trial_form.html', {'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[6], 'steps': step_list(trial_pk), 'next_form_title':_('Descriptor Form')}) @login_required def step_8(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) contact_type = { 'PublicContact': (PublicContact,PublicContactForm), 'ScientificContact': (ScientificContact,ScientificContactForm), 'SiteContact': (SiteContact,SiteContactForm) } InlineFormSetClasses = [] for model,form in contact_type.values(): InlineFormSetClasses.append( inlineformset_factory(ClinicalTrial,model,form=form,can_delete=True,extra=EXTRA_FORMS) ) ContactFormSet = modelformset_factory(Contact, form=ContactForm, extra=1) contact_qs = Contact.objects.none() if request.POST: inlineformsets = [fs(request.POST,instance=ct) for fs in InlineFormSetClasses] new_contact_formset = ContactFormSet(request.POST,queryset=contact_qs) if not False in [fs.is_valid for fs in inlineformsets] \ and new_contact_formset.is_valid(): for contactform in new_contact_formset.forms: if contactform.cleaned_data: Relation = contact_type[contactform.cleaned_data.pop('relation')][0] new_contact = contactform.save() Relation.objects.create(trial=ct,contact=new_contact) for fs in inlineformsets: fs.save() return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: inlineformsets = [fs(instance=ct) for fs in InlineFormSetClasses] new_contact_formset = ContactFormSet(queryset=contact_qs) formsets = inlineformsets + [new_contact_formset] return render_to_response('repository/trial_form.html', {'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[7], 'steps': step_list(trial_pk)}) @login_required def step_9(request, trial_pk): # TODO: this function should be on another place ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) su = Submission.objects.get(trial=ct) ExistingAttachmentFormSet = inlineformset_factory(Submission, Attachment, extra=0, can_delete=True, form=ExistingAttachmentForm) NewAttachmentFormSet = modelformset_factory(Attachment, extra=1, can_delete=False, form=NewAttachmentForm) if request.method == 'POST': existing_attachment_formset = ExistingAttachmentFormSet(request.POST, request.FILES, instance=su, prefix='existing') new_attachment_formset = NewAttachmentFormSet(request.POST, request.FILES, prefix='new') if existing_attachment_formset.is_valid() and new_attachment_formset.is_valid(): existing_attachment_formset.save() for cdata in new_attachment_formset.cleaned_data: cdata['submission'] = su new_attachment_formset.save() return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: existing_attachment_formset = ExistingAttachmentFormSet(instance=su, prefix='existing') new_attachment_formset = NewAttachmentFormSet(queryset=Attachment.objects.none(), prefix='new') formsets = [existing_attachment_formset,new_attachment_formset] return render_to_response('repository/attachments.html', {'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[8], 'steps': step_list(trial_pk)}) \ No newline at end of file diff --git a/clinicaltrials/static/js/submission.utils.js b/clinicaltrials/static/js/submission.utils.js index c145f2c..20a744e 100644 --- a/clinicaltrials/static/js/submission.utils.js +++ b/clinicaltrials/static/js/submission.utils.js @@ -1,117 +1,117 @@ /** * Clone form elements in Django forms. JQuery * is required by this function. */ function cloneMore(selector, type) { var newElement = $(selector).clone(true); var total = $('#id_' + type + '-TOTAL_FORMS').val(); newElement.find(':input').each(function() { var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-'); var id = 'id_' + name; $(this).attr({'name': name, 'id': id}); if($(this).attr('type')!='hidden')$(this).val('').removeAttr('checked'); }); newElement.find('label').each(function() { var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-'); $(this).attr('for', newFor); }); total++; $('#id_' + type + '-TOTAL_FORMS').val(total); newElement.css("display","none"); $(selector).after(newElement); newElement.show("fast"); } /** * A utility to name and create form elements */ function make_decs_for(node){ - var set = node.id.match(/[a-z]-\d+/)[0]; // get django formset prefix + var set = node.id.match(/[a-z]+-\d+/)[0]; // get django formset prefix return {'select':set+"-combodecs", 'div':set+'-decstools', 'input':set+'-searchfield', 'button':set+'-searchbutton', 'id':function(e){return 'id_'+ this[e];}, 'create':function(e){return $('<'+e+'>').attr('id',this.id(e)).attr('name',this[e]);}, 'set':set}; } /** * This is the callback for decsclient app */ function make_decstool_callback(decs){ return function(data){ for(var i=0; i<data.length;i++){ $("<option>").attr("value",data[i].fields.label) .html(data[i].fields.description) .appendTo('#'+decs.id('select')); } $('#'+decs.id('select')).change(function(evt){ decs = make_decs_for(evt.target); $("input#id_"+decs.set+"-code") .attr("value",this.value); $("input#id_"+decs.set+"-text") .attr("value",$(this).find("option[selected]").html()); }); } } /** * Extend the django form and insert decs elements */ function getterm_event(decsclient_url) { return function(){ this.parentNode.className = ""; if(this.value === 'DeCS'){ this.parentNode.className = "showdecs"; var decs = make_decs_for(this); if($('#'+decs.id('select')).length === 0){ decs.create('div') .attr('class','decstool') .appendTo(this.parentNode) .append(decs.create('select')); $.get(decsclient_url,'', make_decstool_callback(decs),"json"); } } } }; /** * Extend the django form and insert decs elements */ function search_event(decsclient_url,label) { return function(){ this.parentNode.className = ""; if(this.value === 'DeCS'){ this.parentNode.className = "showdecs"; var decs = make_decs_for(this); if($('#'+decs.id('input')).length === 0){ decs.create('div') .attr('class','decstool') .appendTo(this.parentNode) .append(decs.create('input')) .append(decs.create('button').html(label)); $('#'+decs.id('button')) .click(function(evt){ var decs = make_decs_for(evt.target); if($('#'+decs.id('select')).length === 0){ decs.create('select') .insertAfter(this); } $('#'+decs.id('select')).html(''); $.get(decsclient_url+$('#'+decs.id('input')).val(),'', make_decstool_callback(decs), 'json'); return false; }); } } } };
ensaiosclinicos/clinicaltrials
df20f0637f14c9f7acb586cc299c47e33b3f3a50
remove xml file field from submission form and model
diff --git a/clinicaltrials/reviewapp/models.py b/clinicaltrials/reviewapp/models.py index b228e27..77bcb9a 100644 --- a/clinicaltrials/reviewapp/models.py +++ b/clinicaltrials/reviewapp/models.py @@ -1,95 +1,93 @@ from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext as _ from django.conf import settings from datetime import datetime from repository.models import ClinicalTrial, Institution from vocabulary.models import CountryCode from utilities import safe_truncate SUBMISSION_STATUS = [ ('draft', 'draft'), ('pending', 'pending'), ('published', 'published'), ('rejected', 'rejected'), ] ACCESS = [ ('public', 'Public'), ('private', 'Private'), ] class Submission(models.Model): creator = models.ForeignKey(User, related_name='submission_creator', editable=False) created = models.DateTimeField(default=datetime.now, editable=False) updater = models.ForeignKey(User, null=True, related_name='submission_updater', editable=False) updated = models.DateTimeField(null=True, editable=False) title = models.TextField(u'Scientific title', max_length=2000) primary_sponsor = models.OneToOneField(Institution, null=True, blank=True, verbose_name=_('Primary Sponsor')) trial = models.OneToOneField(ClinicalTrial, null=True) status = models.CharField(_('Status'), max_length=64, choices=SUBMISSION_STATUS, default=SUBMISSION_STATUS[0][0]) staff_note = models.TextField(_('Submission Note (staff use only)'), max_length=255, blank=True) - submission_xml = models.FileField(upload_to=settings.SUBMISSIONS_XML_PATH, null=True) - def save(self): if self.id: self.updated = datetime.now() super(Submission, self).save() def short_title(self): return safe_truncate(self.title, 120) def creator_username(self): return self.creator.username def __unicode__(self): return u'<%s> %s' % (self.creator_username(), self.short_title()) def get_mandatory_languages(self): langs = set(['en']) langs.add(self.trial.primary_sponsor.country.submission_language) for rc in self.trial.recruitmentcountry_set.all(): langs.add(rc.country.submission_language) return langs.intersection(set(settings.CHECKED_LANGUAGES)) def get_absolute_url(self): # TODO: use reverse to replace absolute path return '/accounts/submission/%s/' % self.id class RecruitmentCountry(models.Model): class Meta: verbose_name_plural = _('Recruitment Countries') submission = models.ForeignKey(Submission) country = models.ForeignKey(CountryCode, verbose_name=_('Country'), related_name='submissionrecruitmentcountry_set') class FrozenForm(models.Model): submission = models.ForeignKey(Submission) form_name = models.CharField(max_length=255) data = models.TextField(max_length=2**16) class Meta: unique_together = ['submission', 'form_name'] class Attachment(models.Model): class Meta: verbose_name_plural = _('Attachments') file = models.FileField(upload_to=settings.ATTACHMENTS_PATH) description = models.TextField(_('Description'), blank=True, max_length=8000) submission = models.ForeignKey(Submission) public = models.BooleanField(_('Public')) diff --git a/clinicaltrials/reviewapp/views.py b/clinicaltrials/reviewapp/views.py index 8536a37..9472a42 100644 --- a/clinicaltrials/reviewapp/views.py +++ b/clinicaltrials/reviewapp/views.py @@ -1,83 +1,79 @@ # coding: utf-8 from django.core.urlresolvers import reverse from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect from django import forms from django.utils.translation import ugettext as _ from django.contrib.auth.decorators import login_required from reviewapp.models import Submission from repository.models import ClinicalTrial, CountryCode, Institution @login_required def index(request): username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/index.html', locals()) @login_required def user_dump(request): uvars = [{'k':k, 'v':v} for k, v in request.user.__dict__.items()] return render_to_response('reviewapp/user_dump.html', locals()) @login_required def submissions_list(request): object_list = Submission.objects.filter(creator=request.user) username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/submission_list.html', locals()) @login_required def submission_detail(request,pk): object = get_object_or_404(Submission, id=int(pk)) username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/submission_detail.html', locals()) ####################################################### New Submission form ### class InitialTrialForm(forms.Form): form_title = _('Initial Trial Data') scientific_title = forms.CharField(widget=forms.Textarea, label=_('Scientific Title'), max_length=2000) recruitment_country = forms.MultipleChoiceField(choices=((cc.pk,cc.description) for cc in CountryCode.objects.iterator()) ) - submission_xml = forms.FileField(required=False) class PrimarySponsorForm(forms.ModelForm): class Meta: model = Institution exclude = ['address'] form_title = _('Primary Sponsor') @login_required def new_submission(request): if request.method == 'POST': initial_form = InitialTrialForm(request.POST,request.FILES) sponsor_form = PrimarySponsorForm(request.POST) if initial_form.is_valid() and sponsor_form.is_valid(): trial = ClinicalTrial() su = Submission(creator=request.user) trial.scientific_title = su.title = initial_form.cleaned_data['scientific_title'] trial.save() su.save() trial.primary_sponsor = su.primary_sponsor = sponsor_form.save() trial.recruitment_country = [CountryCode.objects.get(pk=id) for id in initial_form.cleaned_data['recruitment_country']] su.trial = trial - if initial_form.cleaned_data['submission_xml'] is not None: - su.submission_xml = initial_form.cleaned_data['submission_xml'] - trial.save() su.save() return HttpResponseRedirect(reverse('repository.edittrial',args=[trial.id])) else: initial_form = InitialTrialForm() sponsor_form = PrimarySponsorForm() forms = [initial_form, sponsor_form] return render_to_response('reviewapp/new_submission.html', { 'forms': forms, 'username':request.user.username, })
ensaiosclinicos/clinicaltrials
15e7fea4fcc7a8274c0b0607136a867192ddccf4
filter submission list by logged user
diff --git a/clinicaltrials/reviewapp/views.py b/clinicaltrials/reviewapp/views.py index 71baf02..8536a37 100644 --- a/clinicaltrials/reviewapp/views.py +++ b/clinicaltrials/reviewapp/views.py @@ -1,80 +1,83 @@ # coding: utf-8 from django.core.urlresolvers import reverse from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect from django import forms from django.utils.translation import ugettext as _ from django.contrib.auth.decorators import login_required -from django.forms.models import modelformset_factory -from reviewapp.models import Submission, Attachment +from reviewapp.models import Submission from repository.models import ClinicalTrial, CountryCode, Institution +@login_required def index(request): username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/index.html', locals()) +@login_required def user_dump(request): uvars = [{'k':k, 'v':v} for k, v in request.user.__dict__.items()] return render_to_response('reviewapp/user_dump.html', locals()) +@login_required def submissions_list(request): - object_list = Submission.objects.all() + object_list = Submission.objects.filter(creator=request.user) username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/submission_list.html', locals()) +@login_required def submission_detail(request,pk): object = get_object_or_404(Submission, id=int(pk)) username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/submission_detail.html', locals()) ####################################################### New Submission form ### class InitialTrialForm(forms.Form): form_title = _('Initial Trial Data') scientific_title = forms.CharField(widget=forms.Textarea, label=_('Scientific Title'), max_length=2000) recruitment_country = forms.MultipleChoiceField(choices=((cc.pk,cc.description) for cc in CountryCode.objects.iterator()) ) submission_xml = forms.FileField(required=False) class PrimarySponsorForm(forms.ModelForm): class Meta: model = Institution exclude = ['address'] form_title = _('Primary Sponsor') @login_required def new_submission(request): if request.method == 'POST': initial_form = InitialTrialForm(request.POST,request.FILES) sponsor_form = PrimarySponsorForm(request.POST) if initial_form.is_valid() and sponsor_form.is_valid(): trial = ClinicalTrial() su = Submission(creator=request.user) trial.scientific_title = su.title = initial_form.cleaned_data['scientific_title'] trial.save() su.save() trial.primary_sponsor = su.primary_sponsor = sponsor_form.save() trial.recruitment_country = [CountryCode.objects.get(pk=id) for id in initial_form.cleaned_data['recruitment_country']] su.trial = trial if initial_form.cleaned_data['submission_xml'] is not None: su.submission_xml = initial_form.cleaned_data['submission_xml'] trial.save() su.save() return HttpResponseRedirect(reverse('repository.edittrial',args=[trial.id])) else: initial_form = InitialTrialForm() sponsor_form = PrimarySponsorForm() forms = [initial_form, sponsor_form] return render_to_response('reviewapp/new_submission.html', { 'forms': forms, 'username':request.user.username, })
ensaiosclinicos/clinicaltrials
63bbca65194548d595b7fbcba2ee7c06b3ab4d8b
initial scripts for testing email-based registration
diff --git a/clinicaltrials/reviewapp/test/getmail.py b/clinicaltrials/reviewapp/test/getmail.py new file mode 100755 index 0000000..869b98f --- /dev/null +++ b/clinicaltrials/reviewapp/test/getmail.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +from poplib import POP3_SSL +from email import message_from_string +from email.header import decode_header +import re + +from pprint import pprint + +HOST = 'pop.gmail.com' +EMAIL = '[email protected]' +PASSWD = '132548' + +ACTIVATE_RE = r'''http://.*/activate/([a-fA-F0-9]{40})/''' +ACTIVATE_RE = re.compile(ACTIVATE_RE) + +pop = POP3_SSL(HOST) +pop.user(EMAIL) +pop.pass_(PASSWD) +numMessages = len(pop.list()[1]) +for n in range(1,numMessages+1): + res, lines, size = pop.retr(n) + msg = message_from_string('\n'.join(lines)) + sub = msg['Subject'] + sub, encoding = decode_header(sub)[0] + if encoding: + sub = sub.decode(encoding) + print n, sub + if not msg.is_multipart(): + body = msg.get_payload(decode=True) + res = ACTIVATE_RE.search(body) + print res.group() + diff --git a/clinicaltrials/reviewapp/test/test_register.py b/clinicaltrials/reviewapp/test/test_register.py new file mode 100644 index 0000000..4a3229e --- /dev/null +++ b/clinicaltrials/reviewapp/test/test_register.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python + +import twill +from twill import commands as tc +from twill.shell import TwillCommandLoop +from django.test import TestCase +from django.core.servers.basehttp import AdminMediaHandler +from django.core.handlers.wsgi import WSGIHandler +from StringIO import StringIO + +# Functions you'll need: + +def twill_setup(): + app = AdminMediaHandler(WSGIHandler()) + twill.add_wsgi_intercept("127.0.0.1", 8080, lambda: app) + +def twill_teardown(): + twill.remove_wsgi_intercept('127.0.0.1', 8080) + +def make_twill_url(url): + # modify this + return url.replace("http://ubuntu/", + "http://127.0.0.1:8080/") + +def twill_quiet(): + # suppress normal output of twill.. You don't want to + # call this if you want an interactive session + twill.set_output(StringIO()) + +# Example tests. (This code has not been tested, as it +# would require a website to exist, but very similar +# code is working on my machine) + +class AccessTest(TestCase): + def setUp(self): + twill_setup() + + def tearDown(self): + twill_teardown() + + def test1(self): + url = "http://www.yourwebsite.com/signup/" + twill_quiet() + tc.go('ubuntu') + tc.find('Registro Brasileiro') + tc.follow('register') + tc.url() + # Fill in the form + tc.fv('1', 'username', 'test123') + tc.fv('1', 'email', '[email protected]') + tc.submit() + tc.find('click the activation link') + + def unfinished_test(self): + # Some complicated set up here, perhaps + # url = "http://www.yourwebsite.com/prefs/" + # tc.go(make_twill_url(url)) + + # The following will launch into an interactive twill session + # cmd = TwillCommandLoop() + # cmd.cmdloop() + + diff --git a/clinicaltrials/settings_local-SAMPLE.py b/clinicaltrials/settings_local-SAMPLE.py index 32eda0b..0881805 100644 --- a/clinicaltrials/settings_local-SAMPLE.py +++ b/clinicaltrials/settings_local-SAMPLE.py @@ -1,36 +1,37 @@ DEBUG = False ADMINS = ( ('Webmaster Ensaios Clinicos', '[email protected]'), ) DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'clinicaltrials' # Or path to database file if using sqlite3. DATABASE_USER = 'tester' # Not used with sqlite3. DATABASE_PASSWORD = 'puffpuff' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. SECRET_KEY = 'rmbg(!8sa@&8o9pnnd@*szm+axos_6r$)r48jc2r$^_8+wz)po' EMAIL_HOST = 'pombo.bireme.br' EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers ### if set, used to authenticate with SMTP EMAIL_HOST_USER = '[email protected]' EMAIL_HOST_PASSWORD = '?????' EMAIL_USE_TLS = False SERVER_EMAIL = EMAIL_HOST_USER if DEBUG: + DEBUG_PROPAGATE_EXCEPTIONS = True MIDDLEWARE_CLASSES += ( ## external dependency for debug purposes only # 'debug_middleware.DebugFooter', ) INSTALLED_APPS += ( ## external dependency for generating model ER diagrams # 'graphviz', ) GRAPHVIZ_DOT_CMD = '/usr/bin/dot'
ensaiosclinicos/clinicaltrials
0df01838af36fefc2cc00b5b67773c425640945c
started development of test script for trialist account creation; removed country data from vocabulary fixture (it can be created using tools/load_cc_trans.py); removed gettext usage from settings.py
diff --git a/clinicaltrials/settings.py b/clinicaltrials/settings.py index acb56ee..71c5f77 100644 --- a/clinicaltrials/settings.py +++ b/clinicaltrials/settings.py @@ -1,144 +1,143 @@ # -*- encoding: utf-8 -*- # Django settings for clinicaltrials project. import os -from django.utils.translation import ugettext_lazy as _ DEBUG = False TEMPLATE_DEBUG = DEBUG PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) ADMINS = ( ('Luciano Ramalho', '[email protected]'), ('Fabio Montefuscolo', '[email protected]'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'America/Brasilia' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'pt-BR' # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/static/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = '*06=j&&^n71^a&%%3rs%7lla+^(n^v1w@@dp_rxvi#&(xo7meq' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', # 'django.template.loaders.eggs.load_template_source', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'middleware.scriptprefix.ScriptPrefixMiddleware', ) ROOT_URLCONF = 'clinicaltrials.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(PROJECT_PATH, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'repository', 'vocabulary', 'reviewapp', 'tickets', 'assistance', 'decsclient', 'polyglot', 'rosetta', 'registration', # django-registration package ) ################################################################# ### BEGIN Clinical Trials Repository customization settings ### ### see also settings_local-SAMPLE.py for private customization settings. # this id must match the record with the correct domain name in the # django_site table; the initial values for that table are defined # in clinicaltrials/fixture/initial_data.json SITE_ID = 2 # change if necessary to match a record in django_site SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos' SEND_BROKEN_LINK_EMAILS = True DECS_SERVICE = 'http://decs.bvs.br/cgi-bin/mx/cgi=@vmx/decs' # Notes: # 1) language codes should follow the IANA standard for language subtags # source: http://www.iana.org/assignments/language-subtag-repository # 2) the first managed language is considered the default and is # also the source language for content translation purposes MANAGED_LANGUAGES = ( ('en',u'English'), ('es',u'Español'), - #('fr',_('Français')), + #('fr',u'Français'), ('pt',u'Português'), ) TARGET_LANGUAGES = MANAGED_LANGUAGES[1:] # exlude source language CHECKED_LANGUAGES = [code for code, label in MANAGED_LANGUAGES] # django-registration: for how long the activation link is valid ACCOUNT_ACTIVATION_DAYS = 7 # django-registration: set to False to suspend new user registrations REGISTRATION_OPEN = True ATTACHMENTS_PATH = os.path.join(MEDIA_ROOT, 'attachments') SUBMISSIONS_XML_PATH = os.path.join(MEDIA_ROOT, 'submissions_xml') FIXTURE_DIRS = ('fixtures',) ### END Clinical Trials Repository customization settings ################################################################# # Deployment settings: there *must* be an unversioned settings_local.py # file in the current directory. See sample file at settings_local-SAMPLE.py execfile(os.path.join(PROJECT_PATH,'settings_local.py')) diff --git a/clinicaltrials/test/getmail.py b/clinicaltrials/test/getmail.py new file mode 100755 index 0000000..869b98f --- /dev/null +++ b/clinicaltrials/test/getmail.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +from poplib import POP3_SSL +from email import message_from_string +from email.header import decode_header +import re + +from pprint import pprint + +HOST = 'pop.gmail.com' +EMAIL = '[email protected]' +PASSWD = '132548' + +ACTIVATE_RE = r'''http://.*/activate/([a-fA-F0-9]{40})/''' +ACTIVATE_RE = re.compile(ACTIVATE_RE) + +pop = POP3_SSL(HOST) +pop.user(EMAIL) +pop.pass_(PASSWD) +numMessages = len(pop.list()[1]) +for n in range(1,numMessages+1): + res, lines, size = pop.retr(n) + msg = message_from_string('\n'.join(lines)) + sub = msg['Subject'] + sub, encoding = decode_header(sub)[0] + if encoding: + sub = sub.decode(encoding) + print n, sub + if not msg.is_multipart(): + body = msg.get_payload(decode=True) + res = ACTIVATE_RE.search(body) + print res.group() + diff --git a/clinicaltrials/vocabulary/fixtures/initial_data.json b/clinicaltrials/vocabulary/fixtures/initial_data.json index f2fae24..54c6dbb 100644 --- a/clinicaltrials/vocabulary/fixtures/initial_data.json +++ b/clinicaltrials/vocabulary/fixtures/initial_data.json @@ -1,10127 +1,513 @@ [ - { - "pk": 656, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Afeganist\u00e3o", - "label": "AF", - "content_type": 20, - "language": "pt", - "object_id": 2 - } - }, - { - "pk": 657, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "\u00c1frica do Sul", - "label": "ZA", - "content_type": 20, - "language": "pt", - "object_id": 204 - } - }, - { - "pk": 658, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "\u00c5land, Ilhas", - "label": "AX", - "content_type": 20, - "language": "pt", - "object_id": 3 - } - }, - { - "pk": 659, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Alb\u00e2nia", - "label": "AL", - "content_type": 20, - "language": "pt", - "object_id": 4 - } - }, - { - "pk": 660, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Alemanha", - "label": "DE", - "content_type": 20, - "language": "pt", - "object_id": 81 - } - }, - { - "pk": 661, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Andorra", - "label": "AD", - "content_type": 20, - "language": "pt", - "object_id": 7 - } - }, - { - "pk": 662, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Angola", - "label": "AO", - "content_type": 20, - "language": "pt", - "object_id": 8 - } - }, - { - "pk": 663, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Anguilla", - "label": "AI", - "content_type": 20, - "language": "pt", - "object_id": 9 - } - }, - { - "pk": 664, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ant\u00e1rctida", - "label": "AQ", - "content_type": 20, - "language": "pt", - "object_id": 10 - } - }, - { - "pk": 665, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ant\u00edgua e Barbuda", - "label": "AG", - "content_type": 20, - "language": "pt", - "object_id": 11 - } - }, - { - "pk": 666, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Antilhas Holandesas", - "label": "AN", - "content_type": 20, - "language": "pt", - "object_id": 156 - } - }, - { - "pk": 667, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ar\u00e1bia Saudita", - "label": "SA", - "content_type": 20, - "language": "pt", - "object_id": 194 - } - }, - { - "pk": 668, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Arg\u00e9lia", - "label": "DZ", - "content_type": 20, - "language": "pt", - "object_id": 5 - } - }, - { - "pk": 669, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Argentina", - "label": "AR", - "content_type": 20, - "language": "pt", - "object_id": 12 - } - }, - { - "pk": 670, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Arm\u00eania", - "label": "AM", - "content_type": 20, - "language": "pt", - "object_id": 13 - } - }, - { - "pk": 671, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Aruba", - "label": "AW", - "content_type": 20, - "language": "pt", - "object_id": 14 - } - }, - { - "pk": 672, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Austr\u00e1lia", - "label": "AU", - "content_type": 20, - "language": "pt", - "object_id": 15 - } - }, - { - "pk": 673, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "\u00c1ustria", - "label": "AT", - "content_type": 20, - "language": "pt", - "object_id": 16 - } - }, - { - "pk": 674, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Azerbaij\u00e3o", - "label": "AZ", - "content_type": 20, - "language": "pt", - "object_id": 17 - } - }, - { - "pk": 675, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bahamas", - "label": "BS", - "content_type": 20, - "language": "pt", - "object_id": 18 - } - }, - { - "pk": 676, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bahrain", - "label": "BH", - "content_type": 20, - "language": "pt", - "object_id": 19 - } - }, - { - "pk": 677, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bangladesh", - "label": "BD", - "content_type": 20, - "language": "pt", - "object_id": 20 - } - }, - { - "pk": 678, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Barbados", - "label": "BB", - "content_type": 20, - "language": "pt", - "object_id": 21 - } - }, - { - "pk": 679, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "B\u00e9lgica", - "label": "BE", - "content_type": 20, - "language": "pt", - "object_id": 23 - } - }, - { - "pk": 680, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Belize", - "label": "BZ", - "content_type": 20, - "language": "pt", - "object_id": 24 - } - }, - { - "pk": 681, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Benim", - "label": "BJ", - "content_type": 20, - "language": "pt", - "object_id": 25 - } - }, - { - "pk": 682, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bermudas", - "label": "BM", - "content_type": 20, - "language": "pt", - "object_id": 26 - } - }, - { - "pk": 683, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bielorr\u00fassia", - "label": "BY", - "content_type": 20, - "language": "pt", - "object_id": 22 - } - }, - { - "pk": 684, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bol\u00edvia", - "label": "BO", - "content_type": 20, - "language": "pt", - "object_id": 28 - } - }, - { - "pk": 685, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "B\u00f3snia e Herzegovina", - "label": "BA", - "content_type": 20, - "language": "pt", - "object_id": 29 - } - }, - { - "pk": 686, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Botswana", - "label": "BW", - "content_type": 20, - "language": "pt", - "object_id": 30 - } - }, - { - "pk": 687, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bouvet, Ilha", - "label": "BV", - "content_type": 20, - "language": "pt", - "object_id": 31 - } - }, - { - "pk": 688, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Brasil", - "label": "BR", - "content_type": 20, - "language": "pt", - "object_id": 1 - } - }, - { - "pk": 689, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Brunei", - "label": "BN", - "content_type": 20, - "language": "pt", - "object_id": 33 - } - }, - { - "pk": 690, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bulg\u00e1ria", - "label": "BG", - "content_type": 20, - "language": "pt", - "object_id": 34 - } - }, - { - "pk": 691, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Burkina Faso", - "label": "BF", - "content_type": 20, - "language": "pt", - "object_id": 35 - } - }, - { - "pk": 692, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Burundi", - "label": "BI", - "content_type": 20, - "language": "pt", - "object_id": 36 - } - }, - { - "pk": 693, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "But\u00e3o", - "label": "BT", - "content_type": 20, - "language": "pt", - "object_id": 27 - } - }, - { - "pk": 694, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cabo Verde", - "label": "CV", - "content_type": 20, - "language": "pt", - "object_id": 40 - } - }, - { - "pk": 695, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cambodja", - "label": "KH", - "content_type": 20, - "language": "pt", - "object_id": 37 - } - }, - { - "pk": 696, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Camar\u00f5es", - "label": "CM", - "content_type": 20, - "language": "pt", - "object_id": 38 - } - }, - { - "pk": 697, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Canad\u00e1", - "label": "CA", - "content_type": 20, - "language": "pt", - "object_id": 39 - } - }, - { - "pk": 698, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cayman, Ilhas", - "label": "KY", - "content_type": 20, - "language": "pt", - "object_id": 41 - } - }, - { - "pk": 699, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cazaquist\u00e3o", - "label": "KZ", - "content_type": 20, - "language": "pt", - "object_id": 113 - } - }, - { - "pk": 700, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Centro-Africana, Rep\u00fablica", - "label": "CF", - "content_type": 20, - "language": "pt", - "object_id": 42 - } - }, - { - "pk": 701, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chade", - "label": "TD", - "content_type": 20, - "language": "pt", - "object_id": 43 - } - }, - { - "pk": 702, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Checa, Rep\u00fablica", - "label": "CZ", - "content_type": 20, - "language": "pt", - "object_id": 58 - } - }, - { - "pk": 703, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chile", - "label": "CL", - "content_type": 20, - "language": "pt", - "object_id": 44 - } - }, - { - "pk": 704, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "China", - "label": "CN", - "content_type": 20, - "language": "pt", - "object_id": 45 - } - }, - { - "pk": 705, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chipre", - "label": "CY", - "content_type": 20, - "language": "pt", - "object_id": 57 - } - }, - { - "pk": 706, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Christmas, Ilha", - "label": "CX", - "content_type": 20, - "language": "pt", - "object_id": 46 - } - }, - { - "pk": 707, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cocos, Ilhas", - "label": "CC", - "content_type": 20, - "language": "pt", - "object_id": 47 - } - }, - { - "pk": 708, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Col\u00f4mbia", - "label": "CO", - "content_type": 20, - "language": "pt", - "object_id": 48 - } - }, - { - "pk": 709, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Comores", - "label": "KM", - "content_type": 20, - "language": "pt", - "object_id": 49 - } - }, - { - "pk": 710, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Congo, Rep\u00fablica do", - "label": "CG", - "content_type": 20, - "language": "pt", - "object_id": 50 - } - }, - { - "pk": 711, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Congo, Rep\u00fablica Democr\u00e1tica do (antigo Zaire)", - "label": "CD", - "content_type": 20, - "language": "pt", - "object_id": 51 - } - }, - { - "pk": 712, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cook, Ilhas", - "label": "CK", - "content_type": 20, - "language": "pt", - "object_id": 52 - } - }, - { - "pk": 713, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cor\u00e9ia do Sul", - "label": "KR", - "content_type": 20, - "language": "pt", - "object_id": 117 - } - }, - { - "pk": 714, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Coreia, Rep\u00fablica Democr\u00e1tica da (Coreia do Norte)", - "label": "KP", - "content_type": 20, - "language": "pt", - "object_id": 116 - } - }, - { - "pk": 715, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Costa do Marfim", - "label": "CI", - "content_type": 20, - "language": "pt", - "object_id": 54 - } - }, - { - "pk": 716, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Costa Rica", - "label": "CR", - "content_type": 20, - "language": "pt", - "object_id": 53 - } - }, - { - "pk": 717, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cro\u00e1cia", - "label": "HR", - "content_type": 20, - "language": "pt", - "object_id": 55 - } - }, - { - "pk": 718, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cuba", - "label": "CU", - "content_type": 20, - "language": "pt", - "object_id": 56 - } - }, - { - "pk": 719, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dinamarca", - "label": "DK", - "content_type": 20, - "language": "pt", - "object_id": 59 - } - }, - { - "pk": 720, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Djibouti", - "label": "DJ", - "content_type": 20, - "language": "pt", - "object_id": 60 - } - }, - { - "pk": 721, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dominica", - "label": "DM", - "content_type": 20, - "language": "pt", - "object_id": 61 - } - }, - { - "pk": 722, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dominicana, Rep\u00fablica", - "label": "DO", - "content_type": 20, - "language": "pt", - "object_id": 62 - } - }, - { - "pk": 723, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Egito", - "label": "EG", - "content_type": 20, - "language": "pt", - "object_id": 64 - } - }, - { - "pk": 724, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "El Salvador", - "label": "SV", - "content_type": 20, - "language": "pt", - "object_id": 65 - } - }, - { - "pk": 725, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Emirados \u00c1rabes Unidos", - "label": "AE", - "content_type": 20, - "language": "pt", - "object_id": 231 - } - }, - { - "pk": 726, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Equador", - "label": "EC", - "content_type": 20, - "language": "pt", - "object_id": 63 - } - }, - { - "pk": 727, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eritreia", - "label": "ER", - "content_type": 20, - "language": "pt", - "object_id": 67 - } - }, - { - "pk": 728, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eslov\u00e1quia", - "label": "SK", - "content_type": 20, - "language": "pt", - "object_id": 200 - } - }, - { - "pk": 729, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eslov\u00eania", - "label": "SI", - "content_type": 20, - "language": "pt", - "object_id": 201 - } - }, - { - "pk": 730, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Espanha", - "label": "ES", - "content_type": 20, - "language": "pt", - "object_id": 206 - } - }, - { - "pk": 731, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Estados Unidos da Am\u00e9rica", - "label": "US", - "content_type": 20, - "language": "pt", - "object_id": 233 - } - }, - { - "pk": 732, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Est\u00f3nia", - "label": "EE", - "content_type": 20, - "language": "pt", - "object_id": 68 - } - }, - { - "pk": 733, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eti\u00f3pia", - "label": "ET", - "content_type": 20, - "language": "pt", - "object_id": 69 - } - }, - { - "pk": 734, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Fero\u00e9, Ilhas", - "label": "FO", - "content_type": 20, - "language": "pt", - "object_id": 71 - } - }, - { - "pk": 735, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Fiji", - "label": "FJ", - "content_type": 20, - "language": "pt", - "object_id": 72 - } - }, - { - "pk": 736, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Filipinas", - "label": "PH", - "content_type": 20, - "language": "pt", - "object_id": 174 - } - }, - { - "pk": 737, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Finl\u00e2ndia", - "label": "FI", - "content_type": 20, - "language": "pt", - "object_id": 73 - } - }, - { - "pk": 738, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Fran\u00e7a", - "label": "FR", - "content_type": 20, - "language": "pt", - "object_id": 74 - } - }, - { - "pk": 739, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gab\u00e3o", - "label": "GA", - "content_type": 20, - "language": "pt", - "object_id": 78 - } - }, - { - "pk": 740, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "G\u00e2mbia", - "label": "GM", - "content_type": 20, - "language": "pt", - "object_id": 79 - } - }, - { - "pk": 741, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gana", - "label": "GH", - "content_type": 20, - "language": "pt", - "object_id": 82 - } - }, - { - "pk": 742, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ge\u00f3rgia", - "label": "GE", - "content_type": 20, - "language": "pt", - "object_id": 80 - } - }, - { - "pk": 743, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ge\u00f3rgia do Sul e Sandwich do Sul, Ilhas", - "label": "GS", - "content_type": 20, - "language": "pt", - "object_id": 205 - } - }, - { - "pk": 744, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gibraltar", - "label": "GI", - "content_type": 20, - "language": "pt", - "object_id": 83 - } - }, - { - "pk": 745, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gr\u00e9cia", - "label": "GR", - "content_type": 20, - "language": "pt", - "object_id": 84 - } - }, - { - "pk": 746, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Grenada", - "label": "GD", - "content_type": 20, - "language": "pt", - "object_id": 86 - } - }, - { - "pk": 747, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Groenl\u00e2ndia", - "label": "GL", - "content_type": 20, - "language": "pt", - "object_id": 85 - } - }, - { - "pk": 748, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guadalupe", - "label": "GP", - "content_type": 20, - "language": "pt", - "object_id": 87 - } - }, - { - "pk": 749, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guam", - "label": "GU", - "content_type": 20, - "language": "pt", - "object_id": 88 - } - }, - { - "pk": 750, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guatemala", - "label": "GT", - "content_type": 20, - "language": "pt", - "object_id": 89 - } - }, - { - "pk": 751, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guernsey", - "label": "GG", - "content_type": 20, - "language": "pt", - "object_id": 90 - } - }, - { - "pk": 752, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guiana", - "label": "GY", - "content_type": 20, - "language": "pt", - "object_id": 93 - } - }, - { - "pk": 753, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guiana Francesa", - "label": "GF", - "content_type": 20, - "language": "pt", - "object_id": 75 - } - }, - { - "pk": 754, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guin\u00e9-Bissau", - "label": "GW", - "content_type": 20, - "language": "pt", - "object_id": 92 - } - }, - { - "pk": 755, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guin\u00e9-Conacri", - "label": "GN", - "content_type": 20, - "language": "pt", - "object_id": 91 - } - }, - { - "pk": 756, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guin\u00e9 Equatorial", - "label": "GQ", - "content_type": 20, - "language": "pt", - "object_id": 66 - } - }, - { - "pk": 757, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Haiti", - "label": "HT", - "content_type": 20, - "language": "pt", - "object_id": 94 - } - }, - { - "pk": 758, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Heard e Ilhas McDonald, Ilha", - "label": "HM", - "content_type": 20, - "language": "pt", - "object_id": 95 - } - }, - { - "pk": 759, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Honduras", - "label": "HN", - "content_type": 20, - "language": "pt", - "object_id": 97 - } - }, - { - "pk": 760, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Hong Kong", - "label": "HK", - "content_type": 20, - "language": "pt", - "object_id": 98 - } - }, - { - "pk": 761, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Hungria", - "label": "HU", - "content_type": 20, - "language": "pt", - "object_id": 99 - } - }, - { - "pk": 762, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "I\u00e9men", - "label": "YE", - "content_type": 20, - "language": "pt", - "object_id": 244 - } - }, - { - "pk": 763, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "\u00cdndia", - "label": "IN", - "content_type": 20, - "language": "pt", - "object_id": 101 - } - }, - { - "pk": 764, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Indon\u00e9sia", - "label": "ID", - "content_type": 20, - "language": "pt", - "object_id": 102 - } - }, - { - "pk": 765, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Iraque", - "label": "IQ", - "content_type": 20, - "language": "pt", - "object_id": 104 - } - }, - { - "pk": 766, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ir\u00e3", - "label": "IR", - "content_type": 20, - "language": "pt", - "object_id": 103 - } - }, - { - "pk": 767, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Irlanda", - "label": "IE", - "content_type": 20, - "language": "pt", - "object_id": 105 - } - }, - { - "pk": 768, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Isl\u00e2ndia", - "label": "IS", - "content_type": 20, - "language": "pt", - "object_id": 100 - } - }, - { - "pk": 769, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Israel", - "label": "IL", - "content_type": 20, - "language": "pt", - "object_id": 107 - } - }, - { - "pk": 770, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "It\u00e1lia", - "label": "IT", - "content_type": 20, - "language": "pt", - "object_id": 108 - } - }, - { - "pk": 771, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jamaica", - "label": "JM", - "content_type": 20, - "language": "pt", - "object_id": 109 - } - }, - { - "pk": 772, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jap\u00e3o", - "label": "JP", - "content_type": 20, - "language": "pt", - "object_id": 110 - } - }, - { - "pk": 773, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jersey", - "label": "JE", - "content_type": 20, - "language": "pt", - "object_id": 111 - } - }, - { - "pk": 774, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jord\u00e2nia", - "label": "JO", - "content_type": 20, - "language": "pt", - "object_id": 112 - } - }, - { - "pk": 775, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kiribati", - "label": "KI", - "content_type": 20, - "language": "pt", - "object_id": 115 - } - }, - { - "pk": 776, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kuwait", - "label": "KW", - "content_type": 20, - "language": "pt", - "object_id": 118 - } - }, - { - "pk": 777, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Laos", - "label": "LA", - "content_type": 20, - "language": "pt", - "object_id": 120 - } - }, - { - "pk": 778, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Lesoto", - "label": "LS", - "content_type": 20, - "language": "pt", - "object_id": 123 - } - }, - { - "pk": 779, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Let\u00f4nia", - "label": "LV", - "content_type": 20, - "language": "pt", - "object_id": 121 - } - }, - { - "pk": 780, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "L\u00edbano", - "label": "LB", - "content_type": 20, - "language": "pt", - "object_id": 122 - } - }, - { - "pk": 781, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Lib\u00e9ria", - "label": "LR", - "content_type": 20, - "language": "pt", - "object_id": 124 - } - }, - { - "pk": 782, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "L\u00edbia", - "label": "LY", - "content_type": 20, - "language": "pt", - "object_id": 125 - } - }, - { - "pk": 783, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Liechtenstein", - "label": "LI", - "content_type": 20, - "language": "pt", - "object_id": 126 - } - }, - { - "pk": 784, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Litu\u00e2nia", - "label": "LT", - "content_type": 20, - "language": "pt", - "object_id": 127 - } - }, - { - "pk": 785, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Luxemburgo", - "label": "LU", - "content_type": 20, - "language": "pt", - "object_id": 128 - } - }, - { - "pk": 786, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Macau", - "label": "MO", - "content_type": 20, - "language": "pt", - "object_id": 129 - } - }, - { - "pk": 787, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maced\u00f4nia, Rep\u00fablica da", - "label": "MK", - "content_type": 20, - "language": "pt", - "object_id": 130 - } - }, - { - "pk": 788, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Madag\u00e1scar", - "label": "MG", - "content_type": 20, - "language": "pt", - "object_id": 131 - } - }, - { - "pk": 789, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mal\u00e1sia", - "label": "MY", - "content_type": 20, - "language": "pt", - "object_id": 133 - } - }, - { - "pk": 790, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malawi", - "label": "MW", - "content_type": 20, - "language": "pt", - "object_id": 132 - } - }, - { - "pk": 791, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maldivas", - "label": "MV", - "content_type": 20, - "language": "pt", - "object_id": 134 - } - }, - { - "pk": 792, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mali", - "label": "ML", - "content_type": 20, - "language": "pt", - "object_id": 135 - } - }, - { - "pk": 793, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malta", - "label": "MT", - "content_type": 20, - "language": "pt", - "object_id": 136 - } - }, - { - "pk": 794, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malvinas, Ilhas (Falkland)", - "label": "FK", - "content_type": 20, - "language": "pt", - "object_id": 70 - } - }, - { - "pk": 795, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Man, Ilha de", - "label": "IM", - "content_type": 20, - "language": "pt", - "object_id": 106 - } - }, - { - "pk": 796, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Marianas Setentrionais", - "label": "MP", - "content_type": 20, - "language": "pt", - "object_id": 164 - } - }, - { - "pk": 797, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Marrocos", - "label": "MA", - "content_type": 20, - "language": "pt", - "object_id": 149 - } - }, - { - "pk": 798, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Marshall, Ilhas", - "label": "MH", - "content_type": 20, - "language": "pt", - "object_id": 137 - } - }, - { - "pk": 799, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Martinica", - "label": "MQ", - "content_type": 20, - "language": "pt", - "object_id": 138 - } - }, - { - "pk": 800, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maur\u00edcia", - "label": "MU", - "content_type": 20, - "language": "pt", - "object_id": 140 - } - }, - { - "pk": 801, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maurit\u00e2nia", - "label": "MR", - "content_type": 20, - "language": "pt", - "object_id": 139 - } - }, - { - "pk": 802, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mayotte", - "label": "YT", - "content_type": 20, - "language": "pt", - "object_id": 141 - } - }, - { - "pk": 803, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Menores Distantes dos Estados Unidos, Ilhas", - "label": "UM", - "content_type": 20, - "language": "pt", - "object_id": 234 - } - }, - { - "pk": 804, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "M\u00e9xico", - "label": "MX", - "content_type": 20, - "language": "pt", - "object_id": 142 - } - }, - { - "pk": 805, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Myanmar (antiga Birm\u00e2nia)", - "label": "MM", - "content_type": 20, - "language": "pt", - "object_id": 151 - } - }, - { - "pk": 806, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Micron\u00e9sia, Estados Federados da", - "label": "FM", - "content_type": 20, - "language": "pt", - "object_id": 143 - } - }, - { - "pk": 807, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mo\u00e7ambique", - "label": "MZ", - "content_type": 20, - "language": "pt", - "object_id": 150 - } - }, - { - "pk": 808, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mold\u00e1via", - "label": "MD", - "content_type": 20, - "language": "pt", - "object_id": 144 - } - }, - { - "pk": 809, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "M\u00f4naco", - "label": "MC", - "content_type": 20, - "language": "pt", - "object_id": 145 - } - }, - { - "pk": 810, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mong\u00f3lia", - "label": "MN", - "content_type": 20, - "language": "pt", - "object_id": 146 - } - }, - { - "pk": 811, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Montenegro", - "label": "ME", - "content_type": 20, - "language": "pt", - "object_id": 147 - } - }, - { - "pk": 812, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Montserrat", - "label": "MS", - "content_type": 20, - "language": "pt", - "object_id": 148 - } - }, - { - "pk": 813, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nam\u00edbia", - "label": "NA", - "content_type": 20, - "language": "pt", - "object_id": 152 - } - }, - { - "pk": 814, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nauru", - "label": "NR", - "content_type": 20, - "language": "pt", - "object_id": 153 - } - }, - { - "pk": 815, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nepal", - "label": "NP", - "content_type": 20, - "language": "pt", - "object_id": 154 - } - }, - { - "pk": 816, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nicar\u00e1gua", - "label": "NI", - "content_type": 20, - "language": "pt", - "object_id": 159 - } - }, - { - "pk": 817, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "N\u00edger", - "label": "NE", - "content_type": 20, - "language": "pt", - "object_id": 160 - } - }, - { - "pk": 818, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nig\u00e9ria", - "label": "NG", - "content_type": 20, - "language": "pt", - "object_id": 161 - } - }, - { - "pk": 819, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Niue", - "label": "NU", - "content_type": 20, - "language": "pt", - "object_id": 162 - } - }, - { - "pk": 820, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Norfolk, Ilha", - "label": "NF", - "content_type": 20, - "language": "pt", - "object_id": 163 - } - }, - { - "pk": 821, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Noruega", - "label": "NO", - "content_type": 20, - "language": "pt", - "object_id": 165 - } - }, - { - "pk": 822, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nova Caled\u00f4nia", - "label": "NC", - "content_type": 20, - "language": "pt", - "object_id": 157 - } - }, - { - "pk": 823, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nova Zel\u00e2ndia (Aotearoa)", - "label": "NZ", - "content_type": 20, - "language": "pt", - "object_id": 158 - } - }, - { - "pk": 824, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Oman", - "label": "OM", - "content_type": 20, - "language": "pt", - "object_id": 166 - } - }, - { - "pk": 825, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pa\u00edses Baixos (Holanda)", - "label": "NL", - "content_type": 20, - "language": "pt", - "object_id": 155 - } - }, - { - "pk": 826, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Palau", - "label": "PW", - "content_type": 20, - "language": "pt", - "object_id": 168 - } - }, - { - "pk": 827, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Palestina", - "label": "PS", - "content_type": 20, - "language": "pt", - "object_id": 169 - } - }, - { - "pk": 828, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Panam\u00e1", - "label": "PA", - "content_type": 20, - "language": "pt", - "object_id": 170 - } - }, - { - "pk": 829, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Papua-Nova Guin\u00e9", - "label": "PG", - "content_type": 20, - "language": "pt", - "object_id": 171 - } - }, - { - "pk": 830, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Paquist\u00e3o", - "label": "PK", - "content_type": 20, - "language": "pt", - "object_id": 167 - } - }, - { - "pk": 831, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Paraguai", - "label": "PY", - "content_type": 20, - "language": "pt", - "object_id": 172 - } - }, - { - "pk": 832, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Peru", - "label": "PE", - "content_type": 20, - "language": "pt", - "object_id": 173 - } - }, - { - "pk": 833, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pitcairn", - "label": "PN", - "content_type": 20, - "language": "pt", - "object_id": 175 - } - }, - { - "pk": 834, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Polin\u00e9sia Francesa", - "label": "PF", - "content_type": 20, - "language": "pt", - "object_id": 76 - } - }, - { - "pk": 835, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pol\u00f4nia", - "label": "PL", - "content_type": 20, - "language": "pt", - "object_id": 176 - } - }, - { - "pk": 836, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Porto Rico", - "label": "PR", - "content_type": 20, - "language": "pt", - "object_id": 178 - } - }, - { - "pk": 837, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Portugal", - "label": "PT", - "content_type": 20, - "language": "pt", - "object_id": 177 - } - }, - { - "pk": 838, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Qatar", - "label": "QA", - "content_type": 20, - "language": "pt", - "object_id": 179 - } - }, - { - "pk": 839, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Qu\u00eania", - "label": "KE", - "content_type": 20, - "language": "pt", - "object_id": 114 - } - }, - { - "pk": 840, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Quirguist\u00e3o", - "label": "KG", - "content_type": 20, - "language": "pt", - "object_id": 119 - } - }, - { - "pk": 841, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Reino Unido da Gr\u00e3-Bretanha e Irlanda do Norte", - "label": "GB", - "content_type": 20, - "language": "pt", - "object_id": 232 - } - }, - { - "pk": 842, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Reuni\u00e3o", - "label": "RE", - "content_type": 20, - "language": "pt", - "object_id": 180 - } - }, - { - "pk": 843, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rom\u00eania", - "label": "RO", - "content_type": 20, - "language": "pt", - "object_id": 181 - } - }, - { - "pk": 844, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ruanda", - "label": "RW", - "content_type": 20, - "language": "pt", - "object_id": 183 - } - }, - { - "pk": 845, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "R\u00fassia", - "label": "RU", - "content_type": 20, - "language": "pt", - "object_id": 182 - } - }, - { - "pk": 846, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Saara Ocidental", - "label": "EH", - "content_type": 20, - "language": "pt", - "object_id": 243 - } - }, - { - "pk": 847, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Samoa Americana", - "label": "AS", - "content_type": 20, - "language": "pt", - "object_id": 6 - } - }, - { - "pk": 848, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Samoa (Samoa Ocidental)", - "label": "WS", - "content_type": 20, - "language": "pt", - "object_id": 191 - } - }, - { - "pk": 849, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Saint Pierre et Miquelon", - "label": "PM", - "content_type": 20, - "language": "pt", - "object_id": 189 - } - }, - { - "pk": 850, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Salom\u00e3o, Ilhas", - "label": "SB", - "content_type": 20, - "language": "pt", - "object_id": 202 - } - }, - { - "pk": 851, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00e3o Crist\u00f3v\u00e3o e N\u00e9vis (Saint Kitts e Nevis)", - "label": "KN", - "content_type": 20, - "language": "pt", - "object_id": 186 - } - }, - { - "pk": 852, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "San Marino", - "label": "SM", - "content_type": 20, - "language": "pt", - "object_id": 192 - } - }, - { - "pk": 853, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00e3o Tom\u00e9 e Pr\u00edncipe", - "label": "ST", - "content_type": 20, - "language": "pt", - "object_id": 193 - } - }, - { - "pk": 854, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00e3o Vicente e Granadinas", - "label": "VC", - "content_type": 20, - "language": "pt", - "object_id": 190 - } - }, - { - "pk": 855, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santa Helena", - "label": "SH", - "content_type": 20, - "language": "pt", - "object_id": 185 - } - }, - { - "pk": 856, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santa L\u00facia", - "label": "LC", - "content_type": 20, - "language": "pt", - "object_id": 187 - } - }, - { - "pk": 857, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Senegal", - "label": "SN", - "content_type": 20, - "language": "pt", - "object_id": 195 - } - }, - { - "pk": 858, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Serra Leoa", - "label": "SL", - "content_type": 20, - "language": "pt", - "object_id": 198 - } - }, - { - "pk": 859, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00e9rvia", - "label": "RS", - "content_type": 20, - "language": "pt", - "object_id": 196 - } - }, - { - "pk": 860, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Seychelles", - "label": "SC", - "content_type": 20, - "language": "pt", - "object_id": 197 - } - }, - { - "pk": 861, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Singapura", - "label": "SG", - "content_type": 20, - "language": "pt", - "object_id": 199 - } - }, - { - "pk": 862, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00edria", - "label": "SY", - "content_type": 20, - "language": "pt", - "object_id": 214 - } - }, - { - "pk": 863, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Som\u00e1lia", - "label": "SO", - "content_type": 20, - "language": "pt", - "object_id": 203 - } - }, - { - "pk": 864, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sri Lanka", - "label": "LK", - "content_type": 20, - "language": "pt", - "object_id": 207 - } - }, - { - "pk": 865, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Suazil\u00e2ndia", - "label": "SZ", - "content_type": 20, - "language": "pt", - "object_id": 211 - } - }, - { - "pk": 866, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sud\u00e3o", - "label": "SD", - "content_type": 20, - "language": "pt", - "object_id": 208 - } - }, - { - "pk": 867, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Su\u00e9cia", - "label": "SE", - "content_type": 20, - "language": "pt", - "object_id": 212 - } - }, - { - "pk": 868, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Su\u00ed\u00e7a", - "label": "CH", - "content_type": 20, - "language": "pt", - "object_id": 213 - } - }, - { - "pk": 869, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Suriname", - "label": "SR", - "content_type": 20, - "language": "pt", - "object_id": 209 - } - }, - { - "pk": 870, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Svalbard e Jan Mayen", - "label": "SJ", - "content_type": 20, - "language": "pt", - "object_id": 210 - } - }, - { - "pk": 871, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tail\u00e2ndia", - "label": "TH", - "content_type": 20, - "language": "pt", - "object_id": 218 - } - }, - { - "pk": 872, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Taiwan", - "label": "TW", - "content_type": 20, - "language": "pt", - "object_id": 215 - } - }, - { - "pk": 873, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tajiquist\u00e3o", - "label": "TJ", - "content_type": 20, - "language": "pt", - "object_id": 216 - } - }, - { - "pk": 874, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tanz\u00e2nia", - "label": "TZ", - "content_type": 20, - "language": "pt", - "object_id": 217 - } - }, - { - "pk": 875, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Terras Austrais e Ant\u00e1rticas Francesas (TAAF)", - "label": "TF", - "content_type": 20, - "language": "pt", - "object_id": 77 - } - }, - { - "pk": 876, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Territ\u00f3rio Brit\u00e2nico do Oceano \u00cdndico", - "label": "IO", - "content_type": 20, - "language": "pt", - "object_id": 32 - } - }, - { - "pk": 877, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Timor-Leste", - "label": "TL", - "content_type": 20, - "language": "pt", - "object_id": 219 - } - }, - { - "pk": 878, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Togo", - "label": "TG", - "content_type": 20, - "language": "pt", - "object_id": 220 - } - }, - { - "pk": 879, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Toquelau", - "label": "TK", - "content_type": 20, - "language": "pt", - "object_id": 221 - } - }, - { - "pk": 880, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tonga", - "label": "TO", - "content_type": 20, - "language": "pt", - "object_id": 222 - } - }, - { - "pk": 881, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Trindade e Tobago", - "label": "TT", - "content_type": 20, - "language": "pt", - "object_id": 223 - } - }, - { - "pk": 882, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tun\u00edsia", - "label": "TN", - "content_type": 20, - "language": "pt", - "object_id": 224 - } - }, - { - "pk": 883, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turks e Caicos", - "label": "TC", - "content_type": 20, - "language": "pt", - "object_id": 227 - } - }, - { - "pk": 884, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turquemenist\u00e3o", - "label": "TM", - "content_type": 20, - "language": "pt", - "object_id": 226 - } - }, - { - "pk": 885, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turquia", - "label": "TR", - "content_type": 20, - "language": "pt", - "object_id": 225 - } - }, - { - "pk": 886, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tuvalu", - "label": "TV", - "content_type": 20, - "language": "pt", - "object_id": 228 - } - }, - { - "pk": 887, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ucr\u00e2nia", - "label": "UA", - "content_type": 20, - "language": "pt", - "object_id": 230 - } - }, - { - "pk": 888, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uganda", - "label": "UG", - "content_type": 20, - "language": "pt", - "object_id": 229 - } - }, - { - "pk": 889, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uruguai", - "label": "UY", - "content_type": 20, - "language": "pt", - "object_id": 235 - } - }, - { - "pk": 890, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Usbequist\u00e3o", - "label": "UZ", - "content_type": 20, - "language": "pt", - "object_id": 236 - } - }, - { - "pk": 891, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vanuatu", - "label": "VU", - "content_type": 20, - "language": "pt", - "object_id": 237 - } - }, - { - "pk": 892, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vaticano", - "label": "VA", - "content_type": 20, - "language": "pt", - "object_id": 96 - } - }, - { - "pk": 893, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Venezuela", - "label": "VE", - "content_type": 20, - "language": "pt", - "object_id": 238 - } - }, - { - "pk": 894, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vietnam", - "label": "VN", - "content_type": 20, - "language": "pt", - "object_id": 239 - } - }, - { - "pk": 895, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Virgens Americanas, Ilhas", - "label": "VI", - "content_type": 20, - "language": "pt", - "object_id": 241 - } - }, - { - "pk": 896, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Virgens Brit\u00e2nicas, Ilhas", - "label": "VG", - "content_type": 20, - "language": "pt", - "object_id": 240 - } - }, - { - "pk": 897, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Wallis e Futuna", - "label": "WF", - "content_type": 20, - "language": "pt", - "object_id": 242 - } - }, - { - "pk": 898, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Z\u00e2mbia", - "label": "ZM", - "content_type": 20, - "language": "pt", - "object_id": 245 - } - }, - { - "pk": 899, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Zimbabwe", - "label": "ZW", - "content_type": 20, - "language": "pt", - "object_id": 246 - } - }, - { - "pk": 900, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Afganist\u00e1n (el)", - "label": "AF", - "content_type": 20, - "language": "es", - "object_id": 2 - } - }, - { - "pk": 901, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Albania", - "label": "AL", - "content_type": 20, - "language": "es", - "object_id": 4 - } - }, - { - "pk": 902, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Alemania", - "label": "DE", - "content_type": 20, - "language": "es", - "object_id": 81 - } - }, - { - "pk": 903, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Andorra", - "label": "AD", - "content_type": 20, - "language": "es", - "object_id": 7 - } - }, - { - "pk": 904, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Angola", - "label": "AO", - "content_type": 20, - "language": "es", - "object_id": 8 - } - }, - { - "pk": 905, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Antigua y Barbuda", - "label": "AG", - "content_type": 20, - "language": "es", - "object_id": 11 - } - }, - { - "pk": 906, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Arabia Saudita (la)", - "label": "SA", - "content_type": 20, - "language": "es", - "object_id": 194 - } - }, - { - "pk": 907, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Argelia", - "label": "DZ", - "content_type": 20, - "language": "es", - "object_id": 5 - } - }, - { - "pk": 908, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Argentina (la)", - "label": "AR", - "content_type": 20, - "language": "es", - "object_id": 12 - } - }, - { - "pk": 909, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Armenia", - "label": "AM", - "content_type": 20, - "language": "es", - "object_id": 13 - } - }, - { - "pk": 910, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Australia", - "label": "AU", - "content_type": 20, - "language": "es", - "object_id": 15 - } - }, - { - "pk": 911, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Austria", - "label": "AT", - "content_type": 20, - "language": "es", - "object_id": 16 - } - }, - { - "pk": 912, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Azerbaiy\u00e1n", - "label": "AZ", - "content_type": 20, - "language": "es", - "object_id": 17 - } - }, - { - "pk": 913, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bahamas (las)", - "label": "BS", - "content_type": 20, - "language": "es", - "object_id": 18 - } - }, - { - "pk": 914, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bahrein", - "label": "BH", - "content_type": 20, - "language": "es", - "object_id": 19 - } - }, - { - "pk": 915, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bangladesh", - "label": "BD", - "content_type": 20, - "language": "es", - "object_id": 20 - } - }, - { - "pk": 916, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Barbados", - "label": "BB", - "content_type": 20, - "language": "es", - "object_id": 21 - } - }, - { - "pk": 917, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Belar\u00fas", - "label": "BY", - "content_type": 20, - "language": "es", - "object_id": 22 - } - }, - { - "pk": 918, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "B\u00e9lgica", - "label": "BE", - "content_type": 20, - "language": "es", - "object_id": 23 - } - }, - { - "pk": 919, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Belice", - "label": "BZ", - "content_type": 20, - "language": "es", - "object_id": 24 - } - }, - { - "pk": 920, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Benin", - "label": "BJ", - "content_type": 20, - "language": "es", - "object_id": 25 - } - }, - { - "pk": 921, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bhut\u00e1n", - "label": "BT", - "content_type": 20, - "language": "es", - "object_id": 27 - } - }, - { - "pk": 922, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bolivia", - "label": "BO", - "content_type": 20, - "language": "es", - "object_id": 28 - } - }, - { - "pk": 923, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bosnia y Herzegovina", - "label": "BA", - "content_type": 20, - "language": "es", - "object_id": 29 - } - }, - { - "pk": 924, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Botswana", - "label": "BW", - "content_type": 20, - "language": "es", - "object_id": 30 - } - }, - { - "pk": 925, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Brasil (el)", - "label": "BR", - "content_type": 20, - "language": "es", - "object_id": 1 - } - }, - { - "pk": 926, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Brunei Darussalam", - "label": "BN", - "content_type": 20, - "language": "es", - "object_id": 33 - } - }, - { - "pk": 927, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bulgaria", - "label": "BG", - "content_type": 20, - "language": "es", - "object_id": 34 - } - }, - { - "pk": 928, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Burkina Faso", - "label": "BF", - "content_type": 20, - "language": "es", - "object_id": 35 - } - }, - { - "pk": 929, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Burundi", - "label": "BI", - "content_type": 20, - "language": "es", - "object_id": 36 - } - }, - { - "pk": 930, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cabo Verde", - "label": "CV", - "content_type": 20, - "language": "es", - "object_id": 40 - } - }, - { - "pk": 931, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Camboya", - "label": "KH", - "content_type": 20, - "language": "es", - "object_id": 37 - } - }, - { - "pk": 932, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Camer\u00fan (el)", - "label": "CM", - "content_type": 20, - "language": "es", - "object_id": 38 - } - }, - { - "pk": 933, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Canad\u00e1 (el)", - "label": "CA", - "content_type": 20, - "language": "es", - "object_id": 39 - } - }, - { - "pk": 934, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chad (el)", - "label": "TD", - "content_type": 20, - "language": "es", - "object_id": 43 - } - }, - { - "pk": 935, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chile", - "label": "CL", - "content_type": 20, - "language": "es", - "object_id": 44 - } - }, - { - "pk": 936, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "China", - "label": "CN", - "content_type": 20, - "language": "es", - "object_id": 45 - } - }, - { - "pk": 937, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chipre", - "label": "CY", - "content_type": 20, - "language": "es", - "object_id": 57 - } - }, - { - "pk": 938, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Colombia", - "label": "CO", - "content_type": 20, - "language": "es", - "object_id": 48 - } - }, - { - "pk": 939, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Comoras (las)", - "label": "KM", - "content_type": 20, - "language": "es", - "object_id": 49 - } - }, - { - "pk": 940, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Congo (el)", - "label": "CG", - "content_type": 20, - "language": "es", - "object_id": 50 - } - }, - { - "pk": 941, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Costa de Marfil", - "label": "CI", - "content_type": 20, - "language": "es", - "object_id": 54 - } - }, - { - "pk": 942, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Costa Rica", - "label": "CR", - "content_type": 20, - "language": "es", - "object_id": 53 - } - }, - { - "pk": 943, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Croacia", - "label": "HR", - "content_type": 20, - "language": "es", - "object_id": 55 - } - }, - { - "pk": 944, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cuba", - "label": "CU", - "content_type": 20, - "language": "es", - "object_id": 56 - } - }, - { - "pk": 945, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dinamarca", - "label": "DK", - "content_type": 20, - "language": "es", - "object_id": 59 - } - }, - { - "pk": 946, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Djibouti", - "label": "DJ", - "content_type": 20, - "language": "es", - "object_id": 60 - } - }, - { - "pk": 947, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dominica", - "label": "DM", - "content_type": 20, - "language": "es", - "object_id": 61 - } - }, - { - "pk": 948, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ecuador (el)", - "label": "EC", - "content_type": 20, - "language": "es", - "object_id": 63 - } - }, - { - "pk": 949, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Egipto", - "label": "EG", - "content_type": 20, - "language": "es", - "object_id": 64 - } - }, - { - "pk": 950, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "El Salvador", - "label": "SV", - "content_type": 20, - "language": "es", - "object_id": 65 - } - }, - { - "pk": 951, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Emiratos \u00c1rabes Unidos (los)", - "label": "AE", - "content_type": 20, - "language": "es", - "object_id": 231 - } - }, - { - "pk": 952, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eritrea", - "label": "ER", - "content_type": 20, - "language": "es", - "object_id": 67 - } - }, - { - "pk": 953, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eslovaquia", - "label": "SK", - "content_type": 20, - "language": "es", - "object_id": 200 - } - }, - { - "pk": 954, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eslovenia", - "label": "SI", - "content_type": 20, - "language": "es", - "object_id": 201 - } - }, - { - "pk": 955, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Espa\u00f1a", - "label": "ES", - "content_type": 20, - "language": "es", - "object_id": 206 - } - }, - { - "pk": 956, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Estados Unidos de Am\u00e9rica (los)", - "label": "US", - "content_type": 20, - "language": "es", - "object_id": 233 - } - }, - { - "pk": 957, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Estonia", - "label": "EE", - "content_type": 20, - "language": "es", - "object_id": 68 - } - }, - { - "pk": 958, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Etiop\u00eda", - "label": "ET", - "content_type": 20, - "language": "es", - "object_id": 69 - } - }, - { - "pk": 959, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Fiji", - "label": "FJ", - "content_type": 20, - "language": "es", - "object_id": 72 - } - }, - { - "pk": 960, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Filipinas", - "label": "PH", - "content_type": 20, - "language": "es", - "object_id": 174 - } - }, - { - "pk": 961, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Finlandia", - "label": "FI", - "content_type": 20, - "language": "es", - "object_id": 73 - } - }, - { - "pk": 962, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Francia", - "label": "FR", - "content_type": 20, - "language": "es", - "object_id": 74 - } - }, - { - "pk": 963, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gab\u00f3n (el)", - "label": "GA", - "content_type": 20, - "language": "es", - "object_id": 78 - } - }, - { - "pk": 964, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gambia", - "label": "GM", - "content_type": 20, - "language": "es", - "object_id": 79 - } - }, - { - "pk": 965, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Georgia", - "label": "GE", - "content_type": 20, - "language": "es", - "object_id": 80 - } - }, - { - "pk": 966, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ghana", - "label": "GH", - "content_type": 20, - "language": "es", - "object_id": 82 - } - }, - { - "pk": 967, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Granada", - "label": "GD", - "content_type": 20, - "language": "es", - "object_id": 86 - } - }, - { - "pk": 968, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Grecia", - "label": "GR", - "content_type": 20, - "language": "es", - "object_id": 84 - } - }, - { - "pk": 969, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guatemala", - "label": "GT", - "content_type": 20, - "language": "es", - "object_id": 89 - } - }, - { - "pk": 970, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guinea", - "label": "GN", - "content_type": 20, - "language": "es", - "object_id": 91 - } - }, - { - "pk": 971, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guinea Ecuatorial", - "label": "GQ", - "content_type": 20, - "language": "es", - "object_id": 66 - } - }, - { - "pk": 972, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guinea-Bissau", - "label": "GW", - "content_type": 20, - "language": "es", - "object_id": 92 - } - }, - { - "pk": 973, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guyana", - "label": "GY", - "content_type": 20, - "language": "es", - "object_id": 93 - } - }, - { - "pk": 974, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Hait\u00ed", - "label": "HT", - "content_type": 20, - "language": "es", - "object_id": 94 - } - }, - { - "pk": 975, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Honduras", - "label": "HN", - "content_type": 20, - "language": "es", - "object_id": 97 - } - }, - { - "pk": 976, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Hungr\u00eda", - "label": "HU", - "content_type": 20, - "language": "es", - "object_id": 99 - } - }, - { - "pk": 977, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "India (la)", - "label": "IN", - "content_type": 20, - "language": "es", - "object_id": 101 - } - }, - { - "pk": 978, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Indonesia", - "label": "ID", - "content_type": 20, - "language": "es", - "object_id": 102 - } - }, - { - "pk": 979, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ir\u00e1n", - "label": "IR", - "content_type": 20, - "language": "es", - "object_id": 103 - } - }, - { - "pk": 980, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Iraq (el)", - "label": "IQ", - "content_type": 20, - "language": "es", - "object_id": 104 - } - }, - { - "pk": 981, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Irlanda", - "label": "IE", - "content_type": 20, - "language": "es", - "object_id": 105 - } - }, - { - "pk": 982, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Islandia", - "label": "IS", - "content_type": 20, - "language": "es", - "object_id": 100 - } - }, - { - "pk": 983, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Islas Marshall (las)", - "label": "MH", - "content_type": 20, - "language": "es", - "object_id": 137 - } - }, - { - "pk": 984, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Islas Salom\u00f3n (las)", - "label": "SB", - "content_type": 20, - "language": "es", - "object_id": 202 - } - }, - { - "pk": 985, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Israel", - "label": "IL", - "content_type": 20, - "language": "es", - "object_id": 107 - } - }, - { - "pk": 986, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Italia", - "label": "IT", - "content_type": 20, - "language": "es", - "object_id": 108 - } - }, - { - "pk": 987, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jamaica", - "label": "JM", - "content_type": 20, - "language": "es", - "object_id": 109 - } - }, - { - "pk": 988, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jap\u00f3n (el)", - "label": "JP", - "content_type": 20, - "language": "es", - "object_id": 110 - } - }, - { - "pk": 989, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jordania", - "label": "JO", - "content_type": 20, - "language": "es", - "object_id": 112 - } - }, - { - "pk": 990, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kazajst\u00e1n", - "label": "KZ", - "content_type": 20, - "language": "es", - "object_id": 113 - } - }, - { - "pk": 991, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kenia", - "label": "KE", - "content_type": 20, - "language": "es", - "object_id": 114 - } - }, - { - "pk": 992, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kirguist\u00e1n", - "label": "KG", - "content_type": 20, - "language": "es", - "object_id": 119 - } - }, - { - "pk": 993, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kiribati", - "label": "KI", - "content_type": 20, - "language": "es", - "object_id": 115 - } - }, - { - "pk": 994, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kuwait", - "label": "KW", - "content_type": 20, - "language": "es", - "object_id": 118 - } - }, - { - "pk": 995, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Laos", - "label": "LA", - "content_type": 20, - "language": "es", - "object_id": 120 - } - }, - { - "pk": 996, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Lesotho", - "label": "LS", - "content_type": 20, - "language": "es", - "object_id": 123 - } - }, - { - "pk": 997, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Letonia", - "label": "LV", - "content_type": 20, - "language": "es", - "object_id": 121 - } - }, - { - "pk": 998, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "L\u00edbano (el)", - "label": "LB", - "content_type": 20, - "language": "es", - "object_id": 122 - } - }, - { - "pk": 999, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Liberia", - "label": "LR", - "content_type": 20, - "language": "es", - "object_id": 124 - } - }, - { - "pk": 1000, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Libia", - "label": "LY", - "content_type": 20, - "language": "es", - "object_id": 125 - } - }, - { - "pk": 1001, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Liechtenstein", - "label": "LI", - "content_type": 20, - "language": "es", - "object_id": 126 - } - }, - { - "pk": 1002, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Lituania", - "label": "LT", - "content_type": 20, - "language": "es", - "object_id": 127 - } - }, - { - "pk": 1003, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Luxemburgo", - "label": "LU", - "content_type": 20, - "language": "es", - "object_id": 128 - } - }, - { - "pk": 1004, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Macedonia, la ex Rep\u00fablica Yugoslava de", - "label": "MK", - "content_type": 20, - "language": "es", - "object_id": 130 - } - }, - { - "pk": 1005, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Madagascar", - "label": "MG", - "content_type": 20, - "language": "es", - "object_id": 131 - } - }, - { - "pk": 1006, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malasia", - "label": "MY", - "content_type": 20, - "language": "es", - "object_id": 133 - } - }, - { - "pk": 1007, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malawi", - "label": "MW", - "content_type": 20, - "language": "es", - "object_id": 132 - } - }, - { - "pk": 1008, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maldivas", - "label": "MV", - "content_type": 20, - "language": "es", - "object_id": 134 - } - }, - { - "pk": 1009, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mali", - "label": "ML", - "content_type": 20, - "language": "es", - "object_id": 135 - } - }, - { - "pk": 1010, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malta", - "label": "MT", - "content_type": 20, - "language": "es", - "object_id": 136 - } - }, - { - "pk": 1011, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Marruecos", - "label": "MA", - "content_type": 20, - "language": "es", - "object_id": 149 - } - }, - { - "pk": 1012, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mauricio", - "label": "MU", - "content_type": 20, - "language": "es", - "object_id": 140 - } - }, - { - "pk": 1013, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mauritania", - "label": "MR", - "content_type": 20, - "language": "es", - "object_id": 139 - } - }, - { - "pk": 1014, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "M\u00e9xico", - "label": "MX", - "content_type": 20, - "language": "es", - "object_id": 142 - } - }, - { - "pk": 1015, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Micronesia", - "label": "FM", - "content_type": 20, - "language": "es", - "object_id": 143 - } - }, - { - "pk": 1016, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Moldavia", - "label": "MD", - "content_type": 20, - "language": "es", - "object_id": 144 - } - }, - { - "pk": 1017, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "M\u00f3naco", - "label": "MC", - "content_type": 20, - "language": "es", - "object_id": 145 - } - }, - { - "pk": 1018, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mongolia", - "label": "MN", - "content_type": 20, - "language": "es", - "object_id": 146 - } - }, - { - "pk": 1019, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Montenegro", - "label": "ME", - "content_type": 20, - "language": "es", - "object_id": 147 - } - }, - { - "pk": 1020, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mozambique", - "label": "MZ", - "content_type": 20, - "language": "es", - "object_id": 150 - } - }, - { - "pk": 1021, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Myanmar", - "label": "MM", - "content_type": 20, - "language": "es", - "object_id": 151 - } - }, - { - "pk": 1022, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Namibia", - "label": "NA", - "content_type": 20, - "language": "es", - "object_id": 152 - } - }, - { - "pk": 1023, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nauru", - "label": "NR", - "content_type": 20, - "language": "es", - "object_id": 153 - } - }, - { - "pk": 1024, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nepal", - "label": "NP", - "content_type": 20, - "language": "es", - "object_id": 154 - } - }, - { - "pk": 1025, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nicaragua", - "label": "NI", - "content_type": 20, - "language": "es", - "object_id": 159 - } - }, - { - "pk": 1026, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "N\u00edger (el)", - "label": "NE", - "content_type": 20, - "language": "es", - "object_id": 160 - } - }, - { - "pk": 1027, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nigeria", - "label": "NG", - "content_type": 20, - "language": "es", - "object_id": 161 - } - }, - { - "pk": 1028, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Noruega", - "label": "NO", - "content_type": 20, - "language": "es", - "object_id": 165 - } - }, - { - "pk": 1029, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nueva Zelanda", - "label": "NZ", - "content_type": 20, - "language": "es", - "object_id": 158 - } - }, - { - "pk": 1030, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Om\u00e1n", - "label": "OM", - "content_type": 20, - "language": "es", - "object_id": 166 - } - }, - { - "pk": 1031, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pa\u00edses Bajos (los)", - "label": "NL", - "content_type": 20, - "language": "es", - "object_id": 155 - } - }, - { - "pk": 1032, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pakist\u00e1n (el)", - "label": "PK", - "content_type": 20, - "language": "es", - "object_id": 167 - } - }, - { - "pk": 1033, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Palaos", - "label": "PW", - "content_type": 20, - "language": "es", - "object_id": 168 - } - }, - { - "pk": 1034, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Panam\u00e1", - "label": "PA", - "content_type": 20, - "language": "es", - "object_id": 170 - } - }, - { - "pk": 1035, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pap\u00faa Nueva Guinea", - "label": "PG", - "content_type": 20, - "language": "es", - "object_id": 171 - } - }, - { - "pk": 1036, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Paraguay (el)", - "label": "PY", - "content_type": 20, - "language": "es", - "object_id": 172 - } - }, - { - "pk": 1037, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Per\u00fa (el)", - "label": "PE", - "content_type": 20, - "language": "es", - "object_id": 173 - } - }, - { - "pk": 1038, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Polonia", - "label": "PL", - "content_type": 20, - "language": "es", - "object_id": 176 - } - }, - { - "pk": 1039, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Portugal", - "label": "PT", - "content_type": 20, - "language": "es", - "object_id": 177 - } - }, - { - "pk": 1040, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Qatar", - "label": "QA", - "content_type": 20, - "language": "es", - "object_id": 179 - } - }, - { - "pk": 1041, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Reino Unido de Gran Breta\u00f1a e Irlanda del Norte", - "label": "GB", - "content_type": 20, - "language": "es", - "object_id": 232 - } - }, - { - "pk": 1042, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Centroafricana (la)", - "label": "CF", - "content_type": 20, - "language": "es", - "object_id": 42 - } - }, - { - "pk": 1043, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Checa (la)", - "label": "CZ", - "content_type": 20, - "language": "es", - "object_id": 58 - } - }, - { - "pk": 1044, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica de Corea (la)", - "label": "KR", - "content_type": 20, - "language": "es", - "object_id": 117 - } - }, - { - "pk": 1045, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Democr\u00e1tica del Congo (la)", - "label": "CD", - "content_type": 20, - "language": "es", - "object_id": 51 - } - }, - { - "pk": 1046, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Dominicana (la)", - "label": "DO", - "content_type": 20, - "language": "es", - "object_id": 62 - } - }, - { - "pk": 1047, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Popular Democr\u00e1tica de Corea (la)", - "label": "KP", - "content_type": 20, - "language": "es", - "object_id": 116 - } - }, - { - "pk": 1048, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ruman\u00eda", - "label": "RO", - "content_type": 20, - "language": "es", - "object_id": 181 - } - }, - { - "pk": 1049, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rusia", - "label": "RU", - "content_type": 20, - "language": "es", - "object_id": 182 - } - }, - { - "pk": 1050, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rwanda", - "label": "RW", - "content_type": 20, - "language": "es", - "object_id": 183 - } - }, - { - "pk": 1051, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Samoa", - "label": "WS", - "content_type": 20, - "language": "es", - "object_id": 191 - } - }, - { - "pk": 1052, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "San Crist\u00f3bal y Nieves", - "label": "KN", - "content_type": 20, - "language": "es", - "object_id": 186 - } - }, - { - "pk": 1053, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "San Marino", - "label": "SM", - "content_type": 20, - "language": "es", - "object_id": 192 - } - }, - { - "pk": 1054, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "San Vicente y las Granadinas", - "label": "VC", - "content_type": 20, - "language": "es", - "object_id": 190 - } - }, - { - "pk": 1055, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santa Luc\u00eda", - "label": "LC", - "content_type": 20, - "language": "es", - "object_id": 187 - } - }, - { - "pk": 1056, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santa Sede (la)", - "label": "VA", - "content_type": 20, - "language": "es", - "object_id": 96 - } - }, - { - "pk": 1057, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santo Tom\u00e9 y Pr\u00edncipe", - "label": "ST", - "content_type": 20, - "language": "es", - "object_id": 193 - } - }, - { - "pk": 1058, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Senegal (el)", - "label": "SN", - "content_type": 20, - "language": "es", - "object_id": 195 - } - }, - { - "pk": 1059, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Serbia", - "label": "RS", - "content_type": 20, - "language": "es", - "object_id": 196 - } - }, - { - "pk": 1060, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Seychelles", - "label": "SC", - "content_type": 20, - "language": "es", - "object_id": 197 - } - }, - { - "pk": 1061, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sierra Leona", - "label": "SL", - "content_type": 20, - "language": "es", - "object_id": 198 - } - }, - { - "pk": 1062, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Singapur", - "label": "SG", - "content_type": 20, - "language": "es", - "object_id": 199 - } - }, - { - "pk": 1063, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Siria", - "label": "SY", - "content_type": 20, - "language": "es", - "object_id": 214 - } - }, - { - "pk": 1064, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Somalia", - "label": "SO", - "content_type": 20, - "language": "es", - "object_id": 203 - } - }, - { - "pk": 1065, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sri Lanka", - "label": "LK", - "content_type": 20, - "language": "es", - "object_id": 207 - } - }, - { - "pk": 1066, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sud\u00e1frica", - "label": "ZA", - "content_type": 20, - "language": "es", - "object_id": 204 - } - }, - { - "pk": 1067, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sud\u00e1n (el)", - "label": "SD", - "content_type": 20, - "language": "es", - "object_id": 208 - } - }, - { - "pk": 1068, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Suecia", - "label": "SE", - "content_type": 20, - "language": "es", - "object_id": 212 - } - }, - { - "pk": 1069, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Suiza", - "label": "CH", - "content_type": 20, - "language": "es", - "object_id": 213 - } - }, - { - "pk": 1070, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Surinam", - "label": "SR", - "content_type": 20, - "language": "es", - "object_id": 209 - } - }, - { - "pk": 1071, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Swazilandia", - "label": "SZ", - "content_type": 20, - "language": "es", - "object_id": 211 - } - }, - { - "pk": 1072, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tailandia", - "label": "TH", - "content_type": 20, - "language": "es", - "object_id": 218 - } - }, - { - "pk": 1073, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tanzania", - "label": "TZ", - "content_type": 20, - "language": "es", - "object_id": 217 - } - }, - { - "pk": 1074, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tayikist\u00e1n", - "label": "TJ", - "content_type": 20, - "language": "es", - "object_id": 216 - } - }, - { - "pk": 1075, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Timor Oriental", - "label": "TL", - "content_type": 20, - "language": "es", - "object_id": 219 - } - }, - { - "pk": 1076, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Togo (el)", - "label": "TG", - "content_type": 20, - "language": "es", - "object_id": 220 - } - }, - { - "pk": 1077, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tonga", - "label": "TO", - "content_type": 20, - "language": "es", - "object_id": 222 - } - }, - { - "pk": 1078, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Trinidad y Tobago", - "label": "TT", - "content_type": 20, - "language": "es", - "object_id": 223 - } - }, - { - "pk": 1079, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "T\u00fanez", - "label": "TN", - "content_type": 20, - "language": "es", - "object_id": 224 - } - }, - { - "pk": 1080, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turkmenist\u00e1n", - "label": "TM", - "content_type": 20, - "language": "es", - "object_id": 226 - } - }, - { - "pk": 1081, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turqu\u00eda", - "label": "TR", - "content_type": 20, - "language": "es", - "object_id": 225 - } - }, - { - "pk": 1082, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tuvalu", - "label": "TV", - "content_type": 20, - "language": "es", - "object_id": 228 - } - }, - { - "pk": 1083, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ucrania", - "label": "UA", - "content_type": 20, - "language": "es", - "object_id": 230 - } - }, - { - "pk": 1084, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uganda", - "label": "UG", - "content_type": 20, - "language": "es", - "object_id": 229 - } - }, - { - "pk": 1085, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uruguay (el)", - "label": "UY", - "content_type": 20, - "language": "es", - "object_id": 235 - } - }, - { - "pk": 1086, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uzbekist\u00e1n", - "label": "UZ", - "content_type": 20, - "language": "es", - "object_id": 236 - } - }, - { - "pk": 1087, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vanuatu", - "label": "VU", - "content_type": 20, - "language": "es", - "object_id": 237 - } - }, - { - "pk": 1088, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Venezuela", - "label": "VE", - "content_type": 20, - "language": "es", - "object_id": 238 - } - }, - { - "pk": 1089, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vietnam", - "label": "VN", - "content_type": 20, - "language": "es", - "object_id": 239 - } - }, - { - "pk": 1090, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Yemen (el)", - "label": "YE", - "content_type": 20, - "language": "es", - "object_id": 244 - } - }, - { - "pk": 1091, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Zambia", - "label": "ZM", - "content_type": 20, - "language": "es", - "object_id": 245 - } - }, - { - "pk": 1092, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Zimbabwe", - "label": "ZW", - "content_type": 20, - "language": "es", - "object_id": 246 - } - }, - { - "pk": 1093, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Afeganist\u00e3o", - "label": "AF", - "content_type": 21, - "language": "pt", - "object_id": 2 - } - }, - { - "pk": 1094, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "\u00c1frica do Sul", - "label": "ZA", - "content_type": 21, - "language": "pt", - "object_id": 204 - } - }, - { - "pk": 1095, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "\u00c5land, Ilhas", - "label": "AX", - "content_type": 21, - "language": "pt", - "object_id": 3 - } - }, - { - "pk": 1096, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Alb\u00e2nia", - "label": "AL", - "content_type": 21, - "language": "pt", - "object_id": 4 - } - }, - { - "pk": 1097, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Alemanha", - "label": "DE", - "content_type": 21, - "language": "pt", - "object_id": 81 - } - }, - { - "pk": 1098, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Andorra", - "label": "AD", - "content_type": 21, - "language": "pt", - "object_id": 7 - } - }, - { - "pk": 1099, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Angola", - "label": "AO", - "content_type": 21, - "language": "pt", - "object_id": 8 - } - }, - { - "pk": 1100, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Anguilla", - "label": "AI", - "content_type": 21, - "language": "pt", - "object_id": 9 - } - }, - { - "pk": 1101, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ant\u00e1rctida", - "label": "AQ", - "content_type": 21, - "language": "pt", - "object_id": 10 - } - }, - { - "pk": 1102, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ant\u00edgua e Barbuda", - "label": "AG", - "content_type": 21, - "language": "pt", - "object_id": 11 - } - }, - { - "pk": 1103, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Antilhas Holandesas", - "label": "AN", - "content_type": 21, - "language": "pt", - "object_id": 156 - } - }, - { - "pk": 1104, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ar\u00e1bia Saudita", - "label": "SA", - "content_type": 21, - "language": "pt", - "object_id": 194 - } - }, - { - "pk": 1105, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Arg\u00e9lia", - "label": "DZ", - "content_type": 21, - "language": "pt", - "object_id": 5 - } - }, - { - "pk": 1106, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Argentina", - "label": "AR", - "content_type": 21, - "language": "pt", - "object_id": 12 - } - }, - { - "pk": 1107, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Arm\u00eania", - "label": "AM", - "content_type": 21, - "language": "pt", - "object_id": 13 - } - }, - { - "pk": 1108, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Aruba", - "label": "AW", - "content_type": 21, - "language": "pt", - "object_id": 14 - } - }, - { - "pk": 1109, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Austr\u00e1lia", - "label": "AU", - "content_type": 21, - "language": "pt", - "object_id": 15 - } - }, - { - "pk": 1110, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "\u00c1ustria", - "label": "AT", - "content_type": 21, - "language": "pt", - "object_id": 16 - } - }, - { - "pk": 1111, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Azerbaij\u00e3o", - "label": "AZ", - "content_type": 21, - "language": "pt", - "object_id": 17 - } - }, - { - "pk": 1112, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bahamas", - "label": "BS", - "content_type": 21, - "language": "pt", - "object_id": 18 - } - }, - { - "pk": 1113, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bahrain", - "label": "BH", - "content_type": 21, - "language": "pt", - "object_id": 19 - } - }, - { - "pk": 1114, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bangladesh", - "label": "BD", - "content_type": 21, - "language": "pt", - "object_id": 20 - } - }, - { - "pk": 1115, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Barbados", - "label": "BB", - "content_type": 21, - "language": "pt", - "object_id": 21 - } - }, - { - "pk": 1116, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "B\u00e9lgica", - "label": "BE", - "content_type": 21, - "language": "pt", - "object_id": 23 - } - }, - { - "pk": 1117, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Belize", - "label": "BZ", - "content_type": 21, - "language": "pt", - "object_id": 24 - } - }, - { - "pk": 1118, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Benim", - "label": "BJ", - "content_type": 21, - "language": "pt", - "object_id": 25 - } - }, - { - "pk": 1119, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bermudas", - "label": "BM", - "content_type": 21, - "language": "pt", - "object_id": 26 - } - }, - { - "pk": 1120, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bielorr\u00fassia", - "label": "BY", - "content_type": 21, - "language": "pt", - "object_id": 22 - } - }, - { - "pk": 1121, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bol\u00edvia", - "label": "BO", - "content_type": 21, - "language": "pt", - "object_id": 28 - } - }, - { - "pk": 1122, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "B\u00f3snia e Herzegovina", - "label": "BA", - "content_type": 21, - "language": "pt", - "object_id": 29 - } - }, - { - "pk": 1123, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Botswana", - "label": "BW", - "content_type": 21, - "language": "pt", - "object_id": 30 - } - }, - { - "pk": 1124, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bouvet, Ilha", - "label": "BV", - "content_type": 21, - "language": "pt", - "object_id": 31 - } - }, - { - "pk": 1125, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Brasil", - "label": "BR", - "content_type": 21, - "language": "pt", - "object_id": 1 - } - }, - { - "pk": 1126, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Brunei", - "label": "BN", - "content_type": 21, - "language": "pt", - "object_id": 33 - } - }, - { - "pk": 1127, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bulg\u00e1ria", - "label": "BG", - "content_type": 21, - "language": "pt", - "object_id": 34 - } - }, - { - "pk": 1128, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Burkina Faso", - "label": "BF", - "content_type": 21, - "language": "pt", - "object_id": 35 - } - }, - { - "pk": 1129, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Burundi", - "label": "BI", - "content_type": 21, - "language": "pt", - "object_id": 36 - } - }, - { - "pk": 1130, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "But\u00e3o", - "label": "BT", - "content_type": 21, - "language": "pt", - "object_id": 27 - } - }, - { - "pk": 1131, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cabo Verde", - "label": "CV", - "content_type": 21, - "language": "pt", - "object_id": 40 - } - }, - { - "pk": 1132, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cambodja", - "label": "KH", - "content_type": 21, - "language": "pt", - "object_id": 37 - } - }, - { - "pk": 1133, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Camar\u00f5es", - "label": "CM", - "content_type": 21, - "language": "pt", - "object_id": 38 - } - }, - { - "pk": 1134, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Canad\u00e1", - "label": "CA", - "content_type": 21, - "language": "pt", - "object_id": 39 - } - }, - { - "pk": 1135, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cayman, Ilhas", - "label": "KY", - "content_type": 21, - "language": "pt", - "object_id": 41 - } - }, - { - "pk": 1136, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cazaquist\u00e3o", - "label": "KZ", - "content_type": 21, - "language": "pt", - "object_id": 113 - } - }, - { - "pk": 1137, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Centro-Africana, Rep\u00fablica", - "label": "CF", - "content_type": 21, - "language": "pt", - "object_id": 42 - } - }, - { - "pk": 1138, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chade", - "label": "TD", - "content_type": 21, - "language": "pt", - "object_id": 43 - } - }, - { - "pk": 1139, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Checa, Rep\u00fablica", - "label": "CZ", - "content_type": 21, - "language": "pt", - "object_id": 58 - } - }, - { - "pk": 1140, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chile", - "label": "CL", - "content_type": 21, - "language": "pt", - "object_id": 44 - } - }, - { - "pk": 1141, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "China", - "label": "CN", - "content_type": 21, - "language": "pt", - "object_id": 45 - } - }, - { - "pk": 1142, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chipre", - "label": "CY", - "content_type": 21, - "language": "pt", - "object_id": 57 - } - }, - { - "pk": 1143, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Christmas, Ilha", - "label": "CX", - "content_type": 21, - "language": "pt", - "object_id": 46 - } - }, - { - "pk": 1144, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cocos, Ilhas", - "label": "CC", - "content_type": 21, - "language": "pt", - "object_id": 47 - } - }, - { - "pk": 1145, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Col\u00f4mbia", - "label": "CO", - "content_type": 21, - "language": "pt", - "object_id": 48 - } - }, - { - "pk": 1146, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Comores", - "label": "KM", - "content_type": 21, - "language": "pt", - "object_id": 49 - } - }, - { - "pk": 1147, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Congo, Rep\u00fablica do", - "label": "CG", - "content_type": 21, - "language": "pt", - "object_id": 50 - } - }, - { - "pk": 1148, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Congo, Rep\u00fablica Democr\u00e1tica do (antigo Zaire)", - "label": "CD", - "content_type": 21, - "language": "pt", - "object_id": 51 - } - }, - { - "pk": 1149, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cook, Ilhas", - "label": "CK", - "content_type": 21, - "language": "pt", - "object_id": 52 - } - }, - { - "pk": 1150, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cor\u00e9ia do Sul", - "label": "KR", - "content_type": 21, - "language": "pt", - "object_id": 117 - } - }, - { - "pk": 1151, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Coreia, Rep\u00fablica Democr\u00e1tica da (Coreia do Norte)", - "label": "KP", - "content_type": 21, - "language": "pt", - "object_id": 116 - } - }, - { - "pk": 1152, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Costa do Marfim", - "label": "CI", - "content_type": 21, - "language": "pt", - "object_id": 54 - } - }, - { - "pk": 1153, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Costa Rica", - "label": "CR", - "content_type": 21, - "language": "pt", - "object_id": 53 - } - }, - { - "pk": 1154, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cro\u00e1cia", - "label": "HR", - "content_type": 21, - "language": "pt", - "object_id": 55 - } - }, - { - "pk": 1155, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cuba", - "label": "CU", - "content_type": 21, - "language": "pt", - "object_id": 56 - } - }, - { - "pk": 1156, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dinamarca", - "label": "DK", - "content_type": 21, - "language": "pt", - "object_id": 59 - } - }, - { - "pk": 1157, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Djibouti", - "label": "DJ", - "content_type": 21, - "language": "pt", - "object_id": 60 - } - }, - { - "pk": 1158, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dominica", - "label": "DM", - "content_type": 21, - "language": "pt", - "object_id": 61 - } - }, - { - "pk": 1159, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dominicana, Rep\u00fablica", - "label": "DO", - "content_type": 21, - "language": "pt", - "object_id": 62 - } - }, - { - "pk": 1160, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Egito", - "label": "EG", - "content_type": 21, - "language": "pt", - "object_id": 64 - } - }, - { - "pk": 1161, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "El Salvador", - "label": "SV", - "content_type": 21, - "language": "pt", - "object_id": 65 - } - }, - { - "pk": 1162, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Emirados \u00c1rabes Unidos", - "label": "AE", - "content_type": 21, - "language": "pt", - "object_id": 231 - } - }, - { - "pk": 1163, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Equador", - "label": "EC", - "content_type": 21, - "language": "pt", - "object_id": 63 - } - }, - { - "pk": 1164, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eritreia", - "label": "ER", - "content_type": 21, - "language": "pt", - "object_id": 67 - } - }, - { - "pk": 1165, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eslov\u00e1quia", - "label": "SK", - "content_type": 21, - "language": "pt", - "object_id": 200 - } - }, - { - "pk": 1166, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eslov\u00eania", - "label": "SI", - "content_type": 21, - "language": "pt", - "object_id": 201 - } - }, - { - "pk": 1167, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Espanha", - "label": "ES", - "content_type": 21, - "language": "pt", - "object_id": 206 - } - }, - { - "pk": 1168, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Estados Unidos da Am\u00e9rica", - "label": "US", - "content_type": 21, - "language": "pt", - "object_id": 233 - } - }, - { - "pk": 1169, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Est\u00f3nia", - "label": "EE", - "content_type": 21, - "language": "pt", - "object_id": 68 - } - }, - { - "pk": 1170, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eti\u00f3pia", - "label": "ET", - "content_type": 21, - "language": "pt", - "object_id": 69 - } - }, - { - "pk": 1171, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Fero\u00e9, Ilhas", - "label": "FO", - "content_type": 21, - "language": "pt", - "object_id": 71 - } - }, - { - "pk": 1172, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Fiji", - "label": "FJ", - "content_type": 21, - "language": "pt", - "object_id": 72 - } - }, - { - "pk": 1173, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Filipinas", - "label": "PH", - "content_type": 21, - "language": "pt", - "object_id": 174 - } - }, - { - "pk": 1174, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Finl\u00e2ndia", - "label": "FI", - "content_type": 21, - "language": "pt", - "object_id": 73 - } - }, - { - "pk": 1175, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Fran\u00e7a", - "label": "FR", - "content_type": 21, - "language": "pt", - "object_id": 74 - } - }, - { - "pk": 1176, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gab\u00e3o", - "label": "GA", - "content_type": 21, - "language": "pt", - "object_id": 78 - } - }, - { - "pk": 1177, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "G\u00e2mbia", - "label": "GM", - "content_type": 21, - "language": "pt", - "object_id": 79 - } - }, - { - "pk": 1178, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gana", - "label": "GH", - "content_type": 21, - "language": "pt", - "object_id": 82 - } - }, - { - "pk": 1179, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ge\u00f3rgia", - "label": "GE", - "content_type": 21, - "language": "pt", - "object_id": 80 - } - }, - { - "pk": 1180, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ge\u00f3rgia do Sul e Sandwich do Sul, Ilhas", - "label": "GS", - "content_type": 21, - "language": "pt", - "object_id": 205 - } - }, - { - "pk": 1181, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gibraltar", - "label": "GI", - "content_type": 21, - "language": "pt", - "object_id": 83 - } - }, - { - "pk": 1182, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gr\u00e9cia", - "label": "GR", - "content_type": 21, - "language": "pt", - "object_id": 84 - } - }, - { - "pk": 1183, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Grenada", - "label": "GD", - "content_type": 21, - "language": "pt", - "object_id": 86 - } - }, - { - "pk": 1184, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Groenl\u00e2ndia", - "label": "GL", - "content_type": 21, - "language": "pt", - "object_id": 85 - } - }, - { - "pk": 1185, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guadalupe", - "label": "GP", - "content_type": 21, - "language": "pt", - "object_id": 87 - } - }, - { - "pk": 1186, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guam", - "label": "GU", - "content_type": 21, - "language": "pt", - "object_id": 88 - } - }, - { - "pk": 1187, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guatemala", - "label": "GT", - "content_type": 21, - "language": "pt", - "object_id": 89 - } - }, - { - "pk": 1188, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guernsey", - "label": "GG", - "content_type": 21, - "language": "pt", - "object_id": 90 - } - }, - { - "pk": 1189, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guiana", - "label": "GY", - "content_type": 21, - "language": "pt", - "object_id": 93 - } - }, - { - "pk": 1190, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guiana Francesa", - "label": "GF", - "content_type": 21, - "language": "pt", - "object_id": 75 - } - }, - { - "pk": 1191, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guin\u00e9-Bissau", - "label": "GW", - "content_type": 21, - "language": "pt", - "object_id": 92 - } - }, - { - "pk": 1192, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guin\u00e9-Conacri", - "label": "GN", - "content_type": 21, - "language": "pt", - "object_id": 91 - } - }, - { - "pk": 1193, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guin\u00e9 Equatorial", - "label": "GQ", - "content_type": 21, - "language": "pt", - "object_id": 66 - } - }, - { - "pk": 1194, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Haiti", - "label": "HT", - "content_type": 21, - "language": "pt", - "object_id": 94 - } - }, - { - "pk": 1195, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Heard e Ilhas McDonald, Ilha", - "label": "HM", - "content_type": 21, - "language": "pt", - "object_id": 95 - } - }, - { - "pk": 1196, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Honduras", - "label": "HN", - "content_type": 21, - "language": "pt", - "object_id": 97 - } - }, - { - "pk": 1197, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Hong Kong", - "label": "HK", - "content_type": 21, - "language": "pt", - "object_id": 98 - } - }, - { - "pk": 1198, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Hungria", - "label": "HU", - "content_type": 21, - "language": "pt", - "object_id": 99 - } - }, - { - "pk": 1199, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "I\u00e9men", - "label": "YE", - "content_type": 21, - "language": "pt", - "object_id": 244 - } - }, - { - "pk": 1200, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "\u00cdndia", - "label": "IN", - "content_type": 21, - "language": "pt", - "object_id": 101 - } - }, - { - "pk": 1201, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Indon\u00e9sia", - "label": "ID", - "content_type": 21, - "language": "pt", - "object_id": 102 - } - }, - { - "pk": 1202, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Iraque", - "label": "IQ", - "content_type": 21, - "language": "pt", - "object_id": 104 - } - }, - { - "pk": 1203, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ir\u00e3", - "label": "IR", - "content_type": 21, - "language": "pt", - "object_id": 103 - } - }, - { - "pk": 1204, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Irlanda", - "label": "IE", - "content_type": 21, - "language": "pt", - "object_id": 105 - } - }, - { - "pk": 1205, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Isl\u00e2ndia", - "label": "IS", - "content_type": 21, - "language": "pt", - "object_id": 100 - } - }, - { - "pk": 1206, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Israel", - "label": "IL", - "content_type": 21, - "language": "pt", - "object_id": 107 - } - }, - { - "pk": 1207, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "It\u00e1lia", - "label": "IT", - "content_type": 21, - "language": "pt", - "object_id": 108 - } - }, - { - "pk": 1208, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jamaica", - "label": "JM", - "content_type": 21, - "language": "pt", - "object_id": 109 - } - }, - { - "pk": 1209, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jap\u00e3o", - "label": "JP", - "content_type": 21, - "language": "pt", - "object_id": 110 - } - }, - { - "pk": 1210, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jersey", - "label": "JE", - "content_type": 21, - "language": "pt", - "object_id": 111 - } - }, - { - "pk": 1211, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jord\u00e2nia", - "label": "JO", - "content_type": 21, - "language": "pt", - "object_id": 112 - } - }, - { - "pk": 1212, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kiribati", - "label": "KI", - "content_type": 21, - "language": "pt", - "object_id": 115 - } - }, - { - "pk": 1213, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kuwait", - "label": "KW", - "content_type": 21, - "language": "pt", - "object_id": 118 - } - }, - { - "pk": 1214, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Laos", - "label": "LA", - "content_type": 21, - "language": "pt", - "object_id": 120 - } - }, - { - "pk": 1215, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Lesoto", - "label": "LS", - "content_type": 21, - "language": "pt", - "object_id": 123 - } - }, - { - "pk": 1216, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Let\u00f4nia", - "label": "LV", - "content_type": 21, - "language": "pt", - "object_id": 121 - } - }, - { - "pk": 1217, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "L\u00edbano", - "label": "LB", - "content_type": 21, - "language": "pt", - "object_id": 122 - } - }, - { - "pk": 1218, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Lib\u00e9ria", - "label": "LR", - "content_type": 21, - "language": "pt", - "object_id": 124 - } - }, - { - "pk": 1219, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "L\u00edbia", - "label": "LY", - "content_type": 21, - "language": "pt", - "object_id": 125 - } - }, - { - "pk": 1220, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Liechtenstein", - "label": "LI", - "content_type": 21, - "language": "pt", - "object_id": 126 - } - }, - { - "pk": 1221, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Litu\u00e2nia", - "label": "LT", - "content_type": 21, - "language": "pt", - "object_id": 127 - } - }, - { - "pk": 1222, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Luxemburgo", - "label": "LU", - "content_type": 21, - "language": "pt", - "object_id": 128 - } - }, - { - "pk": 1223, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Macau", - "label": "MO", - "content_type": 21, - "language": "pt", - "object_id": 129 - } - }, - { - "pk": 1224, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maced\u00f4nia, Rep\u00fablica da", - "label": "MK", - "content_type": 21, - "language": "pt", - "object_id": 130 - } - }, - { - "pk": 1225, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Madag\u00e1scar", - "label": "MG", - "content_type": 21, - "language": "pt", - "object_id": 131 - } - }, - { - "pk": 1226, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mal\u00e1sia", - "label": "MY", - "content_type": 21, - "language": "pt", - "object_id": 133 - } - }, - { - "pk": 1227, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malawi", - "label": "MW", - "content_type": 21, - "language": "pt", - "object_id": 132 - } - }, - { - "pk": 1228, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maldivas", - "label": "MV", - "content_type": 21, - "language": "pt", - "object_id": 134 - } - }, - { - "pk": 1229, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mali", - "label": "ML", - "content_type": 21, - "language": "pt", - "object_id": 135 - } - }, - { - "pk": 1230, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malta", - "label": "MT", - "content_type": 21, - "language": "pt", - "object_id": 136 - } - }, - { - "pk": 1231, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malvinas, Ilhas (Falkland)", - "label": "FK", - "content_type": 21, - "language": "pt", - "object_id": 70 - } - }, - { - "pk": 1232, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Man, Ilha de", - "label": "IM", - "content_type": 21, - "language": "pt", - "object_id": 106 - } - }, - { - "pk": 1233, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Marianas Setentrionais", - "label": "MP", - "content_type": 21, - "language": "pt", - "object_id": 164 - } - }, - { - "pk": 1234, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Marrocos", - "label": "MA", - "content_type": 21, - "language": "pt", - "object_id": 149 - } - }, - { - "pk": 1235, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Marshall, Ilhas", - "label": "MH", - "content_type": 21, - "language": "pt", - "object_id": 137 - } - }, - { - "pk": 1236, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Martinica", - "label": "MQ", - "content_type": 21, - "language": "pt", - "object_id": 138 - } - }, - { - "pk": 1237, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maur\u00edcia", - "label": "MU", - "content_type": 21, - "language": "pt", - "object_id": 140 - } - }, - { - "pk": 1238, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maurit\u00e2nia", - "label": "MR", - "content_type": 21, - "language": "pt", - "object_id": 139 - } - }, - { - "pk": 1239, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mayotte", - "label": "YT", - "content_type": 21, - "language": "pt", - "object_id": 141 - } - }, - { - "pk": 1240, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Menores Distantes dos Estados Unidos, Ilhas", - "label": "UM", - "content_type": 21, - "language": "pt", - "object_id": 234 - } - }, - { - "pk": 1241, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "M\u00e9xico", - "label": "MX", - "content_type": 21, - "language": "pt", - "object_id": 142 - } - }, - { - "pk": 1242, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Myanmar (antiga Birm\u00e2nia)", - "label": "MM", - "content_type": 21, - "language": "pt", - "object_id": 151 - } - }, - { - "pk": 1243, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Micron\u00e9sia, Estados Federados da", - "label": "FM", - "content_type": 21, - "language": "pt", - "object_id": 143 - } - }, - { - "pk": 1244, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mo\u00e7ambique", - "label": "MZ", - "content_type": 21, - "language": "pt", - "object_id": 150 - } - }, - { - "pk": 1245, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mold\u00e1via", - "label": "MD", - "content_type": 21, - "language": "pt", - "object_id": 144 - } - }, - { - "pk": 1246, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "M\u00f4naco", - "label": "MC", - "content_type": 21, - "language": "pt", - "object_id": 145 - } - }, - { - "pk": 1247, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mong\u00f3lia", - "label": "MN", - "content_type": 21, - "language": "pt", - "object_id": 146 - } - }, - { - "pk": 1248, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Montenegro", - "label": "ME", - "content_type": 21, - "language": "pt", - "object_id": 147 - } - }, - { - "pk": 1249, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Montserrat", - "label": "MS", - "content_type": 21, - "language": "pt", - "object_id": 148 - } - }, - { - "pk": 1250, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nam\u00edbia", - "label": "NA", - "content_type": 21, - "language": "pt", - "object_id": 152 - } - }, - { - "pk": 1251, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nauru", - "label": "NR", - "content_type": 21, - "language": "pt", - "object_id": 153 - } - }, - { - "pk": 1252, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nepal", - "label": "NP", - "content_type": 21, - "language": "pt", - "object_id": 154 - } - }, - { - "pk": 1253, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nicar\u00e1gua", - "label": "NI", - "content_type": 21, - "language": "pt", - "object_id": 159 - } - }, - { - "pk": 1254, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "N\u00edger", - "label": "NE", - "content_type": 21, - "language": "pt", - "object_id": 160 - } - }, - { - "pk": 1255, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nig\u00e9ria", - "label": "NG", - "content_type": 21, - "language": "pt", - "object_id": 161 - } - }, - { - "pk": 1256, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Niue", - "label": "NU", - "content_type": 21, - "language": "pt", - "object_id": 162 - } - }, - { - "pk": 1257, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Norfolk, Ilha", - "label": "NF", - "content_type": 21, - "language": "pt", - "object_id": 163 - } - }, - { - "pk": 1258, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Noruega", - "label": "NO", - "content_type": 21, - "language": "pt", - "object_id": 165 - } - }, - { - "pk": 1259, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nova Caled\u00f4nia", - "label": "NC", - "content_type": 21, - "language": "pt", - "object_id": 157 - } - }, - { - "pk": 1260, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nova Zel\u00e2ndia (Aotearoa)", - "label": "NZ", - "content_type": 21, - "language": "pt", - "object_id": 158 - } - }, - { - "pk": 1261, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Oman", - "label": "OM", - "content_type": 21, - "language": "pt", - "object_id": 166 - } - }, - { - "pk": 1262, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pa\u00edses Baixos (Holanda)", - "label": "NL", - "content_type": 21, - "language": "pt", - "object_id": 155 - } - }, - { - "pk": 1263, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Palau", - "label": "PW", - "content_type": 21, - "language": "pt", - "object_id": 168 - } - }, - { - "pk": 1264, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Palestina", - "label": "PS", - "content_type": 21, - "language": "pt", - "object_id": 169 - } - }, - { - "pk": 1265, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Panam\u00e1", - "label": "PA", - "content_type": 21, - "language": "pt", - "object_id": 170 - } - }, - { - "pk": 1266, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Papua-Nova Guin\u00e9", - "label": "PG", - "content_type": 21, - "language": "pt", - "object_id": 171 - } - }, - { - "pk": 1267, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Paquist\u00e3o", - "label": "PK", - "content_type": 21, - "language": "pt", - "object_id": 167 - } - }, - { - "pk": 1268, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Paraguai", - "label": "PY", - "content_type": 21, - "language": "pt", - "object_id": 172 - } - }, - { - "pk": 1269, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Peru", - "label": "PE", - "content_type": 21, - "language": "pt", - "object_id": 173 - } - }, - { - "pk": 1270, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pitcairn", - "label": "PN", - "content_type": 21, - "language": "pt", - "object_id": 175 - } - }, - { - "pk": 1271, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Polin\u00e9sia Francesa", - "label": "PF", - "content_type": 21, - "language": "pt", - "object_id": 76 - } - }, - { - "pk": 1272, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pol\u00f4nia", - "label": "PL", - "content_type": 21, - "language": "pt", - "object_id": 176 - } - }, - { - "pk": 1273, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Porto Rico", - "label": "PR", - "content_type": 21, - "language": "pt", - "object_id": 178 - } - }, - { - "pk": 1274, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Portugal", - "label": "PT", - "content_type": 21, - "language": "pt", - "object_id": 177 - } - }, - { - "pk": 1275, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Qatar", - "label": "QA", - "content_type": 21, - "language": "pt", - "object_id": 179 - } - }, - { - "pk": 1276, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Qu\u00eania", - "label": "KE", - "content_type": 21, - "language": "pt", - "object_id": 114 - } - }, - { - "pk": 1277, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Quirguist\u00e3o", - "label": "KG", - "content_type": 21, - "language": "pt", - "object_id": 119 - } - }, - { - "pk": 1278, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Reino Unido da Gr\u00e3-Bretanha e Irlanda do Norte", - "label": "GB", - "content_type": 21, - "language": "pt", - "object_id": 232 - } - }, - { - "pk": 1279, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Reuni\u00e3o", - "label": "RE", - "content_type": 21, - "language": "pt", - "object_id": 180 - } - }, - { - "pk": 1280, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rom\u00eania", - "label": "RO", - "content_type": 21, - "language": "pt", - "object_id": 181 - } - }, - { - "pk": 1281, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ruanda", - "label": "RW", - "content_type": 21, - "language": "pt", - "object_id": 183 - } - }, - { - "pk": 1282, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "R\u00fassia", - "label": "RU", - "content_type": 21, - "language": "pt", - "object_id": 182 - } - }, - { - "pk": 1283, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Saara Ocidental", - "label": "EH", - "content_type": 21, - "language": "pt", - "object_id": 243 - } - }, - { - "pk": 1284, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Samoa Americana", - "label": "AS", - "content_type": 21, - "language": "pt", - "object_id": 6 - } - }, - { - "pk": 1285, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Samoa (Samoa Ocidental)", - "label": "WS", - "content_type": 21, - "language": "pt", - "object_id": 191 - } - }, - { - "pk": 1286, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Saint Pierre et Miquelon", - "label": "PM", - "content_type": 21, - "language": "pt", - "object_id": 189 - } - }, - { - "pk": 1287, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Salom\u00e3o, Ilhas", - "label": "SB", - "content_type": 21, - "language": "pt", - "object_id": 202 - } - }, - { - "pk": 1288, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00e3o Crist\u00f3v\u00e3o e N\u00e9vis (Saint Kitts e Nevis)", - "label": "KN", - "content_type": 21, - "language": "pt", - "object_id": 186 - } - }, - { - "pk": 1289, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "San Marino", - "label": "SM", - "content_type": 21, - "language": "pt", - "object_id": 192 - } - }, - { - "pk": 1290, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00e3o Tom\u00e9 e Pr\u00edncipe", - "label": "ST", - "content_type": 21, - "language": "pt", - "object_id": 193 - } - }, - { - "pk": 1291, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00e3o Vicente e Granadinas", - "label": "VC", - "content_type": 21, - "language": "pt", - "object_id": 190 - } - }, - { - "pk": 1292, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santa Helena", - "label": "SH", - "content_type": 21, - "language": "pt", - "object_id": 185 - } - }, - { - "pk": 1293, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santa L\u00facia", - "label": "LC", - "content_type": 21, - "language": "pt", - "object_id": 187 - } - }, - { - "pk": 1294, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Senegal", - "label": "SN", - "content_type": 21, - "language": "pt", - "object_id": 195 - } - }, - { - "pk": 1295, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Serra Leoa", - "label": "SL", - "content_type": 21, - "language": "pt", - "object_id": 198 - } - }, - { - "pk": 1296, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00e9rvia", - "label": "RS", - "content_type": 21, - "language": "pt", - "object_id": 196 - } - }, - { - "pk": 1297, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Seychelles", - "label": "SC", - "content_type": 21, - "language": "pt", - "object_id": 197 - } - }, - { - "pk": 1298, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Singapura", - "label": "SG", - "content_type": 21, - "language": "pt", - "object_id": 199 - } - }, - { - "pk": 1299, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "S\u00edria", - "label": "SY", - "content_type": 21, - "language": "pt", - "object_id": 214 - } - }, - { - "pk": 1300, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Som\u00e1lia", - "label": "SO", - "content_type": 21, - "language": "pt", - "object_id": 203 - } - }, - { - "pk": 1301, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sri Lanka", - "label": "LK", - "content_type": 21, - "language": "pt", - "object_id": 207 - } - }, - { - "pk": 1302, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Suazil\u00e2ndia", - "label": "SZ", - "content_type": 21, - "language": "pt", - "object_id": 211 - } - }, - { - "pk": 1303, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sud\u00e3o", - "label": "SD", - "content_type": 21, - "language": "pt", - "object_id": 208 - } - }, - { - "pk": 1304, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Su\u00e9cia", - "label": "SE", - "content_type": 21, - "language": "pt", - "object_id": 212 - } - }, - { - "pk": 1305, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Su\u00ed\u00e7a", - "label": "CH", - "content_type": 21, - "language": "pt", - "object_id": 213 - } - }, - { - "pk": 1306, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Suriname", - "label": "SR", - "content_type": 21, - "language": "pt", - "object_id": 209 - } - }, - { - "pk": 1307, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Svalbard e Jan Mayen", - "label": "SJ", - "content_type": 21, - "language": "pt", - "object_id": 210 - } - }, - { - "pk": 1308, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tail\u00e2ndia", - "label": "TH", - "content_type": 21, - "language": "pt", - "object_id": 218 - } - }, - { - "pk": 1309, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Taiwan", - "label": "TW", - "content_type": 21, - "language": "pt", - "object_id": 215 - } - }, - { - "pk": 1310, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tajiquist\u00e3o", - "label": "TJ", - "content_type": 21, - "language": "pt", - "object_id": 216 - } - }, - { - "pk": 1311, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tanz\u00e2nia", - "label": "TZ", - "content_type": 21, - "language": "pt", - "object_id": 217 - } - }, - { - "pk": 1312, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Terras Austrais e Ant\u00e1rticas Francesas (TAAF)", - "label": "TF", - "content_type": 21, - "language": "pt", - "object_id": 77 - } - }, - { - "pk": 1313, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Territ\u00f3rio Brit\u00e2nico do Oceano \u00cdndico", - "label": "IO", - "content_type": 21, - "language": "pt", - "object_id": 32 - } - }, - { - "pk": 1314, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Timor-Leste", - "label": "TL", - "content_type": 21, - "language": "pt", - "object_id": 219 - } - }, - { - "pk": 1315, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Togo", - "label": "TG", - "content_type": 21, - "language": "pt", - "object_id": 220 - } - }, - { - "pk": 1316, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Toquelau", - "label": "TK", - "content_type": 21, - "language": "pt", - "object_id": 221 - } - }, - { - "pk": 1317, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tonga", - "label": "TO", - "content_type": 21, - "language": "pt", - "object_id": 222 - } - }, - { - "pk": 1318, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Trindade e Tobago", - "label": "TT", - "content_type": 21, - "language": "pt", - "object_id": 223 - } - }, - { - "pk": 1319, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tun\u00edsia", - "label": "TN", - "content_type": 21, - "language": "pt", - "object_id": 224 - } - }, - { - "pk": 1320, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turks e Caicos", - "label": "TC", - "content_type": 21, - "language": "pt", - "object_id": 227 - } - }, - { - "pk": 1321, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turquemenist\u00e3o", - "label": "TM", - "content_type": 21, - "language": "pt", - "object_id": 226 - } - }, - { - "pk": 1322, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turquia", - "label": "TR", - "content_type": 21, - "language": "pt", - "object_id": 225 - } - }, - { - "pk": 1323, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tuvalu", - "label": "TV", - "content_type": 21, - "language": "pt", - "object_id": 228 - } - }, - { - "pk": 1324, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ucr\u00e2nia", - "label": "UA", - "content_type": 21, - "language": "pt", - "object_id": 230 - } - }, - { - "pk": 1325, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uganda", - "label": "UG", - "content_type": 21, - "language": "pt", - "object_id": 229 - } - }, - { - "pk": 1326, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uruguai", - "label": "UY", - "content_type": 21, - "language": "pt", - "object_id": 235 - } - }, - { - "pk": 1327, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Usbequist\u00e3o", - "label": "UZ", - "content_type": 21, - "language": "pt", - "object_id": 236 - } - }, - { - "pk": 1328, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vanuatu", - "label": "VU", - "content_type": 21, - "language": "pt", - "object_id": 237 - } - }, - { - "pk": 1329, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vaticano", - "label": "VA", - "content_type": 21, - "language": "pt", - "object_id": 96 - } - }, - { - "pk": 1330, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Venezuela", - "label": "VE", - "content_type": 21, - "language": "pt", - "object_id": 238 - } - }, - { - "pk": 1331, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vietnam", - "label": "VN", - "content_type": 21, - "language": "pt", - "object_id": 239 - } - }, - { - "pk": 1332, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Virgens Americanas, Ilhas", - "label": "VI", - "content_type": 21, - "language": "pt", - "object_id": 241 - } - }, - { - "pk": 1333, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Virgens Brit\u00e2nicas, Ilhas", - "label": "VG", - "content_type": 21, - "language": "pt", - "object_id": 240 - } - }, - { - "pk": 1334, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Wallis e Futuna", - "label": "WF", - "content_type": 21, - "language": "pt", - "object_id": 242 - } - }, - { - "pk": 1335, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Z\u00e2mbia", - "label": "ZM", - "content_type": 21, - "language": "pt", - "object_id": 245 - } - }, - { - "pk": 1336, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Zimbabwe", - "label": "ZW", - "content_type": 21, - "language": "pt", - "object_id": 246 - } - }, - { - "pk": 1337, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Afganist\u00e1n (el)", - "label": "AF", - "content_type": 21, - "language": "es", - "object_id": 2 - } - }, - { - "pk": 1338, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Albania", - "label": "AL", - "content_type": 21, - "language": "es", - "object_id": 4 - } - }, - { - "pk": 1339, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Alemania", - "label": "DE", - "content_type": 21, - "language": "es", - "object_id": 81 - } - }, - { - "pk": 1340, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Andorra", - "label": "AD", - "content_type": 21, - "language": "es", - "object_id": 7 - } - }, - { - "pk": 1341, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Angola", - "label": "AO", - "content_type": 21, - "language": "es", - "object_id": 8 - } - }, - { - "pk": 1342, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Antigua y Barbuda", - "label": "AG", - "content_type": 21, - "language": "es", - "object_id": 11 - } - }, - { - "pk": 1343, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Arabia Saudita (la)", - "label": "SA", - "content_type": 21, - "language": "es", - "object_id": 194 - } - }, - { - "pk": 1344, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Argelia", - "label": "DZ", - "content_type": 21, - "language": "es", - "object_id": 5 - } - }, - { - "pk": 1345, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Argentina (la)", - "label": "AR", - "content_type": 21, - "language": "es", - "object_id": 12 - } - }, - { - "pk": 1346, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Armenia", - "label": "AM", - "content_type": 21, - "language": "es", - "object_id": 13 - } - }, - { - "pk": 1347, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Australia", - "label": "AU", - "content_type": 21, - "language": "es", - "object_id": 15 - } - }, - { - "pk": 1348, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Austria", - "label": "AT", - "content_type": 21, - "language": "es", - "object_id": 16 - } - }, - { - "pk": 1349, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Azerbaiy\u00e1n", - "label": "AZ", - "content_type": 21, - "language": "es", - "object_id": 17 - } - }, - { - "pk": 1350, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bahamas (las)", - "label": "BS", - "content_type": 21, - "language": "es", - "object_id": 18 - } - }, - { - "pk": 1351, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bahrein", - "label": "BH", - "content_type": 21, - "language": "es", - "object_id": 19 - } - }, - { - "pk": 1352, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bangladesh", - "label": "BD", - "content_type": 21, - "language": "es", - "object_id": 20 - } - }, - { - "pk": 1353, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Barbados", - "label": "BB", - "content_type": 21, - "language": "es", - "object_id": 21 - } - }, - { - "pk": 1354, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Belar\u00fas", - "label": "BY", - "content_type": 21, - "language": "es", - "object_id": 22 - } - }, - { - "pk": 1355, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "B\u00e9lgica", - "label": "BE", - "content_type": 21, - "language": "es", - "object_id": 23 - } - }, - { - "pk": 1356, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Belice", - "label": "BZ", - "content_type": 21, - "language": "es", - "object_id": 24 - } - }, - { - "pk": 1357, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Benin", - "label": "BJ", - "content_type": 21, - "language": "es", - "object_id": 25 - } - }, - { - "pk": 1358, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bhut\u00e1n", - "label": "BT", - "content_type": 21, - "language": "es", - "object_id": 27 - } - }, - { - "pk": 1359, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bolivia", - "label": "BO", - "content_type": 21, - "language": "es", - "object_id": 28 - } - }, - { - "pk": 1360, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bosnia y Herzegovina", - "label": "BA", - "content_type": 21, - "language": "es", - "object_id": 29 - } - }, - { - "pk": 1361, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Botswana", - "label": "BW", - "content_type": 21, - "language": "es", - "object_id": 30 - } - }, - { - "pk": 1362, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Brasil (el)", - "label": "BR", - "content_type": 21, - "language": "es", - "object_id": 1 - } - }, - { - "pk": 1363, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Brunei Darussalam", - "label": "BN", - "content_type": 21, - "language": "es", - "object_id": 33 - } - }, - { - "pk": 1364, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Bulgaria", - "label": "BG", - "content_type": 21, - "language": "es", - "object_id": 34 - } - }, - { - "pk": 1365, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Burkina Faso", - "label": "BF", - "content_type": 21, - "language": "es", - "object_id": 35 - } - }, - { - "pk": 1366, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Burundi", - "label": "BI", - "content_type": 21, - "language": "es", - "object_id": 36 - } - }, - { - "pk": 1367, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cabo Verde", - "label": "CV", - "content_type": 21, - "language": "es", - "object_id": 40 - } - }, - { - "pk": 1368, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Camboya", - "label": "KH", - "content_type": 21, - "language": "es", - "object_id": 37 - } - }, - { - "pk": 1369, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Camer\u00fan (el)", - "label": "CM", - "content_type": 21, - "language": "es", - "object_id": 38 - } - }, - { - "pk": 1370, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Canad\u00e1 (el)", - "label": "CA", - "content_type": 21, - "language": "es", - "object_id": 39 - } - }, - { - "pk": 1371, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chad (el)", - "label": "TD", - "content_type": 21, - "language": "es", - "object_id": 43 - } - }, - { - "pk": 1372, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chile", - "label": "CL", - "content_type": 21, - "language": "es", - "object_id": 44 - } - }, - { - "pk": 1373, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "China", - "label": "CN", - "content_type": 21, - "language": "es", - "object_id": 45 - } - }, - { - "pk": 1374, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Chipre", - "label": "CY", - "content_type": 21, - "language": "es", - "object_id": 57 - } - }, - { - "pk": 1375, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Colombia", - "label": "CO", - "content_type": 21, - "language": "es", - "object_id": 48 - } - }, - { - "pk": 1376, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Comoras (las)", - "label": "KM", - "content_type": 21, - "language": "es", - "object_id": 49 - } - }, - { - "pk": 1377, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Congo (el)", - "label": "CG", - "content_type": 21, - "language": "es", - "object_id": 50 - } - }, - { - "pk": 1378, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Costa de Marfil", - "label": "CI", - "content_type": 21, - "language": "es", - "object_id": 54 - } - }, - { - "pk": 1379, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Costa Rica", - "label": "CR", - "content_type": 21, - "language": "es", - "object_id": 53 - } - }, - { - "pk": 1380, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Croacia", - "label": "HR", - "content_type": 21, - "language": "es", - "object_id": 55 - } - }, - { - "pk": 1381, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Cuba", - "label": "CU", - "content_type": 21, - "language": "es", - "object_id": 56 - } - }, - { - "pk": 1382, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dinamarca", - "label": "DK", - "content_type": 21, - "language": "es", - "object_id": 59 - } - }, - { - "pk": 1383, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Djibouti", - "label": "DJ", - "content_type": 21, - "language": "es", - "object_id": 60 - } - }, - { - "pk": 1384, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Dominica", - "label": "DM", - "content_type": 21, - "language": "es", - "object_id": 61 - } - }, - { - "pk": 1385, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ecuador (el)", - "label": "EC", - "content_type": 21, - "language": "es", - "object_id": 63 - } - }, - { - "pk": 1386, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Egipto", - "label": "EG", - "content_type": 21, - "language": "es", - "object_id": 64 - } - }, - { - "pk": 1387, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "El Salvador", - "label": "SV", - "content_type": 21, - "language": "es", - "object_id": 65 - } - }, - { - "pk": 1388, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Emiratos \u00c1rabes Unidos (los)", - "label": "AE", - "content_type": 21, - "language": "es", - "object_id": 231 - } - }, - { - "pk": 1389, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eritrea", - "label": "ER", - "content_type": 21, - "language": "es", - "object_id": 67 - } - }, - { - "pk": 1390, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eslovaquia", - "label": "SK", - "content_type": 21, - "language": "es", - "object_id": 200 - } - }, - { - "pk": 1391, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Eslovenia", - "label": "SI", - "content_type": 21, - "language": "es", - "object_id": 201 - } - }, - { - "pk": 1392, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Espa\u00f1a", - "label": "ES", - "content_type": 21, - "language": "es", - "object_id": 206 - } - }, - { - "pk": 1393, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Estados Unidos de Am\u00e9rica (los)", - "label": "US", - "content_type": 21, - "language": "es", - "object_id": 233 - } - }, - { - "pk": 1394, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Estonia", - "label": "EE", - "content_type": 21, - "language": "es", - "object_id": 68 - } - }, - { - "pk": 1395, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Etiop\u00eda", - "label": "ET", - "content_type": 21, - "language": "es", - "object_id": 69 - } - }, - { - "pk": 1396, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Fiji", - "label": "FJ", - "content_type": 21, - "language": "es", - "object_id": 72 - } - }, - { - "pk": 1397, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Filipinas", - "label": "PH", - "content_type": 21, - "language": "es", - "object_id": 174 - } - }, - { - "pk": 1398, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Finlandia", - "label": "FI", - "content_type": 21, - "language": "es", - "object_id": 73 - } - }, - { - "pk": 1399, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Francia", - "label": "FR", - "content_type": 21, - "language": "es", - "object_id": 74 - } - }, - { - "pk": 1400, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gab\u00f3n (el)", - "label": "GA", - "content_type": 21, - "language": "es", - "object_id": 78 - } - }, - { - "pk": 1401, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Gambia", - "label": "GM", - "content_type": 21, - "language": "es", - "object_id": 79 - } - }, - { - "pk": 1402, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Georgia", - "label": "GE", - "content_type": 21, - "language": "es", - "object_id": 80 - } - }, - { - "pk": 1403, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ghana", - "label": "GH", - "content_type": 21, - "language": "es", - "object_id": 82 - } - }, - { - "pk": 1404, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Granada", - "label": "GD", - "content_type": 21, - "language": "es", - "object_id": 86 - } - }, - { - "pk": 1405, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Grecia", - "label": "GR", - "content_type": 21, - "language": "es", - "object_id": 84 - } - }, - { - "pk": 1406, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guatemala", - "label": "GT", - "content_type": 21, - "language": "es", - "object_id": 89 - } - }, - { - "pk": 1407, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guinea", - "label": "GN", - "content_type": 21, - "language": "es", - "object_id": 91 - } - }, - { - "pk": 1408, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guinea Ecuatorial", - "label": "GQ", - "content_type": 21, - "language": "es", - "object_id": 66 - } - }, - { - "pk": 1409, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guinea-Bissau", - "label": "GW", - "content_type": 21, - "language": "es", - "object_id": 92 - } - }, - { - "pk": 1410, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Guyana", - "label": "GY", - "content_type": 21, - "language": "es", - "object_id": 93 - } - }, - { - "pk": 1411, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Hait\u00ed", - "label": "HT", - "content_type": 21, - "language": "es", - "object_id": 94 - } - }, - { - "pk": 1412, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Honduras", - "label": "HN", - "content_type": 21, - "language": "es", - "object_id": 97 - } - }, - { - "pk": 1413, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Hungr\u00eda", - "label": "HU", - "content_type": 21, - "language": "es", - "object_id": 99 - } - }, - { - "pk": 1414, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "India (la)", - "label": "IN", - "content_type": 21, - "language": "es", - "object_id": 101 - } - }, - { - "pk": 1415, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Indonesia", - "label": "ID", - "content_type": 21, - "language": "es", - "object_id": 102 - } - }, - { - "pk": 1416, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ir\u00e1n", - "label": "IR", - "content_type": 21, - "language": "es", - "object_id": 103 - } - }, - { - "pk": 1417, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Iraq (el)", - "label": "IQ", - "content_type": 21, - "language": "es", - "object_id": 104 - } - }, - { - "pk": 1418, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Irlanda", - "label": "IE", - "content_type": 21, - "language": "es", - "object_id": 105 - } - }, - { - "pk": 1419, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Islandia", - "label": "IS", - "content_type": 21, - "language": "es", - "object_id": 100 - } - }, - { - "pk": 1420, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Islas Marshall (las)", - "label": "MH", - "content_type": 21, - "language": "es", - "object_id": 137 - } - }, - { - "pk": 1421, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Islas Salom\u00f3n (las)", - "label": "SB", - "content_type": 21, - "language": "es", - "object_id": 202 - } - }, - { - "pk": 1422, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Israel", - "label": "IL", - "content_type": 21, - "language": "es", - "object_id": 107 - } - }, - { - "pk": 1423, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Italia", - "label": "IT", - "content_type": 21, - "language": "es", - "object_id": 108 - } - }, - { - "pk": 1424, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jamaica", - "label": "JM", - "content_type": 21, - "language": "es", - "object_id": 109 - } - }, - { - "pk": 1425, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jap\u00f3n (el)", - "label": "JP", - "content_type": 21, - "language": "es", - "object_id": 110 - } - }, - { - "pk": 1426, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Jordania", - "label": "JO", - "content_type": 21, - "language": "es", - "object_id": 112 - } - }, - { - "pk": 1427, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kazajst\u00e1n", - "label": "KZ", - "content_type": 21, - "language": "es", - "object_id": 113 - } - }, - { - "pk": 1428, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kenia", - "label": "KE", - "content_type": 21, - "language": "es", - "object_id": 114 - } - }, - { - "pk": 1429, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kirguist\u00e1n", - "label": "KG", - "content_type": 21, - "language": "es", - "object_id": 119 - } - }, - { - "pk": 1430, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kiribati", - "label": "KI", - "content_type": 21, - "language": "es", - "object_id": 115 - } - }, - { - "pk": 1431, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Kuwait", - "label": "KW", - "content_type": 21, - "language": "es", - "object_id": 118 - } - }, - { - "pk": 1432, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Laos", - "label": "LA", - "content_type": 21, - "language": "es", - "object_id": 120 - } - }, - { - "pk": 1433, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Lesotho", - "label": "LS", - "content_type": 21, - "language": "es", - "object_id": 123 - } - }, - { - "pk": 1434, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Letonia", - "label": "LV", - "content_type": 21, - "language": "es", - "object_id": 121 - } - }, - { - "pk": 1435, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "L\u00edbano (el)", - "label": "LB", - "content_type": 21, - "language": "es", - "object_id": 122 - } - }, - { - "pk": 1436, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Liberia", - "label": "LR", - "content_type": 21, - "language": "es", - "object_id": 124 - } - }, - { - "pk": 1437, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Libia", - "label": "LY", - "content_type": 21, - "language": "es", - "object_id": 125 - } - }, - { - "pk": 1438, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Liechtenstein", - "label": "LI", - "content_type": 21, - "language": "es", - "object_id": 126 - } - }, - { - "pk": 1439, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Lituania", - "label": "LT", - "content_type": 21, - "language": "es", - "object_id": 127 - } - }, - { - "pk": 1440, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Luxemburgo", - "label": "LU", - "content_type": 21, - "language": "es", - "object_id": 128 - } - }, - { - "pk": 1441, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Macedonia, la ex Rep\u00fablica Yugoslava de", - "label": "MK", - "content_type": 21, - "language": "es", - "object_id": 130 - } - }, - { - "pk": 1442, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Madagascar", - "label": "MG", - "content_type": 21, - "language": "es", - "object_id": 131 - } - }, - { - "pk": 1443, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malasia", - "label": "MY", - "content_type": 21, - "language": "es", - "object_id": 133 - } - }, - { - "pk": 1444, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malawi", - "label": "MW", - "content_type": 21, - "language": "es", - "object_id": 132 - } - }, - { - "pk": 1445, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Maldivas", - "label": "MV", - "content_type": 21, - "language": "es", - "object_id": 134 - } - }, - { - "pk": 1446, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mali", - "label": "ML", - "content_type": 21, - "language": "es", - "object_id": 135 - } - }, - { - "pk": 1447, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Malta", - "label": "MT", - "content_type": 21, - "language": "es", - "object_id": 136 - } - }, - { - "pk": 1448, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Marruecos", - "label": "MA", - "content_type": 21, - "language": "es", - "object_id": 149 - } - }, - { - "pk": 1449, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mauricio", - "label": "MU", - "content_type": 21, - "language": "es", - "object_id": 140 - } - }, - { - "pk": 1450, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mauritania", - "label": "MR", - "content_type": 21, - "language": "es", - "object_id": 139 - } - }, - { - "pk": 1451, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "M\u00e9xico", - "label": "MX", - "content_type": 21, - "language": "es", - "object_id": 142 - } - }, - { - "pk": 1452, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Micronesia", - "label": "FM", - "content_type": 21, - "language": "es", - "object_id": 143 - } - }, - { - "pk": 1453, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Moldavia", - "label": "MD", - "content_type": 21, - "language": "es", - "object_id": 144 - } - }, - { - "pk": 1454, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "M\u00f3naco", - "label": "MC", - "content_type": 21, - "language": "es", - "object_id": 145 - } - }, - { - "pk": 1455, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mongolia", - "label": "MN", - "content_type": 21, - "language": "es", - "object_id": 146 - } - }, - { - "pk": 1456, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Montenegro", - "label": "ME", - "content_type": 21, - "language": "es", - "object_id": 147 - } - }, - { - "pk": 1457, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Mozambique", - "label": "MZ", - "content_type": 21, - "language": "es", - "object_id": 150 - } - }, - { - "pk": 1458, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Myanmar", - "label": "MM", - "content_type": 21, - "language": "es", - "object_id": 151 - } - }, - { - "pk": 1459, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Namibia", - "label": "NA", - "content_type": 21, - "language": "es", - "object_id": 152 - } - }, - { - "pk": 1460, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nauru", - "label": "NR", - "content_type": 21, - "language": "es", - "object_id": 153 - } - }, - { - "pk": 1461, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nepal", - "label": "NP", - "content_type": 21, - "language": "es", - "object_id": 154 - } - }, - { - "pk": 1462, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nicaragua", - "label": "NI", - "content_type": 21, - "language": "es", - "object_id": 159 - } - }, - { - "pk": 1463, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "N\u00edger (el)", - "label": "NE", - "content_type": 21, - "language": "es", - "object_id": 160 - } - }, - { - "pk": 1464, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nigeria", - "label": "NG", - "content_type": 21, - "language": "es", - "object_id": 161 - } - }, - { - "pk": 1465, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Noruega", - "label": "NO", - "content_type": 21, - "language": "es", - "object_id": 165 - } - }, - { - "pk": 1466, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Nueva Zelanda", - "label": "NZ", - "content_type": 21, - "language": "es", - "object_id": 158 - } - }, - { - "pk": 1467, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Om\u00e1n", - "label": "OM", - "content_type": 21, - "language": "es", - "object_id": 166 - } - }, - { - "pk": 1468, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pa\u00edses Bajos (los)", - "label": "NL", - "content_type": 21, - "language": "es", - "object_id": 155 - } - }, - { - "pk": 1469, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pakist\u00e1n (el)", - "label": "PK", - "content_type": 21, - "language": "es", - "object_id": 167 - } - }, - { - "pk": 1470, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Palaos", - "label": "PW", - "content_type": 21, - "language": "es", - "object_id": 168 - } - }, - { - "pk": 1471, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Panam\u00e1", - "label": "PA", - "content_type": 21, - "language": "es", - "object_id": 170 - } - }, - { - "pk": 1472, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Pap\u00faa Nueva Guinea", - "label": "PG", - "content_type": 21, - "language": "es", - "object_id": 171 - } - }, - { - "pk": 1473, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Paraguay (el)", - "label": "PY", - "content_type": 21, - "language": "es", - "object_id": 172 - } - }, - { - "pk": 1474, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Per\u00fa (el)", - "label": "PE", - "content_type": 21, - "language": "es", - "object_id": 173 - } - }, - { - "pk": 1475, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Polonia", - "label": "PL", - "content_type": 21, - "language": "es", - "object_id": 176 - } - }, - { - "pk": 1476, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Portugal", - "label": "PT", - "content_type": 21, - "language": "es", - "object_id": 177 - } - }, - { - "pk": 1477, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Qatar", - "label": "QA", - "content_type": 21, - "language": "es", - "object_id": 179 - } - }, - { - "pk": 1478, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Reino Unido de Gran Breta\u00f1a e Irlanda del Norte", - "label": "GB", - "content_type": 21, - "language": "es", - "object_id": 232 - } - }, - { - "pk": 1479, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Centroafricana (la)", - "label": "CF", - "content_type": 21, - "language": "es", - "object_id": 42 - } - }, - { - "pk": 1480, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Checa (la)", - "label": "CZ", - "content_type": 21, - "language": "es", - "object_id": 58 - } - }, - { - "pk": 1481, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica de Corea (la)", - "label": "KR", - "content_type": 21, - "language": "es", - "object_id": 117 - } - }, - { - "pk": 1482, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Democr\u00e1tica del Congo (la)", - "label": "CD", - "content_type": 21, - "language": "es", - "object_id": 51 - } - }, - { - "pk": 1483, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Dominicana (la)", - "label": "DO", - "content_type": 21, - "language": "es", - "object_id": 62 - } - }, - { - "pk": 1484, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rep\u00fablica Popular Democr\u00e1tica de Corea (la)", - "label": "KP", - "content_type": 21, - "language": "es", - "object_id": 116 - } - }, - { - "pk": 1485, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ruman\u00eda", - "label": "RO", - "content_type": 21, - "language": "es", - "object_id": 181 - } - }, - { - "pk": 1486, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rusia", - "label": "RU", - "content_type": 21, - "language": "es", - "object_id": 182 - } - }, - { - "pk": 1487, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Rwanda", - "label": "RW", - "content_type": 21, - "language": "es", - "object_id": 183 - } - }, - { - "pk": 1488, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Samoa", - "label": "WS", - "content_type": 21, - "language": "es", - "object_id": 191 - } - }, - { - "pk": 1489, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "San Crist\u00f3bal y Nieves", - "label": "KN", - "content_type": 21, - "language": "es", - "object_id": 186 - } - }, - { - "pk": 1490, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "San Marino", - "label": "SM", - "content_type": 21, - "language": "es", - "object_id": 192 - } - }, - { - "pk": 1491, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "San Vicente y las Granadinas", - "label": "VC", - "content_type": 21, - "language": "es", - "object_id": 190 - } - }, - { - "pk": 1492, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santa Luc\u00eda", - "label": "LC", - "content_type": 21, - "language": "es", - "object_id": 187 - } - }, - { - "pk": 1493, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santa Sede (la)", - "label": "VA", - "content_type": 21, - "language": "es", - "object_id": 96 - } - }, - { - "pk": 1494, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Santo Tom\u00e9 y Pr\u00edncipe", - "label": "ST", - "content_type": 21, - "language": "es", - "object_id": 193 - } - }, - { - "pk": 1495, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Senegal (el)", - "label": "SN", - "content_type": 21, - "language": "es", - "object_id": 195 - } - }, - { - "pk": 1496, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Serbia", - "label": "RS", - "content_type": 21, - "language": "es", - "object_id": 196 - } - }, - { - "pk": 1497, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Seychelles", - "label": "SC", - "content_type": 21, - "language": "es", - "object_id": 197 - } - }, - { - "pk": 1498, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sierra Leona", - "label": "SL", - "content_type": 21, - "language": "es", - "object_id": 198 - } - }, - { - "pk": 1499, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Singapur", - "label": "SG", - "content_type": 21, - "language": "es", - "object_id": 199 - } - }, - { - "pk": 1500, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Siria", - "label": "SY", - "content_type": 21, - "language": "es", - "object_id": 214 - } - }, - { - "pk": 1501, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Somalia", - "label": "SO", - "content_type": 21, - "language": "es", - "object_id": 203 - } - }, - { - "pk": 1502, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sri Lanka", - "label": "LK", - "content_type": 21, - "language": "es", - "object_id": 207 - } - }, - { - "pk": 1503, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sud\u00e1frica", - "label": "ZA", - "content_type": 21, - "language": "es", - "object_id": 204 - } - }, - { - "pk": 1504, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Sud\u00e1n (el)", - "label": "SD", - "content_type": 21, - "language": "es", - "object_id": 208 - } - }, - { - "pk": 1505, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Suecia", - "label": "SE", - "content_type": 21, - "language": "es", - "object_id": 212 - } - }, - { - "pk": 1506, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Suiza", - "label": "CH", - "content_type": 21, - "language": "es", - "object_id": 213 - } - }, - { - "pk": 1507, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Surinam", - "label": "SR", - "content_type": 21, - "language": "es", - "object_id": 209 - } - }, - { - "pk": 1508, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Swazilandia", - "label": "SZ", - "content_type": 21, - "language": "es", - "object_id": 211 - } - }, - { - "pk": 1509, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tailandia", - "label": "TH", - "content_type": 21, - "language": "es", - "object_id": 218 - } - }, - { - "pk": 1510, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tanzania", - "label": "TZ", - "content_type": 21, - "language": "es", - "object_id": 217 - } - }, - { - "pk": 1511, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tayikist\u00e1n", - "label": "TJ", - "content_type": 21, - "language": "es", - "object_id": 216 - } - }, - { - "pk": 1512, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Timor Oriental", - "label": "TL", - "content_type": 21, - "language": "es", - "object_id": 219 - } - }, - { - "pk": 1513, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Togo (el)", - "label": "TG", - "content_type": 21, - "language": "es", - "object_id": 220 - } - }, - { - "pk": 1514, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tonga", - "label": "TO", - "content_type": 21, - "language": "es", - "object_id": 222 - } - }, - { - "pk": 1515, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Trinidad y Tobago", - "label": "TT", - "content_type": 21, - "language": "es", - "object_id": 223 - } - }, - { - "pk": 1516, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "T\u00fanez", - "label": "TN", - "content_type": 21, - "language": "es", - "object_id": 224 - } - }, - { - "pk": 1517, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turkmenist\u00e1n", - "label": "TM", - "content_type": 21, - "language": "es", - "object_id": 226 - } - }, - { - "pk": 1518, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Turqu\u00eda", - "label": "TR", - "content_type": 21, - "language": "es", - "object_id": 225 - } - }, - { - "pk": 1519, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Tuvalu", - "label": "TV", - "content_type": 21, - "language": "es", - "object_id": 228 - } - }, - { - "pk": 1520, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Ucrania", - "label": "UA", - "content_type": 21, - "language": "es", - "object_id": 230 - } - }, - { - "pk": 1521, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uganda", - "label": "UG", - "content_type": 21, - "language": "es", - "object_id": 229 - } - }, - { - "pk": 1522, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uruguay (el)", - "label": "UY", - "content_type": 21, - "language": "es", - "object_id": 235 - } - }, - { - "pk": 1523, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Uzbekist\u00e1n", - "label": "UZ", - "content_type": 21, - "language": "es", - "object_id": 236 - } - }, - { - "pk": 1524, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vanuatu", - "label": "VU", - "content_type": 21, - "language": "es", - "object_id": 237 - } - }, - { - "pk": 1525, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Venezuela", - "label": "VE", - "content_type": 21, - "language": "es", - "object_id": 238 - } - }, - { - "pk": 1526, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Vietnam", - "label": "VN", - "content_type": 21, - "language": "es", - "object_id": 239 - } - }, - { - "pk": 1527, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Yemen (el)", - "label": "YE", - "content_type": 21, - "language": "es", - "object_id": 244 - } - }, - { - "pk": 1528, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Zambia", - "label": "ZM", - "content_type": 21, - "language": "es", - "object_id": 245 - } - }, - { - "pk": 1529, - "model": "vocabulary.vocabularytranslation", - "fields": { - "description": "Zimbabwe", - "label": "ZW", - "content_type": 21, - "language": "es", - "object_id": 246 - } - }, { "pk": 2, "model": "vocabulary.countrycode", "fields": { "description": "Afghanistan", "submission_language": "", "label": "AF" } }, { "pk": 3, "model": "vocabulary.countrycode", "fields": { "description": "Aland Islands", "submission_language": "", "label": "AX" } }, { "pk": 4, "model": "vocabulary.countrycode", "fields": { "description": "Albania", "submission_language": "", "label": "AL" } }, { "pk": 5, "model": "vocabulary.countrycode", "fields": { "description": "Algeria", "submission_language": "", "label": "DZ" } }, { "pk": 6, "model": "vocabulary.countrycode", "fields": { "description": "American Samoa", "submission_language": "", "label": "AS" } }, { "pk": 7, "model": "vocabulary.countrycode", "fields": { "description": "Andorra", "submission_language": "", "label": "AD" } }, { "pk": 8, "model": "vocabulary.countrycode", "fields": { "description": "Angola", "submission_language": "", "label": "AO" } }, { "pk": 9, "model": "vocabulary.countrycode", "fields": { "description": "Anguilla", "submission_language": "", "label": "AI" } }, { "pk": 10, "model": "vocabulary.countrycode", "fields": { "description": "Antarctica", "submission_language": "", "label": "AQ" } }, { "pk": 11, "model": "vocabulary.countrycode", "fields": { "description": "Antigua and Barbuda", "submission_language": "en", "label": "AG" } }, { "pk": 12, "model": "vocabulary.countrycode", "fields": { "description": "Argentina", "submission_language": "es", "label": "AR" } }, { "pk": 13, "model": "vocabulary.countrycode", "fields": { "description": "Armenia", "submission_language": "", "label": "AM" } }, { "pk": 14, "model": "vocabulary.countrycode", "fields": { "description": "Aruba", "submission_language": "", "label": "AW" } }, { "pk": 15, "model": "vocabulary.countrycode", "fields": { "description": "Australia", "submission_language": "", "label": "AU" } }, { "pk": 16, "model": "vocabulary.countrycode", "fields": { "description": "Austria", "submission_language": "", "label": "AT" } }, { "pk": 17, "model": "vocabulary.countrycode", "fields": { "description": "Azerbaijan", "submission_language": "", "label": "AZ" } }, { "pk": 18, "model": "vocabulary.countrycode", "fields": { "description": "Bahamas", "submission_language": "en", "label": "BS" } }, { "pk": 19, "model": "vocabulary.countrycode", "fields": { "description": "Bahrain", "submission_language": "", "label": "BH" } }, { "pk": 20, "model": "vocabulary.countrycode", "fields": { "description": "Bangladesh", "submission_language": "", "label": "BD" } }, { "pk": 21, "model": "vocabulary.countrycode", "fields": { "description": "Barbados", "submission_language": "en", "label": "BB" } }, { "pk": 22, "model": "vocabulary.countrycode", "fields": { "description": "Belarus", "submission_language": "", "label": "BY" } }, { "pk": 23, "model": "vocabulary.countrycode", "fields": { "description": "Belgium", "submission_language": "", "label": "BE" } }, { "pk": 24, "model": "vocabulary.countrycode", "fields": { "description": "Belize", "submission_language": "en", "label": "BZ" } }, { "pk": 25, "model": "vocabulary.countrycode", "fields": { "description": "Benin", "submission_language": "", "label": "BJ" } }, { "pk": 26, "model": "vocabulary.countrycode", "fields": { "description": "Bermuda", "submission_language": "", "label": "BM" } }, { "pk": 27, "model": "vocabulary.countrycode", "fields": { "description": "Bhutan", "submission_language": "", "label": "BT" } }, { "pk": 28, "model": "vocabulary.countrycode", "fields": { "description": "Bolivia", "submission_language": "es", "label": "BO" } }, { "pk": 29, "model": "vocabulary.countrycode", "fields": { "description": "Bosnia and Herzegovina", "submission_language": "", "label": "BA" } }, { "pk": 30, "model": "vocabulary.countrycode", "fields": { "description": "Botswana", "submission_language": "", "label": "BW" } }, { "pk": 31, "model": "vocabulary.countrycode", "fields": { "description": "Bouvet Island", "submission_language": "", "label": "BV" } }, { "pk": 1, "model": "vocabulary.countrycode", "fields": { "description": "Brazil", "submission_language": "pt", "label": "BR" } }, { "pk": 32, "model": "vocabulary.countrycode", "fields": { "description": "British Indian Ocean Territory", "submission_language": "", "label": "IO" } }, { "pk": 33, "model": "vocabulary.countrycode", "fields": { "description": "Brunei Darussalam", "submission_language": "", "label": "BN" } }, { "pk": 34, "model": "vocabulary.countrycode", "fields": { "description": "Bulgaria", "submission_language": "", "label": "BG" } }, { "pk": 35, "model": "vocabulary.countrycode", "fields": { "description": "Burkina Faso", "submission_language": "", "label": "BF" } }, { "pk": 36, "model": "vocabulary.countrycode", "fields": { "description": "Burundi", "submission_language": "", "label": "BI" } }, { "pk": 37, "model": "vocabulary.countrycode", "fields": { "description": "Cambodia", "submission_language": "", "label": "KH" } }, { "pk": 38, "model": "vocabulary.countrycode", "fields": { "description": "Cameroon", "submission_language": "", "label": "CM" } }, { "pk": 39, "model": "vocabulary.countrycode", "fields": { "description": "Canada", "submission_language": "fr", "label": "CA" } }, { "pk": 40, "model": "vocabulary.countrycode", "fields": { "description": "Cape Verde", "submission_language": "", "label": "CV" } }, { "pk": 41, "model": "vocabulary.countrycode", "fields": { "description": "Cayman Islands", "submission_language": "", "label": "KY" } }, { "pk": 42, "model": "vocabulary.countrycode", "fields": { "description": "Central African Republic", "submission_language": "", "label": "CF" } }, { "pk": 43, "model": "vocabulary.countrycode", "fields": { "description": "Chad", "submission_language": "", "label": "TD" } }, { "pk": 44, "model": "vocabulary.countrycode", "fields": { "description": "Chile", "submission_language": "es", "label": "CL" } }, { "pk": 45, "model": "vocabulary.countrycode", "fields": { "description": "China", "submission_language": "", "label": "CN" } }, { "pk": 46, "model": "vocabulary.countrycode", "fields": { "description": "Christmas Island", "submission_language": "", "label": "CX" } }, { "pk": 47, "model": "vocabulary.countrycode", "fields": { "description": "Cocos (Keeling) Islands", "submission_language": "", "label": "CC" } }, { "pk": 48, "model": "vocabulary.countrycode", "fields": { "description": "Colombia", "submission_language": "es", "label": "CO" } }, { "pk": 49, "model": "vocabulary.countrycode", "fields": { "description": "Comoros", "submission_language": "", "label": "KM" } }, { "pk": 50, "model": "vocabulary.countrycode", "fields": { "description": "Congo", "submission_language": "", "label": "CG" } }, { "pk": 51, "model": "vocabulary.countrycode", "fields": { "description": "Congo, The Democratic Republic of the", "submission_language": "", "label": "CD" } }, { "pk": 52, "model": "vocabulary.countrycode", "fields": { "description": "Cook Islands", "submission_language": "", "label": "CK" } }, { "pk": 53, "model": "vocabulary.countrycode", "fields": { "description": "Costa Rica", "submission_language": "es", "label": "CR" } }, { "pk": 54, "model": "vocabulary.countrycode", "fields": { "description": "Cote d'Ivoire", "submission_language": "", "label": "CI" } }, { "pk": 55, "model": "vocabulary.countrycode", "fields": { "description": "Croatia", "submission_language": "", "label": "HR" } }, { "pk": 56, "model": "vocabulary.countrycode", "fields": { "description": "Cuba", "submission_language": "es", "label": "CU" } }, { "pk": 57, "model": "vocabulary.countrycode", "fields": { "description": "Cyprus", "submission_language": "", "label": "CY" }
ensaiosclinicos/clinicaltrials
072662700794dea34f6536864259b2cb36cc70a2
added django_site records for test, staging and production environments; added comments to settings.py the SITE_ID setting
diff --git a/clinicaltrials/fixtures/initial_data.json b/clinicaltrials/fixtures/initial_data.json index d48a08f..e6e9734 100644 --- a/clinicaltrials/fixtures/initial_data.json +++ b/clinicaltrials/fixtures/initial_data.json @@ -1,10 +1,26 @@ [ { "pk": 2, "model": "sites.site", + "fields": { + "domain": "ec.teste.bvsalud.org", + "name": "EnsaiosClinicos.gov.br (TESTE)" + } + }, + { + "pk": 3, + "model": "sites.site", "fields": { "domain": "ec.homolog.bvsalud.org", - "name": "EnsaiosClinicos.gov.br" + "name": "EnsaiosClinicos.gov.br (HOMOLOG)" + } + }, + { + "pk": 4, + "model": "sites.site", + "fields": { + "domain": "ec.beta.bvsalud.org", + "name": "EnsaiosClinicos.gov.br (BETA)" } } ] diff --git a/clinicaltrials/settings.py b/clinicaltrials/settings.py index 25115f3..acb56ee 100644 --- a/clinicaltrials/settings.py +++ b/clinicaltrials/settings.py @@ -1,141 +1,144 @@ # -*- encoding: utf-8 -*- # Django settings for clinicaltrials project. import os from django.utils.translation import ugettext_lazy as _ DEBUG = False TEMPLATE_DEBUG = DEBUG PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) ADMINS = ( ('Luciano Ramalho', '[email protected]'), ('Fabio Montefuscolo', '[email protected]'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'America/Brasilia' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'pt-BR' -SITE_ID = 2 - # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/static/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = '*06=j&&^n71^a&%%3rs%7lla+^(n^v1w@@dp_rxvi#&(xo7meq' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', # 'django.template.loaders.eggs.load_template_source', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'middleware.scriptprefix.ScriptPrefixMiddleware', ) ROOT_URLCONF = 'clinicaltrials.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(PROJECT_PATH, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'repository', 'vocabulary', 'reviewapp', 'tickets', 'assistance', 'decsclient', 'polyglot', 'rosetta', 'registration', # django-registration package ) ################################################################# ### BEGIN Clinical Trials Repository customization settings +### +### see also settings_local-SAMPLE.py for private customization settings. -# see also settings_local-SAMPLE.py for private customization settings. +# this id must match the record with the correct domain name in the +# django_site table; the initial values for that table are defined +# in clinicaltrials/fixture/initial_data.json +SITE_ID = 2 # change if necessary to match a record in django_site SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos' SEND_BROKEN_LINK_EMAILS = True DECS_SERVICE = 'http://decs.bvs.br/cgi-bin/mx/cgi=@vmx/decs' # Notes: # 1) language codes should follow the IANA standard for language subtags # source: http://www.iana.org/assignments/language-subtag-repository # 2) the first managed language is considered the default and is # also the source language for content translation purposes MANAGED_LANGUAGES = ( ('en',u'English'), ('es',u'Español'), #('fr',_('Français')), ('pt',u'Português'), ) TARGET_LANGUAGES = MANAGED_LANGUAGES[1:] # exlude source language CHECKED_LANGUAGES = [code for code, label in MANAGED_LANGUAGES] # django-registration: for how long the activation link is valid ACCOUNT_ACTIVATION_DAYS = 7 # django-registration: set to False to suspend new user registrations REGISTRATION_OPEN = True ATTACHMENTS_PATH = os.path.join(MEDIA_ROOT, 'attachments') SUBMISSIONS_XML_PATH = os.path.join(MEDIA_ROOT, 'submissions_xml') FIXTURE_DIRS = ('fixtures',) ### END Clinical Trials Repository customization settings ################################################################# # Deployment settings: there *must* be an unversioned settings_local.py # file in the current directory. See sample file at settings_local-SAMPLE.py execfile(os.path.join(PROJECT_PATH,'settings_local.py'))
ensaiosclinicos/clinicaltrials
d0d09a2dfad5ec8eb6b31d7a6cd61d81b360ae5d
fixed svn command in sysinfo diagnostic view
diff --git a/clinicaltrials/diagnostic/views.py b/clinicaltrials/diagnostic/views.py index 6b4a937..59c47bd 100755 --- a/clinicaltrials/diagnostic/views.py +++ b/clinicaltrials/diagnostic/views.py @@ -1,66 +1,68 @@ from django.http import HttpResponse from django.contrib.auth.decorators import user_passes_test def smoke_test(request): from datetime import datetime return HttpResponse(datetime.now().strftime('%H:%M:%S')) @user_passes_test(lambda u: u.is_staff) def req_dump(request): template = ''' <form action="./" method="POST"> <input type="text" name="word" value="mitochondrial"> <input type="submit" name="btn1" value="one"> <input type="submit" name="btn2" value="two"> </form> <table border="1"> <tr><th>key</th><th>POST[key]</th></tr> %s </table> <hr> <p> <a href="this_is_a_broken_link">Click to test broken link notification</a> </p> ''' rows = [] for k in request.POST.keys(): rows.append('<tr><th>%s</th><td>%s</td></tr>' % (k, request.POST[k])) return HttpResponse(template % ('\n'.join(rows))) @user_passes_test(lambda u: u.is_staff) def sys_info(request): template = u''' <h1>Site.objects.get_current()</h1> - <table border="1"> - <tr><th>id</th><td>%(site.pk)r</td></tr> - <tr><th>domain</th><td>%(site.domain)r</td></tr> - <tr><th>name</th><td>%(site.name)r</td></tr> + <table> + <tr><th>id</th><td>%(site.pk)s</td></tr> + <tr><th>domain</th><td>%(site.domain)s</td></tr> + <tr><th>name</th><td>%(site.name)s</td></tr> </table> <h1>settings path</h1> <pre>%(settingspath)s</pre> <h1>svn info</h1> <pre>%(svninfo)s</pre> <h1>sys.path</h1> <pre>%(syspath)s</pre> ''' import sys import settings from django.contrib.sites.models import Site from subprocess import Popen, PIPE site = Site.objects.get_current() - svnout, svnerr = Popen(['svn', 'info', settings.PROJECT_PATH], stdout=PIPE).communicate() + svnout, svnerr = Popen(['svn', 'info', '-r', 'HEAD', settings.PROJECT_PATH], stdout=PIPE).communicate() + svnout = svnout.decode('utf-8') if svnout else u'' + svnerr = svnerr.decode('utf-8') if svnerr else u'' return HttpResponse(template % {'site.pk':site.pk, 'site.domain':site.domain, 'site.name':site.name, 'settingspath': settings.PROJECT_PATH, 'syspath':'\n'.join(sys.path), - 'svninfo':svnout.decode('utf-8') or svnerr.decode('utf-8')}) + 'svninfo':svnout + svnerr}) @user_passes_test(lambda u: u.is_staff) def raise_error(request): class FakeError(StandardError): ''' this is just to test error e-mails and logging ''' raise FakeError('This is not really an error')
ensaiosclinicos/clinicaltrials
1cc2f06b57bf1c79232d17feb4c627d96a205e43
added django.contrib.sites info to sys info view
diff --git a/clinicaltrials/diagnostic/views.py b/clinicaltrials/diagnostic/views.py index 16363e2..6b4a937 100755 --- a/clinicaltrials/diagnostic/views.py +++ b/clinicaltrials/diagnostic/views.py @@ -1,55 +1,66 @@ from django.http import HttpResponse from django.contrib.auth.decorators import user_passes_test def smoke_test(request): from datetime import datetime return HttpResponse(datetime.now().strftime('%H:%M:%S')) @user_passes_test(lambda u: u.is_staff) def req_dump(request): template = ''' <form action="./" method="POST"> <input type="text" name="word" value="mitochondrial"> <input type="submit" name="btn1" value="one"> <input type="submit" name="btn2" value="two"> </form> <table border="1"> <tr><th>key</th><th>POST[key]</th></tr> %s </table> <hr> <p> <a href="this_is_a_broken_link">Click to test broken link notification</a> </p> ''' rows = [] for k in request.POST.keys(): rows.append('<tr><th>%s</th><td>%s</td></tr>' % (k, request.POST[k])) return HttpResponse(template % ('\n'.join(rows))) @user_passes_test(lambda u: u.is_staff) def sys_info(request): - template = ''' + template = u''' + <h1>Site.objects.get_current()</h1> + <table border="1"> + <tr><th>id</th><td>%(site.pk)r</td></tr> + <tr><th>domain</th><td>%(site.domain)r</td></tr> + <tr><th>name</th><td>%(site.name)r</td></tr> + </table> <h1>settings path</h1> <pre>%(settingspath)s</pre> <h1>svn info</h1> <pre>%(svninfo)s</pre> <h1>sys.path</h1> <pre>%(syspath)s</pre> ''' import sys import settings + from django.contrib.sites.models import Site from subprocess import Popen, PIPE + site = Site.objects.get_current() svnout, svnerr = Popen(['svn', 'info', settings.PROJECT_PATH], stdout=PIPE).communicate() - return HttpResponse(template % {'settingspath': settings.PROJECT_PATH, + return HttpResponse(template % {'site.pk':site.pk, + 'site.domain':site.domain, + 'site.name':site.name, + 'settingspath': settings.PROJECT_PATH, 'syspath':'\n'.join(sys.path), - 'svninfo':svnout or svnerr}) + 'svninfo':svnout.decode('utf-8') or svnerr.decode('utf-8')}) @user_passes_test(lambda u: u.is_staff) def raise_error(request): class FakeError(StandardError): ''' this is just to test error e-mails and logging ''' raise FakeError('This is not really an error') diff --git a/clinicaltrials/registration/templates/registration/activation_email.txt b/clinicaltrials/registration/templates/registration/activation_email.txt index 6c48a96..c4ab8fe 100644 --- a/clinicaltrials/registration/templates/registration/activation_email.txt +++ b/clinicaltrials/registration/templates/registration/activation_email.txt @@ -1,18 +1,8 @@ Please click on the link below to activate your account. {% url registration_activate activation_key %} -OR - -You may visit the page at - -XXX - -and copy and paste the activation key below - -{{activation_key}} - This key will expire in {{expiration_days}} days. site.name = [{{site.name}}] site.domain = [{{site.domain}}] diff --git a/clinicaltrials/settings_local-SAMPLE.py b/clinicaltrials/settings_local-SAMPLE.py index e9eb8e9..32eda0b 100644 --- a/clinicaltrials/settings_local-SAMPLE.py +++ b/clinicaltrials/settings_local-SAMPLE.py @@ -1,36 +1,36 @@ -DEBUG = True +DEBUG = False ADMINS = ( ('Webmaster Ensaios Clinicos', '[email protected]'), ) DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'clinicaltrials' # Or path to database file if using sqlite3. DATABASE_USER = 'tester' # Not used with sqlite3. DATABASE_PASSWORD = 'puffpuff' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. SECRET_KEY = 'rmbg(!8sa@&8o9pnnd@*szm+axos_6r$)r48jc2r$^_8+wz)po' EMAIL_HOST = 'pombo.bireme.br' EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers ### if set, used to authenticate with SMTP EMAIL_HOST_USER = '[email protected]' EMAIL_HOST_PASSWORD = '?????' EMAIL_USE_TLS = False SERVER_EMAIL = EMAIL_HOST_USER if DEBUG: MIDDLEWARE_CLASSES += ( ## external dependency for debug purposes only # 'debug_middleware.DebugFooter', ) INSTALLED_APPS += ( ## external dependency for generating model ER diagrams # 'graphviz', ) GRAPHVIZ_DOT_CMD = '/usr/bin/dot'
ensaiosclinicos/clinicaltrials
a770bc02d6609df06f2a2c93d8c2a670c37d0f3f
first version of json export from admin
diff --git a/clinicaltrials/assistance/admin.py b/clinicaltrials/assistance/admin.py index 2ff6cc0..37e3a35 100644 --- a/clinicaltrials/assistance/admin.py +++ b/clinicaltrials/assistance/admin.py @@ -1,41 +1,45 @@ from django.contrib import admin from assistance.models import * -from utilities import safe_truncate +from utilities import safe_truncate, export_json from polyglot.admin import TranslationInline, TranslationAdmin class FieldHelpTranslationInline(TranslationInline): model = FieldHelpTranslation class FieldHelpAdmin(TranslationAdmin): list_display = ('form','field','short_text', 'translation_completed', 'missing_translations') list_display_links = ('form','field') search_fields = ('form','field') list_filter = ('form',) inlines = [FieldHelpTranslationInline] + actions = [export_json] def short_text(self, obj): return safe_truncate(obj.text) class CategoryTranslationInline(TranslationInline): model = CategoryTranslation class CategoryAdmin(TranslationAdmin): inlines = [CategoryTranslationInline] list_display = ('label', 'translation_completed', 'missing_translations') + actions = [export_json] class QuestionTranslationInline(TranslationInline): model = QuestionTranslation class QuestionAdmin(TranslationAdmin): inlines = [QuestionTranslationInline] list_display = ('title','short_text', 'translation_completed', 'missing_translations') + actions = [export_json] + def short_text(self, obj): return safe_truncate(obj.answer) admin.site.register(FieldHelp, FieldHelpAdmin) admin.site.register(Category, CategoryAdmin) admin.site.register(Question, QuestionAdmin) diff --git a/clinicaltrials/settings_local-SAMPLE.py b/clinicaltrials/settings_local-SAMPLE.py index 3952718..e9eb8e9 100644 --- a/clinicaltrials/settings_local-SAMPLE.py +++ b/clinicaltrials/settings_local-SAMPLE.py @@ -1,32 +1,36 @@ DEBUG = True +ADMINS = ( + ('Webmaster Ensaios Clinicos', '[email protected]'), +) + DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'clinicaltrials' # Or path to database file if using sqlite3. DATABASE_USER = 'tester' # Not used with sqlite3. DATABASE_PASSWORD = 'puffpuff' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. SECRET_KEY = 'rmbg(!8sa@&8o9pnnd@*szm+axos_6r$)r48jc2r$^_8+wz)po' EMAIL_HOST = 'pombo.bireme.br' EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers ### if set, used to authenticate with SMTP EMAIL_HOST_USER = '[email protected]' EMAIL_HOST_PASSWORD = '?????' EMAIL_USE_TLS = False SERVER_EMAIL = EMAIL_HOST_USER if DEBUG: MIDDLEWARE_CLASSES += ( ## external dependency for debug purposes only # 'debug_middleware.DebugFooter', ) INSTALLED_APPS += ( ## external dependency for generating model ER diagrams # 'graphviz', ) GRAPHVIZ_DOT_CMD = '/usr/bin/dot' diff --git a/clinicaltrials/utilities.py b/clinicaltrials/utilities.py index e405f1d..0716e10 100644 --- a/clinicaltrials/utilities.py +++ b/clinicaltrials/utilities.py @@ -1,56 +1,64 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from django.http import HttpResponse +from django.core import serializers + ELLIPSIS = u'\u2026' def safe_truncate(text, max_length=60, ellipsis=ELLIPSIS, encoding='utf-8', raise_exc=False): u'''truncate a string without breaking words >>> safe_truncate(u'the time has come', 9, u'>') u'the time>' >>> safe_truncate(u'the-time-has-come', 9, u'>') u'the-time>' >>> safe_truncate(u'the time', 8) u'the time' >>> safe_truncate(u'the time', 9) u'the time' >>> s = u'uncharacteristically-long' >>> safe_truncate(s, 10, u'>') u'uncharacteristically>' >>> safe_truncate(s, 10, u'>', raise_exc=True) Traceback (most recent call last): ... ValueError: Cannot safely truncate to 10 characters ''' if not isinstance(text, unicode): text = text.decode(encoding) if len(text) <= max_length: return text # reverse-seek a non-alphanumeric character for i, c in enumerate(reversed(text[:max_length])): if not c.isalnum(): pos = max_length - i - 1 break else: pos = -1 if pos == -1: if raise_exc: msg = 'Cannot safely truncate to %s characters' raise ValueError(msg % max_length) else: # seek nearest non-alphanumeric character after the cuttoff point pos = len(text) for i, c in enumerate(text[max_length:]): if not c.isalnum(): pos = max_length + i break if pos == len(text): return text return text[:pos] + ellipsis +def export_json(modeladmin, request, queryset): + response = HttpResponse(mimetype="application/json") + serializers.serialize("json", queryset, stream=response, indent=2) + return response +export_json.short_description = 'Export selected records in JSON format' if __name__=='__main__': import doctest doctest.testmod() \ No newline at end of file diff --git a/clinicaltrials/vocabulary/admin.py b/clinicaltrials/vocabulary/admin.py index 63d64f7..8e97b7e 100644 --- a/clinicaltrials/vocabulary/admin.py +++ b/clinicaltrials/vocabulary/admin.py @@ -1,26 +1,29 @@ from django.contrib import admin from django.contrib.contenttypes import generic from django.conf import settings from vocabulary.models import * from polyglot.admin import TranslationInline, TranslationAdmin +from utilities import export_json + class VocabularyTranslationInline(TranslationInline): model = VocabularyTranslation class SimpleVocabularyAdmin(TranslationAdmin): list_display = ('label', 'description', 'translation_completed', 'missing_translations') inlines = [VocabularyTranslationInline] + actions = [export_json] class CountryCodeAdmin(TranslationAdmin): list_display = ('label', 'description', 'submission_language', 'translation_completed', 'missing_translations') search_fields = ('label', 'description') list_filter = ('submission_language',) inlines = [VocabularyTranslationInline] for model in (RecruitmentStatus, StudyType, StudyPhase, InterventionCode, AttachmentType, TrialNumberIssuingAuthority, StudyPurpose, InterventionAssigment, StudyMasking, StudyAllocation): admin.site.register(model, SimpleVocabularyAdmin) admin.site.register(CountryCode, CountryCodeAdmin)
ensaiosclinicos/clinicaltrials
f1e5feac93d8e42f22f666a34ab833a58ac60d30
created package and added e-mail check for diagnostic; removed local copy of jquery, replacing with URL for serving from Google, along with JQuery UI
diff --git a/clinicaltrials/diagnostic/__init__.py b/clinicaltrials/diagnostic/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/clinicaltrials/diagnostic/urls.py b/clinicaltrials/diagnostic/urls.py new file mode 100644 index 0000000..2597f33 --- /dev/null +++ b/clinicaltrials/diagnostic/urls.py @@ -0,0 +1,12 @@ +from django.conf.urls.defaults import * + +from diagnostic.views import * + +urlpatterns = patterns('', + # Diagnostic views + url(r'^smoke/$', smoke_test), + url(r'^reqdump/$', req_dump), + url(r'^sysinfo/$', sys_info), + url(r'^error/$', raise_error), + +) diff --git a/clinicaltrials/diagnostic/views.py b/clinicaltrials/diagnostic/views.py new file mode 100755 index 0000000..16363e2 --- /dev/null +++ b/clinicaltrials/diagnostic/views.py @@ -0,0 +1,55 @@ +from django.http import HttpResponse +from django.contrib.auth.decorators import user_passes_test + +def smoke_test(request): + from datetime import datetime + return HttpResponse(datetime.now().strftime('%H:%M:%S')) + +@user_passes_test(lambda u: u.is_staff) +def req_dump(request): + template = ''' + <form action="./" method="POST"> + <input type="text" name="word" value="mitochondrial"> + <input type="submit" name="btn1" value="one"> + <input type="submit" name="btn2" value="two"> + </form> + <table border="1"> + <tr><th>key</th><th>POST[key]</th></tr> + %s + </table> + <hr> + <p> + <a href="this_is_a_broken_link">Click to test broken link notification</a> + </p> + ''' + rows = [] + for k in request.POST.keys(): + rows.append('<tr><th>%s</th><td>%s</td></tr>' % (k, request.POST[k])) + return HttpResponse(template % ('\n'.join(rows))) + +@user_passes_test(lambda u: u.is_staff) +def sys_info(request): + template = ''' + <h1>settings path</h1> + <pre>%(settingspath)s</pre> + <h1>svn info</h1> + <pre>%(svninfo)s</pre> + <h1>sys.path</h1> + <pre>%(syspath)s</pre> + ''' + import sys + import settings + from subprocess import Popen, PIPE + svnout, svnerr = Popen(['svn', 'info', settings.PROJECT_PATH], stdout=PIPE).communicate() + return HttpResponse(template % {'settingspath': settings.PROJECT_PATH, + 'syspath':'\n'.join(sys.path), + 'svninfo':svnout or svnerr}) + +@user_passes_test(lambda u: u.is_staff) +def raise_error(request): + class FakeError(StandardError): + ''' this is just to test error e-mails and logging ''' + raise FakeError('This is not really an error') + + + diff --git a/clinicaltrials/static/js/jquery-1.3.1.min.js b/clinicaltrials/static/js/jquery-1.3.1.min.js deleted file mode 100644 index c327fae..0000000 --- a/clinicaltrials/static/js/jquery-1.3.1.min.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.1 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009) - * Revision: 6158 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.makeArray(E))},selector:"",jquery:"1.3.1",size:function(){return this.length},get:function(E){return E===g?o.makeArray(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,find:function(E){if(this.length===1&&!/,/.test(E)){var G=this.pushStack([],"find",E);G.length=0;o.find(E,this[0],G);return G}else{var F=o.map(this,function(H){return o.find(E,H)});return this.pushStack(/[^+>] [^+>]/.test(E)?o.unique(F):F,"find",E)}},clone:function(F){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.cloneNode(true),H=document.createElement("div");H.appendChild(I);return o.clean([H.innerHTML])[0]}else{return this.cloneNode(true)}});var G=E.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(F===true){this.find("*").andSelf().each(function(I){if(this.nodeType==3){return}var H=o.data(this,"events");for(var K in H){for(var J in H[K]){o.event.add(G[I],K,H[K][J],H[K][J].data)}}})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var F=o.expr.match.POS.test(E)?o(E):null;return this.map(function(){var G=this;while(G&&G.ownerDocument){if(F?F.index(G)>-1:o(G).is(E)){return G}G=G.parentNode}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML:null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(K,N,M){if(this[0]){var J=(this[0].ownerDocument||this[0]).createDocumentFragment(),G=o.clean(K,(this[0].ownerDocument||this[0]),J),I=J.firstChild,E=this.length>1?J.cloneNode(true):J;if(I){for(var H=0,F=this.length;H<F;H++){M.call(L(this[H],I),H>0?E.cloneNode(true):J)}}if(G){o.each(G,z)}}return this;function L(O,P){return N&&o.nodeName(O,"table")&&o.nodeName(P,"tr")?(O.getElementsByTagName("tbody")[0]||O.appendChild(O.ownerDocument.createElement("tbody"))):O}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){G=o.trim(G);if(G){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(G,E,I){if(E=="width"||E=="height"){var K,F={position:"absolute",visibility:"hidden",display:"block"},J=E=="width"?["Left","Right"]:["Top","Bottom"];function H(){K=E=="width"?G.offsetWidth:G.offsetHeight;var M=0,L=0;o.each(J,function(){M+=parseFloat(o.curCSS(G,"padding"+this,true))||0;L+=parseFloat(o.curCSS(G,"border"+this+"Width",true))||0});K-=Math.round(M+L)}if(o(G).is(":visible")){H()}else{o.swap(G,F,H)}return Math.max(0,K)}return o.curCSS(G,E,I)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,R){if(typeof R==="number"){R+=""}if(!R){return}if(typeof R==="string"){R=R.replace(/(<(\w+)[^>]*?)\/>/g,function(T,U,S){return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?T:U+"></"+S+">"});var O=o.trim(R).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+R+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var N=!O.indexOf("<table")&&O.indexOf("<tbody")<0?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&O.indexOf("<tbody")<0?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(R)){L.insertBefore(K.createTextNode(R.match(/^\s*/)[0]),L.firstChild)}R=o.makeArray(L.childNodes)}if(R.nodeType){G.push(R)}else{G=o.merge(G,R)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(){var G=arguments;return this.each(function(){for(var H=0,I=G.length;H<I;H++){o(G[H])[F](this)}})}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var Q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,K=0,G=Object.prototype.toString;var F=function(X,T,aa,ab){aa=aa||[];T=T||document;if(T.nodeType!==1&&T.nodeType!==9){return[]}if(!X||typeof X!=="string"){return aa}var Y=[],V,ae,ah,S,ac,U,W=true;Q.lastIndex=0;while((V=Q.exec(X))!==null){Y.push(V[1]);if(V[2]){U=RegExp.rightContext;break}}if(Y.length>1&&L.exec(X)){if(Y.length===2&&H.relative[Y[0]]){ae=I(Y[0]+Y[1],T)}else{ae=H.relative[Y[0]]?[T]:F(Y.shift(),T);while(Y.length){X=Y.shift();if(H.relative[X]){X+=Y.shift()}ae=I(X,ae)}}}else{var ad=ab?{expr:Y.pop(),set:E(ab)}:F.find(Y.pop(),Y.length===1&&T.parentNode?T.parentNode:T,P(T));ae=F.filter(ad.expr,ad.set);if(Y.length>0){ah=E(ae)}else{W=false}while(Y.length){var ag=Y.pop(),af=ag;if(!H.relative[ag]){ag=""}else{af=Y.pop()}if(af==null){af=T}H.relative[ag](ah,af,P(T))}}if(!ah){ah=ae}if(!ah){throw"Syntax error, unrecognized expression: "+(ag||X)}if(G.call(ah)==="[object Array]"){if(!W){aa.push.apply(aa,ah)}else{if(T.nodeType===1){for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&(ah[Z]===true||ah[Z].nodeType===1&&J(T,ah[Z]))){aa.push(ae[Z])}}}else{for(var Z=0;ah[Z]!=null;Z++){if(ah[Z]&&ah[Z].nodeType===1){aa.push(ae[Z])}}}}}else{E(ah,aa)}if(U){F(U,T,aa,ab)}return aa};F.matches=function(S,T){return F(S,null,null,T)};F.find=function(Z,S,aa){var Y,W;if(!Z){return[]}for(var V=0,U=H.order.length;V<U;V++){var X=H.order[V],W;if((W=H.match[X].exec(Z))){var T=RegExp.leftContext;if(T.substr(T.length-1)!=="\\"){W[1]=(W[1]||"").replace(/\\/g,"");Y=H.find[X](W,S,aa);if(Y!=null){Z=Z.replace(H.match[X],"");break}}}}if(!Y){Y=S.getElementsByTagName("*")}return{set:Y,expr:Z}};F.filter=function(ab,aa,ae,V){var U=ab,ag=[],Y=aa,X,S;while(ab&&aa.length){for(var Z in H.filter){if((X=H.match[Z].exec(ab))!=null){var T=H.filter[Z],af,ad;S=false;if(Y==ag){ag=[]}if(H.preFilter[Z]){X=H.preFilter[Z](X,Y,ae,ag,V);if(!X){S=af=true}else{if(X===true){continue}}}if(X){for(var W=0;(ad=Y[W])!=null;W++){if(ad){af=T(ad,X,W,Y);var ac=V^!!af;if(ae&&af!=null){if(ac){S=true}else{Y[W]=false}}else{if(ac){ag.push(ad);S=true}}}}}if(af!==g){if(!ae){Y=ag}ab=ab.replace(H.match[Z],"");if(!S){return[]}break}}}ab=ab.replace(/\s*,\s*/,"");if(ab==U){if(S==null){throw"Syntax error, unrecognized expression: "+ab}else{break}}U=ab}return Y};var H=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(S){return S.getAttribute("href")}},relative:{"+":function(W,T){for(var U=0,S=W.length;U<S;U++){var V=W[U];if(V){var X=V.previousSibling;while(X&&X.nodeType!==1){X=X.previousSibling}W[U]=typeof T==="string"?X||false:X===T}}if(typeof T==="string"){F.filter(T,W,true)}},">":function(X,T,Y){if(typeof T==="string"&&!/\W/.test(T)){T=Y?T:T.toUpperCase();for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){var V=W.parentNode;X[U]=V.nodeName===T?V:false}}}else{for(var U=0,S=X.length;U<S;U++){var W=X[U];if(W){X[U]=typeof T==="string"?W.parentNode:W.parentNode===T}}if(typeof T==="string"){F.filter(T,X,true)}}},"":function(V,T,X){var U="done"+(K++),S=R;if(!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("parentNode",T,U,V,W,X)},"~":function(V,T,X){var U="done"+(K++),S=R;if(typeof T==="string"&&!T.match(/\W/)){var W=T=X?T:T.toUpperCase();S=O}S("previousSibling",T,U,V,W,X)}},find:{ID:function(T,U,V){if(typeof U.getElementById!=="undefined"&&!V){var S=U.getElementById(T[1]);return S?[S]:[]}},NAME:function(S,T,U){if(typeof T.getElementsByName!=="undefined"&&!U){return T.getElementsByName(S[1])}},TAG:function(S,T){return T.getElementsByTagName(S[1])}},preFilter:{CLASS:function(V,T,U,S,Y){V=" "+V[1].replace(/\\/g,"")+" ";var X;for(var W=0;(X=T[W])!=null;W++){if(X){if(Y^(" "+X.className+" ").indexOf(V)>=0){if(!U){S.push(X)}}else{if(U){T[W]=false}}}}return false},ID:function(S){return S[1].replace(/\\/g,"")},TAG:function(T,S){for(var U=0;S[U]===false;U++){}return S[U]&&P(S[U])?T[1]:T[1].toUpperCase()},CHILD:function(S){if(S[1]=="nth"){var T=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(S[2]=="even"&&"2n"||S[2]=="odd"&&"2n+1"||!/\D/.test(S[2])&&"0n+"+S[2]||S[2]);S[2]=(T[1]+(T[2]||1))-0;S[3]=T[3]-0}S[0]="done"+(K++);return S},ATTR:function(T){var S=T[1].replace(/\\/g,"");if(H.attrMap[S]){T[1]=H.attrMap[S]}if(T[2]==="~="){T[4]=" "+T[4]+" "}return T},PSEUDO:function(W,T,U,S,X){if(W[1]==="not"){if(W[3].match(Q).length>1){W[3]=F(W[3],null,null,T)}else{var V=F.filter(W[3],T,U,true^X);if(!U){S.push.apply(S,V)}return false}}else{if(H.match.POS.test(W[0])){return true}}return W},POS:function(S){S.unshift(true);return S}},filters:{enabled:function(S){return S.disabled===false&&S.type!=="hidden"},disabled:function(S){return S.disabled===true},checked:function(S){return S.checked===true},selected:function(S){S.parentNode.selectedIndex;return S.selected===true},parent:function(S){return !!S.firstChild},empty:function(S){return !S.firstChild},has:function(U,T,S){return !!F(S[3],U).length},header:function(S){return/h\d/i.test(S.nodeName)},text:function(S){return"text"===S.type},radio:function(S){return"radio"===S.type},checkbox:function(S){return"checkbox"===S.type},file:function(S){return"file"===S.type},password:function(S){return"password"===S.type},submit:function(S){return"submit"===S.type},image:function(S){return"image"===S.type},reset:function(S){return"reset"===S.type},button:function(S){return"button"===S.type||S.nodeName.toUpperCase()==="BUTTON"},input:function(S){return/input|select|textarea|button/i.test(S.nodeName)}},setFilters:{first:function(T,S){return S===0},last:function(U,T,S,V){return T===V.length-1},even:function(T,S){return S%2===0},odd:function(T,S){return S%2===1},lt:function(U,T,S){return T<S[3]-0},gt:function(U,T,S){return T>S[3]-0},nth:function(U,T,S){return S[3]-0==T},eq:function(U,T,S){return S[3]-0==T}},filter:{CHILD:function(S,V){var Y=V[1],Z=S.parentNode;var X=V[0];if(Z&&(!Z[X]||!S.nodeIndex)){var W=1;for(var T=Z.firstChild;T;T=T.nextSibling){if(T.nodeType==1){T.nodeIndex=W++}}Z[X]=W-1}if(Y=="first"){return S.nodeIndex==1}else{if(Y=="last"){return S.nodeIndex==Z[X]}else{if(Y=="only"){return Z[X]==1}else{if(Y=="nth"){var ab=false,U=V[2],aa=V[3];if(U==1&&aa==0){return true}if(U==0){if(S.nodeIndex==aa){ab=true}}else{if((S.nodeIndex-aa)%U==0&&(S.nodeIndex-aa)/U>=0){ab=true}}return ab}}}}},PSEUDO:function(Y,U,V,Z){var T=U[1],W=H.filters[T];if(W){return W(Y,V,U,Z)}else{if(T==="contains"){return(Y.textContent||Y.innerText||"").indexOf(U[3])>=0}else{if(T==="not"){var X=U[3];for(var V=0,S=X.length;V<S;V++){if(X[V]===Y){return false}}return true}}}},ID:function(T,S){return T.nodeType===1&&T.getAttribute("id")===S},TAG:function(T,S){return(S==="*"&&T.nodeType===1)||T.nodeName===S},CLASS:function(T,S){return S.test(T.className)},ATTR:function(W,U){var S=H.attrHandle[U[1]]?H.attrHandle[U[1]](W):W[U[1]]||W.getAttribute(U[1]),X=S+"",V=U[2],T=U[4];return S==null?V==="!=":V==="="?X===T:V==="*="?X.indexOf(T)>=0:V==="~="?(" "+X+" ").indexOf(T)>=0:!U[4]?S:V==="!="?X!=T:V==="^="?X.indexOf(T)===0:V==="$="?X.substr(X.length-T.length)===T:V==="|="?X===T||X.substr(0,T.length+1)===T+"-":false},POS:function(W,T,U,X){var S=T[2],V=H.setFilters[S];if(V){return V(W,U,T,X)}}}};var L=H.match.POS;for(var N in H.match){H.match[N]=RegExp(H.match[N].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(T,S){T=Array.prototype.slice.call(T);if(S){S.push.apply(S,T);return S}return T};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(M){E=function(W,V){var T=V||[];if(G.call(W)==="[object Array]"){Array.prototype.push.apply(T,W)}else{if(typeof W.length==="number"){for(var U=0,S=W.length;U<S;U++){T.push(W[U])}}else{for(var U=0;W[U];U++){T.push(W[U])}}}return T}}(function(){var T=document.createElement("form"),U="script"+(new Date).getTime();T.innerHTML="<input name='"+U+"'/>";var S=document.documentElement;S.insertBefore(T,S.firstChild);if(!!document.getElementById(U)){H.find.ID=function(W,X,Y){if(typeof X.getElementById!=="undefined"&&!Y){var V=X.getElementById(W[1]);return V?V.id===W[1]||typeof V.getAttributeNode!=="undefined"&&V.getAttributeNode("id").nodeValue===W[1]?[V]:g:[]}};H.filter.ID=function(X,V){var W=typeof X.getAttributeNode!=="undefined"&&X.getAttributeNode("id");return X.nodeType===1&&W&&W.nodeValue===V}}S.removeChild(T)})();(function(){var S=document.createElement("div");S.appendChild(document.createComment(""));if(S.getElementsByTagName("*").length>0){H.find.TAG=function(T,X){var W=X.getElementsByTagName(T[1]);if(T[1]==="*"){var V=[];for(var U=0;W[U];U++){if(W[U].nodeType===1){V.push(W[U])}}W=V}return W}}S.innerHTML="<a href='#'></a>";if(S.firstChild&&S.firstChild.getAttribute("href")!=="#"){H.attrHandle.href=function(T){return T.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var S=F,T=document.createElement("div");T.innerHTML="<p class='TEST'></p>";if(T.querySelectorAll&&T.querySelectorAll(".TEST").length===0){return}F=function(X,W,U,V){W=W||document;if(!V&&W.nodeType===9&&!P(W)){try{return E(W.querySelectorAll(X),U)}catch(Y){}}return S(X,W,U,V)};F.find=S.find;F.filter=S.filter;F.selectors=S.selectors;F.matches=S.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){H.order.splice(1,0,"CLASS");H.find.CLASS=function(S,T){return T.getElementsByClassName(S[1])}}function O(T,Z,Y,ac,aa,ab){for(var W=0,U=ac.length;W<U;W++){var S=ac[W];if(S){S=S[T];var X=false;while(S&&S.nodeType){var V=S[Y];if(V){X=ac[V];break}if(S.nodeType===1&&!ab){S[Y]=W}if(S.nodeName===Z){X=S;break}S=S[T]}ac[W]=X}}}function R(T,Y,X,ab,Z,aa){for(var V=0,U=ab.length;V<U;V++){var S=ab[V];if(S){S=S[T];var W=false;while(S&&S.nodeType){if(S[X]){W=ab[S[X]];break}if(S.nodeType===1){if(!aa){S[X]=V}if(typeof Y!=="string"){if(S===Y){W=true;break}}else{if(F.filter(Y,[S]).length>0){W=S;break}}}S=S[T]}ab[V]=W}}}var J=document.compareDocumentPosition?function(T,S){return T.compareDocumentPosition(S)&16}:function(T,S){return T!==S&&(T.contains?T.contains(S):true)};var P=function(S){return S.nodeType===9&&S.documentElement.nodeName!=="HTML"||!!S.ownerDocument&&P(S.ownerDocument)};var I=function(S,Z){var V=[],W="",X,U=Z.nodeType?[Z]:Z;while((X=H.match.PSEUDO.exec(S))){W+=X[0];S=S.replace(H.match.PSEUDO,"")}S=H.relative[S]?S+"*":S;for(var Y=0,T=U.length;Y<T;Y++){F(S,U[Y],V)}return F.filter(W,V)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(S){return"hidden"===S.type||o.css(S,"display")==="none"||o.css(S,"visibility")==="hidden"};F.selectors.filters.visible=function(S){return"hidden"!==S.type&&o.css(S,"display")!=="none"&&o.css(S,"visibility")!=="hidden"};F.selectors.filters.animated=function(S){return o.grep(o.timers,function(T){return S===T.elem}).length};o.multiFilter=function(U,S,T){if(T){U=":not("+U+")"}return F.matches(U,S)};o.dir=function(U,T){var S=[],V=U[T];while(V&&V!=document){if(V.nodeType==1){S.push(V)}V=V[T]}return S};o.nth=function(W,S,U,V){S=S||1;var T=0;for(;W;W=W[U]){if(W.nodeType==1&&++T==S){break}}return W};o.sibling=function(U,T){var S=[];for(;U;U=U.nextSibling){if(U.nodeType==1&&U!=T){S.push(U)}}return S};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){G=false}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&typeof l.frameElement==="undefined"){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width="1px";L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L)})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}this[H].style.display=o.data(this[H],"olddisplay",K)}}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)==1){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n)}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(H,F){var E=H?"Left":"Top",G=H?"Right":"Bottom";o.fn["inner"+F]=function(){return this[F.toLowerCase()]()+j(this,"padding"+E)+j(this,"padding"+G)};o.fn["outer"+F]=function(J){return this["inner"+F]()+j(this,"border"+E+"Width")+j(this,"border"+G+"Width")+(J?j(this,"margin"+E)+j(this,"margin"+G):0)};var I=F.toLowerCase();o.fn[I]=function(J){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+F]||document.body["client"+F]:this[0]==document?Math.max(document.documentElement["client"+F],document.body["scroll"+F],document.documentElement["scroll"+F],document.body["offset"+F],document.documentElement["offset"+F]):J===g?(this.length?o.css(this[0],I):null):this.css(I,typeof J==="string"?J:J+"px")}})})(); \ No newline at end of file diff --git a/clinicaltrials/templates/500.html b/clinicaltrials/templates/500.html index 1bc5878..f01d319 100644 --- a/clinicaltrials/templates/500.html +++ b/clinicaltrials/templates/500.html @@ -1,10 +1,10 @@ {% extends "base.html" %} {% load i18n %} {% block body %} <h2>{% trans "Internal Server Error (500)" %}</h2> -<p>{% trans "The server encountered an unexpected condition which prevented it from fulfilling the request. %}</p> +<p>{% trans "The server encountered an unexpected condition which prevented it from fulfilling the request." %}</p> {% endblock %} diff --git a/clinicaltrials/templates/base.html b/clinicaltrials/templates/base.html index 038e840..c761beb 100644 --- a/clinicaltrials/templates/base.html +++ b/clinicaltrials/templates/base.html @@ -1,114 +1,116 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> {% load i18n %} <head> <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"/> <title>{% block page_title %}{% trans "Clinical Trials Platform" %}{% endblock %}</title> <link rel="shortcut icon" href="/static/favicon.ico"/> - + <link rel="stylesheet" type="text/css" href="/static/css/asmselect/jquery.asmselect.css"/> <link rel="stylesheet" type="text/css" href="/static/css/style.css"/> - - <script type="text/javascript" src="/static/js/jquery-1.3.1.min.js" type="text/javascript"></script> - <script type="text/javascript" src="/static/js/jquery.ui.js" type="text/javascript"></script> + <!-- fetch JS libraries from Google --> + <script type="text/javascript" type="text/javascript" + src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" /> + <script type="text/javascript" type="text/javascript" + src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js" /> <script type="text/javascript" src="/static/js/asmselect/jquery.asmselect.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/submission.utils.js"></script> </head> <body> <div id="container"> <div class="barra_MSaude"> <div class="barra1000"> <div class="minSaude"> <a href="http://www.saude.gov.br" title="Ministério da Saúde" target="_blank"> <span>{% trans 'Ministério da Saúde'%}</span> </a> </div> <div class="form"> <form method="post" action="/" id="govform" name="govform"> <select name="opcoes" class="pr"> <option>{% trans 'Destaques do governo' %}</option> <option value="http://www.brasil.gov.br">{% trans 'Portal do Governo Federal' %}</option> <option value="http://www.e.gov.br">{% trans 'Portal de Serviços do Governo' %}</option> <option value="http://www.radiobras.gov.br">{% trans 'Portal da Agência de Notícias' %}</option> <option value="http://www.previdenciasocial.gov.br">{% trans 'Reforma da Previdência' %}</option> <option value="http://www.fomezero.gov.br">{% trans 'Programa Fome Zero' %}</option> </select> </form> <script type="text/javascript">$('form#govform select option[value]').click(function(){window.open(this.value);});</script> </div> <div class="brasilGov"> <a href="http://www.brasil.gov.br" title="Governo Federal" target="_blank"> <span>{% trans 'Governo Federal' %}</span> </a> </div> </div> </div> <div id="top"> <div id="banner"> - <div class="logo"> + <div class="logo"> <h1> <!--a href="{% url reviewapp.home %}"><span>{% block headline %}{% trans "RBEC" %}{% endblock %}</span></a--> <a href="{% url reviewapp.home %}"><img alt="Registro Brasileiro de Ensaios Clínicos" src="/static/title.gif" border="none"/></a> </h1> </div> <div class="institutions"> <ul> <li class="BIREME"><a href="http://regional.bvsalud.org/php/index.php?lang=pt" title="Centro Latino-Americano e do Caribe de Informação em Ciências da Saúde" target="_blank"><span>BIREME</span></a></li> <li class="FIOCRUZ"><a href="http://www.fiocruz.br/cgi/cgilua.exe/sys/start.htm?tpl=home" title="Fundação Oswaldo Cruz" target="_blank"><span>FioCruz</span></a></li> </ul> </div> </div> </div> <div id="middle"> <div id="columns"> <div id="workarea"> {% block stepmenu_top %}{% endblock %} <div id="content"> {% block body %}{% endblock %} </div> {% block stepmenu_bottom %}{% endblock %} </div> <div id="rebracmenu"> <h2>{% trans "Options menu" %}</h2> <div id="usermenu"> {% if username %} <div> <span>{{username}}</span><br/> <a href="/accounts/logout">log out</a> </div> <ul> <li>Profile</li> <li>Dashboard</li> <li><a href="{% url reviewapp.userhome %}">{% trans 'Submissions' %}</a></li> <li>Issues</li> </ul> {% else %} <div><a href="/accounts/login" title="{% trans 'access with an existing account' %}">[{% trans 'login' %}]</a> <br />&nbsp;<br /> <a href="/accounts/register" title="{% trans 'create an account to submit trial records' %}">[{% trans 'register' %}]</a> </div> {% endif %} </div> <ul> <li>{% trans "News" %}</li> <li>{% trans "About" %}</li> <li>{% trans "Help" %}</li> </ul> </div> </div> </div> <div id="footer"> <p> <strong> BIREME - OPAS - OMS </strong><br/> Centro Latino-Americano e do Caribe de Informação em Ciências da Saúde <br/> Rua Botucatu, 862 - 04023-901 - São Paulo/SP - Brasil - Tel: (55 11) 5576-9800 - Fax: (55 11) 5575-8868 <br/> </p> </div> </div> </body> </html> diff --git a/clinicaltrials/urls.py b/clinicaltrials/urls.py index fa592b7..c838e27 100644 --- a/clinicaltrials/urls.py +++ b/clinicaltrials/urls.py @@ -1,49 +1,48 @@ from django.conf.urls.defaults import * import utilities from django.contrib import admin # Django admin UI admin.autodiscover() # Django admin UI urlpatterns = patterns('', # Repository application url(r'^rg/', include('clinicaltrials.repository.urls')), # Tickets application url(r'^ticket/', include('clinicaltrials.tickets.urls')), # Assistance application url(r'^assistance/', include('clinicaltrials.assistance.urls')), # Review application url(r'^', include('clinicaltrials.reviewapp.urls')), # Django admin UI and documentation url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), - # Diagnostic views - url(r'^dbg/smoke/', utilities.smoke_test), - url(r'^dbg/reqdump/', utilities.req_dump), - url(r'^dbg/sysinfo/', utilities.sys_info), - url(r'^decs/', include('clinicaltrials.decsclient.urls')), # django-registration views url(r'^accounts/', include('registration.backends.default.urls')), + # system diagnostic views (may be disabled in production) + url(r'^diag/', include('clinicaltrials.diagnostic.urls')), + + ) from django.conf import settings if settings.DEBUG: # serve static files from develpment server from django.views import static urlpatterns += patterns('', url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += patterns('', url(r'^rosetta/', include('rosetta.urls')), ) diff --git a/clinicaltrials/utilities.py b/clinicaltrials/utilities.py index 6df6df9..e405f1d 100644 --- a/clinicaltrials/utilities.py +++ b/clinicaltrials/utilities.py @@ -1,99 +1,56 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from django.http import HttpResponse -from django.contrib.auth.decorators import user_passes_test - -def smoke_test(request): - from datetime import datetime - return HttpResponse(datetime.now().strftime('%H:%M:%S')) - -@user_passes_test(lambda u: u.is_staff) -def req_dump(request): - template = ''' - <form action="./" method="POST"> - <input type="text" name="word" value="mitochondrial"> - <input type="submit" name="btn1" value="one"> - <input type="submit" name="btn2" value="two"> - </form> - <table border="1"> - <tr><th>key</th><th>POST[key]</th></tr> - %s - </table> - ''' - rows = [] - for k in request.POST.keys(): - rows.append('<tr><th>%s</th><td>%s</td></tr>' % (k, request.POST[k])) - return HttpResponse(template % ('\n'.join(rows))) - -@user_passes_test(lambda u: u.is_staff) -def sys_info(request): - template = ''' - <h1>settings path</h1> - <pre>%(settingspath)s</pre> - <h1>svn info</h1> - <pre>%(svninfo)s</pre> - <h1>sys.path</h1> - <pre>%(syspath)s</pre> - ''' - import sys - import settings - from subprocess import Popen, PIPE - svnout, svnerr = Popen(['svn', 'info', settings.PROJECT_PATH], stdout=PIPE).communicate() - return HttpResponse(template % {'settingspath': settings.PROJECT_PATH, - 'syspath':'\n'.join(sys.path), - 'svninfo':svnout or svnerr}) - ELLIPSIS = u'\u2026' def safe_truncate(text, max_length=60, ellipsis=ELLIPSIS, encoding='utf-8', raise_exc=False): u'''truncate a string without breaking words >>> safe_truncate(u'the time has come', 9, u'>') u'the time>' >>> safe_truncate(u'the-time-has-come', 9, u'>') u'the-time>' >>> safe_truncate(u'the time', 8) u'the time' >>> safe_truncate(u'the time', 9) u'the time' >>> s = u'uncharacteristically-long' >>> safe_truncate(s, 10, u'>') u'uncharacteristically>' >>> safe_truncate(s, 10, u'>', raise_exc=True) Traceback (most recent call last): ... ValueError: Cannot safely truncate to 10 characters ''' if not isinstance(text, unicode): text = text.decode(encoding) if len(text) <= max_length: return text # reverse-seek a non-alphanumeric character for i, c in enumerate(reversed(text[:max_length])): if not c.isalnum(): pos = max_length - i - 1 break else: pos = -1 if pos == -1: if raise_exc: msg = 'Cannot safely truncate to %s characters' raise ValueError(msg % max_length) else: # seek nearest non-alphanumeric character after the cuttoff point pos = len(text) for i, c in enumerate(text[max_length:]): if not c.isalnum(): pos = max_length + i break if pos == len(text): return text return text[:pos] + ellipsis if __name__=='__main__': import doctest doctest.testmod() \ No newline at end of file
ensaiosclinicos/clinicaltrials
6ecf2dfd665ca56dfda56573000c69f231a6bd5d
prepare reviwe app view for django signal
diff --git a/clinicaltrials/load.py b/clinicaltrials/load.py deleted file mode 100644 index 89c50e8..0000000 --- a/clinicaltrials/load.py +++ /dev/null @@ -1,139 +0,0 @@ -import re -from lxml.etree import ElementTree - -from django.core.management import setup_environ -import settings -setup_environ(settings) - -from vocabulary.models import CountryCode, StudyType, StudyPurpose, StudyMasking -from vocabulary.models import InterventionAssigment, StudyAllocation, StudyPhase -from vocabulary.models import RecruitmentStatus - -from repository.models import ClinicalTrial, Institution, TrialSecondarySponsor -from repository.models import TrialSupportSource, Contact, SiteContact, PublicContact -from repository.models import ScientificContact, InterventionCode - -clinical_trial_xpath = { - 'trial_id':'', - 'date_registration':'', - 'scientific_title':'trial_identification/scientific_title', - 'scientific_acronym':'trial_identification/scientific_acronym', - 'public_title':'trial_identification/public_title', - 'acronym':'trial_identification/acronym', - 'hc_freetext':'health_conditions/freetext', - 'i_freetext':'interventions/freetext', - 'inclusion_criteria':'recruitment/inclusion_criteria', - 'gender':'recruitment/gender/@value', - 'agemin_value':'recruitment/agemin', - 'agemin_unit':'recruitment/agemin/@unit', - 'agemax_value':'recruitment/agemax', - 'agemax_unit':'recruitment/agemax/@unit', - 'exclusion_criteria':'recruitment/exclusion_criteria', - 'study_design':'study_type/study_design', - 'expanded_access_program':'study_type/study_design/@expanded_access_program', - 'number_of_arms':'study_type/study_design/@number_of_arms', - 'date_enrollment_anticipated':'recruitment/date_enrolment_anticipated', - 'date_enrollment_actual':'recruitment/date_enrolment_actual', - 'target_sample_size':'recruitment/target_size', - 'created':'', - 'updated':'', - 'exported':'', - 'status':'', - 'staff_note':'' -} - -contact_types_map = { - 'public_contact':PublicContact, - 'scientific_contact':ScientificContact, - 'site_contact':SiteContact -} - -study_design_map = { - 'allocation': StudyAllocation, - 'intervention_assignment':InterventionAssigment, - 'masking': StudyMasking, - 'purpose': StudyPurpose -} - -xml = open('repository/xml/sample_1b.xml') -tree = ElementTree() -root = tree.parse(xml) - -ct = ClinicalTrial() -ct.save() - -# Non-relational Fields from Clinical Trial -for field,xpath in clinical_trial_xpath.items(): - if xpath != '': - resultEl = root.xpath(xpath) - if len(resultEl) > 0: - if hasattr(resultEl[0],'text'): - setattr(ct, field, resultEl[0].text) - else: - setattr(ct, field, resultEl[0]) - -# Add Sponsors -for sponsorNode in root.xpath('sponsors_and_support/*'): - sponsor = Institution() - sponsor.name = sponsorNode.find('name').text - sponsor.address = sponsorNode.find('address').text - sponsor.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) - sponsor.save() - if sponsorNode.tag == 'primary_sponsor': - ct.primary_sponsor = sponsor - elif sponsorNode.tag == 'secondary_sponsor': - TrialSecondarySponsor.objects.create(trial=ct,institution=sponsor) - elif sponsorNode.tag == 'source_support': - TrialSupportSource.objects.create(trial=ct,institution=sponsor) - -# Add Contacts -contactList = {} -for personNode in root.xpath('contacts/person'): - contact = Contact() - - for attr in ['firstname','middlename','lastname','email','address','city','zip','telephone']: - value = personNode.find(attr) - if value is not None: - setattr(contact, attr, value.text) - contact.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) - contact.save() - contactList[ personNode.attrib['pid'] ] = contact - -# Assign PublicContact, ScientificContact and SiteContact to the trial -for cType,model in contact_types_map.items(): - for typeNode in root.xpath('contacts/'+cType): - pattern = re.compile('p[0-9]+') - for person in pattern.findall(typeNode.attrib['persons']): - model.objects.create(trial=ct,contact=contactList[person]) - -# Interventions -for icodeNode in root.xpath('interventions/i_code'): - i_code = InterventionCode.objects.get(label=icodeNode.attrib['value']) - if isinstance(i_code,InterventionCode): - ct.i_code.add(i_code) - -# Recruitment Country -for rcountryNode in root.xpath('recruitment/recruitment_country'): - ccode = CountryCode.objects.get(label=rcountryNode.attrib['value']) - if isinstance(ccode,CountryCode): - ct.recruitment_country.add(ccode) - -# StudyType -study_type_node = StudyType.objects.get(label=root.attrib['type']) -if study_type_node is not None: - ct.study_type = study_type_node - -study_design_node = root.find('study_type/study_design') -if study_design_node is not None: - for attr,model in study_design_map.items(): - setattr(ct, attr, model.objects.get(label=study_design_node.attrib[attr])) - -study_phase_node = root.find('study_type/phase') -if study_phase_node is not None: - ct.phase = StudyPhase.objects.get(label=study_phase_node.attrib['value']) - -recruitment_status = RecruitmentStatus.objects.get(label = root.find('recruitment').attrib['study_status']) -if recruitment_status is not None: - ct.status = recruitment_status - -# TODO: Integrate this script with django! \ No newline at end of file diff --git a/clinicaltrials/reviewapp/models.py b/clinicaltrials/reviewapp/models.py index e53c069..b228e27 100644 --- a/clinicaltrials/reviewapp/models.py +++ b/clinicaltrials/reviewapp/models.py @@ -1,93 +1,95 @@ from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext as _ from django.conf import settings from datetime import datetime from repository.models import ClinicalTrial, Institution from vocabulary.models import CountryCode from utilities import safe_truncate SUBMISSION_STATUS = [ ('draft', 'draft'), ('pending', 'pending'), ('published', 'published'), ('rejected', 'rejected'), ] ACCESS = [ ('public', 'Public'), ('private', 'Private'), ] class Submission(models.Model): creator = models.ForeignKey(User, related_name='submission_creator', editable=False) created = models.DateTimeField(default=datetime.now, editable=False) updater = models.ForeignKey(User, null=True, related_name='submission_updater', editable=False) updated = models.DateTimeField(null=True, editable=False) - title = models.CharField(u'Scientific title', max_length=2000) + title = models.TextField(u'Scientific title', max_length=2000) primary_sponsor = models.OneToOneField(Institution, null=True, blank=True, verbose_name=_('Primary Sponsor')) trial = models.OneToOneField(ClinicalTrial, null=True) status = models.CharField(_('Status'), max_length=64, choices=SUBMISSION_STATUS, default=SUBMISSION_STATUS[0][0]) staff_note = models.TextField(_('Submission Note (staff use only)'), max_length=255, blank=True) + submission_xml = models.FileField(upload_to=settings.SUBMISSIONS_XML_PATH, null=True) + def save(self): if self.id: self.updated = datetime.now() super(Submission, self).save() def short_title(self): return safe_truncate(self.title, 120) def creator_username(self): return self.creator.username def __unicode__(self): return u'<%s> %s' % (self.creator_username(), self.short_title()) def get_mandatory_languages(self): langs = set(['en']) langs.add(self.trial.primary_sponsor.country.submission_language) for rc in self.trial.recruitmentcountry_set.all(): langs.add(rc.country.submission_language) return langs.intersection(set(settings.CHECKED_LANGUAGES)) def get_absolute_url(self): # TODO: use reverse to replace absolute path return '/accounts/submission/%s/' % self.id class RecruitmentCountry(models.Model): class Meta: verbose_name_plural = _('Recruitment Countries') submission = models.ForeignKey(Submission) country = models.ForeignKey(CountryCode, verbose_name=_('Country'), related_name='submissionrecruitmentcountry_set') class FrozenForm(models.Model): submission = models.ForeignKey(Submission) form_name = models.CharField(max_length=255) data = models.TextField(max_length=2**16) class Meta: unique_together = ['submission', 'form_name'] class Attachment(models.Model): class Meta: verbose_name_plural = _('Attachments') file = models.FileField(upload_to=settings.ATTACHMENTS_PATH) description = models.TextField(_('Description'), blank=True, max_length=8000) submission = models.ForeignKey(Submission) public = models.BooleanField(_('Public')) diff --git a/clinicaltrials/reviewapp/signals.py b/clinicaltrials/reviewapp/signals.py new file mode 100644 index 0000000..629be8e --- /dev/null +++ b/clinicaltrials/reviewapp/signals.py @@ -0,0 +1,138 @@ +import re +from lxml.etree import ElementTree + +from django.core.management import setup_environ +import settings +setup_environ(settings) + +from vocabulary.models import CountryCode, StudyType, StudyPurpose, StudyMasking +from vocabulary.models import InterventionAssigment, StudyAllocation, StudyPhase +from vocabulary.models import RecruitmentStatus + +from repository.models import ClinicalTrial, Institution, TrialSecondarySponsor +from repository.models import TrialSupportSource, Contact, SiteContact, PublicContact +from repository.models import ScientificContact, InterventionCode + +def post_save_submission(xml_file_path): + clinical_trial_xpath = { + 'trial_id':'', + 'date_registration':'', + 'scientific_title':'trial_identification/scientific_title', + 'scientific_acronym':'trial_identification/scientific_acronym', + 'public_title':'trial_identification/public_title', + 'acronym':'trial_identification/acronym', + 'hc_freetext':'health_conditions/freetext', + 'i_freetext':'interventions/freetext', + 'inclusion_criteria':'recruitment/inclusion_criteria', + 'gender':'recruitment/gender/@value', + 'agemin_value':'recruitment/agemin', + 'agemin_unit':'recruitment/agemin/@unit', + 'agemax_value':'recruitment/agemax', + 'agemax_unit':'recruitment/agemax/@unit', + 'exclusion_criteria':'recruitment/exclusion_criteria', + 'study_design':'study_type/study_design', + 'expanded_access_program':'study_type/study_design/@expanded_access_program', + 'number_of_arms':'study_type/study_design/@number_of_arms', + 'date_enrollment_anticipated':'recruitment/date_enrolment_anticipated', + 'date_enrollment_actual':'recruitment/date_enrolment_actual', + 'target_sample_size':'recruitment/target_size', + 'created':'', + 'updated':'', + 'exported':'', + 'status':'', + 'staff_note':'' + } + + contact_types_map = { + 'public_contact':PublicContact, + 'scientific_contact':ScientificContact, + 'site_contact':SiteContact + } + + study_design_map = { + 'allocation': StudyAllocation, + 'intervention_assignment':InterventionAssigment, + 'masking': StudyMasking, + 'purpose': StudyPurpose + } + + xml = open(xml_file_path) + tree = ElementTree() + root = tree.parse(xml) + + ct = ClinicalTrial() + ct.save() + + # Non-relational Fields from Clinical Trial + for field,xpath in clinical_trial_xpath.items(): + if xpath != '': + resultEl = root.xpath(xpath) + if len(resultEl) > 0: + if hasattr(resultEl[0],'text'): + setattr(ct, field, resultEl[0].text) + else: + setattr(ct, field, resultEl[0]) + + # Add Sponsors + for sponsorNode in root.xpath('sponsors_and_support/*'): + sponsor = Institution() + sponsor.name = sponsorNode.find('name').text + sponsor.address = sponsorNode.find('address').text + sponsor.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) + sponsor.save() + if sponsorNode.tag == 'primary_sponsor': + ct.primary_sponsor = sponsor + elif sponsorNode.tag == 'secondary_sponsor': + TrialSecondarySponsor.objects.create(trial=ct,institution=sponsor) + elif sponsorNode.tag == 'source_support': + TrialSupportSource.objects.create(trial=ct,institution=sponsor) + + # Add Contacts + contactList = {} + for personNode in root.xpath('contacts/person'): + contact = Contact() + + for attr in ['firstname','middlename','lastname','email','address','city','zip','telephone']: + value = personNode.find(attr) + if value is not None: + setattr(contact, attr, value.text) + contact.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) + contact.save() + contactList[ personNode.attrib['pid'] ] = contact + + # Assign PublicContact, ScientificContact and SiteContact to the trial + for cType,model in contact_types_map.items(): + for typeNode in root.xpath('contacts/'+cType): + pattern = re.compile('p[0-9]+') + for person in pattern.findall(typeNode.attrib['persons']): + model.objects.create(trial=ct,contact=contactList[person]) + + # Interventions + for icodeNode in root.xpath('interventions/i_code'): + i_code = InterventionCode.objects.get(label=icodeNode.attrib['value']) + if isinstance(i_code,InterventionCode): + ct.i_code.add(i_code) + + # Recruitment Country + for rcountryNode in root.xpath('recruitment/recruitment_country'): + ccode = CountryCode.objects.get(label=rcountryNode.attrib['value']) + if isinstance(ccode,CountryCode): + ct.recruitment_country.add(ccode) + + # StudyType + study_type_node = StudyType.objects.get(label=root.attrib['type']) + if study_type_node is not None: + ct.study_type = study_type_node + + study_design_node = root.find('study_type/study_design') + if study_design_node is not None: + for attr,model in study_design_map.items(): + setattr(ct, attr, model.objects.get(label=study_design_node.attrib[attr])) + + study_phase_node = root.find('study_type/phase') + if study_phase_node is not None: + ct.phase = StudyPhase.objects.get(label=study_phase_node.attrib['value']) + + recruitment_status = RecruitmentStatus.objects.get(label = root.find('recruitment').attrib['study_status']) + if recruitment_status is not None: + ct.status = recruitment_status diff --git a/clinicaltrials/reviewapp/templates/reviewapp/new_submission.html b/clinicaltrials/reviewapp/templates/reviewapp/new_submission.html index 48a5a2e..59949d9 100644 --- a/clinicaltrials/reviewapp/templates/reviewapp/new_submission.html +++ b/clinicaltrials/reviewapp/templates/reviewapp/new_submission.html @@ -1,53 +1,53 @@ {% extends "base.html" %} {% load i18n %} {% block body %} <script type="text/javascript"> //{# From http://stackoverflow.com/questions/501719/dynamically-adding-a-form-to-a-django-formset-with-ajax#669982 */ #} function cloneMore(selector, type) { var newElement = $(selector).clone(true); var total = $('#id_' + type + '-TOTAL_FORMS').val(); newElement.find(':input').each(function() { var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-'); var id = 'id_' + name; $(this).attr({'name': name, 'id': id}).val('').removeAttr('checked'); }); newElement.find('label').each(function() { var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-'); $(this).attr('for', newFor); }); total++; $('#id_' + type + '-TOTAL_FORMS').val(total); newElement.css("display","none"); $(selector).after(newElement); newElement.show("fast"); } $(document).ready(function() { $("input#addmore").click(function(){ cloneMore('table:last','form'); }); $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: false }); }); </script> -<form method="post" action="/accounts/newsubmission/"> +<form method="post" action="/accounts/newsubmission/" enctype="multipart/form-data"> <h2>{% trans "New Submission" %}</h2> {% for form in forms %} <fieldset> - <legend>{{ form.title }}</legend> + <legend>{{ form.form_title }}</legend> <table id="table_{{ forloop.counter }}"> {{ form.as_table }} </table> </fieldset> {% endfor %} <input name="submit" type="submit" value="{% trans "Submit" %}"/> </form> {% endblock %} \ No newline at end of file diff --git a/clinicaltrials/reviewapp/views.py b/clinicaltrials/reviewapp/views.py index e346519..71baf02 100644 --- a/clinicaltrials/reviewapp/views.py +++ b/clinicaltrials/reviewapp/views.py @@ -1,81 +1,80 @@ # coding: utf-8 from django.core.urlresolvers import reverse from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect from django import forms from django.utils.translation import ugettext as _ from django.contrib.auth.decorators import login_required from django.forms.models import modelformset_factory from reviewapp.models import Submission, Attachment from repository.models import ClinicalTrial, CountryCode, Institution def index(request): username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/index.html', locals()) def user_dump(request): uvars = [{'k':k, 'v':v} for k, v in request.user.__dict__.items()] return render_to_response('reviewapp/user_dump.html', locals()) def submissions_list(request): object_list = Submission.objects.all() username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/submission_list.html', locals()) def submission_detail(request,pk): object = get_object_or_404(Submission, id=int(pk)) username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/submission_detail.html', locals()) ####################################################### New Submission form ### -class InitialTrialForm(forms.ModelForm): - class Meta: - model = ClinicalTrial - fields = ['scientific_title','recruitment_country'] - - title = _('Initial Trial Data') - recruitment_country = forms.ModelMultipleChoiceField( - label=_('Recruitment Country'), - queryset=CountryCode.objects.all()) +class InitialTrialForm(forms.Form): + form_title = _('Initial Trial Data') + scientific_title = forms.CharField(widget=forms.Textarea, label=_('Scientific Title'), max_length=2000) + recruitment_country = forms.MultipleChoiceField(choices=((cc.pk,cc.description) for cc in CountryCode.objects.iterator()) ) + submission_xml = forms.FileField(required=False) class PrimarySponsorForm(forms.ModelForm): class Meta: model = Institution exclude = ['address'] - title = _('Primary Sponsor') + form_title = _('Primary Sponsor') @login_required def new_submission(request): - - AttachmentForm = modelformset_factory(Attachment, extra=1, can_delete=False, - exclude='submission') - AttachmentForm.title = _('Attachments') - if request.method == 'POST': - initial_form = InitialTrialForm(request.POST) + initial_form = InitialTrialForm(request.POST,request.FILES) sponsor_form = PrimarySponsorForm(request.POST) if initial_form.is_valid() and sponsor_form.is_valid(): - initial_form.instance.primary_sponsor = sponsor_form.save() - trial = initial_form.save() + trial = ClinicalTrial() + su = Submission(creator=request.user) + + trial.scientific_title = su.title = initial_form.cleaned_data['scientific_title'] + + trial.save() + su.save() + + trial.primary_sponsor = su.primary_sponsor = sponsor_form.save() + trial.recruitment_country = [CountryCode.objects.get(pk=id) for id in initial_form.cleaned_data['recruitment_country']] + su.trial = trial + if initial_form.cleaned_data['submission_xml'] is not None: + su.submission_xml = initial_form.cleaned_data['submission_xml'] - submission = Submission(creator=request.user, - trial=trial, - primary_sponsor=trial.primary_sponsor, - title=trial.scientific_title) - submission.save() + trial.save() + su.save() return HttpResponseRedirect(reverse('repository.edittrial',args=[trial.id])) else: initial_form = InitialTrialForm() sponsor_form = PrimarySponsorForm() forms = [initial_form, sponsor_form] return render_to_response('reviewapp/new_submission.html', { 'forms': forms, 'username':request.user.username, }) diff --git a/clinicaltrials/settings.py b/clinicaltrials/settings.py index c88058c..25115f3 100644 --- a/clinicaltrials/settings.py +++ b/clinicaltrials/settings.py @@ -1,140 +1,141 @@ # -*- encoding: utf-8 -*- # Django settings for clinicaltrials project. import os from django.utils.translation import ugettext_lazy as _ DEBUG = False TEMPLATE_DEBUG = DEBUG PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) ADMINS = ( ('Luciano Ramalho', '[email protected]'), ('Fabio Montefuscolo', '[email protected]'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'America/Brasilia' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'pt-BR' SITE_ID = 2 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/static/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = '*06=j&&^n71^a&%%3rs%7lla+^(n^v1w@@dp_rxvi#&(xo7meq' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', # 'django.template.loaders.eggs.load_template_source', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'middleware.scriptprefix.ScriptPrefixMiddleware', ) ROOT_URLCONF = 'clinicaltrials.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(PROJECT_PATH, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'repository', 'vocabulary', 'reviewapp', 'tickets', 'assistance', 'decsclient', 'polyglot', 'rosetta', 'registration', # django-registration package ) ################################################################# ### BEGIN Clinical Trials Repository customization settings # see also settings_local-SAMPLE.py for private customization settings. SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos' SEND_BROKEN_LINK_EMAILS = True DECS_SERVICE = 'http://decs.bvs.br/cgi-bin/mx/cgi=@vmx/decs' # Notes: # 1) language codes should follow the IANA standard for language subtags # source: http://www.iana.org/assignments/language-subtag-repository # 2) the first managed language is considered the default and is # also the source language for content translation purposes MANAGED_LANGUAGES = ( ('en',u'English'), ('es',u'Español'), #('fr',_('Français')), ('pt',u'Português'), ) TARGET_LANGUAGES = MANAGED_LANGUAGES[1:] # exlude source language CHECKED_LANGUAGES = [code for code, label in MANAGED_LANGUAGES] # django-registration: for how long the activation link is valid ACCOUNT_ACTIVATION_DAYS = 7 # django-registration: set to False to suspend new user registrations REGISTRATION_OPEN = True ATTACHMENTS_PATH = os.path.join(MEDIA_ROOT, 'attachments') +SUBMISSIONS_XML_PATH = os.path.join(MEDIA_ROOT, 'submissions_xml') FIXTURE_DIRS = ('fixtures',) ### END Clinical Trials Repository customization settings ################################################################# # Deployment settings: there *must* be an unversioned settings_local.py # file in the current directory. See sample file at settings_local-SAMPLE.py execfile(os.path.join(PROJECT_PATH,'settings_local.py')) diff --git a/clinicaltrials/static/help.png b/clinicaltrials/static/help.png new file mode 100644 index 0000000..19928fd Binary files /dev/null and b/clinicaltrials/static/help.png differ
ensaiosclinicos/clinicaltrials
39d339009e8fb7823f1b903472791da2341d3faa
refactored application path to make it easier to edit
diff --git a/clinicaltrials/apache/app/production.wsgi b/clinicaltrials/apache/app/production.wsgi index 3fa5287..b05f9fc 100644 --- a/clinicaltrials/apache/app/production.wsgi +++ b/clinicaltrials/apache/app/production.wsgi @@ -1,9 +1,12 @@ +INSTALL_BASE = '/home/aplicacoes-bvs/ensaiosclinicos' + +PROJECT_NAME = 'clinicaltrials' import os, sys -sys.path.append('/home/aplicacoes-bvs/ensaiosclinicos/clinicaltrials') -sys.path.append('/home/aplicacoes-bvs/ensaiosclinicos') -os.environ['DJANGO_SETTINGS_MODULE'] = 'clinicaltrials.settings' +sys.path.append(os.path.join(INSTALL_BASE,PROJECT_NAME)) +sys.path.append(INSTALL_BASE) +os.environ['DJANGO_SETTINGS_MODULE'] = PROJECT_NAME+'.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
ensaiosclinicos/clinicaltrials
14422b58ddd1685bc8938aa7a1845e741a518d9e
fixed installation paths in httpd.conf file
diff --git a/clinicaltrials/apache/httpd.conf b/clinicaltrials/apache/httpd.conf index 0bcbbac..ab43a2f 100644 --- a/clinicaltrials/apache/httpd.conf +++ b/clinicaltrials/apache/httpd.conf @@ -1,30 +1,30 @@ <VirtualHost 172.17.1.5X:80> - ServerName rebrac.XXX.bvsalud.org + ServerName ec.XXX.bvsalud.org SetEnv PYTHON_EGG_CACHE /tmp - <Directory /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/static/> + <Directory /home/aplicacoes-bvs/ensaiosclinicos/clinicaltrials/static/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> - Alias /static/ /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/static/ + Alias /static/ /home/aplicacoes-bvs/ensaiosclinicos/clinicaltrials/static/ - <Directory /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/> + <Directory /home/aplicacoes-bvs/ensaiosclinicos/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> - Alias /media/ /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/ + Alias /media/ /home/aplicacoes-bvs/ensaiosclinicos/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/ - WSGIScriptAlias / /home/aplicacoes-bvs/rebrac-alfa/apache/apache.wsgi + WSGIScriptAlias / /home/aplicacoes-bvs/ensaiosclinicos/clinicaltrials/apache/app/production.wsgi <Directory /home/aplicacoes-bvs/rebrac-alfa/apache> Order deny,allow Allow from all </Directory> - WSGIDaemonProcess clinicaltrials user=apache group=apache processes=1 threads=10 python-path=/home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/django-env/lib/python2.6/site-packages + WSGIDaemonProcess clinicaltrials user=apache group=apache processes=1 threads=10 python-path=/home/aplicacoes-bvs/ensaiosclinicos/django-env/lib/python2.6/site-packages WSGIProcessGroup clinicaltrials DirectoryIndex index.htm index.php homepage.htm index.html default.htm default.html </VirtualHost>
ensaiosclinicos/clinicaltrials
a36bac5472eabea1a71221f84ec2755c7f3dc3a8
added error templates; refactored e-mail settings
diff --git a/clinicaltrials/settings.py b/clinicaltrials/settings.py index 57bb5bf..c88058c 100644 --- a/clinicaltrials/settings.py +++ b/clinicaltrials/settings.py @@ -1,145 +1,140 @@ # -*- encoding: utf-8 -*- # Django settings for clinicaltrials project. import os from django.utils.translation import ugettext_lazy as _ DEBUG = False TEMPLATE_DEBUG = DEBUG PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) ADMINS = ( ('Luciano Ramalho', '[email protected]'), ('Fabio Montefuscolo', '[email protected]'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'America/Brasilia' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'pt-BR' SITE_ID = 2 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/static/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = '*06=j&&^n71^a&%%3rs%7lla+^(n^v1w@@dp_rxvi#&(xo7meq' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', # 'django.template.loaders.eggs.load_template_source', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'middleware.scriptprefix.ScriptPrefixMiddleware', ) ROOT_URLCONF = 'clinicaltrials.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(PROJECT_PATH, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'repository', 'vocabulary', 'reviewapp', 'tickets', 'assistance', 'decsclient', 'polyglot', 'rosetta', 'registration', # django-registration package ) ################################################################# ### BEGIN Clinical Trials Repository customization settings -SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos' - -EMAIL_HOST = '' -EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers -### if set, used to authenticate with SMTP -# EMAIL_HOST_USER = '' -# EMAIL_HOST_PASSWORD = '' -# EMAIL_USE_TLS = False +# see also settings_local-SAMPLE.py for private customization settings. +SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos' +SEND_BROKEN_LINK_EMAILS = True DECS_SERVICE = 'http://decs.bvs.br/cgi-bin/mx/cgi=@vmx/decs' # Notes: # 1) language codes should follow the IANA standard for language subtags # source: http://www.iana.org/assignments/language-subtag-repository # 2) the first managed language is considered the default and is # also the source language for content translation purposes MANAGED_LANGUAGES = ( ('en',u'English'), ('es',u'Español'), #('fr',_('Français')), ('pt',u'Português'), ) TARGET_LANGUAGES = MANAGED_LANGUAGES[1:] # exlude source language CHECKED_LANGUAGES = [code for code, label in MANAGED_LANGUAGES] # django-registration: for how long the activation link is valid ACCOUNT_ACTIVATION_DAYS = 7 # django-registration: set to False to suspend new user registrations REGISTRATION_OPEN = True ATTACHMENTS_PATH = os.path.join(MEDIA_ROOT, 'attachments') FIXTURE_DIRS = ('fixtures',) ### END Clinical Trials Repository customization settings ################################################################# # Deployment settings: there *must* be an unversioned settings_local.py # file in the current directory. See sample file at settings_local-SAMPLE.py execfile(os.path.join(PROJECT_PATH,'settings_local.py')) diff --git a/clinicaltrials/settings_local-SAMPLE.py b/clinicaltrials/settings_local-SAMPLE.py index 6b44d69..3952718 100644 --- a/clinicaltrials/settings_local-SAMPLE.py +++ b/clinicaltrials/settings_local-SAMPLE.py @@ -1,30 +1,32 @@ DEBUG = True DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'clinicaltrials' # Or path to database file if using sqlite3. DATABASE_USER = 'tester' # Not used with sqlite3. DATABASE_PASSWORD = 'puffpuff' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. SECRET_KEY = 'rmbg(!8sa@&8o9pnnd@*szm+axos_6r$)r48jc2r$^_8+wz)po' +EMAIL_HOST = 'pombo.bireme.br' +EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers +### if set, used to authenticate with SMTP +EMAIL_HOST_USER = '[email protected]' +EMAIL_HOST_PASSWORD = '?????' +EMAIL_USE_TLS = False + +SERVER_EMAIL = EMAIL_HOST_USER + if DEBUG: MIDDLEWARE_CLASSES += ( ## external dependency for debug purposes only # 'debug_middleware.DebugFooter', ) INSTALLED_APPS += ( ## external dependency for generating model ER diagrams # 'graphviz', ) GRAPHVIZ_DOT_CMD = '/usr/bin/dot' - - EMAIL_HOST = '' - EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers - ### if set, used to authenticate with SMTP - # EMAIL_HOST_USER = '' - # EMAIL_HOST_PASSWORD = '' - # EMAIL_USE_TLS = False diff --git a/clinicaltrials/templates/404.html b/clinicaltrials/templates/404.html new file mode 100644 index 0000000..d46d475 --- /dev/null +++ b/clinicaltrials/templates/404.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block body %} + +<h2>{% trans "Page not found (404)" %}</h2> + +{% endblock %} diff --git a/clinicaltrials/templates/500.html b/clinicaltrials/templates/500.html new file mode 100644 index 0000000..1bc5878 --- /dev/null +++ b/clinicaltrials/templates/500.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block body %} + +<h2>{% trans "Internal Server Error (500)" %}</h2> + +<p>{% trans "The server encountered an unexpected condition which prevented it from fulfilling the request. %}</p> + +{% endblock %}
ensaiosclinicos/clinicaltrials
a51b57495e7f54ed89be9d7ca51e56bc7feafab6
user registration fixed; added script prefix middleware to produce full absolute URL for activation
diff --git a/clinicaltrials/apache/httpd-devel.conf b/clinicaltrials/apache/httpd-devel.conf index 8a8301e..c245782 100644 --- a/clinicaltrials/apache/httpd-devel.conf +++ b/clinicaltrials/apache/httpd-devel.conf @@ -1,30 +1,31 @@ <VirtualHost 127.0.1.1:80> - ServerName zhun + ServerName ubuntu SetEnv PYTHON_EGG_CACHE /tmp <Directory /home/luciano/prj/ct/svn/trunk/clinicaltrials/static/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> Alias /static/ /home/luciano/prj/ct/svn/trunk/clinicaltrials/static/ - <Directory /home/luciano/prj/ct/env2.5/lib/python2.5/site-packages/Django-1.1.1-py2.5.egg/django/contrib/admin/media/> + <Directory /home/luciano/prj/ct/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> - Alias /media/ /home/luciano/prj/ct/env2.5/lib/python2.5/site-packages/Django-1.1.1-py2.5.egg/django/contrib/admin/media/ + Alias /media/ /home/luciano/prj/ct/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/ WSGIScriptAlias / /home/luciano/prj/ct/svn/trunk/clinicaltrials/apache/app/devel.wsgi <Directory /home/luciano/prj/ct/svn/trunk/clinicaltrials/apache/app> Order deny,allow Allow from all </Directory> - WSGIDaemonProcess clinicaltrials user=www-data group=www-data processes=1 threads=10 python-path=/home/luciano/prj/ct/env2.5/lib/python2.5/site-packages + + WSGIDaemonProcess clinicaltrials user=www-data group=www-data processes=1 threads=10 python-path=/home/luciano/prj/ct/django-env/lib/python2.6/site-packages WSGIProcessGroup clinicaltrials DirectoryIndex index.htm index.php homepage.htm index.html default.htm default.html </VirtualHost> diff --git a/clinicaltrials/apache/httpd.conf b/clinicaltrials/apache/httpd.conf index ce31a3e..0bcbbac 100644 --- a/clinicaltrials/apache/httpd.conf +++ b/clinicaltrials/apache/httpd.conf @@ -1,33 +1,30 @@ - <VirtualHost 172.17.1.5X:80> - SetEnv PYTHON_EGG_CACHE /tmp - ServerName rebrac.XXX.bvsalud.org + SetEnv PYTHON_EGG_CACHE /tmp <Directory /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/static/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> Alias /static/ /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/static/ <Directory /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> Alias /media/ /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/ WSGIScriptAlias / /home/aplicacoes-bvs/rebrac-alfa/apache/apache.wsgi <Directory /home/aplicacoes-bvs/rebrac-alfa/apache> Order deny,allow Allow from all </Directory> WSGIDaemonProcess clinicaltrials user=apache group=apache processes=1 threads=10 python-path=/home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/django-env/lib/python2.6/site-packages WSGIProcessGroup clinicaltrials DirectoryIndex index.htm index.php homepage.htm index.html default.htm default.html </VirtualHost> - diff --git a/clinicaltrials/middleware/__init__.py b/clinicaltrials/middleware/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/clinicaltrials/middleware/scriptprefix.py b/clinicaltrials/middleware/scriptprefix.py new file mode 100644 index 0000000..29f9623 --- /dev/null +++ b/clinicaltrials/middleware/scriptprefix.py @@ -0,0 +1,19 @@ +from django.core.urlresolvers import set_script_prefix + +class ScriptPrefixMiddleware(object): + """ + Set the script prefix for all requests. + + Essentially this adds the current request host to all calls to + get_absolute_url(). Much more convenient than adding the schema and + domain manually everywhere. + + """ + + def process_request(self, request): + schema = 'http://' + if request.is_secure(): + schema = 'https://' + host = request.get_host() + if host: + set_script_prefix('%s%s' % (schema, host)) diff --git a/clinicaltrials/registration/READ-ME.txt b/clinicaltrials/registration/READ-ME.txt index caebaec..011422c 100644 --- a/clinicaltrials/registration/READ-ME.txt +++ b/clinicaltrials/registration/READ-ME.txt @@ -1,12 +1,14 @@ This is a copy of django-registration changeset d36a38202ee3 [1] [1] http://bitbucket.org/ubernostrum/django-registration/changeset/d36a38202ee3/ It was obtained doing wget on URL [2] on 2010-03-23 [2] http://bitbucket.org/ubernostrum/django-registration/get/tip.zip From the zip above the registration/ subdir was extracted and this readme added. -Previously I tried to do a regular install but successive import errors trying to use the default backend convinced me that the documented installation procedure does not work at this time. (LR) +Previously I tried to do a regular install but successive import errors trying +to use the default backend convinced me that the documented installation +procedure does not work at this time. (LR) diff --git a/clinicaltrials/registration/templates/registration/activation_complete.html b/clinicaltrials/registration/templates/registration/activation_complete.html index e69de29..c70518e 100644 --- a/clinicaltrials/registration/templates/registration/activation_complete.html +++ b/clinicaltrials/registration/templates/registration/activation_complete.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block body %} + +<h2>{% trans "Your account is now activated." %}</h2> + +<p>{% trans "You may now login using your username and password." %} +</p> + +{% endblock %} diff --git a/clinicaltrials/registration/templates/registration/activation_email.txt b/clinicaltrials/registration/templates/registration/activation_email.txt index 26687de..6c48a96 100644 --- a/clinicaltrials/registration/templates/registration/activation_email.txt +++ b/clinicaltrials/registration/templates/registration/activation_email.txt @@ -1,8 +1,18 @@ -Please use the activation key below to activate your account. +Please click on the link below to activate your account. -activation_key = {{activation_key}} +{% url registration_activate activation_key %} + +OR + +You may visit the page at + +XXX + +and copy and paste the activation key below + +{{activation_key}} This key will expire in {{expiration_days}} days. site.name = [{{site.name}}] site.domain = [{{site.domain}}] diff --git a/clinicaltrials/registration/templates/registration/activation_email_subject.txt b/clinicaltrials/registration/templates/registration/activation_email_subject.txt index 2429a43..154e2d3 100644 --- a/clinicaltrials/registration/templates/registration/activation_email_subject.txt +++ b/clinicaltrials/registration/templates/registration/activation_email_subject.txt @@ -1 +1 @@ -Ativação de conta para login em {{site.domain}} \ No newline at end of file +Ativação de login para acesso a {{site.domain}} \ No newline at end of file diff --git a/clinicaltrials/settings.py b/clinicaltrials/settings.py index a33f744..57bb5bf 100644 --- a/clinicaltrials/settings.py +++ b/clinicaltrials/settings.py @@ -1,143 +1,145 @@ # -*- encoding: utf-8 -*- # Django settings for clinicaltrials project. import os from django.utils.translation import ugettext_lazy as _ DEBUG = False TEMPLATE_DEBUG = DEBUG PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) ADMINS = ( ('Luciano Ramalho', '[email protected]'), ('Fabio Montefuscolo', '[email protected]'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'America/Brasilia' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'pt-BR' SITE_ID = 2 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/static/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = '*06=j&&^n71^a&%%3rs%7lla+^(n^v1w@@dp_rxvi#&(xo7meq' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', # 'django.template.loaders.eggs.load_template_source', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'middleware.scriptprefix.ScriptPrefixMiddleware', + ) ROOT_URLCONF = 'clinicaltrials.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(PROJECT_PATH, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'repository', 'vocabulary', 'reviewapp', 'tickets', 'assistance', 'decsclient', 'polyglot', 'rosetta', 'registration', # django-registration package ) ################################################################# ### BEGIN Clinical Trials Repository customization settings SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos' EMAIL_HOST = '' EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers ### if set, used to authenticate with SMTP # EMAIL_HOST_USER = '' # EMAIL_HOST_PASSWORD = '' # EMAIL_USE_TLS = False DECS_SERVICE = 'http://decs.bvs.br/cgi-bin/mx/cgi=@vmx/decs' # Notes: # 1) language codes should follow the IANA standard for language subtags # source: http://www.iana.org/assignments/language-subtag-repository # 2) the first managed language is considered the default and is # also the source language for content translation purposes MANAGED_LANGUAGES = ( ('en',u'English'), ('es',u'Español'), #('fr',_('Français')), ('pt',u'Português'), ) TARGET_LANGUAGES = MANAGED_LANGUAGES[1:] # exlude source language CHECKED_LANGUAGES = [code for code, label in MANAGED_LANGUAGES] # django-registration: for how long the activation link is valid ACCOUNT_ACTIVATION_DAYS = 7 # django-registration: set to False to suspend new user registrations REGISTRATION_OPEN = True ATTACHMENTS_PATH = os.path.join(MEDIA_ROOT, 'attachments') FIXTURE_DIRS = ('fixtures',) ### END Clinical Trials Repository customization settings ################################################################# # Deployment settings: there *must* be an unversioned settings_local.py # file in the current directory. See sample file at settings_local-SAMPLE.py execfile(os.path.join(PROJECT_PATH,'settings_local.py'))
ensaiosclinicos/clinicaltrials
a629c0de576bc22ba27e0e9ad4ea95859d8439a4
revised httpd.conf files and utilities for checking deployment status
diff --git a/clinicaltrials/apache/app/devel.wsgi b/clinicaltrials/apache/app/devel.wsgi index 86108aa..049114f 100644 --- a/clinicaltrials/apache/app/devel.wsgi +++ b/clinicaltrials/apache/app/devel.wsgi @@ -1,9 +1,9 @@ import os, sys -sys.path.append('/home/aplicacoes-bvs/rebrac-alfa/clinicaltrials') -sys.path.append('/home/aplicacoes-bvs/rebrac-alfa') +sys.path.append('/home/luciano/prj/ct/svn/trunk/clinicaltrials') +sys.path.append('/home/luciano/prj/ct/svn/trunk') os.environ['DJANGO_SETTINGS_MODULE'] = 'clinicaltrials.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() diff --git a/clinicaltrials/apache/httpd-devel.conf b/clinicaltrials/apache/httpd-devel.conf index 66971c3..8a8301e 100644 --- a/clinicaltrials/apache/httpd-devel.conf +++ b/clinicaltrials/apache/httpd-devel.conf @@ -1,29 +1,30 @@ -<VirtualHost 127.0.0.1:80> - ServerName localhost +<VirtualHost 127.0.1.1:80> + ServerName zhun + SetEnv PYTHON_EGG_CACHE /tmp - <Directory /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/static/> + <Directory /home/luciano/prj/ct/svn/trunk/clinicaltrials/static/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> - Alias /static/ /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/static/ + Alias /static/ /home/luciano/prj/ct/svn/trunk/clinicaltrials/static/ <Directory /home/luciano/prj/ct/env2.5/lib/python2.5/site-packages/Django-1.1.1-py2.5.egg/django/contrib/admin/media/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> Alias /media/ /home/luciano/prj/ct/env2.5/lib/python2.5/site-packages/Django-1.1.1-py2.5.egg/django/contrib/admin/media/ - WSGIScriptAlias / /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/apache/app/devel.wsgi - <Directory /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/apache/app> + WSGIScriptAlias / /home/luciano/prj/ct/svn/trunk/clinicaltrials/apache/app/devel.wsgi + <Directory /home/luciano/prj/ct/svn/trunk/clinicaltrials/apache/app> Order deny,allow Allow from all </Directory> WSGIDaemonProcess clinicaltrials user=www-data group=www-data processes=1 threads=10 python-path=/home/luciano/prj/ct/env2.5/lib/python2.5/site-packages WSGIProcessGroup clinicaltrials DirectoryIndex index.htm index.php homepage.htm index.html default.htm default.html </VirtualHost> diff --git a/clinicaltrials/apache/httpd.conf b/clinicaltrials/apache/httpd.conf index 7c0453e..ce31a3e 100644 --- a/clinicaltrials/apache/httpd.conf +++ b/clinicaltrials/apache/httpd.conf @@ -1,30 +1,33 @@ + <VirtualHost 172.17.1.5X:80> + SetEnv PYTHON_EGG_CACHE /tmp + ServerName rebrac.XXX.bvsalud.org <Directory /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/static/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> Alias /static/ /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/static/ <Directory /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/> AllowOverride All Options FollowSymLinks MultiViews Order allow,deny Allow from all </Directory> Alias /media/ /home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/django-env/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/contrib/admin/media/ WSGIScriptAlias / /home/aplicacoes-bvs/rebrac-alfa/apache/apache.wsgi <Directory /home/aplicacoes-bvs/rebrac-alfa/apache> Order deny,allow Allow from all </Directory> WSGIDaemonProcess clinicaltrials user=apache group=apache processes=1 threads=10 python-path=/home/aplicacoes-bvs/rebrac-alfa/clinicaltrials/django-env/lib/python2.6/site-packages WSGIProcessGroup clinicaltrials DirectoryIndex index.htm index.php homepage.htm index.html default.htm default.html </VirtualHost> diff --git a/clinicaltrials/urls.py b/clinicaltrials/urls.py index 0789b7e..fa592b7 100644 --- a/clinicaltrials/urls.py +++ b/clinicaltrials/urls.py @@ -1,48 +1,49 @@ from django.conf.urls.defaults import * import utilities from django.contrib import admin # Django admin UI admin.autodiscover() # Django admin UI urlpatterns = patterns('', # Repository application url(r'^rg/', include('clinicaltrials.repository.urls')), # Tickets application url(r'^ticket/', include('clinicaltrials.tickets.urls')), # Assistance application url(r'^assistance/', include('clinicaltrials.assistance.urls')), # Review application url(r'^', include('clinicaltrials.reviewapp.urls')), # Django admin UI and documentation url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), # Diagnostic views - url(r'^smoke/', utilities.smoke_test), - url(r'^req_dump/', utilities.req_dump), + url(r'^dbg/smoke/', utilities.smoke_test), + url(r'^dbg/reqdump/', utilities.req_dump), + url(r'^dbg/sysinfo/', utilities.sys_info), url(r'^decs/', include('clinicaltrials.decsclient.urls')), # django-registration views url(r'^accounts/', include('registration.backends.default.urls')), ) from django.conf import settings if settings.DEBUG: # serve static files from develpment server from django.views import static urlpatterns += patterns('', url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += patterns('', url(r'^rosetta/', include('rosetta.urls')), ) diff --git a/clinicaltrials/utilities.py b/clinicaltrials/utilities.py index 1a94687..6df6df9 100644 --- a/clinicaltrials/utilities.py +++ b/clinicaltrials/utilities.py @@ -1,80 +1,99 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- from django.http import HttpResponse +from django.contrib.auth.decorators import user_passes_test def smoke_test(request): from datetime import datetime return HttpResponse(datetime.now().strftime('%H:%M:%S')) +@user_passes_test(lambda u: u.is_staff) def req_dump(request): template = ''' <form action="./" method="POST"> <input type="text" name="word" value="mitochondrial"> <input type="submit" name="btn1" value="one"> <input type="submit" name="btn2" value="two"> </form> <table border="1"> <tr><th>key</th><th>POST[key]</th></tr> %s </table> ''' rows = [] for k in request.POST.keys(): rows.append('<tr><th>%s</th><td>%s</td></tr>' % (k, request.POST[k])) return HttpResponse(template % ('\n'.join(rows))) +@user_passes_test(lambda u: u.is_staff) +def sys_info(request): + template = ''' + <h1>settings path</h1> + <pre>%(settingspath)s</pre> + <h1>svn info</h1> + <pre>%(svninfo)s</pre> + <h1>sys.path</h1> + <pre>%(syspath)s</pre> + ''' + import sys + import settings + from subprocess import Popen, PIPE + svnout, svnerr = Popen(['svn', 'info', settings.PROJECT_PATH], stdout=PIPE).communicate() + return HttpResponse(template % {'settingspath': settings.PROJECT_PATH, + 'syspath':'\n'.join(sys.path), + 'svninfo':svnout or svnerr}) ELLIPSIS = u'\u2026' def safe_truncate(text, max_length=60, ellipsis=ELLIPSIS, encoding='utf-8', raise_exc=False): u'''truncate a string without breaking words >>> safe_truncate(u'the time has come', 9, u'>') u'the time>' >>> safe_truncate(u'the-time-has-come', 9, u'>') u'the-time>' >>> safe_truncate(u'the time', 8) u'the time' >>> safe_truncate(u'the time', 9) u'the time' >>> s = u'uncharacteristically-long' >>> safe_truncate(s, 10, u'>') u'uncharacteristically>' >>> safe_truncate(s, 10, u'>', raise_exc=True) Traceback (most recent call last): ... ValueError: Cannot safely truncate to 10 characters ''' if not isinstance(text, unicode): text = text.decode(encoding) if len(text) <= max_length: return text # reverse-seek a non-alphanumeric character for i, c in enumerate(reversed(text[:max_length])): if not c.isalnum(): pos = max_length - i - 1 break else: pos = -1 if pos == -1: if raise_exc: msg = 'Cannot safely truncate to %s characters' raise ValueError(msg % max_length) else: # seek nearest non-alphanumeric character after the cuttoff point pos = len(text) for i, c in enumerate(text[max_length:]): if not c.isalnum(): pos = max_length + i break if pos == len(text): return text return text[:pos] + ellipsis if __name__=='__main__': import doctest doctest.testmod() \ No newline at end of file
ensaiosclinicos/clinicaltrials
d5af7d849bdfc10525ae0292e6631196810ea084
starting the help icons
diff --git a/clinicaltrials/repository/templates/repository/attachments.html b/clinicaltrials/repository/templates/repository/attachments.html index 2ea12fa..353a65f 100644 --- a/clinicaltrials/repository/templates/repository/attachments.html +++ b/clinicaltrials/repository/templates/repository/attachments.html @@ -1,79 +1,85 @@ {% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript"> function cloneMore(selector, type) { var newElement = $(selector).clone(true); var total = $('#id_' + type + '-TOTAL_FORMS').val(); newElement.find(':input').each(function() { var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-'); var id = 'id_' + name; $(this).attr({'name': name, 'id': id}); if($(this).attr('type')!='hidden')$(this).val('').removeAttr('checked'); }); newElement.find('label').each(function() { var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-'); $(this).attr('for', newFor); }); total++; $('#id_' + type + '-TOTAL_FORMS').val(total); newElement.css("display","none"); $(selector).after(newElement); newElement.show("fast"); } $(document).ready(function() { $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: true }); }); // management_form.prefix </script> <form action="./" method="POST" enctype="multipart/form-data"> {{ formsets.0.management_form }} <fieldset> <legend>{{ formsets.0.form.title }}</legend> <div class="{{formsets.0.management_form.prefix}}"> {% for form in formsets.0.forms %} - <table> + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> {{ form.as_table }} </table> {% endfor %} </div> </fieldset> {{ formsets.1.management_form }} <fieldset> <legend>{{ formsets.1.form.title }}</legend> <div class="{{formsets.1.management_form.prefix}}"> {% for form in formsets.1.forms %} - <table> + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formsets.1.management_form.prefix}} table:last','{{formsets.1.management_form.prefix}}')" type="button" value="add more"/> </div> </fieldset> <br/> <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> {% if next_form_title %} <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> {% endif %} </form> {% endblock %} diff --git a/clinicaltrials/repository/templates/repository/step_2.html b/clinicaltrials/repository/templates/repository/step_2.html index 6395e02..6bbcee2 100644 --- a/clinicaltrials/repository/templates/repository/step_2.html +++ b/clinicaltrials/repository/templates/repository/step_2.html @@ -1,73 +1,79 @@ {% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript"> $(document).ready(function() { $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: true }); // TODO: Replace absolute path $("div.g select") .change(getterm_event('{% url decs.getterm lang="en",code="" %}')) .each(function(){$(this).change();}); $("div.s select") .change(search_event( '{% url decs.search lang="en",term="" %}', '{% trans "Search terms" %}')) .each(function(){$(this).change();}); }); function new_institution(){ return window.open('{% url new_institution %}','n_i','status=0,location=0,height=375'); } // management_form.prefix </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> - <table> + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} - <table> + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> <input onclick="new_institution()" type="button" value="{% trans 'New Institution' %}"/> </div> </fieldset> {% endfor %} <br/> <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> {% if next_form_title %} <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> {% endif %} </form> {% endblock %} diff --git a/clinicaltrials/repository/templates/repository/step_3.html b/clinicaltrials/repository/templates/repository/step_3.html index 051458b..1d57d44 100644 --- a/clinicaltrials/repository/templates/repository/step_3.html +++ b/clinicaltrials/repository/templates/repository/step_3.html @@ -1,69 +1,75 @@ {% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript" src="/static/js/submission.utils.js"></script> <script type="text/javascript"> $(document).ready(function() { $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: true }); // TODO: Replace absolute path $("div.g select") .change(getterm_event('{% url decs.getterm lang="en",code="" %}')) .each(function(){$(this).change();}); $("div.s select") .change(search_event( '{% url decs.search lang="en",term="" %}', '{% trans "Search terms" %}')) .each(function(){$(this).change();}); }); // management_form.prefix </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> - <table> + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} - <table> + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> </div> </fieldset> {% endfor %} <br/> <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> {% if next_form_title %} <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> {% endif %} </form> {% endblock %} diff --git a/clinicaltrials/repository/templates/repository/trial_form.html b/clinicaltrials/repository/templates/repository/trial_form.html index 0beb66e..4b9fade 100644 --- a/clinicaltrials/repository/templates/repository/trial_form.html +++ b/clinicaltrials/repository/templates/repository/trial_form.html @@ -1,56 +1,63 @@ {% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript"> $(document).ready(function() { $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: false }); }); </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> - <table> + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> + {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} - <table> + <table class="table"> + <col width="20%"/> + <col width="75%"/> + <col width="5%"/> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> </div> </fieldset> {% endfor %} <br/> <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> {% if next_form_title %} <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> {% endif %} </form> {% endblock %} diff --git a/clinicaltrials/repository/trds_forms.py b/clinicaltrials/repository/trds_forms.py index 44d541c..19d9bfe 100644 --- a/clinicaltrials/repository/trds_forms.py +++ b/clinicaltrials/repository/trds_forms.py @@ -1,364 +1,364 @@ #coding: utf-8 from assistance.models import FieldHelp from vocabulary.models import CountryCode from repository.models import ClinicalTrial, Contact, Descriptor, Institution from repository.models import InterventionCode, Outcome, RecruitmentStatus from repository.models import StudyPhase, TrialSecondarySponsor from repository.models import TrialSupportSource import choices from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django import forms from django.forms.forms import BoundField, conditional_escape class ReviewModelForm(forms.ModelForm): def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row): "Helper function for outputting HTML. Used by as_table(), as_ul(), as_p()." top_errors = self.non_field_errors() # Errors that should be displayed above all fields. output, hidden_fields = [], [] for name, field in self.fields.items(): bf = BoundField(self, field, name) bf_errors = self.error_class([conditional_escape(error) for error in bf.errors]) # Escape and cache in local variable. if bf.is_hidden: if bf_errors: top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors]) hidden_fields.append(unicode(bf)) else: if errors_on_separate_row and bf_errors: output.append(error_row % force_unicode(bf_errors)) if bf.label: label = conditional_escape(force_unicode(bf.label)) # Only add the suffix if the label does not end in # punctuation. if self.label_suffix: if label[-1] not in ':?.!': label += self.label_suffix label = bf.label_tag(label) or '' else: label = '' if field.help_text: help_text = help_text_html % force_unicode(field.help_text) else: help_text = u'' form_name = self.__class__.__name__ #import pdb; pdb.set_trace() help_record, new = FieldHelp.objects.get_or_create(form=form_name, field=name) help_text = help_text + u' ' + force_unicode(help_record) help_text = help_text_html % help_text field_path = '%s.%s' % (form_name, name) issue_text = '%s #%s' % (field_path, self.instance.pk) output.append(normal_row % {'errors': force_unicode(bf_errors), 'label': force_unicode(label), 'field': unicode(bf), 'help_text': help_text, 'issue': issue_text,}) if top_errors: output.insert(0, error_row % force_unicode(top_errors)) if hidden_fields: # Insert any hidden fields in the last row. str_hidden = u''.join(hidden_fields) if output: last_row = output[-1] # Chop off the trailing row_ender (e.g. '</td></tr>') and # insert the hidden fields. if not last_row.endswith(row_ender): # This can happen in the as_p() case (and possibly others # that users write): if there are only top errors, we may # not be able to conscript the last row for our purposes, # so insert a new, empty row. last_row = normal_row % {'errors': '', 'label': '', 'field': '', 'help_text': '', 'issue': '',} output.append(last_row) output[-1] = last_row[:-len(row_ender)] + str_hidden + row_ender else: # If there aren't any rows in the output, just append the # hidden fields. output.append(str_hidden) return mark_safe(u'\n'.join(output)) def as_table(self): "Returns this form rendered as HTML <tr>s -- excluding the <table></table>." normal_row = u''' <tr><th>%(label)s</th> <td>%(errors)s%(field)s</td> <td class="help"> - <div class="text">%(help_text)s</div> + <img src="/static/help.png" alt="%(help_text)s"/> <div class="issue">%(issue)s</div> </td></tr> ''' return self._html_output(normal_row=normal_row, error_row=u'<tr><td colspan="3">%s</td></tr>', row_ender='</td></tr>', help_text_html=u'%s', errors_on_separate_row=False) # # Forms # #step1 class TrialIdentificationForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['scientific_title','scientific_acronym', 'public_title','acronym'] title = _('Trial Identification') # TRDS 10a scientific_title = forms.CharField(label=_('Scientific Title'), max_length=2000, widget=forms.Textarea) # TRDS 10b scientific_acronym = forms.CharField(required=False, label=_('Scientific Acronym'), max_length=255) # TRDS 9a public_title = forms.CharField(required=False, label=_('Public Title'), max_length=2000, widget=forms.Textarea) # TRDS 9b acronym = forms.CharField(required=False, label=_('Acronym'), max_length=255) class SecondaryIdForm(ReviewModelForm): title = _('Secondary Identifying Numbers') # this is just to inherit the custom _html_output and as_table methods #step2 class PrimarySponsorForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['primary_sponsor',] title = _('Primary Sponsor') #step2 class SecondarySponsorForm(ReviewModelForm): class Meta: model = TrialSecondarySponsor fields = ['institution','relation'] title = _('Secondary Sponsor(s)') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[1][0]) #step2 class SupportSourceForm(ReviewModelForm): class Meta: model = TrialSupportSource fields = ['institution','relation'] title = _('Source(s) of Monetary or Material Support') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[0][0]) class NewInstitution(ReviewModelForm): class Meta: model = Institution title = _('New Institution') #step3 class HealthConditionsForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['hc_freetext',] title = _('Health Condition(s) or Problem(s) Studied') # TRDS 12a hc_freetext = forms.CharField(label=_('Health Condition(s) or Problem(s)'), required=False, max_length=8000, widget=forms.Textarea) #step3 class DescriptorForm(ReviewModelForm): class Meta: model = Descriptor trial = forms.CharField(widget=forms.HiddenInput,required=False) class GeneralHealthDescriptorForm(DescriptorForm): title = _('General Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) class SpecificHealthDescriptorForm(DescriptorForm): title = _('Specific Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[1][0]) #step4 class InterventionDescriptorForm(DescriptorForm): title = _('Descriptor for Intervention(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[1][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) #step4 class InterventionForm(ReviewModelForm): title = _('Intervention(s)') class Meta: model = ClinicalTrial fields = ['i_freetext','i_code'] title = _('Intervention(s)') i_freetext = forms.CharField(label=_('Intervention(s)'), required=False, max_length=8000, widget=forms.Textarea) i_code = forms.ModelMultipleChoiceField(label=_("Intervention Code(s)"), queryset=InterventionCode.objects.all(), widget=forms.CheckboxSelectMultiple()) #step5 class RecruitmentForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['recruitment_status', 'recruitment_country','date_enrollment', 'target_sample_size', 'inclusion_criteria', 'gender', 'agemin_value', 'agemin_unit', 'agemax_value', 'agemax_unit', 'exclusion_criteria', ] title = _('Recruitment') # TRDS 18 recruitment_status = forms.ModelChoiceField(label=_('Recruitment Status'), queryset=RecruitmentStatus.objects.all()) recruitment_country = forms.ModelMultipleChoiceField( label=_('Recruitment Country'), queryset=CountryCode.objects.all()) # TRDS 16a,b (type_enrollment: anticipated or actual) date_enrollment = forms.CharField( # yyyy-mm or yyyy-mm-dd label=_('Date of First Enrollment'), max_length=10, required=False) # TRDS 17 target_sample_size = forms.IntegerField(label=_('Target Sample Size'), initial=0 , required=False) # TRDS 14a inclusion_criteria = forms.CharField(label=_('Inclusion Criteria'), required=False, max_length=8000, widget=forms.Textarea) # TRDS 14b gender = forms.ChoiceField(label=_('Gender (inclusion sex)'), choices=choices.INCLUSION_GENDER) # TRDS 14c agemin_value = forms.IntegerField(required=False, label=_('Inclusion Minimum Age')) agemin_unit = forms.ChoiceField(label=_('Minimum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14d agemax_value = forms.IntegerField(required=False, label=_('Inclusion Maximum Age')) agemax_unit = forms.ChoiceField(label=_('Maximum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14e exclusion_criteria = forms.CharField(label=_('Exclusion Criteria'),required=False, max_length=8000, widget=forms.Textarea,) #step6 class StudyTypeForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['study_design', 'expanded_access_program', 'purpose', 'intervention_assignment', 'number_of_arms', 'masking', 'allocation', 'phase'] title = _('Study Type') # TRDS 15b study_design = forms.CharField(label=_('Study Design'), required=False, max_length=1000, widget=forms.Textarea) expanded_access_program = forms.ChoiceField(label=_('Expandend Access Program'), choices=[(None,_('Unknown')), (True,_('Yes')), (False,_('No')),], widget=forms.RadioSelect) # TRDS 15c phase = forms.ModelChoiceField(label=_('Study Phase'), queryset=StudyPhase.objects.all()) #step7 class OutcomesForm(ReviewModelForm): class Meta: model = Outcome fields = ['interest','description'] title = _('Outcomes') #step8 class PublicContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Public Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[0][0], widget=forms.HiddenInput) #step8 class ScientificContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Scientific Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[1][0], widget=forms.HiddenInput) #step8 class SiteContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Site Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[2][0], widget=forms.HiddenInput) #step8-partof class ContactForm(ReviewModelForm): class Meta: model = Contact title = _('New Contact(s)') relation = forms.ChoiceField(widget=forms.RadioSelect, choices=choices.CONTACT_RELATION) firstname = forms.CharField(label=_('First Name'), max_length=50) middlename = forms.CharField(label=_('Middle Name'), max_length=50,required=False) lastname = forms.CharField(label=_('Last Name'), max_length=50) email = forms.EmailField(label=_('E-mail'), max_length=255) affiliation = forms.ModelChoiceField(Institution.objects.all(), _('Affiliation')) address = forms.CharField(label=_('Address'), max_length=255,required=False) city = forms.CharField(label=_('City'), max_length=255) country = forms.ModelChoiceField(CountryCode.objects.all(), _('Country')) zip = forms.CharField(label=_('Postal Code'), max_length=50) telephone = forms.CharField(label=_('Telephone'), max_length=255) \ No newline at end of file diff --git a/clinicaltrials/static/css/style.css b/clinicaltrials/static/css/style.css index 64689c6..b4c604f 100644 --- a/clinicaltrials/static/css/style.css +++ b/clinicaltrials/static/css/style.css @@ -1,349 +1,357 @@ body { height: 100%; margin: 0; padding: 0; text-align: left; font: 78% "Verdana", "Arial", "sans-serif"; background:#cbcbcd; } h1, h2, label, legend, #content a { color: #296784; } /* STYLE for BORDERED MAIN BLOCKS */ #container, #top, #footer, #columns, .stepmenu-top, .stepmenu-bottom { border-color: #D4D4FF; } #container { margin: 0px; padding: 0; line-height: 1.7em; background: transparent url(/static/bg_header.png) repeat-x scroll 0 0; } /*TOP BANNER*/ #top { padding: 0; margin: 0; border-width: 0 0 1px; float: left; clear: both; width: 100%; height: 118px; } #banner div.logo a { text-decoration: none; color: #296784; } #banner div.logo, #top div.institutions { float: left; width: 40%; margin: 1em 0 0 10%; } #banner div.institutions { margin-top: 4em; } #top div.institutions ul li { float: left; width: 40%; text-align: right; } #top div.institutions ul span { display: none; } #top div.institutions ul li a { display: block; height: 2em; } #top div.institutions ul li.BIREME a { background: transparent url(/static/bireme.gif) no-repeat center right; } #top div.institutions ul li.FIOCRUZ a { background: transparent url(/static/fiocruz.gif) no-repeat center right; } #middle { background-color: #FFF; position: relative; float: left; width: 100%; clear: both; overflow: hidden; } #columns { position: relative; width: 100%; float: left; right: 81%; border-width: 0 1px 0 0; background:#ebecf0; } #rebracmenu, #workarea { position: relative; } #rebracmenu h2 { display: none; } /* GROUP STEPS NAVIGATION AND CONTENT */ #workarea { float: left; left: 100%; width: 81%; } #rebracmenu { float: left; width: 16%; left: 1%; } #rebracmenu #usermenu div { padding: 3em; border-bottom: 1px dotted #D4D4FF; line-height: 100%; text-align: center; } #rebracmenu #usermenu div * { text-transform: capitalize; font-weight: bold; } #rebracmenu ul { list-style-type: none; padding-left: 1em; } #rebracmenu li { text-transform: capitalize; margin-bottom: 0.5em; border-bottom: 1px dotted #D4D4FF; } /* STEPS NAVIGATION*/ .stepmenu { background: transparent url(/static/bg_stepmenu.png) repeat-x; float: left; width: 100%; clear: both; } .stepmenu ul { margin: 0; padding: 0 0 0 2em; list-style: none; } .stepmenu ul li { display: block; float: left; width: 9%; border: 1px solid transparent; text-align: center; } .stepmenu li.current { border: 1px inset white; } .stepmenu a { text-decoration: none; text-transform: capitalize; color: #0a5172; font-weight: bold; font-size:11px; } .stepmenu li:hover { text-decoration: underline; } .stepmenu-top { border-width: 0 0 1px; } .stepmenu-bottom { border-width: 1px 0 0; } /*MAIN CONTENT*/ #content { padding: 10px; } #content a:link, #content a:visited { text-decoration: none; background: inherit; } #content a:hover { text-decoration: underline; } #content h2 { padding: 0.2em 0; } /*FOOTER*/ #footer { clear: both; padding: 5px; margin-top: 5px; border-width: 1px 0 0; background:#f3f4f6; } #footer a:link, #footer a:visited { background: inherit; } #footer, #footer a { color:#666; } #footer a{ text-decoration:underline; } #footer { font-size:69%; } /*TYPOGRAPHY*/ p { margin: 20px; } blockquote { font-weight: bold; font-style: italic; } table.table { border-collapse: collapse; border-width: 0 0 1px 1px; width: 100%; } table.table, table.table td, table.table th { color:#4a4c4e; } table.table td, table.table th { padding: 10px; } table.table th { background-color: #F1F4F7; color:#333; } +table.table textarea { + width: 100%; +} + +table.table td.help div.issue { + display: none; +} + table.trialsummary { width: 100%; } /* AJAX DeCS Tools */ td div.decstool { display: none; } td div select { display: block; } td select, td div.decstool input { width: 80%; } td.showdecs div.decstool { display: block; } .issue{ font-size:10px; color:#5d5d5d; } fieldset{ border: 1px solid #CCC; margin-bottom:30px; } label{ font-weight:normal; } ul li{ list-style:none; } legend{ font-weight:bold; } #content a.buttonadd { background: transparent url(/static/add.png) no-repeat right center; padding: 0em 2em 0em 1em; border: 1px solid #EBECF0; } /* BARRA GOVERNO FEDERAL */ .barra_MSaude { width: 100%; height: 30px; background:#ffcc00; } .barra_MSaude .barra1000 { width:100%; margin: 0 auto; } .barra_MSaude .barra1000 .minSaude a { width: 152px; height: 21px; float: left; margin: 1px; background: url(ms.gif) top left no-repeat; } .barra_MSaude .barra1000 .brasilGov a { margin: 1px; width: 96px; height: 21px; float: right; background: url(brasil.gif) top left no-repeat; } .barra_MSaude .barra1000 .minSaude, .barra_MSaude .barra1000 .form { float: left; } .barra_MSaude .barra1000 .form { margin: 2px 0px 0px 50px; } .barra_MSaude .barra1000 .form .pr{ background: #ffcc00 !important; font-size: 10px; } .barra_MSaude .barra1000 .brasilGov { float: right; } .barra_MSaude .barra1000 DIV a span { display: none; }
ensaiosclinicos/clinicaltrials
59431382533887a3f91b2209f08765e0b93c57eb
change label "step" for "part"
diff --git a/clinicaltrials/repository/templates/repository/submission_step.html b/clinicaltrials/repository/templates/repository/submission_step.html index b45e745..584a6a8 100644 --- a/clinicaltrials/repository/templates/repository/submission_step.html +++ b/clinicaltrials/repository/templates/repository/submission_step.html @@ -1,31 +1,31 @@ {% extends "base.html" %} {% load i18n %} {% block body_title %}{{ forms.form_main.title }}{% endblock %} {# Last <p > in http://docs.djangoproject.com/en/dev/topics/templates/#id1 #} {% block stepmenu_top %} <div class="stepmenu stepmenu-top"> <ul> <li><a href="{% url repository.edittrial trial_pk %}">{% trans "Summary" %}</a></li> {% for step,iscurrent in steps %} <li{% if iscurrent %} class="current"{% endif %}> - <a href="{{step}}">step {{forloop.counter}}</a> + <a href="{{step}}">{% trans "Part" %} {{forloop.counter}}</a> </li> {% endfor %} </ul> </div> {% endblock %} {% block stepmenu_bottom %} <div class="stepmenu stepmenu-bottom"> <ul> <li><a href="{% url repository.edittrial trial_pk %}">{% trans "Summary" %}</a></li> {% for step,iscurrent in steps %} <li{% if iscurrent %} class="current"{% endif %}> - <a href="{{step}}">step {{forloop.counter}}</a> + <a href="{{step}}">{% trans "Part" %} {{forloop.counter}}</a> </li> {% endfor %} </ul> </div> {% endblock %} diff --git a/clinicaltrials/repository/templates/repository/trial_index.html b/clinicaltrials/repository/templates/repository/trial_index.html index a87c4ea..1102d15 100644 --- a/clinicaltrials/repository/templates/repository/trial_index.html +++ b/clinicaltrials/repository/templates/repository/trial_index.html @@ -1,25 +1,25 @@ {% extends "base.html" %} {% load i18n %} {% block body_title %}{% trans "Trial Summary" %}{% endblock %} {% block body %} <h2>{% trans "Trial Summary" %}</h2> <table class="table trialsummary"> <thead> <tr> - <th>{% trans "Step" %}</th> + <th>{% trans "Part" %}</th> <th>{% trans "Form name" %}</th> <th>{% trans "Status" %}</th> </tr> </thead> {% for link in links %} <!-- TODO: use url filter to remove hardcoded path --> <tr> <td>{{forloop.counter}}</td> <td><a href="{{link.url}}">{{ link.label }}</a></td> <td><img src="{{link.icon}}" alt="{{link.msg}}" title="{{link.msg}}"/>&nbsp;&nbsp;{{link.msg}}</td> </tr> {% endfor %} </table> {% endblock %} \ No newline at end of file
ensaiosclinicos/clinicaltrials
2726e811908bcd1705dfeb87c5be8746fd22d440
images for last commit
diff --git a/clinicaltrials/static/add.png b/clinicaltrials/static/add.png new file mode 100644 index 0000000..323edb0 Binary files /dev/null and b/clinicaltrials/static/add.png differ diff --git a/clinicaltrials/static/bireme.gif b/clinicaltrials/static/bireme.gif new file mode 100644 index 0000000..d174f50 Binary files /dev/null and b/clinicaltrials/static/bireme.gif differ diff --git a/clinicaltrials/static/fiocruz.gif b/clinicaltrials/static/fiocruz.gif new file mode 100644 index 0000000..759a68c Binary files /dev/null and b/clinicaltrials/static/fiocruz.gif differ
ensaiosclinicos/clinicaltrials
73b01e0aa329a58ed8e83c7761d51ec65bc7b3c6
Fix javascript on gov bar; change style for the new trial button; change banner for something that looks like proqualis.net
diff --git a/clinicaltrials/reviewapp/templates/reviewapp/submission_list.html b/clinicaltrials/reviewapp/templates/reviewapp/submission_list.html index e63f767..cdc8b67 100644 --- a/clinicaltrials/reviewapp/templates/reviewapp/submission_list.html +++ b/clinicaltrials/reviewapp/templates/reviewapp/submission_list.html @@ -1,31 +1,30 @@ {% extends "base.html" %} {% load i18n %} {% block body %} <h2>{% trans "Your Submissions" %}</h2> +<a href="{% url reviewapp.new_submission %}" class="buttonadd">{% trans "Submit a new Clinical Trial" %}</a> <table class="table"> <thead> <tr> <th>{% trans "Created" %}</th> <th>{% trans "Submission Title" %}</th> <th>{% trans "Situation" %}</th> </tr> </thead> <tbody> {% for submission in object_list %} <tr> <td>{{ submission.created|date:'d M Y' }}</td> <td> <a href="{% url repository.edittrial submission.trial.pk %}">{{ submission.short_title }}</a> </td> <td>{{ submission.status }}</td> </tr> {% endfor %} </tbody> </table> -<p> - <a href="{% url reviewapp.new_submission %}">{% trans "Submit a new Clinical Trial" %}</a> -</p> +<a href="{% url reviewapp.new_submission %}" class="buttonadd">{% trans "Submit a new Clinical Trial" %}</a> {% endblock %} diff --git a/clinicaltrials/static/css/style.css b/clinicaltrials/static/css/style.css index 64779d7..64689c6 100644 --- a/clinicaltrials/static/css/style.css +++ b/clinicaltrials/static/css/style.css @@ -1,315 +1,349 @@ body { height: 100%; - margin-top: 0px; + margin: 0; padding: 0; text-align: left; font: 78% "Verdana", "Arial", "sans-serif"; background:#cbcbcd; } h1, h2, label, legend, #content a { color: #296784; } /* STYLE for BORDERED MAIN BLOCKS */ #container, #top, #footer, #columns, .stepmenu-top, .stepmenu-bottom { border-color: #D4D4FF; } #container { - width: 87%; - margin: 0px auto; + margin: 0px; padding: 0; line-height: 1.7em; background: transparent url(/static/bg_header.png) repeat-x scroll 0 0; } /*TOP BANNER*/ #top { padding: 0; margin: 0; border-width: 0 0 1px; float: left; clear: both; width: 100%; height: 118px; } -#top img { - display: block; + +#banner div.logo a { + text-decoration: none; + color: #296784; +} +#banner div.logo, #top div.institutions { float: left; - margin: 3em; - margin-top: 10px; + width: 40%; + margin: 1em 0 0 10%; } -#top h1 { - margin: 20px; +#banner div.institutions { + margin-top: 4em; +} + +#top div.institutions ul li { float: left; + width: 40%; + text-align: right; +} +#top div.institutions ul span { + display: none; +} + +#top div.institutions ul li a { + display: block; + height: 2em; +} + +#top div.institutions ul li.BIREME a { + background: transparent url(/static/bireme.gif) no-repeat center right; +} + +#top div.institutions ul li.FIOCRUZ a { + background: transparent url(/static/fiocruz.gif) no-repeat center right; } #middle { background-color: #FFF; position: relative; float: left; width: 100%; clear: both; overflow: hidden; } #columns { position: relative; width: 100%; float: left; right: 81%; border-width: 0 1px 0 0; background:#ebecf0; } #rebracmenu, #workarea { position: relative; } +#rebracmenu h2 { + display: none; +} /* GROUP STEPS NAVIGATION AND CONTENT */ #workarea { float: left; left: 100%; width: 81%; } #rebracmenu { float: left; width: 16%; left: 1%; } #rebracmenu #usermenu div { padding: 3em; border-bottom: 1px dotted #D4D4FF; line-height: 100%; text-align: center; } #rebracmenu #usermenu div * { text-transform: capitalize; font-weight: bold; } #rebracmenu ul { list-style-type: none; padding-left: 1em; } #rebracmenu li { text-transform: capitalize; margin-bottom: 0.5em; border-bottom: 1px dotted #D4D4FF; } /* STEPS NAVIGATION*/ .stepmenu { background: transparent url(/static/bg_stepmenu.png) repeat-x; float: left; width: 100%; clear: both; } .stepmenu ul { margin: 0; padding: 0 0 0 2em; list-style: none; } .stepmenu ul li { display: block; float: left; width: 9%; border: 1px solid transparent; text-align: center; } .stepmenu li.current { border: 1px inset white; } .stepmenu a { text-decoration: none; text-transform: capitalize; color: #0a5172; font-weight: bold; font-size:11px; } .stepmenu li:hover { text-decoration: underline; } .stepmenu-top { border-width: 0 0 1px; } .stepmenu-bottom { border-width: 1px 0 0; } /*MAIN CONTENT*/ #content { padding: 10px; } #content a:link, #content a:visited { text-decoration: none; background: inherit; } #content a:hover { text-decoration: underline; } #content h2 { padding: 0.2em 0; } /*FOOTER*/ #footer { clear: both; padding: 5px; - x margin-top: 5px; + margin-top: 5px; border-width: 1px 0 0; background:#f3f4f6; } #footer a:link, #footer a:visited { background: inherit; } #footer, #footer a { color:#666; } #footer a{ text-decoration:underline; } #footer { font-size:69%; } /*TYPOGRAPHY*/ p { margin: 20px; } blockquote { font-weight: bold; font-style: italic; } table.table { border-collapse: collapse; border-width: 0 0 1px 1px; + width: 100%; } table.table, table.table td, table.table th { color:#4a4c4e; } table.table td, table.table th { padding: 10px; } table.table th { background-color: #F1F4F7; color:#333; } table.trialsummary { width: 100%; } /* AJAX DeCS Tools */ td div.decstool { display: none; } td div select { display: block; } td select, td div.decstool input { width: 80%; } td.showdecs div.decstool { display: block; } .issue{ font-size:10px; color:#5d5d5d; } fieldset{ border: 1px solid #CCC; margin-bottom:30px; } label{ font-weight:normal; } ul li{ list-style:none; } legend{ font-weight:bold; } -/**********BARRA GOVERNO FEDERAL ******/ +#content a.buttonadd { + background: transparent url(/static/add.png) no-repeat right center; + padding: 0em 2em 0em 1em; + border: 1px solid #EBECF0; +} + +/* BARRA GOVERNO FEDERAL */ .barra_MSaude { - width: 100%; - height: 30px; - background:#ffcc00; + width: 100%; + height: 30px; + background:#ffcc00; } .barra_MSaude .barra1000 { - width:100%; - margin: 0 auto; + width:100%; + margin: 0 auto; } .barra_MSaude .barra1000 .minSaude a { - width: 152px; - height: 21px; - float: left; - margin: 1px; - background: url(ms.gif) top left no-repeat; + width: 152px; + height: 21px; + float: left; + margin: 1px; + background: url(ms.gif) top left no-repeat; } .barra_MSaude .barra1000 .brasilGov a { - margin: 1px; - width: 96px; - height: 21px; - float: right; - background: url(brasil.gif) top left no-repeat; + margin: 1px; + width: 96px; + height: 21px; + float: right; + background: url(brasil.gif) top left no-repeat; } .barra_MSaude .barra1000 .minSaude, .barra_MSaude .barra1000 .form { - float: left; + float: left; } .barra_MSaude .barra1000 .form { - margin: 2px 0px 0px 50px; + margin: 2px 0px 0px 50px; } .barra_MSaude .barra1000 .form .pr{ - background: #ffcc00 !important; - font-size: 10px; - } + background: #ffcc00 !important; + font-size: 10px; +} .barra_MSaude .barra1000 .brasilGov { - float: right; + float: right; } .barra_MSaude .barra1000 DIV a span { - display: none; + display: none; } diff --git a/clinicaltrials/templates/base.html b/clinicaltrials/templates/base.html index af428ef..443a58b 100644 --- a/clinicaltrials/templates/base.html +++ b/clinicaltrials/templates/base.html @@ -1,100 +1,113 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> {% load i18n %} <head> <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"/> <title>{% block page_title %}{% trans "Clinical Trials Platform" %}{% endblock %}</title> <link rel="shortcut icon" href="/static/favicon.ico"/> <link rel="stylesheet" type="text/css" href="/static/css/asmselect/jquery.asmselect.css"/> <link rel="stylesheet" type="text/css" href="/static/css/style.css"/> <script type="text/javascript" src="/static/js/jquery-1.3.1.min.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/jquery.ui.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/asmselect/jquery.asmselect.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/submission.utils.js"></script> </head> <body> <div id="container"> <div class="barra_MSaude"> <div class="barra1000"> <div class="minSaude"> <a href="http://www.saude.gov.br" title="Ministério da Saúde" target="_blank"> <span>{% trans 'Ministério da Saúde'%}</span> </a> </div> <div class="form"> <form method="post" action="/" id="govform" name="govform"> - <select name="opcoes" onchange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)" class="pr"> + <select name="opcoes" class="pr"> <option>{% trans 'Destaques do governo' %}</option> - <option value="javascript:nova_jan('http://www.brasil.gov.br')">{% trans 'Portal do Governo Federal' %}</option> - <option value="javascript:nova_jan('http://www.e.gov.br')">{% trans 'Portal de Serviços do Governo' %}</option> - <option value="javascript:nova_jan('http://www.radiobras.gov.br')">{% trans 'Portal da Agência de Notícias' %}</option> - <option value="javascript:nova_jan('http://www.previdenciasocial.gov.br')">{% trans 'Reforma da Previdência' %}</option> - <option value="javascript:nova_jan('http://www.fomezero.gov.br')">{% trans 'Programa Fome Zero' %}</option> + <option value="http://www.brasil.gov.br">{% trans 'Portal do Governo Federal' %}</option> + <option value="http://www.e.gov.br">{% trans 'Portal de Serviços do Governo' %}</option> + <option value="http://www.radiobras.gov.br">{% trans 'Portal da Agência de Notícias' %}</option> + <option value="http://www.previdenciasocial.gov.br">{% trans 'Reforma da Previdência' %}</option> + <option value="http://www.fomezero.gov.br">{% trans 'Programa Fome Zero' %}</option> </select> </form> + <script type="text/javascript">$('form#govform select option[value]').click(function(){window.open(this.value);});</script> </div> <div class="brasilGov"> <a href="http://www.brasil.gov.br" title="Governo Federal" target="_blank"> <span>{% trans 'Governo Federal' %}</span> </a> </div> </div> </div> <div id="top"> - <img src="/static/logoOpas.gif" alt="Pan-American Health Organization Logo"/> - <h1>{% block headline %}{% trans "RBEC" %}{% endblock %}</h1> + <div id="banner"> + <div class="logo"> + <h1> + <a href="{% url reviewapp.home %}"><span>{% block headline %}{% trans "RBEC" %}{% endblock %}</span></a> + </h1> + </div> + <div class="institutions"> + <ul> + <li class="BIREME"><a href="http://regional.bvsalud.org/php/index.php?lang=pt" title="Centro Latino-Americano e do Caribe de Informação em Ciências da Saúde" target="_blank"><span>BIREME</span></a></li> + <li class="FIOCRUZ"><a href="http://www.fiocruz.br/cgi/cgilua.exe/sys/start.htm?tpl=home" title="Fundação Oswaldo Cruz" target="_blank"><span>FioCruz</span></a></li> + </ul> + </div> + </div> </div> <div id="middle"> <div id="columns"> <div id="workarea"> {% block stepmenu_top %}{% endblock %} <div id="content"> {% block body %}{% endblock %} </div> {% block stepmenu_bottom %}{% endblock %} </div> <div id="rebracmenu"> + <h2>{% trans "Options menu" %}</h2> <div id="usermenu"> {% if username %} <div> <span>{{username}}</span><br/> <a href="/accounts/logout">log out</a> </div> <ul> <li>Profile</li> <li>Dashboard</li> <li><a href="{% url reviewapp.userhome %}">{% trans 'Submissions' %}</a></li> <li>Issues</li> </ul> {% else %} <div><a href="/accounts/login" title="{% trans 'access with an existing account' %}">[{% trans 'login' %}]</a> <br />&nbsp;<br /> <a href="/accounts/register" title="{% trans 'create an account to submit trial records' %}">[{% trans 'register' %}]</a> </div> {% endif %} </div> <ul> <li>{% trans "News" %}</li> <li>{% trans "About" %}</li> <li>{% trans "Help" %}</li> </ul> </div> </div> </div> <div id="footer"> <p> <strong> BIREME - OPAS - OMS </strong><br/> Centro Latino-Americano e do Caribe de Informação em Ciências da Saúde <br/> Rua Botucatu, 862 - 04023-901 - São Paulo/SP - Brasil - Tel: (55 11) 5576-9800 - Fax: (55 11) 5575-8868 <br/> </p> </div> </div> </body> </html>
ensaiosclinicos/clinicaltrials
16b4f7d562cdae1b7d6a9d1aa6a0001e075cf711
changed production wsgi script to reflect new dir structure
diff --git a/clinicaltrials/apache/app/production.wsgi b/clinicaltrials/apache/app/production.wsgi index 86108aa..3fa5287 100644 --- a/clinicaltrials/apache/app/production.wsgi +++ b/clinicaltrials/apache/app/production.wsgi @@ -1,9 +1,9 @@ import os, sys -sys.path.append('/home/aplicacoes-bvs/rebrac-alfa/clinicaltrials') -sys.path.append('/home/aplicacoes-bvs/rebrac-alfa') +sys.path.append('/home/aplicacoes-bvs/ensaiosclinicos/clinicaltrials') +sys.path.append('/home/aplicacoes-bvs/ensaiosclinicos') os.environ['DJANGO_SETTINGS_MODULE'] = 'clinicaltrials.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler()
ensaiosclinicos/clinicaltrials
d67ca2cf308772fe285439bad063b21d340e7376
adjustment in stepmenu layout
diff --git a/clinicaltrials/static/css/style.css b/clinicaltrials/static/css/style.css index 04547e3..64779d7 100644 --- a/clinicaltrials/static/css/style.css +++ b/clinicaltrials/static/css/style.css @@ -1,312 +1,315 @@ body { height: 100%; margin-top: 0px; padding: 0; text-align: left; font: 78% "Verdana", "Arial", "sans-serif"; background:#cbcbcd; } h1, h2, label, legend, #content a { color: #296784; } /* STYLE for BORDERED MAIN BLOCKS */ #container, #top, #footer, #columns, .stepmenu-top, .stepmenu-bottom { border-color: #D4D4FF; } #container { width: 87%; margin: 0px auto; padding: 0; line-height: 1.7em; background: transparent url(/static/bg_header.png) repeat-x scroll 0 0; } /*TOP BANNER*/ #top { padding: 0; margin: 0; border-width: 0 0 1px; float: left; clear: both; width: 100%; height: 118px; } #top img { display: block; float: left; margin: 3em; margin-top: 10px; } #top h1 { margin: 20px; float: left; } #middle { background-color: #FFF; position: relative; float: left; width: 100%; clear: both; overflow: hidden; } #columns { position: relative; width: 100%; float: left; right: 81%; border-width: 0 1px 0 0; background:#ebecf0; } #rebracmenu, #workarea { position: relative; } /* GROUP STEPS NAVIGATION AND CONTENT */ #workarea { float: left; left: 100%; width: 81%; } #rebracmenu { float: left; width: 16%; left: 1%; } #rebracmenu #usermenu div { padding: 3em; border-bottom: 1px dotted #D4D4FF; line-height: 100%; text-align: center; } #rebracmenu #usermenu div * { text-transform: capitalize; font-weight: bold; } #rebracmenu ul { list-style-type: none; padding-left: 1em; } #rebracmenu li { text-transform: capitalize; margin-bottom: 0.5em; border-bottom: 1px dotted #D4D4FF; } /* STEPS NAVIGATION*/ .stepmenu { background: transparent url(/static/bg_stepmenu.png) repeat-x; + float: left; + width: 100%; + clear: both; } + .stepmenu ul { margin: 0; padding: 0 0 0 2em; list-style: none; } .stepmenu ul li { - display: inline; + display: block; + float: left; width: 9%; border: 1px solid transparent; text-align: center; - margin: 0px 8px; - } .stepmenu li.current { border: 1px inset white; } .stepmenu a { text-decoration: none; text-transform: capitalize; color: #0a5172; font-weight: bold; font-size:11px; } .stepmenu li:hover { text-decoration: underline; } .stepmenu-top { border-width: 0 0 1px; } .stepmenu-bottom { border-width: 1px 0 0; } /*MAIN CONTENT*/ #content { padding: 10px; } #content a:link, #content a:visited { text-decoration: none; background: inherit; } #content a:hover { text-decoration: underline; } #content h2 { padding: 0.2em 0; } /*FOOTER*/ #footer { clear: both; padding: 5px; x margin-top: 5px; border-width: 1px 0 0; background:#f3f4f6; } #footer a:link, #footer a:visited { background: inherit; } #footer, #footer a { color:#666; } #footer a{ text-decoration:underline; } #footer { font-size:69%; } /*TYPOGRAPHY*/ p { margin: 20px; } blockquote { font-weight: bold; font-style: italic; } table.table { border-collapse: collapse; border-width: 0 0 1px 1px; } table.table, table.table td, table.table th { color:#4a4c4e; } table.table td, table.table th { padding: 10px; } table.table th { background-color: #F1F4F7; color:#333; } table.trialsummary { width: 100%; } /* AJAX DeCS Tools */ td div.decstool { display: none; } td div select { display: block; } td select, td div.decstool input { width: 80%; } td.showdecs div.decstool { display: block; } .issue{ font-size:10px; color:#5d5d5d; } fieldset{ border: 1px solid #CCC; margin-bottom:30px; } label{ font-weight:normal; } ul li{ list-style:none; } legend{ font-weight:bold; } /**********BARRA GOVERNO FEDERAL ******/ .barra_MSaude { width: 100%; height: 30px; background:#ffcc00; } .barra_MSaude .barra1000 { width:100%; margin: 0 auto; } .barra_MSaude .barra1000 .minSaude a { width: 152px; height: 21px; float: left; margin: 1px; background: url(ms.gif) top left no-repeat; } .barra_MSaude .barra1000 .brasilGov a { margin: 1px; width: 96px; height: 21px; float: right; background: url(brasil.gif) top left no-repeat; } .barra_MSaude .barra1000 .minSaude, .barra_MSaude .barra1000 .form { float: left; } .barra_MSaude .barra1000 .form { margin: 2px 0px 0px 50px; } .barra_MSaude .barra1000 .form .pr{ background: #ffcc00 !important; font-size: 10px; } .barra_MSaude .barra1000 .brasilGov { float: right; } .barra_MSaude .barra1000 DIV a span { display: none; }
ensaiosclinicos/clinicaltrials
0ed95c84e6c57a2d3891021acd609ad4aa0d9d02
Adjustments for bar of brazilian government and added a footer
diff --git a/clinicaltrials/static/css/brasil.gif b/clinicaltrials/static/css/brasil.gif new file mode 100644 index 0000000..a0055df Binary files /dev/null and b/clinicaltrials/static/css/brasil.gif differ diff --git a/clinicaltrials/static/css/ms.gif b/clinicaltrials/static/css/ms.gif new file mode 100644 index 0000000..8a3705d Binary files /dev/null and b/clinicaltrials/static/css/ms.gif differ diff --git a/clinicaltrials/static/css/style.css b/clinicaltrials/static/css/style.css index f6a68eb..04547e3 100644 --- a/clinicaltrials/static/css/style.css +++ b/clinicaltrials/static/css/style.css @@ -1,250 +1,312 @@ -body { - height: 100%; - margin-top: 0px; - padding: 0; - text-align: left; - font: 78% "Verdana", "Arial", "sans-serif"; - background:#cbcbcd; -} - -h1, h2, label, legend, #content a { - color: #296784; -} - -/* STYLE for BORDERED MAIN BLOCKS */ -#container, #top, #footer, #columns, -.stepmenu-top, .stepmenu-bottom { - border-color: #D4D4FF; -} - -#container { - width: 87%; - margin: 0px auto; - padding: 0; - line-height: 1.7em; - background: transparent url(/static/bg_header.png) repeat-x scroll 0 0; -} - -/*TOP BANNER*/ -#top { - padding: 0; - margin: 0; - border-width: 0 0 1px; - float: left; - clear: both; - width: 100%; - height: 148px; -} - -#top img { - display: block; - float: left; - margin: 4em -} - -#top h1 { - margin: 2.7em 0 0; - float: left; -} - -#middle { - background-color: #FFF; - position: relative; - float: left; - width: 100%; - clear: both; - overflow: hidden; -} - -#columns { - position: relative; - width: 100%; - float: left; - right: 81%; - border-width: 0 1px 0 0; - background:#ebecf0; -} - -#rebracmenu, #workarea { - position: relative; -} - -/* GROUP STEPS NAVIGATION AND CONTENT */ -#workarea { - float: left; - left: 100%; - width: 81%; -} - -#rebracmenu { - float: left; - width: 16%; - left: 1%; -} - -#rebracmenu #usermenu div { - padding: 3em; - border-bottom: 1px dotted #D4D4FF; - line-height: 100%; - text-align: center; -} - -#rebracmenu #usermenu div * { - text-transform: capitalize; - font-weight: bold; -} - -#rebracmenu ul { - list-style-type: none; - padding-left: 1em; -} - -#rebracmenu li { - text-transform: capitalize; - margin-bottom: 0.5em; - border-bottom: 1px dotted #D4D4FF; -} - -/* STEPS NAVIGATION*/ -.stepmenu { - background: transparent url(/static/bg_stepmenu.png) repeat-x; -} -.stepmenu ul { - margin: 0; - padding: 0 0 0 2em; - list-style: none; -} - -.stepmenu li { - display: inline-block; - width: 9%; - border: 1px solid transparent; - text-align: center; -} - -.stepmenu li.current { - border: 1px inset white; -} - -.stepmenu a { - text-decoration: none; - text-transform: capitalize; - color: #0a5172; - font-weight: bold; -} - -.stepmenu li:hover { - text-decoration: underline; -} - -.stepmenu-top { - border-width: 0 0 1px; -} - -.stepmenu-bottom { - border-width: 1px 0 0; -} - -/*MAIN CONTENT*/ -#content { - padding: 10px; -} - -#content a:link, #content a:visited { - text-decoration: none; - background: inherit; - -} - -#content a:hover { - text-decoration: underline; - -} - -#content h2 { - padding: 0.2em 0; -} - -/*FOOTER*/ -#footer { - clear: both; - padding: 5px; - margin-top: 5px; - border-width: 1px 0 0; - background:#f3f4f6; -} - -#footer a:link, #footer a:visited { - text-decoration: none; - background: inherit; - -} - -/*TYPOGRAPHY*/ -p { - margin: 20px; -} - -blockquote { - font-weight: bold; - font-style: italic; -} - -table.table { - border-collapse: collapse; - border-width: 0 0 1px 1px; -} - -table.table, -table.table td, table.table th { - color:#4a4c4e; -} - -table.table td, table.table th { - padding: 10px; -} - -table.table th { - background-color: #F1F4F7; - color:#333; -} - -table.trialsummary { - width: 100%; -} - -/* AJAX DeCS Tools */ -td div.decstool { - display: none; -} - -td div select { - display: block; -} - -td select, -td div.decstool input { - width: 80%; -} - -td.showdecs div.decstool { - display: block; -} - -.issue{ - font-size:10px; - color:#5d5d5d; -} - -fieldset{ - border: 1px solid #CCC; - margin-bottom:30px; -} - -label{ - font-weight:normal; -} - -legend{ - font-weight:bold; -} +body { + height: 100%; + margin-top: 0px; + padding: 0; + text-align: left; + font: 78% "Verdana", "Arial", "sans-serif"; + background:#cbcbcd; +} + +h1, h2, label, legend, #content a { + color: #296784; +} + +/* STYLE for BORDERED MAIN BLOCKS */ +#container, #top, #footer, #columns, +.stepmenu-top, .stepmenu-bottom { + border-color: #D4D4FF; +} + +#container { + width: 87%; + margin: 0px auto; + padding: 0; + line-height: 1.7em; + background: transparent url(/static/bg_header.png) repeat-x scroll 0 0; +} + +/*TOP BANNER*/ +#top { + padding: 0; + margin: 0; + border-width: 0 0 1px; + float: left; + clear: both; + width: 100%; + height: 118px; +} + +#top img { + display: block; + float: left; + margin: 3em; + margin-top: 10px; +} + +#top h1 { + margin: 20px; + float: left; + +} + +#middle { + background-color: #FFF; + position: relative; + float: left; + width: 100%; + clear: both; + overflow: hidden; +} + +#columns { + position: relative; + width: 100%; + float: left; + right: 81%; + border-width: 0 1px 0 0; + background:#ebecf0; +} + +#rebracmenu, #workarea { + position: relative; +} + +/* GROUP STEPS NAVIGATION AND CONTENT */ +#workarea { + float: left; + left: 100%; + width: 81%; +} + +#rebracmenu { + float: left; + width: 16%; + left: 1%; +} + +#rebracmenu #usermenu div { + padding: 3em; + border-bottom: 1px dotted #D4D4FF; + line-height: 100%; + text-align: center; +} + +#rebracmenu #usermenu div * { + text-transform: capitalize; + font-weight: bold; +} + +#rebracmenu ul { + list-style-type: none; + padding-left: 1em; +} + +#rebracmenu li { + text-transform: capitalize; + margin-bottom: 0.5em; + border-bottom: 1px dotted #D4D4FF; +} + +/* STEPS NAVIGATION*/ +.stepmenu { + background: transparent url(/static/bg_stepmenu.png) repeat-x; +} +.stepmenu ul { + margin: 0; + padding: 0 0 0 2em; + list-style: none; +} + +.stepmenu ul li { + display: inline; + width: 9%; + border: 1px solid transparent; + text-align: center; + margin: 0px 8px; + +} + +.stepmenu li.current { + border: 1px inset white; +} + +.stepmenu a { + text-decoration: none; + text-transform: capitalize; + color: #0a5172; + font-weight: bold; + font-size:11px; +} + +.stepmenu li:hover { + text-decoration: underline; +} + +.stepmenu-top { + border-width: 0 0 1px; +} + +.stepmenu-bottom { + border-width: 1px 0 0; +} + +/*MAIN CONTENT*/ +#content { + padding: 10px; +} + +#content a:link, #content a:visited { + text-decoration: none; + background: inherit; + +} + +#content a:hover { + text-decoration: underline; + +} + +#content h2 { + padding: 0.2em 0; +} + +/*FOOTER*/ +#footer { + clear: both; + padding: 5px; + x margin-top: 5px; + border-width: 1px 0 0; + background:#f3f4f6; +} + +#footer a:link, #footer a:visited { + + background: inherit; + +} +#footer, #footer a { +color:#666; +} +#footer a{ + text-decoration:underline; + } +#footer { +font-size:69%; +} +/*TYPOGRAPHY*/ +p { + margin: 20px; +} + +blockquote { + font-weight: bold; + font-style: italic; +} + +table.table { + border-collapse: collapse; + border-width: 0 0 1px 1px; +} + +table.table, +table.table td, table.table th { + color:#4a4c4e; +} + +table.table td, table.table th { + padding: 10px; +} + +table.table th { + background-color: #F1F4F7; + color:#333; +} + +table.trialsummary { + width: 100%; +} + +/* AJAX DeCS Tools */ +td div.decstool { + display: none; +} + +td div select { + display: block; +} + +td select, +td div.decstool input { + width: 80%; +} + +td.showdecs div.decstool { + display: block; +} + +.issue{ + font-size:10px; + color:#5d5d5d; +} + +fieldset{ + border: 1px solid #CCC; + margin-bottom:30px; +} + +label{ + font-weight:normal; +} + +ul li{ + list-style:none; +} + +legend{ + font-weight:bold; +} +/**********BARRA GOVERNO FEDERAL ******/ + +.barra_MSaude { + width: 100%; + height: 30px; + background:#ffcc00; +} + +.barra_MSaude .barra1000 { + width:100%; + margin: 0 auto; +} +.barra_MSaude .barra1000 .minSaude a { + width: 152px; + height: 21px; + float: left; + margin: 1px; + background: url(ms.gif) top left no-repeat; +} +.barra_MSaude .barra1000 .brasilGov a { + margin: 1px; + width: 96px; + height: 21px; + float: right; + background: url(brasil.gif) top left no-repeat; +} +.barra_MSaude .barra1000 .minSaude, .barra_MSaude .barra1000 .form { + float: left; +} + +.barra_MSaude .barra1000 .form { + margin: 2px 0px 0px 50px; + +} +.barra_MSaude .barra1000 .form .pr{ + background: #ffcc00 !important; + font-size: 10px; + } + +.barra_MSaude .barra1000 .brasilGov { + float: right; +} +.barra_MSaude .barra1000 DIV a span { + display: none; +} diff --git a/clinicaltrials/static/logoOpas.gif b/clinicaltrials/static/logoOpas.gif index efa1d80..0a8d34d 100644 Binary files a/clinicaltrials/static/logoOpas.gif and b/clinicaltrials/static/logoOpas.gif differ diff --git a/clinicaltrials/templates/base.html b/clinicaltrials/templates/base.html index d184cab..af428ef 100644 --- a/clinicaltrials/templates/base.html +++ b/clinicaltrials/templates/base.html @@ -1,104 +1,100 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -{% load i18n %} -<head> - <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"/> - <title>{% block page_title %}{% trans "Clinical Trials Platform" %}{% endblock %}</title> - <link rel="shortcut icon" href="/static/favicon.ico"/> - <!-- stylesheets to support admin widgets in public forms --> -<!-- <link rel="stylesheet" type="text/css" href="/media/css/base.css" /> - <link rel="stylesheet" type="text/css" href="/media/css/forms.css" /> - <link rel="stylesheet" type="text/css" href="/media/css/widgets.css" />--> - <link rel="stylesheet" type="text/css" href="/static/css/asmselect/jquery.asmselect.css"/> - <link rel="stylesheet" type="text/css" href="/static/css/style.css"/> - <!-- js to support admin widgets in public forms --> - <!-- script type="text/javascript" src="/admin/jsi18n/"></script> - <script type="text/javascript" src="/media/js/core.js"></script> - <script type="text/javascript" src="/media/js/dateparse.js"></script> - <script type="text/javascript" src="/media/js/timeparse.js"></script> - <script type="text/javascript" src="/media/js/calendar.js"></script> - <script type="text/javascript" src="/media/js/admin/DateTimeShortcuts.js" type="text/javascript"></script --> - <script type="text/javascript" src="/static/js/jquery-1.3.1.min.js" type="text/javascript"></script> - <script type="text/javascript" src="/static/js/jquery.ui.js" type="text/javascript"></script> - <script type="text/javascript" src="/static/js/asmselect/jquery.asmselect.js" type="text/javascript"></script> - <script type="text/javascript" src="/static/js/submission.utils.js"></script> -</head> - <body> - <div id="container"> - <div class="barra_MSaude"> - <div class="barra1000"> - <div class="minSaude"> - <a href="http://www.saude.gov.br" title="Ministério da Saúde" target="_blank"> - <span>{% trans 'Ministério da Saúde'%}</span> - </a> - </div> - <div class="form"> - <form method="post" action="/" id="govform" name="govform"> - <select name="opcoes" onchange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)" class="pr"> - <option>{% trans 'Destaques do governo' %}</option> - <option value="javascript:nova_jan('http://www.brasil.gov.br')">{% trans 'Portal do Governo Federal' %}</option> - <option value="javascript:nova_jan('http://www.e.gov.br')">{% trans 'Portal de Serviços do Governo' %}</option> - <option value="javascript:nova_jan('http://www.radiobras.gov.br')">{% trans 'Portal da Agência de Notícias' %}</option> - <option value="javascript:nova_jan('http://www.previdenciasocial.gov.br')">{% trans 'Reforma da Previdência' %}</option> - <option value="javascript:nova_jan('http://www.fomezero.gov.br')">{% trans 'Programa Fome Zero' %}</option> - </select> - </form> - </div> - <div class="brasilGov"> - <a href="http://www.brasil.gov.br" title="Governo Federal" target="_blank"> - <span>{% trans 'Governo Federal' %}</span> - </a> - </div> - </div> - </div> - - <div id="top"> - <img src="/static/logoOpas.gif" alt="Pan-American Health Organization Logo"/> - <h1>{% block headline %}{% trans "RBEC" %}{% endblock %}</h1> - </div> - <div id="middle"> - <div id="columns"> - <div id="workarea"> - {% block stepmenu_top %}{% endblock %} - - <div id="content"> - {% block body %}{% endblock %} - </div> - - {% block stepmenu_bottom %}{% endblock %} - </div> - <div id="rebracmenu"> - <div id="usermenu"> - {% if username %} - <div> - <span>{{username}}</span><br/> - <a href="/accounts/logout">log out</a> - </div> - <ul> - <li>Profile</li> - <li>Dashboard</li> - <li><a href="{% url reviewapp.userhome %}">{% trans 'Submissions' %}</a></li> - <li>Issues</li> - </ul> - {% else %} - <div><a href="/accounts/login" title="{% trans 'access with an existing account' %}">[{% trans 'login' %}]</a> - <br />&nbsp;<br /> - <a href="/accounts/register" title="{% trans 'create an account to submit trial records' %}">[{% trans 'register' %}]</a> - </div> - {% endif %} - </div> - <ul> - <li>{% trans "News" %}</li> - <li>{% trans "About" %}</li> - <li>{% trans "Help" %}</li> - </ul> - </div> - </div> - </div> - <div id="footer"> - <p>&nbsp;</p> - </div> - </div> - </body> -</html> +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + {% load i18n %} + <head> + <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"/> + <title>{% block page_title %}{% trans "Clinical Trials Platform" %}{% endblock %}</title> + <link rel="shortcut icon" href="/static/favicon.ico"/> + + <link rel="stylesheet" type="text/css" href="/static/css/asmselect/jquery.asmselect.css"/> + <link rel="stylesheet" type="text/css" href="/static/css/style.css"/> + + <script type="text/javascript" src="/static/js/jquery-1.3.1.min.js" type="text/javascript"></script> + <script type="text/javascript" src="/static/js/jquery.ui.js" type="text/javascript"></script> + <script type="text/javascript" src="/static/js/asmselect/jquery.asmselect.js" type="text/javascript"></script> + <script type="text/javascript" src="/static/js/submission.utils.js"></script> + </head> + <body> + <div id="container"> + <div class="barra_MSaude"> + <div class="barra1000"> + <div class="minSaude"> + <a href="http://www.saude.gov.br" title="Ministério da Saúde" target="_blank"> + <span>{% trans 'Ministério da Saúde'%}</span> + </a> + </div> + <div class="form"> + <form method="post" action="/" id="govform" name="govform"> + <select name="opcoes" onchange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)" class="pr"> + <option>{% trans 'Destaques do governo' %}</option> + <option value="javascript:nova_jan('http://www.brasil.gov.br')">{% trans 'Portal do Governo Federal' %}</option> + <option value="javascript:nova_jan('http://www.e.gov.br')">{% trans 'Portal de Serviços do Governo' %}</option> + <option value="javascript:nova_jan('http://www.radiobras.gov.br')">{% trans 'Portal da Agência de Notícias' %}</option> + <option value="javascript:nova_jan('http://www.previdenciasocial.gov.br')">{% trans 'Reforma da Previdência' %}</option> + <option value="javascript:nova_jan('http://www.fomezero.gov.br')">{% trans 'Programa Fome Zero' %}</option> + </select> + </form> + </div> + <div class="brasilGov"> + <a href="http://www.brasil.gov.br" title="Governo Federal" target="_blank"> + <span>{% trans 'Governo Federal' %}</span> + </a> + </div> + </div> + </div> + <div id="top"> + <img src="/static/logoOpas.gif" alt="Pan-American Health Organization Logo"/> + <h1>{% block headline %}{% trans "RBEC" %}{% endblock %}</h1> + </div> + <div id="middle"> + <div id="columns"> + <div id="workarea"> + {% block stepmenu_top %}{% endblock %} + <div id="content"> + {% block body %}{% endblock %} + </div> + {% block stepmenu_bottom %}{% endblock %} + </div> + <div id="rebracmenu"> + <div id="usermenu"> + {% if username %} + <div> + <span>{{username}}</span><br/> + <a href="/accounts/logout">log out</a> + </div> + <ul> + <li>Profile</li> + <li>Dashboard</li> + <li><a href="{% url reviewapp.userhome %}">{% trans 'Submissions' %}</a></li> + <li>Issues</li> + </ul> + {% else %} + <div><a href="/accounts/login" title="{% trans 'access with an existing account' %}">[{% trans 'login' %}]</a> + <br />&nbsp;<br /> + <a href="/accounts/register" title="{% trans 'create an account to submit trial records' %}">[{% trans 'register' %}]</a> + </div> + {% endif %} + </div> + <ul> + <li>{% trans "News" %}</li> + <li>{% trans "About" %}</li> + <li>{% trans "Help" %}</li> + </ul> + </div> + </div> + </div> + <div id="footer"> + <p> + <strong> BIREME - OPAS - OMS + </strong><br/> + Centro Latino-Americano e do Caribe de Informação em Ciências da Saúde + <br/> + Rua Botucatu, 862 - 04023-901 - São Paulo/SP - Brasil - Tel: (55 11) 5576-9800 - Fax: (55 11) 5575-8868 + <br/> + </p> + </div> + </div> + </body> +</html> +
ensaiosclinicos/clinicaltrials
abfa5de7c2b3988b792553bc7abbd0293d0a4055
script to import trial from xml files
diff --git a/clinicaltrials/load.py b/clinicaltrials/load.py index a5cb3e5..89c50e8 100644 --- a/clinicaltrials/load.py +++ b/clinicaltrials/load.py @@ -1,105 +1,139 @@ import re from lxml.etree import ElementTree from django.core.management import setup_environ import settings setup_environ(settings) -from vocabulary.models import CountryCode +from vocabulary.models import CountryCode, StudyType, StudyPurpose, StudyMasking +from vocabulary.models import InterventionAssigment, StudyAllocation, StudyPhase +from vocabulary.models import RecruitmentStatus + from repository.models import ClinicalTrial, Institution, TrialSecondarySponsor from repository.models import TrialSupportSource, Contact, SiteContact, PublicContact from repository.models import ScientificContact, InterventionCode clinical_trial_xpath = { 'trial_id':'', 'date_registration':'', 'scientific_title':'trial_identification/scientific_title', 'scientific_acronym':'trial_identification/scientific_acronym', 'public_title':'trial_identification/public_title', 'acronym':'trial_identification/acronym', 'hc_freetext':'health_conditions/freetext', 'i_freetext':'interventions/freetext', 'inclusion_criteria':'recruitment/inclusion_criteria', 'gender':'recruitment/gender/@value', 'agemin_value':'recruitment/agemin', 'agemin_unit':'recruitment/agemin/@unit', 'agemax_value':'recruitment/agemax', 'agemax_unit':'recruitment/agemax/@unit', 'exclusion_criteria':'recruitment/exclusion_criteria', 'study_design':'study_type/study_design', 'expanded_access_program':'study_type/study_design/@expanded_access_program', 'number_of_arms':'study_type/study_design/@number_of_arms', 'date_enrollment_anticipated':'recruitment/date_enrolment_anticipated', 'date_enrollment_actual':'recruitment/date_enrolment_actual', 'target_sample_size':'recruitment/target_size', 'created':'', 'updated':'', 'exported':'', 'status':'', 'staff_note':'' } -contact_types = { +contact_types_map = { 'public_contact':PublicContact, 'scientific_contact':ScientificContact, 'site_contact':SiteContact } +study_design_map = { + 'allocation': StudyAllocation, + 'intervention_assignment':InterventionAssigment, + 'masking': StudyMasking, + 'purpose': StudyPurpose +} xml = open('repository/xml/sample_1b.xml') tree = ElementTree() root = tree.parse(xml) ct = ClinicalTrial() ct.save() # Non-relational Fields from Clinical Trial for field,xpath in clinical_trial_xpath.items(): if xpath != '': resultEl = root.xpath(xpath) if len(resultEl) > 0: if hasattr(resultEl[0],'text'): - ct.__setattr__(field,resultEl[0].text) + setattr(ct, field, resultEl[0].text) else: - ct.__setattr__(field,resultEl[0]) - + setattr(ct, field, resultEl[0]) # Add Sponsors for sponsorNode in root.xpath('sponsors_and_support/*'): sponsor = Institution() sponsor.name = sponsorNode.find('name').text sponsor.address = sponsorNode.find('address').text sponsor.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) sponsor.save() if sponsorNode.tag == 'primary_sponsor': ct.primary_sponsor = sponsor elif sponsorNode.tag == 'secondary_sponsor': TrialSecondarySponsor.objects.create(trial=ct,institution=sponsor) elif sponsorNode.tag == 'source_support': TrialSupportSource.objects.create(trial=ct,institution=sponsor) # Add Contacts contactList = {} for personNode in root.xpath('contacts/person'): contact = Contact() for attr in ['firstname','middlename','lastname','email','address','city','zip','telephone']: value = personNode.find(attr) if value is not None: - contact.__setattr__(attr,value.text) + setattr(contact, attr, value.text) contact.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) contact.save() contactList[ personNode.attrib['pid'] ] = contact # Assign PublicContact, ScientificContact and SiteContact to the trial -for cType,model in contact_types.items(): +for cType,model in contact_types_map.items(): for typeNode in root.xpath('contacts/'+cType): pattern = re.compile('p[0-9]+') for person in pattern.findall(typeNode.attrib['persons']): model.objects.create(trial=ct,contact=contactList[person]) -#Interventions +# Interventions for icodeNode in root.xpath('interventions/i_code'): i_code = InterventionCode.objects.get(label=icodeNode.attrib['value']) if isinstance(i_code,InterventionCode): ct.i_code.add(i_code) + +# Recruitment Country +for rcountryNode in root.xpath('recruitment/recruitment_country'): + ccode = CountryCode.objects.get(label=rcountryNode.attrib['value']) + if isinstance(ccode,CountryCode): + ct.recruitment_country.add(ccode) + +# StudyType +study_type_node = StudyType.objects.get(label=root.attrib['type']) +if study_type_node is not None: + ct.study_type = study_type_node + +study_design_node = root.find('study_type/study_design') +if study_design_node is not None: + for attr,model in study_design_map.items(): + setattr(ct, attr, model.objects.get(label=study_design_node.attrib[attr])) + +study_phase_node = root.find('study_type/phase') +if study_phase_node is not None: + ct.phase = StudyPhase.objects.get(label=study_phase_node.attrib['value']) + +recruitment_status = RecruitmentStatus.objects.get(label = root.find('recruitment').attrib['study_status']) +if recruitment_status is not None: + ct.status = recruitment_status + +# TODO: Integrate this script with django! \ No newline at end of file
ensaiosclinicos/clinicaltrials
4a695c6a973b14d8b0b594df96ea181927b29048
Equalize RecruitmentStatus labels with options in DTD
diff --git a/clinicaltrials/vocabulary/fixtures/initial_data.json b/clinicaltrials/vocabulary/fixtures/initial_data.json index 2fcfcba..f2fae24 100644 --- a/clinicaltrials/vocabulary/fixtures/initial_data.json +++ b/clinicaltrials/vocabulary/fixtures/initial_data.json @@ -11691,884 +11691,884 @@ "submission_language": "", "label": "AE" } }, { "pk": 232, "model": "vocabulary.countrycode", "fields": { "description": "United Kingdom", "submission_language": "", "label": "GB" } }, { "pk": 233, "model": "vocabulary.countrycode", "fields": { "description": "United States", "submission_language": "", "label": "US" } }, { "pk": 234, "model": "vocabulary.countrycode", "fields": { "description": "United States Minor Outlying Islands", "submission_language": "", "label": "UM" } }, { "pk": 235, "model": "vocabulary.countrycode", "fields": { "description": "Uruguay", "submission_language": "es", "label": "UY" } }, { "pk": 236, "model": "vocabulary.countrycode", "fields": { "description": "Uzbekistan", "submission_language": "", "label": "UZ" } }, { "pk": 237, "model": "vocabulary.countrycode", "fields": { "description": "Vanuatu", "submission_language": "", "label": "VU" } }, { "pk": 238, "model": "vocabulary.countrycode", "fields": { "description": "Venezuela", "submission_language": "es", "label": "VE" } }, { "pk": 239, "model": "vocabulary.countrycode", "fields": { "description": "Viet Nam", "submission_language": "", "label": "VN" } }, { "pk": 240, "model": "vocabulary.countrycode", "fields": { "description": "Virgin Islands, British", "submission_language": "", "label": "VG" } }, { "pk": 241, "model": "vocabulary.countrycode", "fields": { "description": "Virgin Islands, U.S.", "submission_language": "", "label": "VI" } }, { "pk": 242, "model": "vocabulary.countrycode", "fields": { "description": "Wallis and Futuna", "submission_language": "", "label": "WF" } }, { "pk": 243, "model": "vocabulary.countrycode", "fields": { "description": "Western Sahara", "submission_language": "", "label": "EH" } }, { "pk": 244, "model": "vocabulary.countrycode", "fields": { "description": "Yemen", "submission_language": "", "label": "YE" } }, { "pk": 245, "model": "vocabulary.countrycode", "fields": { "description": "Zambia", "submission_language": "", "label": "ZM" } }, { "pk": 246, "model": "vocabulary.countrycode", "fields": { "description": "Zimbabwe", "submission_language": "", "label": "ZW" } }, { "pk": 1, "model": "vocabulary.trialnumberissuingauthority", "fields": { "description": "World Health Organization, International Clinical Trials Registry Platform", "label": "WHO ICTRP" } }, { "pk": 2, "model": "vocabulary.trialnumberissuingauthority", "fields": { "description": "Comiss\u00e3o Nacional de \u00c9tica em Pesquisa, Conselho Nacional de Pesquisa, Minist\u00e9rio da Sa\u00fade, Brasil", "label": "Plataforma Brasil (CONEP)" } }, { "pk": 3, "model": "vocabulary.trialnumberissuingauthority", "fields": { "description": "National Library of Medicine (NLM), U.S. National Institutes of Health (NIH)", "label": "ClinicalTrials.gov" } }, { "pk": 4, "model": "vocabulary.trialnumberissuingauthority", "fields": { "description": "Australian New Zealand Clinical Trials Registry", "label": "ANZCTR" } }, { "pk": 5, "model": "vocabulary.trialnumberissuingauthority", "fields": { "description": "Iranian Registry of Clinical Trials", "label": "IRCT" } }, { "pk": 6, "model": "vocabulary.trialnumberissuingauthority", "fields": { "description": "Cochrane Renal Group", "label": "CRG" } }, { "pk": 1, "model": "vocabulary.interventioncode", "fields": { "description": "", "label": "drug" } }, { "pk": 2, "model": "vocabulary.interventioncode", "fields": { "description": "", "label": "device" } }, { "pk": 3, "model": "vocabulary.interventioncode", "fields": { "description": "http://reddes.bvsaude.org/projects/clinical-trials/wiki/InterventionsField", "label": "biological/vaccine" } }, { "pk": 4, "model": "vocabulary.interventioncode", "fields": { "description": "", "label": "procedure/surgery" } }, { "pk": 5, "model": "vocabulary.interventioncode", "fields": { "description": "", "label": "radiation" } }, { "pk": 6, "model": "vocabulary.interventioncode", "fields": { "description": "ex. psychoteraphy, lifestyle counselling", "label": "behavioural" } }, { "pk": 7, "model": "vocabulary.interventioncode", "fields": { "description": "", "label": "genetics" } }, { "pk": 8, "model": "vocabulary.interventioncode", "fields": { "description": "", "label": "dietary supplement" } }, { "pk": 9, "model": "vocabulary.interventioncode", "fields": { "description": "", "label": "other" } }, { "pk": 1, "model": "vocabulary.studytype", "fields": { "description": "", "label": "interventional" } }, { "pk": 2, "model": "vocabulary.studytype", "fields": { "description": "", "label": "observational" } }, { "pk": 1, "model": "vocabulary.studypurpose", "fields": { "description": "", "label": "diagnostic" } }, { "pk": 2, "model": "vocabulary.studypurpose", "fields": { "description": "", "label": "etiological" } }, { "pk": 3, "model": "vocabulary.studypurpose", "fields": { "description": "", "label": "prognostic" } }, { "pk": 4, "model": "vocabulary.studypurpose", "fields": { "description": "", "label": "prevention" } }, { "pk": 5, "model": "vocabulary.studypurpose", "fields": { "description": "", "label": "treatment" } }, { "pk": 6, "model": "vocabulary.studypurpose", "fields": { "description": "", "label": "other" } }, { "pk": 1, "model": "vocabulary.interventionassigment", "fields": { "description": "", "label": "single-group" } }, { "pk": 2, "model": "vocabulary.interventionassigment", "fields": { "description": "", "label": "parallel" } }, { "pk": 3, "model": "vocabulary.interventionassigment", "fields": { "description": "", "label": "cross-over" } }, { "pk": 4, "model": "vocabulary.interventionassigment", "fields": { "description": "", "label": "factorial" } }, { "pk": 5, "model": "vocabulary.interventionassigment", "fields": { "description": "", "label": "other" } }, { "pk": 1, "model": "vocabulary.studymasking", "fields": { "description": "", "label": "open" } }, { "pk": 2, "model": "vocabulary.studymasking", "fields": { "description": "", "label": "single-blind" } }, { "pk": 3, "model": "vocabulary.studymasking", "fields": { "description": "", "label": "double-blind" } }, { "pk": 4, "model": "vocabulary.studymasking", "fields": { "description": "", "label": "triple-blind" } }, { "pk": 1, "model": "vocabulary.studyallocation", "fields": { "description": "", "label": "non-randomized-controlled" } }, { "pk": 2, "model": "vocabulary.studyallocation", "fields": { "description": "", "label": "randomized-controlled" } }, { "pk": 3, "model": "vocabulary.studyallocation", "fields": { "description": "", "label": "single-arm-study" } }, { "pk": 1, "model": "vocabulary.studyphase", "fields": { "description": "not applicable", "label": "N/A" } }, { "pk": 2, "model": "vocabulary.studyphase", "fields": { "description": "exploratory trial", "label": "0" } }, { "pk": 3, "model": "vocabulary.studyphase", "fields": { "description": "phase 1", "label": "1" } }, { "pk": 4, "model": "vocabulary.studyphase", "fields": { "description": "phases 1-2", "label": "1-2" } }, { "pk": 5, "model": "vocabulary.studyphase", "fields": { "description": "phase 2", "label": "2" } }, { "pk": 6, "model": "vocabulary.studyphase", "fields": { "description": "phases 2-3", "label": "2-3" } }, { "pk": 7, "model": "vocabulary.studyphase", "fields": { "description": "phase 3", "label": "3" } }, { "pk": 8, "model": "vocabulary.studyphase", "fields": { "description": "phase 4", "label": "4" } }, { "pk": 1, "model": "vocabulary.recruitmentstatus", "fields": { "description": "Recruitment of participants has not yet commenced at any site.", "label": "pending" } }, { "pk": 2, "model": "vocabulary.recruitmentstatus", "fields": { "description": "Open to recruitment\r\n", "label": "recruiting" } }, { "pk": 3, "model": "vocabulary.recruitmentstatus", "fields": { "description": "Recruitment has been temporarily stopped", "label": "suspended" } }, { "pk": 4, "model": "vocabulary.recruitmentstatus", "fields": { "description": "Participants are no longer being recruited. The trial is closed. Participants may, however, still be in follow-up.", - "label": "complete" + "label": "completed" } }, { "pk": 5, "model": "vocabulary.recruitmentstatus", "fields": { "description": "Other recruitment status", "label": "other" } }, { "pk": 1, "model": "vocabulary.decsdisease", "fields": { "description": "Bacterial Infections and Mycoses", "label": "C01" } }, { "pk": 2, "model": "vocabulary.decsdisease", "fields": { "description": "Virus Diseases", "label": "C02" } }, { "pk": 3, "model": "vocabulary.decsdisease", "fields": { "description": "Parasitic Diseases", "label": "C03" } }, { "pk": 4, "model": "vocabulary.decsdisease", "fields": { "description": "Neoplasms", "label": "C04" } }, { "pk": 5, "model": "vocabulary.decsdisease", "fields": { "description": "Musculoskeletal Diseases", "label": "C05" } }, { "pk": 6, "model": "vocabulary.decsdisease", "fields": { "description": "Digestive System Diseases", "label": "C06" } }, { "pk": 7, "model": "vocabulary.decsdisease", "fields": { "description": "Stomatognathic Diseases", "label": "C07" } }, { "pk": 8, "model": "vocabulary.decsdisease", "fields": { "description": "Respiratory Tract Diseases", "label": "C08" } }, { "pk": 9, "model": "vocabulary.decsdisease", "fields": { "description": "Otorhinolaryngologic Diseases", "label": "C09" } }, { "pk": 10, "model": "vocabulary.decsdisease", "fields": { "description": "Nervous System Diseases", "label": "C10" } }, { "pk": 11, "model": "vocabulary.decsdisease", "fields": { "description": "Eye Diseases", "label": "C11" } }, { "pk": 12, "model": "vocabulary.decsdisease", "fields": { "description": "Male Urogenital Diseases", "label": "C12" } }, { "pk": 13, "model": "vocabulary.decsdisease", "fields": { "description": "Female Urogenital Diseases and Pregnancy Complications", "label": "C13" } }, { "pk": 14, "model": "vocabulary.decsdisease", "fields": { "description": "Cardiovascular Diseases", "label": "C14" } }, { "pk": 15, "model": "vocabulary.decsdisease", "fields": { "description": "Hemic and Lymphatic Diseases", "label": "C15" } }, { "pk": 16, "model": "vocabulary.decsdisease", "fields": { "description": "Congenital, Hereditary, and Neonatal Diseases and Abnormalities", "label": "C16" } }, { "pk": 17, "model": "vocabulary.decsdisease", "fields": { "description": "Skin and Connective Tissue Diseases", "label": "C17" } }, { "pk": 18, "model": "vocabulary.decsdisease", "fields": { "description": "Nutritional and Metabolic Diseases", "label": "C18" } }, { "pk": 19, "model": "vocabulary.decsdisease", "fields": { "description": "Endocrine System Diseases", "label": "C19" } }, { "pk": 20, "model": "vocabulary.decsdisease", "fields": { "description": "Immune System Diseases", "label": "C20" } }, { "pk": 21, "model": "vocabulary.decsdisease", "fields": { "description": "Disorders of Environmental Origin", "label": "C21" } }, { "pk": 22, "model": "vocabulary.decsdisease", "fields": { "description": "Animal Diseases", "label": "C22" } }, { "pk": 23, "model": "vocabulary.decsdisease", "fields": { "description": "Pathological Conditions, Signs and Symptoms", "label": "C23" } }, { "pk": 1, "model": "vocabulary.icdchapter", "fields": { "description": "Certain infectious and parasitic diseases", "label": "I" } }, { "pk": 2, "model": "vocabulary.icdchapter", "fields": { "description": "Neoplasms", "label": "II" } }, { "pk": 3, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the blood and blood-forming organs and certain disorders involving the immune mechanism", "label": "III" } }, { "pk": 4, "model": "vocabulary.icdchapter", "fields": { "description": "Endocrine, nutritional and metabolic diseases", "label": "IV" } }, { "pk": 5, "model": "vocabulary.icdchapter", "fields": { "description": "Mental and behavioural disorders", "label": "V" } }, { "pk": 6, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the nervous system", "label": "VI" } }, { "pk": 7, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the eye and adnexa", "label": "VII" } }, { "pk": 8, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the ear and mastoid process", "label": "VIII" } }, { "pk": 9, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the circulatory system", "label": "IX" } }, { "pk": 10, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the respiratory system", "label": "X" } }, { "pk": 11, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the digestive system", "label": "XI" } }, { "pk": 12, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the skin and subcutaneous tissue", "label": "XII" } }, { "pk": 13, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the musculoskeletal system and connective tissue", "label": "XIII" } }, { "pk": 14, "model": "vocabulary.icdchapter", "fields": { "description": "Diseases of the genitourinary system", "label": "XIV" } }, { "pk": 15, "model": "vocabulary.icdchapter", "fields": { "description": "Pregnancy, childbirth and the puerperium", "label": "XV" } }, { "pk": 16, "model": "vocabulary.icdchapter", "fields": { "description": "Certain conditions originating in the perinatal period", "label": "XVI" } }, { "pk": 17, "model": "vocabulary.icdchapter", "fields": { "description": "Congenital malformations, deformations and chromosomal abnormalities", "label": "XVII" } }, { "pk": 18, "model": "vocabulary.icdchapter", "fields": { "description": "Symptoms, signs and abnormal clinical and laboratory findings, not elsewhere classified", "label": "XVIII" } }, { "pk": 19, "model": "vocabulary.icdchapter", "fields": { "description": "Injury, poisoning and certain other consequences of external causes", "label": "XIX" } }, { "pk": 20, "model": "vocabulary.icdchapter", "fields": { "description": "External causes of morbidity and mortality", "label": "XX" } }, { "pk": 21, "model": "vocabulary.icdchapter", "fields": { "description": "Factors influencing health status and contact with health services", "label": "XXI" } }, { "pk": 22, "model": "vocabulary.icdchapter", "fields": { "description": "Codes for special purposes", "label": "XXII" } } ]
ensaiosclinicos/clinicaltrials
380cd4cf54d6db98f00b957e6275b0d9f3a59475
the bar of brazilian government
diff --git a/clinicaltrials/templates/base.html b/clinicaltrials/templates/base.html index 5d510ea..d184cab 100644 --- a/clinicaltrials/templates/base.html +++ b/clinicaltrials/templates/base.html @@ -1,77 +1,104 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> {% load i18n %} <head> <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"/> <title>{% block page_title %}{% trans "Clinical Trials Platform" %}{% endblock %}</title> <link rel="shortcut icon" href="/static/favicon.ico"/> <!-- stylesheets to support admin widgets in public forms --> <!-- <link rel="stylesheet" type="text/css" href="/media/css/base.css" /> <link rel="stylesheet" type="text/css" href="/media/css/forms.css" /> <link rel="stylesheet" type="text/css" href="/media/css/widgets.css" />--> <link rel="stylesheet" type="text/css" href="/static/css/asmselect/jquery.asmselect.css"/> <link rel="stylesheet" type="text/css" href="/static/css/style.css"/> <!-- js to support admin widgets in public forms --> <!-- script type="text/javascript" src="/admin/jsi18n/"></script> <script type="text/javascript" src="/media/js/core.js"></script> <script type="text/javascript" src="/media/js/dateparse.js"></script> <script type="text/javascript" src="/media/js/timeparse.js"></script> <script type="text/javascript" src="/media/js/calendar.js"></script> <script type="text/javascript" src="/media/js/admin/DateTimeShortcuts.js" type="text/javascript"></script --> <script type="text/javascript" src="/static/js/jquery-1.3.1.min.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/jquery.ui.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/asmselect/jquery.asmselect.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/submission.utils.js"></script> </head> <body> <div id="container"> + <div class="barra_MSaude"> + <div class="barra1000"> + <div class="minSaude"> + <a href="http://www.saude.gov.br" title="Ministério da Saúde" target="_blank"> + <span>{% trans 'Ministério da Saúde'%}</span> + </a> + </div> + <div class="form"> + <form method="post" action="/" id="govform" name="govform"> + <select name="opcoes" onchange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)" class="pr"> + <option>{% trans 'Destaques do governo' %}</option> + <option value="javascript:nova_jan('http://www.brasil.gov.br')">{% trans 'Portal do Governo Federal' %}</option> + <option value="javascript:nova_jan('http://www.e.gov.br')">{% trans 'Portal de Serviços do Governo' %}</option> + <option value="javascript:nova_jan('http://www.radiobras.gov.br')">{% trans 'Portal da Agência de Notícias' %}</option> + <option value="javascript:nova_jan('http://www.previdenciasocial.gov.br')">{% trans 'Reforma da Previdência' %}</option> + <option value="javascript:nova_jan('http://www.fomezero.gov.br')">{% trans 'Programa Fome Zero' %}</option> + </select> + </form> + </div> + <div class="brasilGov"> + <a href="http://www.brasil.gov.br" title="Governo Federal" target="_blank"> + <span>{% trans 'Governo Federal' %}</span> + </a> + </div> + </div> + </div> + <div id="top"> <img src="/static/logoOpas.gif" alt="Pan-American Health Organization Logo"/> <h1>{% block headline %}{% trans "RBEC" %}{% endblock %}</h1> </div> <div id="middle"> <div id="columns"> <div id="workarea"> {% block stepmenu_top %}{% endblock %} <div id="content"> {% block body %}{% endblock %} </div> {% block stepmenu_bottom %}{% endblock %} </div> <div id="rebracmenu"> <div id="usermenu"> {% if username %} <div> <span>{{username}}</span><br/> <a href="/accounts/logout">log out</a> </div> <ul> <li>Profile</li> <li>Dashboard</li> <li><a href="{% url reviewapp.userhome %}">{% trans 'Submissions' %}</a></li> <li>Issues</li> </ul> {% else %} <div><a href="/accounts/login" title="{% trans 'access with an existing account' %}">[{% trans 'login' %}]</a> <br />&nbsp;<br /> <a href="/accounts/register" title="{% trans 'create an account to submit trial records' %}">[{% trans 'register' %}]</a> </div> {% endif %} </div> <ul> <li>{% trans "News" %}</li> <li>{% trans "About" %}</li> <li>{% trans "Help" %}</li> </ul> </div> </div> </div> <div id="footer"> <p>&nbsp;</p> </div> </div> </body> </html>
ensaiosclinicos/clinicaltrials
03d3c6bcb4a94c8bf4ef43d24c5eacac46730a25
link to register
diff --git a/clinicaltrials/templates/base.html b/clinicaltrials/templates/base.html index 44c4dac..5d510ea 100644 --- a/clinicaltrials/templates/base.html +++ b/clinicaltrials/templates/base.html @@ -1,74 +1,77 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> {% load i18n %} <head> <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8"/> <title>{% block page_title %}{% trans "Clinical Trials Platform" %}{% endblock %}</title> <link rel="shortcut icon" href="/static/favicon.ico"/> <!-- stylesheets to support admin widgets in public forms --> <!-- <link rel="stylesheet" type="text/css" href="/media/css/base.css" /> <link rel="stylesheet" type="text/css" href="/media/css/forms.css" /> <link rel="stylesheet" type="text/css" href="/media/css/widgets.css" />--> <link rel="stylesheet" type="text/css" href="/static/css/asmselect/jquery.asmselect.css"/> <link rel="stylesheet" type="text/css" href="/static/css/style.css"/> <!-- js to support admin widgets in public forms --> <!-- script type="text/javascript" src="/admin/jsi18n/"></script> <script type="text/javascript" src="/media/js/core.js"></script> <script type="text/javascript" src="/media/js/dateparse.js"></script> <script type="text/javascript" src="/media/js/timeparse.js"></script> <script type="text/javascript" src="/media/js/calendar.js"></script> <script type="text/javascript" src="/media/js/admin/DateTimeShortcuts.js" type="text/javascript"></script --> <script type="text/javascript" src="/static/js/jquery-1.3.1.min.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/jquery.ui.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/asmselect/jquery.asmselect.js" type="text/javascript"></script> <script type="text/javascript" src="/static/js/submission.utils.js"></script> </head> <body> <div id="container"> <div id="top"> <img src="/static/logoOpas.gif" alt="Pan-American Health Organization Logo"/> <h1>{% block headline %}{% trans "RBEC" %}{% endblock %}</h1> </div> <div id="middle"> <div id="columns"> <div id="workarea"> {% block stepmenu_top %}{% endblock %} <div id="content"> {% block body %}{% endblock %} </div> {% block stepmenu_bottom %}{% endblock %} </div> <div id="rebracmenu"> <div id="usermenu"> {% if username %} <div> <span>{{username}}</span><br/> <a href="/accounts/logout">log out</a> </div> <ul> <li>Profile</li> <li>Dashboard</li> <li><a href="{% url reviewapp.userhome %}">{% trans 'Submissions' %}</a></li> <li>Issues</li> </ul> {% else %} - <div><a href="/accounts/login">[{% trans 'log in' %}]</a></div> + <div><a href="/accounts/login" title="{% trans 'access with an existing account' %}">[{% trans 'login' %}]</a> + <br />&nbsp;<br /> + <a href="/accounts/register" title="{% trans 'create an account to submit trial records' %}">[{% trans 'register' %}]</a> + </div> {% endif %} </div> <ul> <li>{% trans "News" %}</li> <li>{% trans "About" %}</li> <li>{% trans "Help" %}</li> </ul> </div> </div> </div> <div id="footer"> <p>&nbsp;</p> </div> </div> </body> </html>
ensaiosclinicos/clinicaltrials
fb933bf613a497c3cefbe85b9780d5b705fd3c02
major renaming registry->repository
diff --git a/clinicaltrials/dbpython.py b/clinicaltrials/dbpython.py index 842fcfb..32411a5 100644 --- a/clinicaltrials/dbpython.py +++ b/clinicaltrials/dbpython.py @@ -1,8 +1,8 @@ #!/usr/bin/env bpython from django.core.management import setup_environ import settings setup_environ(settings) -from registry.models import * +from repository.models import * from reviewapp.models import * diff --git a/clinicaltrials/load.py b/clinicaltrials/load.py index ff038eb..a5cb3e5 100644 --- a/clinicaltrials/load.py +++ b/clinicaltrials/load.py @@ -1,105 +1,105 @@ import re from lxml.etree import ElementTree from django.core.management import setup_environ import settings setup_environ(settings) from vocabulary.models import CountryCode -from registry.models import ClinicalTrial, Institution, TrialSecondarySponsor -from registry.models import TrialSupportSource, Contact, SiteContact, PublicContact -from registry.models import ScientificContact, InterventionCode +from repository.models import ClinicalTrial, Institution, TrialSecondarySponsor +from repository.models import TrialSupportSource, Contact, SiteContact, PublicContact +from repository.models import ScientificContact, InterventionCode clinical_trial_xpath = { 'trial_id':'', 'date_registration':'', 'scientific_title':'trial_identification/scientific_title', 'scientific_acronym':'trial_identification/scientific_acronym', 'public_title':'trial_identification/public_title', 'acronym':'trial_identification/acronym', 'hc_freetext':'health_conditions/freetext', 'i_freetext':'interventions/freetext', 'inclusion_criteria':'recruitment/inclusion_criteria', 'gender':'recruitment/gender/@value', 'agemin_value':'recruitment/agemin', 'agemin_unit':'recruitment/agemin/@unit', 'agemax_value':'recruitment/agemax', 'agemax_unit':'recruitment/agemax/@unit', 'exclusion_criteria':'recruitment/exclusion_criteria', 'study_design':'study_type/study_design', 'expanded_access_program':'study_type/study_design/@expanded_access_program', 'number_of_arms':'study_type/study_design/@number_of_arms', 'date_enrollment_anticipated':'recruitment/date_enrolment_anticipated', 'date_enrollment_actual':'recruitment/date_enrolment_actual', 'target_sample_size':'recruitment/target_size', 'created':'', 'updated':'', 'exported':'', 'status':'', 'staff_note':'' } contact_types = { 'public_contact':PublicContact, 'scientific_contact':ScientificContact, 'site_contact':SiteContact } -xml = open('registry/xml/sample_1b.xml') +xml = open('repository/xml/sample_1b.xml') tree = ElementTree() root = tree.parse(xml) ct = ClinicalTrial() ct.save() # Non-relational Fields from Clinical Trial for field,xpath in clinical_trial_xpath.items(): if xpath != '': resultEl = root.xpath(xpath) if len(resultEl) > 0: if hasattr(resultEl[0],'text'): ct.__setattr__(field,resultEl[0].text) else: ct.__setattr__(field,resultEl[0]) # Add Sponsors for sponsorNode in root.xpath('sponsors_and_support/*'): sponsor = Institution() sponsor.name = sponsorNode.find('name').text sponsor.address = sponsorNode.find('address').text sponsor.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) sponsor.save() if sponsorNode.tag == 'primary_sponsor': ct.primary_sponsor = sponsor elif sponsorNode.tag == 'secondary_sponsor': TrialSecondarySponsor.objects.create(trial=ct,institution=sponsor) elif sponsorNode.tag == 'source_support': TrialSupportSource.objects.create(trial=ct,institution=sponsor) # Add Contacts contactList = {} for personNode in root.xpath('contacts/person'): contact = Contact() for attr in ['firstname','middlename','lastname','email','address','city','zip','telephone']: value = personNode.find(attr) if value is not None: contact.__setattr__(attr,value.text) contact.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) contact.save() contactList[ personNode.attrib['pid'] ] = contact # Assign PublicContact, ScientificContact and SiteContact to the trial for cType,model in contact_types.items(): for typeNode in root.xpath('contacts/'+cType): pattern = re.compile('p[0-9]+') for person in pattern.findall(typeNode.attrib['persons']): model.objects.create(trial=ct,contact=contactList[person]) #Interventions for icodeNode in root.xpath('interventions/i_code'): i_code = InterventionCode.objects.get(label=icodeNode.attrib['value']) if isinstance(i_code,InterventionCode): ct.i_code.add(i_code) diff --git a/clinicaltrials/locale/es/LC_MESSAGES/django.po b/clinicaltrials/locale/es/LC_MESSAGES/django.po index ddce894..37c2797 100644 --- a/clinicaltrials/locale/es/LC_MESSAGES/django.po +++ b/clinicaltrials/locale/es/LC_MESSAGES/django.po @@ -1,533 +1,533 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-12-12 16:46+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <[email protected]>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: rebrac/models.py:23 registry/models.py:295 +#: rebrac/models.py:23 repository/models.py:295 msgid "Status" msgstr "" #: rebrac/models.py:26 msgid "Submission Note (staff use only)" msgstr "" #: rebrac/views.py:23 msgid "Initial Data fields" msgstr "" -#: rebrac/views.py:24 registry/models.py:20 registry/trds.py:15 -#: registry/trds_forms.py:24 +#: rebrac/views.py:24 repository/models.py:20 repository/trds.py:15 +#: repository/trds_forms.py:24 msgid "Scientific Title" msgstr "" -#: rebrac/views.py:27 registry/trds.py:16 +#: rebrac/views.py:27 repository/trds.py:16 msgid "Countries of Recruitment" msgstr "" #: rebrac/views.py:34 rebrac/templates/rebrac/new_submission.html:10 -#: registry/models.py:27 registry/trds.py:10 +#: repository/models.py:27 repository/trds.py:10 msgid "Primary Sponsor" msgstr "" #: rebrac/templates/rebrac/new_submission.html:8 msgid "Initial Trial Data" msgstr "" #: rebrac/templates/rebrac/new_submission.html:14 msgid "Submit" msgstr "" #: rebrac/templates/rebrac/submission_list.html:25 msgid "Submit a new Clinical Trial" msgstr "" -#: registry/models.py:14 +#: repository/models.py:14 msgid "Primary Id Number" msgstr "" -#: registry/models.py:17 tickets/models.py:11 +#: repository/models.py:17 tickets/models.py:11 msgid "Date of Registration" msgstr "" -#: registry/models.py:23 registry/trds_forms.py:29 +#: repository/models.py:23 repository/trds_forms.py:29 msgid "Scientific Acronym" msgstr "" -#: registry/models.py:29 registry/trds.py:14 registry/trds_forms.py:33 +#: repository/models.py:29 repository/trds.py:14 repository/trds_forms.py:33 msgid "Public Title" msgstr "" -#: registry/models.py:32 registry/trds_forms.py:37 +#: repository/models.py:32 repository/trds_forms.py:37 msgid "Acronym" msgstr "" -#: registry/models.py:35 +#: repository/models.py:35 msgid "Health Condition(s)" msgstr "" -#: registry/models.py:38 registry/trds_forms.py:78 registry/trds_forms.py:81 +#: repository/models.py:38 repository/trds_forms.py:78 repository/trds_forms.py:81 msgid "Intervention(s)" msgstr "" -#: registry/models.py:41 registry/trds_forms.py:131 +#: repository/models.py:41 repository/trds_forms.py:131 msgid "Inclusion Criteria" msgstr "" -#: registry/models.py:44 registry/trds_forms.py:135 +#: repository/models.py:44 repository/trds_forms.py:135 msgid "Gender (inclusion sex)" msgstr "" -#: registry/models.py:48 registry/trds_forms.py:138 +#: repository/models.py:48 repository/trds_forms.py:138 msgid "Inclusion Minimum Age" msgstr "" -#: registry/models.py:50 registry/trds_forms.py:140 +#: repository/models.py:50 repository/trds_forms.py:140 msgid "Minimum Age Unit" msgstr "" -#: registry/models.py:54 registry/trds_forms.py:143 +#: repository/models.py:54 repository/trds_forms.py:143 msgid "Inclusion Maximum Age" msgstr "" -#: registry/models.py:56 registry/trds_forms.py:145 +#: repository/models.py:56 repository/trds_forms.py:145 msgid "Maximum Age Unit" msgstr "" -#: registry/models.py:60 registry/trds_forms.py:148 +#: repository/models.py:60 repository/trds_forms.py:148 msgid "Exclusion Criteria" msgstr "" -#: registry/models.py:64 registry/trds_forms.py:90 registry/trds_forms.py:93 +#: repository/models.py:64 repository/trds_forms.py:90 repository/trds_forms.py:93 msgid "Study Type" msgstr "" -#: registry/models.py:67 registry/trds_forms.py:97 +#: repository/models.py:67 repository/trds_forms.py:97 msgid "Study Design" msgstr "" -#: registry/models.py:71 registry/trds_forms.py:101 +#: repository/models.py:71 repository/trds_forms.py:101 msgid "Study Phase" msgstr "" -#: registry/models.py:75 +#: repository/models.py:75 msgid "Anticipated Date of First Enrollment" msgstr "" -#: registry/models.py:79 +#: repository/models.py:79 msgid "Actual Date of First Enrollment" msgstr "" -#: registry/models.py:82 registry/trds_forms.py:128 +#: repository/models.py:82 repository/trds_forms.py:128 msgid "Target Sample Size" msgstr "" -#: registry/models.py:86 registry/trds_forms.py:120 +#: repository/models.py:86 repository/trds_forms.py:120 msgid "Recruitment Status" msgstr "" -#: registry/models.py:90 +#: repository/models.py:90 msgid "Last Update" msgstr "" -#: registry/models.py:91 +#: repository/models.py:91 msgid "Record Note (staff use only)" msgstr "" -#: registry/models.py:155 +#: repository/models.py:155 msgid "Updated" msgstr "" -#: registry/models.py:236 +#: repository/models.py:236 msgid "Issuing Authority" msgstr "" -#: registry/models.py:238 +#: repository/models.py:238 msgid "Secondary Id Number" msgstr "" -#: registry/models.py:250 registry/models.py:293 +#: repository/models.py:250 repository/models.py:293 msgid "Relationship" msgstr "" -#: registry/models.py:259 +#: repository/models.py:259 msgid "Name" msgstr "" -#: registry/models.py:260 +#: repository/models.py:260 msgid "Postal Address" msgstr "" -#: registry/models.py:261 registry/models.py:279 registry/models.py:307 -#: registry/trds_forms.py:166 +#: repository/models.py:261 repository/models.py:279 repository/models.py:307 +#: repository/trds_forms.py:166 msgid "Country" msgstr "" -#: registry/models.py:270 registry/trds_forms.py:154 +#: repository/models.py:270 repository/trds_forms.py:154 msgid "First Name" msgstr "" -#: registry/models.py:271 registry/trds_forms.py:155 +#: repository/models.py:271 repository/trds_forms.py:155 msgid "Middle Name" msgstr "" -#: registry/models.py:272 registry/trds_forms.py:156 +#: repository/models.py:272 repository/trds_forms.py:156 msgid "Last Name" msgstr "" -#: registry/models.py:273 registry/trds_forms.py:158 +#: repository/models.py:273 repository/trds_forms.py:158 msgid "E-mail" msgstr "" -#: registry/models.py:275 registry/trds_forms.py:161 +#: repository/models.py:275 repository/trds_forms.py:161 msgid "Affiliation" msgstr "" -#: registry/models.py:276 registry/trds_forms.py:163 +#: repository/models.py:276 repository/trds_forms.py:163 msgid "Address" msgstr "" -#: registry/models.py:277 registry/trds_forms.py:164 +#: repository/models.py:277 repository/trds_forms.py:164 msgid "City" msgstr "" -#: registry/models.py:280 registry/trds_forms.py:168 +#: repository/models.py:280 repository/trds_forms.py:168 msgid "Postal Code" msgstr "" -#: registry/models.py:281 registry/trds_forms.py:169 +#: repository/models.py:281 repository/trds_forms.py:169 msgid "Telephone" msgstr "" -#: registry/models.py:310 +#: repository/models.py:310 msgid "Recruitment Countries" msgstr "" -#: registry/models.py:332 +#: repository/models.py:332 msgid "Interest" msgstr "" -#: registry/models.py:335 +#: repository/models.py:335 msgid "Outcome Description" msgstr "" -#: registry/models.py:345 +#: repository/models.py:345 msgid "Trial Aspect" msgstr "" -#: registry/models.py:347 +#: repository/models.py:347 msgid "Vocabulary" msgstr "" -#: registry/models.py:349 +#: repository/models.py:349 msgid "Version" msgstr "" -#: registry/models.py:350 +#: repository/models.py:350 msgid "Level" msgstr "" -#: registry/models.py:352 +#: repository/models.py:352 msgid "Code" msgstr "" -#: registry/models.py:353 +#: repository/models.py:353 msgid "Text" msgstr "" -#: registry/trds.py:6 +#: repository/trds.py:6 msgid "Primary Registry and Trial Identifying Number" msgstr "" -#: registry/trds.py:7 +#: repository/trds.py:7 msgid "Date of Registration in Primary Registry" msgstr "" -#: registry/trds.py:8 +#: repository/trds.py:8 msgid "Secondary Identifying Numbers" msgstr "" -#: registry/trds.py:9 +#: repository/trds.py:9 msgid "Source(s) of Monetary or Material Support" msgstr "" -#: registry/trds.py:11 +#: repository/trds.py:11 msgid "Secondary Sponsors" msgstr "" -#: registry/trds.py:12 +#: repository/trds.py:12 msgid "Contacts for Public Queries" msgstr "" -#: registry/trds.py:13 +#: repository/trds.py:13 msgid "Contacts for Scientific Queries" msgstr "" -#: registry/trds_forms.py:22 +#: repository/trds_forms.py:22 msgid "Trial Identification" msgstr "" -#: registry/trds_forms.py:48 +#: repository/trds_forms.py:48 msgid "Sponsors and Sources of Support" msgstr "" -#: registry/trds_forms.py:58 +#: repository/trds_forms.py:58 msgid "Descriptor" msgstr "" -#: registry/trds_forms.py:66 +#: repository/trds_forms.py:66 msgid "Health Condition(s) or Problem(s) Studied" msgstr "" -#: registry/trds_forms.py:69 +#: repository/trds_forms.py:69 msgid "Health Condition(s) or Problem(s)" msgstr "" -#: registry/trds_forms.py:115 +#: repository/trds_forms.py:115 msgid "Recruitment" msgstr "" -#: registry/trds_forms.py:125 +#: repository/trds_forms.py:125 msgid "Date of First Enrollment" msgstr "" -#: registry/trds_forms.py:152 +#: repository/trds_forms.py:152 msgid "Contacts" msgstr "" -#: registry/trds_forms.py:175 +#: repository/trds_forms.py:175 msgid "Outcomes" msgstr "" -#: registry/templates/registry/add_clinicalTrials.html:3 +#: repository/templates/repository/add_clinicalTrials.html:3 msgid "Add a new Clinical Trial Record" msgstr "" -#: registry/templates/registry/trial_form.html:12 -#: registry/templates/registry/trial_outcomes_form.html:15 +#: repository/templates/repository/trial_form.html:12 +#: repository/templates/repository/trial_outcomes_form.html:15 msgid "Save and continue later" msgstr "" -#: registry/templates/registry/trial_form.html:16 -#: registry/templates/registry/trial_outcomes_form.html:19 +#: repository/templates/repository/trial_form.html:16 +#: repository/templates/repository/trial_outcomes_form.html:19 msgid "Save and go to" msgstr "" -#: registry/templates/registry/trial_index.html:3 +#: repository/templates/repository/trial_index.html:3 msgid "Trial Summary" msgstr "" -#: registry/templates/registry/trial_outcomes_form.html:8 +#: repository/templates/repository/trial_outcomes_form.html:8 msgid "Primary Outcomes" msgstr "" -#: registry/templates/registry/trial_outcomes_form.html:11 +#: repository/templates/repository/trial_outcomes_form.html:11 msgid "Secondary Outcomes" msgstr "" #: rosetta/templates/rosetta/languages.html:3 #: rosetta/templates/rosetta/pofile.html:14 msgid "Home" msgstr "" #: rosetta/templates/rosetta/languages.html:3 #: rosetta/templates/rosetta/languages.html:4 msgid "Language selection" msgstr "" #: rosetta/templates/rosetta/languages.html:14 msgid "Application" msgstr "" #: rosetta/templates/rosetta/languages.html:15 msgid "Progress" msgstr "" #: rosetta/templates/rosetta/languages.html:16 msgid "Messages" msgstr "" #: rosetta/templates/rosetta/languages.html:17 msgid "Translated" msgstr "" #: rosetta/templates/rosetta/languages.html:18 #: rosetta/templates/rosetta/pofile.html:51 msgid "Fuzzy" msgstr "" #: rosetta/templates/rosetta/languages.html:19 msgid "Obsolete" msgstr "" #: rosetta/templates/rosetta/languages.html:20 msgid "File" msgstr "" #: rosetta/templates/rosetta/languages.html:41 msgid "Nothing to translate!" msgstr "" #: rosetta/templates/rosetta/languages.html:42 msgid "" "You haven't specified any languages in your settings file, or haven't yet " "generated a batch of translation catalogs." msgstr "" #: rosetta/templates/rosetta/languages.html:43 #, python-format msgid "" "Please refer to <a href=\"%(i18n_doc_link)s\">Django's I18N documentation</" "a> for a guide on how to set up internationalization for your project." msgstr "" #: rosetta/templates/rosetta/pofile.html:8 msgid "Pick another file" msgstr "" #: rosetta/templates/rosetta/pofile.html:9 msgid "Download this catalog" msgstr "" #: rosetta/templates/rosetta/pofile.html:17 msgid "Progress: %(percent_translated)s%" msgstr "" #: rosetta/templates/rosetta/pofile.html:18 msgid "File is read-only: download the file when done editing!" msgstr "" #: rosetta/templates/rosetta/pofile.html:20 msgid "English" msgstr "" #: rosetta/templates/rosetta/pofile.html:22 #, python-format msgid "Translate into %(rosetta_i18n_lang_name)s" msgstr "" #: rosetta/templates/rosetta/pofile.html:25 msgid "Display:" msgstr "" #: rosetta/templates/rosetta/pofile.html:26 msgid "Untranslated only" msgstr "" #: rosetta/templates/rosetta/pofile.html:27 msgid "Translated only" msgstr "" #: rosetta/templates/rosetta/pofile.html:28 msgid "Fuzzy only" msgstr "" #: rosetta/templates/rosetta/pofile.html:29 msgid "All" msgstr "" #: rosetta/templates/rosetta/pofile.html:36 msgid "Search" msgstr "" #: rosetta/templates/rosetta/pofile.html:38 msgid "Go" msgstr "" #: rosetta/templates/rosetta/pofile.html:48 msgid "Original" msgstr "" #: rosetta/templates/rosetta/pofile.html:52 msgid "Occurrences(s)" msgstr "" #: rosetta/templates/rosetta/pofile.html:76 msgid "suggest" msgstr "" #: rosetta/templates/rosetta/pofile.html:87 #, python-format msgid "%(more_count)s more" msgid_plural "%(more_count)s more" msgstr[0] "" msgstr[1] "" #: rosetta/templates/rosetta/pofile.html:99 msgid "Save and translate next block" msgstr "" #: rosetta/templates/rosetta/pofile.html:103 msgid "Skip to page:" msgstr "" #: rosetta/templates/rosetta/pofile.html:116 msgid "Displaying:" msgstr "" #: rosetta/templates/rosetta/pofile.html:118 #, python-format msgid "%(hits)s/%(message_number)s message" msgid_plural "%(hits)s/%(message_number)s messages" msgstr[0] "" msgstr[1] "" #: templates/base.html:6 msgid "Reclac Platform" msgstr "" #: templates/base.html:26 msgid "Rebrac, part of the WHO/ICTRP network" msgstr "" #: tickets/models.py:13 msgid "Context" msgstr "" #: tickets/models.py:25 msgid "Date of Iteration" msgstr "" #: tickets/models.py:27 msgid "Subject" msgstr "" #: tickets/models.py:28 vocabulary/models.py:10 msgid "Description" msgstr "" #: tickets/models.py:29 msgid "From user" msgstr "" #: tickets/models.py:30 msgid "To User" msgstr "" #: tickets/models.py:31 msgid "Ticket Status" msgstr "" #: vocabulary/models.py:9 msgid "Label" msgstr "" #: vocabulary/models.py:27 msgid "Required Language" msgstr "" #: vocabulary/models.py:49 msgid "Recruitment status" msgstr "" diff --git a/clinicaltrials/locale/pt_BR/LC_MESSAGES/django.po b/clinicaltrials/locale/pt_BR/LC_MESSAGES/django.po index e839148..dc1f474 100644 --- a/clinicaltrials/locale/pt_BR/LC_MESSAGES/django.po +++ b/clinicaltrials/locale/pt_BR/LC_MESSAGES/django.po @@ -1,849 +1,849 @@ # Rebrac Clinical Trials Project # Brazilian Portuguese localization file # Copyright (C) 2009 BIREME/PAHO/WHO # This file is distributed under the same license as the PACKAGE package. # Luciano Ramalho <[email protected]>, 2009. -# +# msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-03-09 21:18+0000\n" "PO-Revision-Date: 2010-03-10 03:26\n" "Last-Translator: <[email protected]>\n" "Language-Team: LANGUAGE <[email protected]>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Translated-Using: django-rosetta 0.5.1\n" #: settings.py:111 rosetta/templates/rosetta/pofile.html:20 msgid "English" msgstr "Inglês" #: settings.py:112 msgid "Spanish" msgstr "Espanhol" #: settings.py:114 msgid "Portuguese" msgstr "Português" #: assistance/models.py:11 msgid "Categories" msgstr "Categorias" #: assistance/models.py:13 assistance/models.py:20 vocabulary/models.py:10 #: vocabulary/models.py:28 msgid "Label" msgstr "Rótulo" #: assistance/models.py:24 assistance/models.py:41 msgid "Title" msgstr "Título" #: assistance/models.py:25 assistance/models.py:42 msgid "Answer" msgstr "Resposta" -#: assistance/models.py:27 registry/models.py:84 tickets/models.py:14 +#: assistance/models.py:27 repository/models.py:84 tickets/models.py:14 #, fuzzy msgid "Date of Registration" msgstr "Data de publicação do registro" #: assistance/models.py:46 msgid "Field Help" msgstr "Auxílio a nível de campo" #: polyglot/models.py:9 msgid "Language" msgstr "Idioma" -#: registry/models.py:81 +#: repository/models.py:81 msgid "Primary Id Number" msgstr "Identificador primário" -#: registry/models.py:87 registry/trds.py:15 registry/trds_forms.py:114 +#: repository/models.py:87 repository/trds.py:15 repository/trds_forms.py:114 msgid "Scientific Title" msgstr "Título científico" -#: registry/models.py:90 registry/trds_forms.py:119 +#: repository/models.py:90 repository/trds_forms.py:119 #, fuzzy msgid "Scientific Acronym" msgstr "Acrônimo científico" -#: registry/models.py:94 registry/trds.py:10 registry/trds_forms.py:141 +#: repository/models.py:94 repository/trds.py:10 repository/trds_forms.py:141 #: reviewapp/models.py:33 reviewapp/views.py:47 msgid "Primary Sponsor" msgstr "Patrocinador primário" -#: registry/models.py:103 registry/trds.py:14 registry/trds_forms.py:123 +#: repository/models.py:103 repository/trds.py:14 repository/trds_forms.py:123 msgid "Public Title" msgstr "Título público" -#: registry/models.py:106 registry/trds_forms.py:127 +#: repository/models.py:106 repository/trds_forms.py:127 msgid "Acronym" msgstr "Acrônimo público" -#: registry/models.py:109 +#: repository/models.py:109 msgid "Health Condition(s)" msgstr "Condições de saúde" -#: registry/models.py:112 registry/trds_forms.py:205 -#: registry/trds_forms.py:209 registry/trds_forms.py:211 +#: repository/models.py:112 repository/trds_forms.py:205 +#: repository/trds_forms.py:209 repository/trds_forms.py:211 msgid "Intervention(s)" msgstr "Intervenções" -#: registry/models.py:119 registry/trds_forms.py:246 +#: repository/models.py:119 repository/trds_forms.py:246 msgid "Inclusion Criteria" msgstr "Critérios de inclusão" -#: registry/models.py:122 registry/trds_forms.py:250 +#: repository/models.py:122 repository/trds_forms.py:250 msgid "Gender (inclusion sex)" msgstr "Gênero para inclusão" -#: registry/models.py:126 registry/trds_forms.py:253 +#: repository/models.py:126 repository/trds_forms.py:253 msgid "Inclusion Minimum Age" msgstr "Idade mímima para inclusão" -#: registry/models.py:128 registry/trds_forms.py:255 +#: repository/models.py:128 repository/trds_forms.py:255 msgid "Minimum Age Unit" msgstr "Unidade de tempo da idade máxima" -#: registry/models.py:132 registry/trds_forms.py:258 +#: repository/models.py:132 repository/trds_forms.py:258 msgid "Inclusion Maximum Age" msgstr "Idade máxima para inclusão" -#: registry/models.py:134 registry/trds_forms.py:260 +#: repository/models.py:134 repository/trds_forms.py:260 msgid "Maximum Age Unit" msgstr "Unidade de tempo da idade máxima" -#: registry/models.py:138 registry/trds_forms.py:263 +#: repository/models.py:138 repository/trds_forms.py:263 msgid "Exclusion Criteria" msgstr "Critérios de exclusão" -#: registry/models.py:142 registry/trds_forms.py:279 +#: repository/models.py:142 repository/trds_forms.py:279 msgid "Study Type" msgstr "Tipo do ensaio" -#: registry/models.py:145 registry/trds_forms.py:282 +#: repository/models.py:145 repository/trds_forms.py:282 msgid "Study Design" msgstr "" -#: registry/models.py:149 +#: repository/models.py:149 msgid "Expanded access program" msgstr "Programa de acesso expandido" -#: registry/models.py:152 +#: repository/models.py:152 msgid "Study Purpose" msgstr "Enfoque do estudo" -#: registry/models.py:154 +#: repository/models.py:154 msgid "Intervention Assignment" msgstr "Desenho da intervenção" -#: registry/models.py:155 +#: repository/models.py:155 msgid "Number of arms" msgstr "Número de braços" -#: registry/models.py:157 +#: repository/models.py:157 msgid "Masking type" msgstr "Tipo de mascaramento" -#: registry/models.py:159 +#: repository/models.py:159 msgid "Allocation type" msgstr "Tipo de alocação" -#: registry/models.py:164 registry/trds_forms.py:292 +#: repository/models.py:164 repository/trds_forms.py:292 msgid "Study Phase" msgstr "Fase do ensaio" -#: registry/models.py:168 +#: repository/models.py:168 #, fuzzy msgid "Anticipated Date of First Enrollment" msgstr "Data prevista do primeiro recrutamento" -#: registry/models.py:172 +#: repository/models.py:172 #, fuzzy msgid "Actual Date of First Enrollment" msgstr "Data real do primeiro recrutamento" -#: registry/models.py:175 registry/trds_forms.py:243 +#: repository/models.py:175 repository/trds_forms.py:243 msgid "Target Sample Size" msgstr "Tamanho da amostra alvo" -#: registry/models.py:179 registry/trds_forms.py:231 +#: repository/models.py:179 repository/trds_forms.py:231 msgid "Recruitment Status" msgstr "Situação de recrutamento" -#: registry/models.py:187 +#: repository/models.py:187 msgid "Last Update" msgstr "Atualização mais recente" -#: registry/models.py:189 registry/models.py:373 registry/models.py:384 -#: registry/templates/registry/trial_index.html:13 reviewapp/models.py:36 +#: repository/models.py:189 repository/models.py:373 repository/models.py:384 +#: repository/templates/repository/trial_index.html:13 reviewapp/models.py:36 msgid "Status" msgstr "Situação" -#: registry/models.py:192 +#: repository/models.py:192 msgid "Record Note (staff use only)" msgstr "Anotação do registro (uso interno apenas)" -#: registry/models.py:255 +#: repository/models.py:255 msgid "Updated" msgstr "Atualizado" -#: registry/models.py:312 +#: repository/models.py:312 msgid "Issuing Authority" msgstr "Órgão emissor" -#: registry/models.py:314 +#: repository/models.py:314 msgid "Secondary Id Number" msgstr "Identificador secundário" -#: registry/models.py:339 +#: repository/models.py:339 msgid "Name" msgstr "Nome" -#: registry/models.py:340 +#: repository/models.py:340 msgid "Postal Address" msgstr "Endereço postal" -#: registry/models.py:341 registry/models.py:359 registry/trds_forms.py:344 +#: repository/models.py:341 repository/models.py:359 repository/trds_forms.py:344 #: reviewapp/models.py:74 msgid "Country" msgstr "País" -#: registry/models.py:350 registry/trds_forms.py:332 +#: repository/models.py:350 repository/trds_forms.py:332 msgid "First Name" msgstr "Primeiro nome" -#: registry/models.py:351 registry/trds_forms.py:333 +#: repository/models.py:351 repository/trds_forms.py:333 msgid "Middle Name" msgstr "Nome do meio" -#: registry/models.py:352 registry/trds_forms.py:334 +#: repository/models.py:352 repository/trds_forms.py:334 msgid "Last Name" msgstr "Sobrenome" -#: registry/models.py:353 registry/trds_forms.py:336 +#: repository/models.py:353 repository/trds_forms.py:336 msgid "E-mail" msgstr "E-mail" -#: registry/models.py:355 registry/trds_forms.py:339 +#: repository/models.py:355 repository/trds_forms.py:339 msgid "Affiliation" msgstr "Filiação" -#: registry/models.py:356 registry/trds_forms.py:341 +#: repository/models.py:356 repository/trds_forms.py:341 msgid "Address" msgstr "Endereço" -#: registry/models.py:357 registry/trds_forms.py:342 +#: repository/models.py:357 repository/trds_forms.py:342 msgid "City" msgstr "Cidade" -#: registry/models.py:360 registry/trds_forms.py:346 +#: repository/models.py:360 repository/trds_forms.py:346 msgid "Postal Code" msgstr "Código postal" -#: registry/models.py:361 registry/trds_forms.py:347 +#: repository/models.py:361 repository/trds_forms.py:347 msgid "Telephone" msgstr "Fone" -#: registry/models.py:397 +#: repository/models.py:397 msgid "Interest" msgstr "Interesse" -#: registry/models.py:400 +#: repository/models.py:400 msgid "Outcome Description" msgstr "Descrição do desfecho" -#: registry/models.py:413 +#: repository/models.py:413 msgid "Trial Aspect" msgstr "Apecto do ensaio" -#: registry/models.py:415 +#: repository/models.py:415 msgid "Vocabulary" msgstr "Vocabulário" -#: registry/models.py:417 +#: repository/models.py:417 msgid "Version" msgstr "Versão" -#: registry/models.py:418 +#: repository/models.py:418 msgid "Level" msgstr "Nível" -#: registry/models.py:420 +#: repository/models.py:420 msgid "Code" msgstr "Código" -#: registry/models.py:421 +#: repository/models.py:421 msgid "Text" msgstr "Texto" -#: registry/trds.py:6 +#: repository/trds.py:6 msgid "Primary Registry and Trial Identifying Number" msgstr "Registro primário e identificador do ensaio" -#: registry/trds.py:7 +#: repository/trds.py:7 msgid "Date of Registration in Primary Registry" msgstr "Data de registro no registro primário" -#: registry/trds.py:8 registry/trds_forms.py:131 +#: repository/trds.py:8 repository/trds_forms.py:131 msgid "Secondary Identifying Numbers" msgstr "Identificadores secundários" -#: registry/trds.py:9 registry/trds_forms.py:158 +#: repository/trds.py:9 repository/trds_forms.py:158 msgid "Source(s) of Monetary or Material Support" msgstr "Fontes de apoio financeiro ou material" -#: registry/trds.py:11 +#: repository/trds.py:11 msgid "Secondary Sponsors" msgstr "Patrocinadores secundários" -#: registry/trds.py:12 +#: repository/trds.py:12 msgid "Contacts for Public Queries" msgstr "Contatos de relações públicas" -#: registry/trds.py:13 +#: repository/trds.py:13 msgid "Contacts for Scientific Queries" msgstr "Contatos para a comunidade científica" -#: registry/trds.py:16 +#: repository/trds.py:16 msgid "Countries of Recruitment" msgstr "Países de recrutamento" -#: registry/trds_forms.py:112 +#: repository/trds_forms.py:112 msgid "Trial Identification" msgstr "Identificação do ensaio" -#: registry/trds_forms.py:149 +#: repository/trds_forms.py:149 msgid "Secondary Sponsor(s)" msgstr "Patrocinadores secundários" -#: registry/trds_forms.py:167 +#: repository/trds_forms.py:167 msgid "Health Condition(s) or Problem(s) Studied" msgstr "Condições de saúde ou problemas estudados" -#: registry/trds_forms.py:170 +#: repository/trds_forms.py:170 msgid "Health Condition(s) or Problem(s)" msgstr "Condições de saúde ou problemas" -#: registry/trds_forms.py:182 +#: repository/trds_forms.py:182 msgid "General Descriptors for Health Condition(s)" msgstr "Descritores gerais para as condições de saúde" -#: registry/trds_forms.py:189 +#: repository/trds_forms.py:189 msgid "Specific Descriptors for Health Condition(s)" msgstr "Descritores específicos para as condições de saúde" -#: registry/trds_forms.py:197 +#: repository/trds_forms.py:197 msgid "Descriptor for Intervention(s)" msgstr "Descritores para as intervenções" -#: registry/trds_forms.py:215 +#: repository/trds_forms.py:215 msgid "Intervention Code(s)" msgstr "Categorias das intervenções" -#: registry/trds_forms.py:228 +#: repository/trds_forms.py:228 #, fuzzy msgid "Recruitment" msgstr "Recrutamento" -#: registry/trds_forms.py:235 reviewapp/views.py:40 +#: repository/trds_forms.py:235 reviewapp/views.py:40 #, fuzzy msgid "Recruitment Country" msgstr "País de recrutamento" -#: registry/trds_forms.py:240 +#: repository/trds_forms.py:240 msgid "Date of First Enrollment" msgstr "Data do primeiro recrutamento" -#: registry/trds_forms.py:285 +#: repository/trds_forms.py:285 msgid "Expandend Access Program" msgstr "Programa de acesso expandido" -#: registry/trds_forms.py:286 +#: repository/trds_forms.py:286 msgid "Unknown" msgstr "desconhecido" -#: registry/trds_forms.py:287 +#: repository/trds_forms.py:287 msgid "Yes" msgstr "sim" -#: registry/trds_forms.py:288 +#: repository/trds_forms.py:288 msgid "No" msgstr "não" -#: registry/trds_forms.py:301 +#: repository/trds_forms.py:301 msgid "Outcomes" msgstr "Desfechos" -#: registry/trds_forms.py:309 +#: repository/trds_forms.py:309 msgid "Contact(s) for Public Queries" msgstr "Contatos de relações públicas" -#: registry/trds_forms.py:319 +#: repository/trds_forms.py:319 msgid "Contact(s) for Scientific Queries" msgstr "Contatos para a comunidade científica" -#: registry/trds_forms.py:328 +#: repository/trds_forms.py:328 msgid "New Contact(s)" msgstr "Cadastrar novos contatos" -#: registry/views.py:105 +#: repository/views.py:105 msgid "Sponsors and Sources of Support" msgstr "Patrocinadores e fontes de apoio" -#: registry/views.py:152 +#: repository/views.py:152 msgid "Health Conditions Form" msgstr "Formulário de condições de saúde" -#: registry/views.py:207 +#: repository/views.py:207 msgid "Interventions Form" msgstr "Formulário de intervenções" -#: registry/views.py:249 +#: repository/views.py:249 #, fuzzy msgid "Recruitment Form" msgstr "Formulário de recrutamento" -#: registry/views.py:276 +#: repository/views.py:276 msgid "Study Type Form" msgstr "Formulário de tipo de ensaio" -#: registry/views.py:303 +#: repository/views.py:303 msgid "Outcomes Form" msgstr "Formulário de desfechos" -#: registry/views.py:333 +#: repository/views.py:333 msgid "Descriptor Form" msgstr "Formulário de descritores" -#: registry/templates/registry/add_clinicalTrials.html:3 +#: repository/templates/repository/add_clinicalTrials.html:3 msgid "Add a new Clinical Trial Record" msgstr "Incluir novo registro de ensaio clínico" -#: registry/templates/registry/attachments.html:72 -#: registry/templates/registry/step_3.html:120 -#: registry/templates/registry/trial_form.html:69 -#: registry/templates/registry/trial_outcomes_form.html:15 +#: repository/templates/repository/attachments.html:72 +#: repository/templates/repository/step_3.html:120 +#: repository/templates/repository/trial_form.html:69 +#: repository/templates/repository/trial_outcomes_form.html:15 msgid "Save and continue later" msgstr "Salvar e continuar depois" -#: registry/templates/registry/attachments.html:75 -#: registry/templates/registry/step_3.html:123 -#: registry/templates/registry/trial_form.html:72 -#: registry/templates/registry/trial_outcomes_form.html:19 +#: repository/templates/repository/attachments.html:75 +#: repository/templates/repository/step_3.html:123 +#: repository/templates/repository/trial_form.html:72 +#: repository/templates/repository/trial_outcomes_form.html:19 msgid "Save and go to" msgstr "Salvar e ir para" -#: registry/templates/registry/step_3.html:54 +#: repository/templates/repository/step_3.html:54 msgid "Search terms" msgstr "Termos de busca" -#: registry/templates/registry/submission_step.html:10 -#: registry/templates/registry/submission_step.html:21 +#: repository/templates/repository/submission_step.html:10 +#: repository/templates/repository/submission_step.html:21 msgid "Summary" msgstr "Sumário" -#: registry/templates/registry/trds.html:3 -#: registry/templates/registry/trds.html:4 +#: repository/templates/repository/trds.html:3 +#: repository/templates/repository/trds.html:4 msgid "Trial Registration Data Set" msgstr "Conjunto de dados de registro de ensaio" -#: registry/templates/registry/trial_index.html:3 -#: registry/templates/registry/trial_index.html:7 +#: repository/templates/repository/trial_index.html:3 +#: repository/templates/repository/trial_index.html:7 msgid "Trial Summary" msgstr "Sumário do ensaio" -#: registry/templates/registry/trial_index.html:11 +#: repository/templates/repository/trial_index.html:11 msgid "Step" msgstr "Passo" -#: registry/templates/registry/trial_index.html:12 +#: repository/templates/repository/trial_index.html:12 msgid "Form name" msgstr "Nome do formulário" -#: registry/templates/registry/trial_outcomes_form.html:8 +#: repository/templates/repository/trial_outcomes_form.html:8 msgid "Primary Outcomes" msgstr "Desfechos primários" -#: registry/templates/registry/trial_outcomes_form.html:11 +#: repository/templates/repository/trial_outcomes_form.html:11 msgid "Secondary Outcomes" msgstr "Desfechos secundários" #: reviewapp/models.py:39 msgid "Submission Note (staff use only)" msgstr "Anotação da submissão (uso interno apenas)" #: reviewapp/models.py:71 #, fuzzy msgid "Recruitment Countries" msgstr "Países de recrutamento" #: reviewapp/models.py:87 reviewapp/views.py:54 msgid "Attachments" msgstr "Anexos" #: reviewapp/models.py:91 msgid "Access" msgstr "Acesso" #: reviewapp/trds_forms.py:18 msgid "Existing Attachment" msgstr "Anexo existente" #: reviewapp/trds_forms.py:19 rosetta/templates/rosetta/languages.html:20 msgid "File" msgstr "Arquivo" #: reviewapp/trds_forms.py:27 msgid "New Attachment" msgstr "Novo anexo" #: reviewapp/views.py:38 msgid "Initial Trial Data" msgstr "Dados iniciais do ensaio" #: reviewapp/templates/reviewapp/new_submission.html:40 msgid "New Submission" msgstr "Nova submissão" #: reviewapp/templates/reviewapp/new_submission.html:50 #: tickets/templates/tickets/new_iteration.html:11 #: tickets/templates/tickets/open_ticket.html:13 msgid "Submit" msgstr "Submeter" #: reviewapp/templates/reviewapp/submission_list.html:6 msgid "Your Submissions" msgstr "Suas submissões" #: reviewapp/templates/reviewapp/submission_list.html:10 msgid "Created" msgstr "Data de criação" #: reviewapp/templates/reviewapp/submission_list.html:11 #, fuzzy msgid "Submission Title" msgstr "Título científico" #: reviewapp/templates/reviewapp/submission_list.html:12 msgid "Situation" msgstr "Situação" #: reviewapp/templates/reviewapp/submission_list.html:29 #, fuzzy msgid "Submit a new Clinical Trial" msgstr "Incluir novo registro de ensaio clínico" #: rosetta/templates/rosetta/languages.html:3 #: rosetta/templates/rosetta/pofile.html:14 msgid "Home" msgstr "Página principal" #: rosetta/templates/rosetta/languages.html:3 #: rosetta/templates/rosetta/languages.html:4 msgid "Language selection" msgstr "Seleção de idioma" #: rosetta/templates/rosetta/languages.html:14 msgid "Application" msgstr "Aplicação" #: rosetta/templates/rosetta/languages.html:15 msgid "Progress" msgstr "Progresso" #: rosetta/templates/rosetta/languages.html:16 msgid "Messages" msgstr "Mensagens" #: rosetta/templates/rosetta/languages.html:17 msgid "Translated" msgstr "Traduzido" #: rosetta/templates/rosetta/languages.html:18 #: rosetta/templates/rosetta/pofile.html:51 msgid "Fuzzy" msgstr "Aproximado" #: rosetta/templates/rosetta/languages.html:19 msgid "Obsolete" msgstr "Obsoleto" #: rosetta/templates/rosetta/languages.html:41 msgid "Nothing to translate!" msgstr "Nada a traduzir!" #: rosetta/templates/rosetta/languages.html:42 msgid "You haven't specified any languages in your settings file, or haven't yet generated a batch of translation catalogs." msgstr "Não foram especificados idiomas no arquivo de settings, ou ainda não foram gerados catálogos de tradução." #: rosetta/templates/rosetta/languages.html:43 #, python-format msgid "Please refer to <a href=\"%(i18n_doc_link)s\">Django's I18N documentation</a> for a guide on how to set up internationalization for your project." msgstr "Consulte a <a href=\"%(i18n_doc_link)s\">documentação do Django</a> para saber como configurar a internacionalização do seu projeto." #: rosetta/templates/rosetta/pofile.html:8 msgid "Pick another file" msgstr "Escolha outro arquivo" #: rosetta/templates/rosetta/pofile.html:9 msgid "Download this catalog" msgstr "Baixar este catálogo" #: rosetta/templates/rosetta/pofile.html:17 msgid "Progress: %(percent_translated)s%" msgstr "Progresso: %(percent_translated)s%" #: rosetta/templates/rosetta/pofile.html:18 msgid "File is read-only: download the file when done editing!" msgstr "Arquivo somente para leitura: baixe o arquivo quando terminar de editar!" #: rosetta/templates/rosetta/pofile.html:22 #, python-format msgid "Translate into %(rosetta_i18n_lang_name)s" msgstr "Traduzir para %(rosetta_i18n_lang_name)s" #: rosetta/templates/rosetta/pofile.html:25 msgid "Display:" msgstr "Exibir:" #: rosetta/templates/rosetta/pofile.html:26 msgid "Untranslated only" msgstr "Apenas não traduzidos" #: rosetta/templates/rosetta/pofile.html:27 msgid "Translated only" msgstr "Apenas traduzidos" #: rosetta/templates/rosetta/pofile.html:28 msgid "Fuzzy only" msgstr "Apenas aproximados" #: rosetta/templates/rosetta/pofile.html:29 msgid "All" msgstr "Todos" #: rosetta/templates/rosetta/pofile.html:36 msgid "Search" msgstr "Busca" #: rosetta/templates/rosetta/pofile.html:38 msgid "Go" msgstr "Ir" #: rosetta/templates/rosetta/pofile.html:48 msgid "Original" msgstr "Original" #: rosetta/templates/rosetta/pofile.html:52 msgid "Occurrences(s)" msgstr "Ocorrência(s)" #: rosetta/templates/rosetta/pofile.html:76 msgid "suggest" msgstr "sugerir" #: rosetta/templates/rosetta/pofile.html:87 #, python-format msgid "%(more_count)s more" msgid_plural "%(more_count)s more" msgstr[0] "mais %(more_count)s" msgstr[1] "mais %(more_count)s" #: rosetta/templates/rosetta/pofile.html:99 msgid "Save and translate next block" msgstr "Salvar e traduzir próximo bloco" #: rosetta/templates/rosetta/pofile.html:103 msgid "Skip to page:" msgstr "Pular para a página:" #: rosetta/templates/rosetta/pofile.html:116 msgid "Displaying:" msgstr "Exibindo:" #: rosetta/templates/rosetta/pofile.html:118 #, python-format msgid "%(hits)s/%(message_number)s message" msgid_plural "%(hits)s/%(message_number)s messages" msgstr[0] "mensagem %(hits)s/%(message_number)s" msgstr[1] "mensagens %(hits)s/%(message_number)s" #: templates/base.html:7 #, fuzzy msgid "Clinical Trials Platform" msgstr "Repositório de Ensaios Clínicos" #: templates/base.html:29 msgid "RBEC" msgstr "ec.gov.br" #: tickets/models.py:16 msgid "Context" msgstr "Contexto" #: tickets/models.py:18 msgid "Ticket Type" msgstr "Tipo da pendência" #: tickets/models.py:71 #, fuzzy msgid "Date of Iteration" msgstr "Data da iteração" #: tickets/models.py:73 tickets/views.py:150 msgid "Subject" msgstr "Assunto" #: tickets/models.py:74 tickets/views.py:57 tickets/views.py:151 #: vocabulary/models.py:11 vocabulary/models.py:29 msgid "Description" msgstr "Descrição" #: tickets/models.py:77 msgid "To User (e-mail)" msgstr "Para (e-mail)" #: tickets/models.py:79 #, fuzzy msgid "Ticket Status" msgstr "Situação da pendência" #: tickets/models.py:94 msgid "Upload File" msgstr "Enviar arquivo" #: tickets/templates/tickets/new_iteration.html:7 msgid "Adding Iteration" msgstr "Incluindo iteração" #: tickets/templates/tickets/open_ticket.html:7 msgid "Opening Ticket" msgstr "Abrindo pendência" #: tickets/templates/tickets/ticket_detail.html:6 msgid "Current Situation" msgstr "Situação atual" #: tickets/templates/tickets/ticket_detail.html:10 #: tickets/templates/tickets/user_tickets.html:8 #: tickets/templates/tickets/waiting_acceptance_tickets.html:8 msgid "creation date" msgstr "data de criação" #: tickets/templates/tickets/ticket_detail.html:11 #: tickets/templates/tickets/user_tickets.html:9 #: tickets/templates/tickets/waiting_acceptance_tickets.html:9 msgid "context" msgstr "contexto" #: tickets/templates/tickets/ticket_detail.html:12 #: tickets/templates/tickets/user_tickets.html:10 #: tickets/templates/tickets/waiting_acceptance_tickets.html:10 msgid "type" msgstr "tipo" #: tickets/templates/tickets/ticket_detail.html:13 #: tickets/templates/tickets/user_tickets.html:11 #: tickets/templates/tickets/waiting_acceptance_tickets.html:12 msgid "subject" msgstr "assunto" #: tickets/templates/tickets/ticket_detail.html:14 #: tickets/templates/tickets/ticket_detail.html:47 #: tickets/templates/tickets/user_tickets.html:12 msgid "status" msgstr "situação" #: tickets/templates/tickets/ticket_detail.html:15 #: tickets/templates/tickets/user_tickets.html:13 msgid "last update" msgstr "última atualização" #: tickets/templates/tickets/ticket_detail.html:16 msgid "mark as" msgstr "marcar como" #: tickets/templates/tickets/ticket_detail.html:39 msgid "Ticket not found" msgstr "Pendência não encontrada" #: tickets/templates/tickets/ticket_detail.html:42 msgid "History" msgstr "Histórico" #: tickets/templates/tickets/ticket_detail.html:46 msgid "update date" msgstr "data de atualização" #: tickets/templates/tickets/ticket_detail.html:48 #: tickets/templates/tickets/waiting_acceptance_tickets.html:13 msgid "description" msgstr "descrição" #: tickets/templates/tickets/ticket_detail.html:49 msgid "assigned to" msgstr "designado para" #: tickets/templates/tickets/ticket_detail.html:61 msgid "To show the \"add iterarion link\" the ticket must be diferente from \"closed\"." msgstr "Para exibir o link de adicionar iteração a pendência não pode estar fechada." #: tickets/templates/tickets/ticket_list.html:15 #: tickets/templates/tickets/user_tickets.html:31 msgid "open ticket" msgstr "Pendências em aberto" #: tickets/templates/tickets/user_tickets.html:3 #: tickets/templates/tickets/waiting_acceptance_tickets.html:3 msgid "User Tickets" msgstr "Pendências do usuário" #: tickets/templates/tickets/user_tickets.html:24 msgid "view history" msgstr "Ver histórico" #: tickets/templates/tickets/user_tickets.html:24 #, fuzzy msgid "add iteration" msgstr "incluir iteração" #: tickets/templates/tickets/user_tickets.html:29 msgid "Have no open tickets" msgstr "Não há pendências em aberto" #: tickets/templates/tickets/waiting_acceptance_tickets.html:11 msgid "owner" msgstr "dono" #: tickets/templates/tickets/waiting_acceptance_tickets.html:24 msgid "accepted" msgstr "aceito" #: tickets/templates/tickets/waiting_acceptance_tickets.html:29 msgid "Have no tickets waiting acceptance" msgstr "Não há pendências aguardando aceitação" #: vocabulary/models.py:36 msgid "Submission Language" msgstr "Idioma de submissão" #: vocabulary/models.py:51 msgid "Trial number issuing authorities" msgstr "Órgãos emissores de identificadores de ensaios" #: vocabulary/models.py:82 #, fuzzy msgid "Recruitment status" msgstr "Situação de recrutamento" #~ msgid "Reclac Platform" #~ msgstr "Plataforma Reclac" #~ msgid "Rebrac, part of the WHO/ICTRP network" #~ msgstr "Rebrac, parte da rede OMS/ICTRP" diff --git a/clinicaltrials/registry/templates/registry/add_done.html b/clinicaltrials/registry/templates/registry/add_done.html deleted file mode 100755 index 0f87495..0000000 --- a/clinicaltrials/registry/templates/registry/add_done.html +++ /dev/null @@ -1,7 +0,0 @@ -{% extends "base.html" %} - -{% block body_title %}Registry Done{% endblock %} - -{% block body %} - <h3>{{public_title}}, add!</h3> -{% endblock %} \ No newline at end of file diff --git a/clinicaltrials/registry/__init__.py b/clinicaltrials/repository/__init__.py similarity index 100% rename from clinicaltrials/registry/__init__.py rename to clinicaltrials/repository/__init__.py diff --git a/clinicaltrials/registry/admin.py b/clinicaltrials/repository/admin.py similarity index 97% rename from clinicaltrials/registry/admin.py rename to clinicaltrials/repository/admin.py index 2ea0670..accd966 100755 --- a/clinicaltrials/registry/admin.py +++ b/clinicaltrials/repository/admin.py @@ -1,32 +1,32 @@ # -*- coding: utf-8 -*- from django.contrib import admin -from registry.models import * +from repository.models import * tabular_inline_models = [Descriptor, TrialNumber, PublicContact, ScientificContact, TrialSecondarySponsor, TrialSupportSource] tabular_inlines = [] for model in tabular_inline_models: cls_name = model.__name__+'line' cls = type(cls_name, (admin.TabularInline,), {'model':model}) tabular_inlines.append(cls) class OutcomeInline(admin.StackedInline): model = Outcome class ClinicalTrialAdmin(admin.ModelAdmin): inlines = tabular_inlines + [OutcomeInline] list_display = ('updated_str','identifier','short_title','recruitment_status',) list_display_links = ('identifier','short_title',) search_fields = ('scientific_title', 'public_title', 'i_freetext',) list_filter = ('updated', 'study_type', 'phase', 'recruitment_status',) date_hierarchy = 'updated' save_on_top = True class DescriptorAdmin(admin.ModelAdmin): list_display = ('trial_identifier','vocabulary','code', 'text') admin.site.register(ClinicalTrial, ClinicalTrialAdmin) admin.site.register(Descriptor, DescriptorAdmin) admin.site.register(Institution) admin.site.register(Contact) diff --git a/clinicaltrials/registry/choices.py b/clinicaltrials/repository/choices.py similarity index 100% rename from clinicaltrials/registry/choices.py rename to clinicaltrials/repository/choices.py diff --git a/clinicaltrials/registry/fixtures/clinicaltrial_detail.sample.xml b/clinicaltrials/repository/fixtures/clinicaltrial_detail.sample.xml similarity index 100% rename from clinicaltrials/registry/fixtures/clinicaltrial_detail.sample.xml rename to clinicaltrials/repository/fixtures/clinicaltrial_detail.sample.xml diff --git a/clinicaltrials/registry/fixtures/first_3_trials.json b/clinicaltrials/repository/fixtures/first_3_trials.json similarity index 50% rename from clinicaltrials/registry/fixtures/first_3_trials.json rename to clinicaltrials/repository/fixtures/first_3_trials.json index 4bf2ce9..1a53d18 100644 --- a/clinicaltrials/registry/fixtures/first_3_trials.json +++ b/clinicaltrials/repository/fixtures/first_3_trials.json @@ -1,406 +1,406 @@ [ { - "pk": 2, - "model": "registry.clinicaltrial", - "fields": { - "scientific_title": "Minimal trial record (only required fields)", - "public_title": "", - "trial_id": null, - "inclusion_criteria": "", - "date_enrollment_actual": "", - "agemax_value": 0, - "agemax_unit": "-", - "agemin_unit": "-", - "scientific_acronym": "", - "acronym": "", - "target_sample_size": 0, - "staff_note": "", - "updated": "2009-10-19 21:11:43", - "hc_freetext": "", - "study_type": null, - "i_freetext": "", - "date_enrollment_anticipated": "", - "recruitment_status": null, - "phase": null, - "date_registration": null, - "agemin_value": 0, - "study_design": "", - "gender": "-", - "exclusion_criteria": "", + "pk": 2, + "model": "repository.clinicaltrial", + "fields": { + "scientific_title": "Minimal trial record (only required fields)", + "public_title": "", + "trial_id": null, + "inclusion_criteria": "", + "date_enrollment_actual": "", + "agemax_value": 0, + "agemax_unit": "-", + "agemin_unit": "-", + "scientific_acronym": "", + "acronym": "", + "target_sample_size": 0, + "staff_note": "", + "updated": "2009-10-19 21:11:43", + "hc_freetext": "", + "study_type": null, + "i_freetext": "", + "date_enrollment_anticipated": "", + "recruitment_status": null, + "phase": null, + "date_registration": null, + "agemin_value": 0, + "study_design": "", + "gender": "-", + "exclusion_criteria": "", "primary_sponsor": null } - }, - { - "pk": 3, - "model": "registry.clinicaltrial", - "fields": { - "scientific_title": "Effect of Ascorbic Acid and Grape Seed Extract \"Vitis Vinifera L.\" on Oxidative Stress Induced by on Pump Coronary Artery by Pass Grafting Surgery", - "public_title": "Comparison of Ascorbic Acid and Grape Seed Extract in Oxidative Stress Induced by on Pump Heart Surgery", - "trial_id": null, - "inclusion_criteria": "Candidates for elective CABG surgery with pump for first time, 3 Vessel Disease (3VD).", - "date_enrollment_actual": "", - "agemax_value": 0, - "agemax_unit": "-", - "agemin_unit": "-", - "scientific_acronym": "", - "acronym": "", - "target_sample_size": 75, - "staff_note": "", - "updated": null, - "hc_freetext": "Condition 1: Coronary Atrery Bypass Graft (CABG).\r\nCondition 2: Atherosclerotic heart disease.\r\nCondition 3: Ischaemic cardiomyopathy.", - "study_type": 1, - "i_freetext": "Intervention 1: Control Group: without intervention.\r\nIntervention 2: Grape Seed Extract 100 mg/6h .\r\nIntervention 3: Vit C 25 mg/kg.", - "date_enrollment_anticipated": "2008-11-01", - "recruitment_status": 4, - "phase": 6, - "date_registration": null, - "agemin_value": 0, - "study_design": "Randomization: randomized. Blinding: Double blind. Placebo: not used. Assignment: Parallel. Purpose: Supportive care. Other design features: .", - "gender": "-", - "exclusion_criteria": "High risk patients, Those who need another heart surgery beside CABG, Urgent patients Diabetics, Ischemic time more than 120 min.", + }, + { + "pk": 3, + "model": "repository.clinicaltrial", + "fields": { + "scientific_title": "Effect of Ascorbic Acid and Grape Seed Extract \"Vitis Vinifera L.\" on Oxidative Stress Induced by on Pump Coronary Artery by Pass Grafting Surgery", + "public_title": "Comparison of Ascorbic Acid and Grape Seed Extract in Oxidative Stress Induced by on Pump Heart Surgery", + "trial_id": null, + "inclusion_criteria": "Candidates for elective CABG surgery with pump for first time, 3 Vessel Disease (3VD).", + "date_enrollment_actual": "", + "agemax_value": 0, + "agemax_unit": "-", + "agemin_unit": "-", + "scientific_acronym": "", + "acronym": "", + "target_sample_size": 75, + "staff_note": "", + "updated": null, + "hc_freetext": "Condition 1: Coronary Atrery Bypass Graft (CABG).\r\nCondition 2: Atherosclerotic heart disease.\r\nCondition 3: Ischaemic cardiomyopathy.", + "study_type": 1, + "i_freetext": "Intervention 1: Control Group: without intervention.\r\nIntervention 2: Grape Seed Extract 100 mg/6h .\r\nIntervention 3: Vit C 25 mg/kg.", + "date_enrollment_anticipated": "2008-11-01", + "recruitment_status": 4, + "phase": 6, + "date_registration": null, + "agemin_value": 0, + "study_design": "Randomization: randomized. Blinding: Double blind. Placebo: not used. Assignment: Parallel. Purpose: Supportive care. Other design features: .", + "gender": "-", + "exclusion_criteria": "High risk patients, Those who need another heart surgery beside CABG, Urgent patients Diabetics, Ischemic time more than 120 min.", "primary_sponsor": 2 } - }, - { - "pk": 1, - "model": "registry.clinicaltrial", - "fields": { - "scientific_title": "A randomised, double-blind, placebo-controlled, factorial-design trial to assess the effect of aspirin and fish oil in the prevention of early thrombosis in arterio-venous fistulae in patients with Stage IV or V chronic kidney disease requiring haemodialysis", - "public_title": "", - "trial_id": null, - "inclusion_criteria": "1. Stage 4 or 5 chronic kidney disease\r\n2. Currently on haemodialysis or haemodialysis is planned to start within 6\r\nmonths (including patients currently on peritoneal dialysis).\r\n3. Planned AVF will be the primary haemodialysis access mechanism.\r\n4. Surgery to create an arterio-venous fistula in the upper or lower arm is planned.\r\n5. Aged over 18 years\r\n6. Life expectancy predicted to be 12 months minimum\r\n7. Treating team agreeable to patient\\'s involvement in the trial\r\n8. Informed consent ", - "date_enrollment_actual": "", - "agemax_value": 0, - "agemax_unit": "-", - "agemin_unit": "Y", - "scientific_acronym": "FAVOURED (Fish oil and Aspirin in Vascular acccess OUtcomes in REnal Disease)", - "acronym": "", - "target_sample_size": 1200, - "staff_note": "", - "updated": null, - "hc_freetext": "Early thrombosis in arterio-venous fistulae in patients with Stage IV or V chronic kidney disease requiring haemodialysis.", - "study_type": 1, - "i_freetext": "Aspirin 100 mg per day or matching placebo, commencing on the day prior to scheduled surgery and continuing for 3 months.", - "date_enrollment_anticipated": "", - "recruitment_status": 1, - "phase": 3, - "date_registration": null, - "agemin_value": 18, - "study_design": "", - "gender": "-", - "exclusion_criteria": "1. Revision of existing AVF rather than de novo AVF\r\n2. Medical indication for anti-platelet agent(s)\r\n3. Known intolerance of agents including hypersensitivity to aspirin\r\n4. Current use of aspirin within two weeks of commencing trial, and of fish oil within 4 weeks of commencing trial.\r\n5. Pregnancy, lactation or intention to fall pregnant during the time course of the study\r\n6. Known bleeding disorder or established diagnosis of active or suspected bleeding\r\n7. Known active peptic ulcer disease\r\n8. Already receiving anti-coagulation therapy such as warfarin\r\n9. Receiving regular anti-inflammatory agents for another indication such as\r\narthritis\r\n10.Potential non-compliance with treatment regimen in the view of the\r\ntreating clinicians\r\n11.Involved in another clinical trial where the intervention being trialled is likely to confound the outcome of this trial\r\n12.Previously randomised to this trial. ", + }, + { + "pk": 1, + "model": "repository.clinicaltrial", + "fields": { + "scientific_title": "A randomised, double-blind, placebo-controlled, factorial-design trial to assess the effect of aspirin and fish oil in the prevention of early thrombosis in arterio-venous fistulae in patients with Stage IV or V chronic kidney disease requiring haemodialysis", + "public_title": "", + "trial_id": null, + "inclusion_criteria": "1. Stage 4 or 5 chronic kidney disease\r\n2. Currently on haemodialysis or haemodialysis is planned to start within 6\r\nmonths (including patients currently on peritoneal dialysis).\r\n3. Planned AVF will be the primary haemodialysis access mechanism.\r\n4. Surgery to create an arterio-venous fistula in the upper or lower arm is planned.\r\n5. Aged over 18 years\r\n6. Life expectancy predicted to be 12 months minimum\r\n7. Treating team agreeable to patient\\'s involvement in the trial\r\n8. Informed consent ", + "date_enrollment_actual": "", + "agemax_value": 0, + "agemax_unit": "-", + "agemin_unit": "Y", + "scientific_acronym": "FAVOURED (Fish oil and Aspirin in Vascular acccess OUtcomes in REnal Disease)", + "acronym": "", + "target_sample_size": 1200, + "staff_note": "", + "updated": null, + "hc_freetext": "Early thrombosis in arterio-venous fistulae in patients with Stage IV or V chronic kidney disease requiring haemodialysis.", + "study_type": 1, + "i_freetext": "Aspirin 100 mg per day or matching placebo, commencing on the day prior to scheduled surgery and continuing for 3 months.", + "date_enrollment_anticipated": "", + "recruitment_status": 1, + "phase": 3, + "date_registration": null, + "agemin_value": 18, + "study_design": "", + "gender": "-", + "exclusion_criteria": "1. Revision of existing AVF rather than de novo AVF\r\n2. Medical indication for anti-platelet agent(s)\r\n3. Known intolerance of agents including hypersensitivity to aspirin\r\n4. Current use of aspirin within two weeks of commencing trial, and of fish oil within 4 weeks of commencing trial.\r\n5. Pregnancy, lactation or intention to fall pregnant during the time course of the study\r\n6. Known bleeding disorder or established diagnosis of active or suspected bleeding\r\n7. Known active peptic ulcer disease\r\n8. Already receiving anti-coagulation therapy such as warfarin\r\n9. Receiving regular anti-inflammatory agents for another indication such as\r\narthritis\r\n10.Potential non-compliance with treatment regimen in the view of the\r\ntreating clinicians\r\n11.Involved in another clinical trial where the intervention being trialled is likely to confound the outcome of this trial\r\n12.Previously randomised to this trial. ", "primary_sponsor": 1 } - }, + }, { - "pk": 1, - "model": "registry.trialnumber", + "pk": 1, + "model": "repository.trialnumber", "fields": { - "id_number": "CRG120600100", - "trial": 1, + "id_number": "CRG120600100", + "trial": 1, "issuing_authority": "Cochrane Renal Group" } - }, + }, { - "pk": 2, - "model": "registry.trialnumber", + "pk": 2, + "model": "repository.trialnumber", "fields": { - "id_number": "ACTRN12607000569404", - "trial": 1, + "id_number": "ACTRN12607000569404", + "trial": 1, "issuing_authority": "Australian New Zealand Clinical Trials Registry" } - }, + }, { - "pk": 3, - "model": "registry.trialnumber", + "pk": 3, + "model": "repository.trialnumber", "fields": { - "id_number": "NCT00839085", - "trial": 3, + "id_number": "NCT00839085", + "trial": 3, "issuing_authority": "ClinicalTrials.gov" } - }, + }, { - "pk": 4, - "model": "registry.trialnumber", + "pk": 4, + "model": "repository.trialnumber", "fields": { - "id_number": "IRCT138708271460N1", - "trial": 3, + "id_number": "IRCT138708271460N1", + "trial": 3, "issuing_authority": "Iranian Registry of Clinical Trials" } - }, + }, { - "pk": 1, - "model": "registry.trialinstitution", + "pk": 1, + "model": "repository.trialinstitution", "fields": { - "trial": 3, - "relation": "SupportSource", + "trial": 3, + "relation": "SupportSource", "institution": 2 } - }, + }, { - "pk": 1, - "model": "registry.institution", + "pk": 1, + "model": "repository.institution", "fields": { - "country": 158, - "name": "National Institute for Health Innovation", + "country": 158, + "name": "National Institute for Health Innovation", "address": "School of Population Health\r\nTamaki Campus\r\nThe University of Auckland\r\nPrivate Bag 92019 \r\nAuckland Mail Centre\r\nAuckland 1142" } - }, + }, { - "pk": 2, - "model": "registry.institution", + "pk": 2, + "model": "repository.institution", "fields": { - "country": 103, - "name": "Tabriz University of Medical Sciences", + "country": 103, + "name": "Tabriz University of Medical Sciences", "address": "Daneshgah St,Tabriz Univ Med Sci\r\nTabriz\r\nZip: 51656-65811" } - }, + }, { - "pk": 1, - "model": "registry.contact", + "pk": 1, + "model": "repository.contact", "fields": { - "city": "Tabriz", - "zip": "51656-65811", - "firstname": "Naser", - "middlename": "", - "lastname": "Safaei", - "telephone": "+98-411-3357767", - "affiliation": 2, - "address": "Daneshgah St, Tabriz Univ Med Sci", - "country": 103, + "city": "Tabriz", + "zip": "51656-65811", + "firstname": "Naser", + "middlename": "", + "lastname": "Safaei", + "telephone": "+98-411-3357767", + "affiliation": 2, + "address": "Daneshgah St, Tabriz Univ Med Sci", + "country": 103, "email": "[email protected]" } - }, + }, { - "pk": 1, - "model": "registry.trialcontact", + "pk": 1, + "model": "repository.trialcontact", "fields": { - "status": "Active", - "trial": 3, - "contact": 1, + "status": "Active", + "trial": 3, + "contact": 1, "relation": "PublicContact" } - }, + }, { - "pk": 2, - "model": "registry.trialcontact", + "pk": 2, + "model": "repository.trialcontact", "fields": { - "status": "Active", - "trial": 3, - "contact": 1, + "status": "Active", + "trial": 3, + "contact": 1, "relation": "ScientificContact" } - }, + }, { - "pk": 1, - "model": "registry.recruitmentcountry", + "pk": 1, + "model": "repository.recruitmentcountry", "fields": { - "trial": 1, + "trial": 1, "country": 14 } - }, + }, { - "pk": 2, - "model": "registry.recruitmentcountry", + "pk": 2, + "model": "repository.recruitmentcountry", "fields": { - "trial": 1, + "trial": 1, "country": 158 } - }, + }, { - "pk": 3, - "model": "registry.recruitmentcountry", + "pk": 3, + "model": "repository.recruitmentcountry", "fields": { - "trial": 3, + "trial": 3, "country": 103 } - }, + }, { - "pk": 1, - "model": "registry.trialinterventioncode", + "pk": 1, + "model": "repository.trialinterventioncode", "fields": { - "trial": 3, - "i_code": 1, + "trial": 3, + "i_code": 1, "order": 0 } - }, + }, { - "pk": 2, - "model": "registry.trialinterventioncode", + "pk": 2, + "model": "repository.trialinterventioncode", "fields": { - "trial": 1, - "i_code": 1, + "trial": 1, + "i_code": 1, "order": 0 } - }, + }, { - "pk": 3, - "model": "registry.trialinterventioncode", + "pk": 3, + "model": "repository.trialinterventioncode", "fields": { - "trial": 1, - "i_code": 8, + "trial": 1, + "i_code": 8, "order": 0 } - }, + }, { - "pk": 1, - "model": "registry.outcome", + "pk": 1, + "model": "repository.outcome", "fields": { - "trial": 1, - "order": 0, - "interest": "primary", + "trial": 1, + "order": 0, + "interest": "primary", "description": "The primary outcome measure is (unassisted) patency of the AVF at ninety (90)days after surgery. This is defined as the presence of an audible bruit over the site of the arterio-venous anastomosis, without the need for surgical or radiological intervention from the time of creation until the time of assessment.\r\nThe assessment of patency will be made at this time even if the AVF is not yet used for haemodialysis (11). Measurement of bruit will also be taken at 1 month to better define the natural history of thrombotic events." } - }, + }, { - "pk": 6, - "model": "registry.outcome", + "pk": 6, + "model": "repository.outcome", "fields": { - "trial": 3, - "order": 0, - "interest": "primary", + "trial": 3, + "order": 0, + "interest": "primary", "description": "Left Ventricular Ejection Fraction (LVEF). Timepoint: Before and after CABG. Method of measurement: Trans Thoracic Echocardiography (TTE)" } - }, + }, { - "pk": 7, - "model": "registry.outcome", + "pk": 7, + "model": "repository.outcome", "fields": { - "trial": 3, - "order": 0, - "interest": "secondary", + "trial": 3, + "order": 0, + "interest": "secondary", "description": "Total Antioxidant Capacity (TAC) . Timepoint: Before, middle and after CABG. Method of measurement: Biochemistry (blood sample)" } - }, + }, { - "pk": 2, - "model": "registry.outcome", + "pk": 2, + "model": "repository.outcome", "fields": { - "trial": 1, - "order": 1, - "interest": "secondary", + "trial": 1, + "order": 1, + "interest": "secondary", "description": "Functional patency at 6 months. This is defined as the ability to use the AVF for a minimum of 3 consecutive dialysis treatments to the satisfaction of the clinician(s), without the need to use alternative dialysis access, or to delay commencement of dialysis. In patients who have not needed to start dialysis,\r\nassessment of functional patency will be delayed until commencement of dialysis. " } - }, + }, { - "pk": 3, - "model": "registry.outcome", + "pk": 3, + "model": "repository.outcome", "fields": { - "trial": 1, - "order": 2, - "interest": "secondary", + "trial": 1, + "order": 2, + "interest": "secondary", "description": "Time to failure of primary patency. Time from AVF creation to need for first intervention. An event is defined as revision surgery, need for alternative access, or abandonment of AVF which ever comes first. Censored observations are defined as regaining renal function such that dialysis is not needed or still having a patent AVF at time of study analysis. There will be a minimum of 12 months follow up time for each patient. " } - }, + }, { - "pk": 4, - "model": "registry.outcome", + "pk": 4, + "model": "repository.outcome", "fields": { - "trial": 1, - "order": 3, - "interest": "secondary", + "trial": 1, + "order": 3, + "interest": "secondary", "description": "Time to failure of assisted patency. This is defined as time from AVF creation to abandonment of access. That is, radiological and surgical interventions to preserve or restore patency do not constitute failure. An event is defined as abandonment of the AVF as dialysis access. Censored observations will be as for time to failure of primary patency above. " } - }, + }, { - "pk": 5, - "model": "registry.outcome", + "pk": 5, + "model": "repository.outcome", "fields": { - "trial": 1, - "order": 4, - "interest": "secondary", + "trial": 1, + "order": 4, + "interest": "secondary", "description": "Adverse events. All serious adverse events (see section 5.4) will be collected. The analysis of this secondary outcome will focus specifically on bleeding events." } - }, + }, { - "pk": 1, - "model": "registry.descriptor", + "pk": 1, + "model": "repository.descriptor", "fields": { - "code": "C14", - "vocabulary": "DeCS", - "level": "general", - "text": "Cardiovascular Diseases", - "trial": 3, - "aspect": "HealthCondition", + "code": "C14", + "vocabulary": "DeCS", + "level": "general", + "text": "Cardiovascular Diseases", + "trial": 3, + "aspect": "HealthCondition", "order": 0 } - }, + }, { - "pk": 8, - "model": "registry.descriptor", + "pk": 8, + "model": "repository.descriptor", "fields": { - "code": "50-81-7", - "vocabulary": "CAS", - "level": "specific", - "text": "L-Ascorbic acid", - "trial": 3, - "aspect": "Intervention", + "code": "50-81-7", + "vocabulary": "CAS", + "level": "specific", + "text": "L-Ascorbic acid", + "trial": 3, + "aspect": "Intervention", "order": 0 } - }, + }, { - "pk": 9, - "model": "registry.descriptor", + "pk": 9, + "model": "repository.descriptor", "fields": { - "code": "C23.300.575.950.250", - "vocabulary": "DeCS", - "level": "specific", - "text": "Arteriovenous Fistula", - "trial": 1, - "aspect": "HealthCondition", + "code": "C23.300.575.950.250", + "vocabulary": "DeCS", + "level": "specific", + "text": "Arteriovenous Fistula", + "trial": 1, + "aspect": "HealthCondition", "order": 0 } - }, + }, { - "pk": 10, - "model": "registry.descriptor", + "pk": 10, + "model": "repository.descriptor", "fields": { - "code": "50-78-2", - "vocabulary": "CAS", - "level": "specific", - "text": "Benzoic acid, 2-(acetyloxy)-", - "trial": 1, - "aspect": "Intervention", + "code": "50-78-2", + "vocabulary": "CAS", + "level": "specific", + "text": "Benzoic acid, 2-(acetyloxy)-", + "trial": 1, + "aspect": "Intervention", "order": 0 } - }, + }, { - "pk": 2, - "model": "registry.descriptor", + "pk": 2, + "model": "repository.descriptor", "fields": { - "code": "C14.280.647", - "vocabulary": "DeCS", - "level": "specific", - "text": "Myocardial Ischemia", - "trial": 3, - "aspect": "HealthCondition", + "code": "C14.280.647", + "vocabulary": "DeCS", + "level": "specific", + "text": "Myocardial Ischemia", + "trial": 3, + "aspect": "HealthCondition", "order": 1 } - }, + }, { - "pk": 3, - "model": "registry.descriptor", + "pk": 3, + "model": "repository.descriptor", "fields": { - "code": "C14.280.647.250.260", - "vocabulary": "DeCS", - "level": "specific", - "text": "Coronary Artery Disease ", - "trial": 3, - "aspect": "HealthCondition", + "code": "C14.280.647.250.260", + "vocabulary": "DeCS", + "level": "specific", + "text": "Coronary Artery Disease ", + "trial": 3, + "aspect": "HealthCondition", "order": 2 } - }, + }, { - "pk": 7, - "model": "registry.descriptor", + "pk": 7, + "model": "repository.descriptor", "fields": { - "code": "C14.280.238", - "vocabulary": "DeCS", - "level": "specific", - "text": "Cardiomyopathies", - "trial": 3, - "aspect": "HealthCondition", + "code": "C14.280.238", + "vocabulary": "DeCS", + "level": "specific", + "text": "Cardiomyopathies", + "trial": 3, + "aspect": "HealthCondition", "order": 3 } } ] diff --git a/clinicaltrials/registry/fixtures/initial_data.json b/clinicaltrials/repository/fixtures/initial_data.json similarity index 63% rename from clinicaltrials/registry/fixtures/initial_data.json rename to clinicaltrials/repository/fixtures/initial_data.json index d721577..5ac27d1 100644 --- a/clinicaltrials/registry/fixtures/initial_data.json +++ b/clinicaltrials/repository/fixtures/initial_data.json @@ -1,815 +1,815 @@ [ { - "pk": 4, - "model": "registry.clinicaltrial", + "pk": 4, + "model": "repository.clinicaltrial", "fields": { - "scientific_title": "Clinical Investigation: A Continuation in the Clinical Evaluation of the Bioabsorbable Vascular Solutions (BVS) Everolimus Eluting Coronary Stent System (EECCS) in the Treatment of Subjects With de Novo Native Coronary Artery Lesions ", - "public_title": "Clinical Investigation: An assessment of the safety and performance of the Bioabsorbable Vascular Solutions (BVS) Everolimus Eluting Coronary Stent System (EECCS) in the treatment of patients with de novo native coronary artery lesions.", - "trial_id": null, - "inclusion_criteria": "Up to two de novo lesions can be treated, each located in a separate native epicardial vessel.\r\n\r\nTarget lesion(s) must measure <= 28 mm in length by Qualitative Coronary Angiography (QCA), or by visual estimation if on line QCA is not available.\r\n\r\nTarget lesion(s) must be in a major artery or branch with a visually estimated stenosis of >= 50% and < 100% with a Thrombolysis in Myocardial Infarction (TIMI) flow of >= 1.\r\n\r\nIf two treatable lesions meet the inclusion criteria they must be in separate major epicardial vessels.\r\n\r\nPercutaneous interventions for lesions in a non-target vessel are allowed if done >= 30 days prior to or if planned to be done > 6 months after the index procedure.\r\n\r\nPercutaneous intervention for lesions in the target vessel are allowed if done > 6 months prior to or if planned to be done 6 months after the index procedure.", + "scientific_title": "Clinical Investigation: A Continuation in the Clinical Evaluation of the Bioabsorbable Vascular Solutions (BVS) Everolimus Eluting Coronary Stent System (EECCS) in the Treatment of Subjects With de Novo Native Coronary Artery Lesions ", + "public_title": "Clinical Investigation: An assessment of the safety and performance of the Bioabsorbable Vascular Solutions (BVS) Everolimus Eluting Coronary Stent System (EECCS) in the treatment of patients with de novo native coronary artery lesions.", + "trial_id": null, + "inclusion_criteria": "Up to two de novo lesions can be treated, each located in a separate native epicardial vessel.\r\n\r\nTarget lesion(s) must measure <= 28 mm in length by Qualitative Coronary Angiography (QCA), or by visual estimation if on line QCA is not available.\r\n\r\nTarget lesion(s) must be in a major artery or branch with a visually estimated stenosis of >= 50% and < 100% with a Thrombolysis in Myocardial Infarction (TIMI) flow of >= 1.\r\n\r\nIf two treatable lesions meet the inclusion criteria they must be in separate major epicardial vessels.\r\n\r\nPercutaneous interventions for lesions in a non-target vessel are allowed if done >= 30 days prior to or if planned to be done > 6 months after the index procedure.\r\n\r\nPercutaneous intervention for lesions in the target vessel are allowed if done > 6 months prior to or if planned to be done 6 months after the index procedure.", "recruitment_country": [ - 15, - 23, - 1, - 59, - 74, - 108, - 155, - 176, + 15, + 23, + 1, + 59, + 74, + 108, + 155, + 176, 213 - ], + ], "i_code": [ 2 - ], - "date_enrollment_actual": "", - "agemax_value": 0, - "agemax_unit": "-", - "agemin_unit": "Y", - "scientific_acronym": "ABSORB EXTEND", - "acronym": "ABSORB EXTEND", - "target_sample_size": 1000, - "staff_note": "", - "status": "pending", - "updated": "2010-03-02 17:41:38", - "hc_freetext": "Coronary Artery Stenosis\r\nCoronary Disease\r\nCoronary Artery Disease\r\n", - "study_type": null, - "i_freetext": "Bioabsorbable Vascular Solutions Everolimus Eluting Coronary Stent System (BVS EECSS). Percutaneous Coronary Intervention (PCI) is commonly known as coronary angioplasty. Typically, PCI is performed by threading a slender balloon-tipped tube, a catheter, from an artery in the groin to a trouble spot in an artery of the heart. The balloon is then inflated, compressing the plaque and dilating (widening) the narrowed coronary artery so that blood can flow more easily. During PCI for this study, the BVS EECSS is then placed in the coronary artery to support the previously narrowed area. The BVS EECSS will remain in place until the bioabsorbtion process is complete, your physician will discuss this process with you. The duration of the PCI procedure will depend on many factors, and is typically less than 2 hours. Your physician will discuss those factors and the length of your procedure with you.\r\n\r\nOptical Coherence Tomography (OCT) subgroup definition:\r\n- A subgroup of up to 50 subjects who:\r\n\r\n- Have their procedures performed at selected investigational sites with OCT capability; and\r\n\r\n- Receive planned overlapping stent treatment of the target lesion.\r\n\r\n- The need for planned overlapping of BVS stents will be determined by the investigator up to the time of the index procedure.\r\n\r\n- Angiography, Intravascular Ultrasound (IVUS) and OCT are required for all subjects in the OCT subgroup post-procedure and at 2-year follow-up\r\n\r\n\r\n\r\nMulti-Slice Computed Tomography subgroup definition:\r\n\r\n- A subgroup of up to 100 subjects who:\r\n\r\n- Have their procedures performed at selected investigational sites having both OCT and MSCT capability; and\r\n\r\n- Receive at least one BVS EECSS in the target lesion.\r\n\r\nMSCT imaging and clinical follow-up at 18 months is required for all subjects in the MSCT subgroup.", - "date_enrollment_anticipated": "", - "recruitment_status": 2, - "phase": null, - "date_registration": null, - "agemin_value": 18, - "study_design": "", - "created": "2010-03-02 13:34:30", - "gender": "-", - "exclusion_criteria": "Lesion(s) located within an arterial or saphenous vein graft or distal to a diseased (defined as vessel irregularity per angiogram and > 20% stenosed lesion by visual estimation) arterial or saphenous vein graft. Lesion(s) involving a bifurcation with side branch vessel >= 2 mm in diameter, ostial lesion > 40% stenosed by visual estimation or side branch requiring predilatation. Total occlusion (TIMI flow 0), prior to wire passing. Target vessel(s) contains visible thrombus. Another clinically significant lesion is located in the same epicardial vessel (including side branch) as the target lesion(s). Subject has received brachytherapy in any epicardial vessel (including side branches).", - "primary_sponsor": 3, + ], + "date_enrollment_actual": "", + "agemax_value": 0, + "agemax_unit": "-", + "agemin_unit": "Y", + "scientific_acronym": "ABSORB EXTEND", + "acronym": "ABSORB EXTEND", + "target_sample_size": 1000, + "staff_note": "", + "status": "pending", + "updated": "2010-03-02 17:41:38", + "hc_freetext": "Coronary Artery Stenosis\r\nCoronary Disease\r\nCoronary Artery Disease\r\n", + "study_type": null, + "i_freetext": "Bioabsorbable Vascular Solutions Everolimus Eluting Coronary Stent System (BVS EECSS). Percutaneous Coronary Intervention (PCI) is commonly known as coronary angioplasty. Typically, PCI is performed by threading a slender balloon-tipped tube, a catheter, from an artery in the groin to a trouble spot in an artery of the heart. The balloon is then inflated, compressing the plaque and dilating (widening) the narrowed coronary artery so that blood can flow more easily. During PCI for this study, the BVS EECSS is then placed in the coronary artery to support the previously narrowed area. The BVS EECSS will remain in place until the bioabsorbtion process is complete, your physician will discuss this process with you. The duration of the PCI procedure will depend on many factors, and is typically less than 2 hours. Your physician will discuss those factors and the length of your procedure with you.\r\n\r\nOptical Coherence Tomography (OCT) subgroup definition:\r\n- A subgroup of up to 50 subjects who:\r\n\r\n- Have their procedures performed at selected investigational sites with OCT capability; and\r\n\r\n- Receive planned overlapping stent treatment of the target lesion.\r\n\r\n- The need for planned overlapping of BVS stents will be determined by the investigator up to the time of the index procedure.\r\n\r\n- Angiography, Intravascular Ultrasound (IVUS) and OCT are required for all subjects in the OCT subgroup post-procedure and at 2-year follow-up\r\n\r\n\r\n\r\nMulti-Slice Computed Tomography subgroup definition:\r\n\r\n- A subgroup of up to 100 subjects who:\r\n\r\n- Have their procedures performed at selected investigational sites having both OCT and MSCT capability; and\r\n\r\n- Receive at least one BVS EECSS in the target lesion.\r\n\r\nMSCT imaging and clinical follow-up at 18 months is required for all subjects in the MSCT subgroup.", + "date_enrollment_anticipated": "", + "recruitment_status": 2, + "phase": null, + "date_registration": null, + "agemin_value": 18, + "study_design": "", + "created": "2010-03-02 13:34:30", + "gender": "-", + "exclusion_criteria": "Lesion(s) located within an arterial or saphenous vein graft or distal to a diseased (defined as vessel irregularity per angiogram and > 20% stenosed lesion by visual estimation) arterial or saphenous vein graft. Lesion(s) involving a bifurcation with side branch vessel >= 2 mm in diameter, ostial lesion > 40% stenosed by visual estimation or side branch requiring predilatation. Total occlusion (TIMI flow 0), prior to wire passing. Target vessel(s) contains visible thrombus. Another clinically significant lesion is located in the same epicardial vessel (including side branch) as the target lesion(s). Subject has received brachytherapy in any epicardial vessel (including side branches).", + "primary_sponsor": 3, "exported": null } - }, + }, { - "pk": 1, - "model": "registry.clinicaltrial", + "pk": 1, + "model": "repository.clinicaltrial", "fields": { - "scientific_title": "A randomised, double-blind, placebo-controlled, factorial-design trial to assess the effect of aspirin and fish oil in the prevention of early thrombosis in arterio-venous fistulae in patients with Stage IV or V chronic kidney disease requiring haemodialysis", - "public_title": "", - "trial_id": null, - "inclusion_criteria": "1. Stage 4 or 5 chronic kidney disease\r\n2. Currently on haemodialysis or haemodialysis is planned to start within 6\r\nmonths (including patients currently on peritoneal dialysis).\r\n3. Planned AVF will be the primary haemodialysis access mechanism.\r\n4. Surgery to create an arterio-venous fistula in the upper or lower arm is planned.\r\n5. Aged over 18 years\r\n6. Life expectancy predicted to be 12 months minimum\r\n7. Treating team agreeable to patient\\'s involvement in the trial\r\n8. Informed consent ", + "scientific_title": "A randomised, double-blind, placebo-controlled, factorial-design trial to assess the effect of aspirin and fish oil in the prevention of early thrombosis in arterio-venous fistulae in patients with Stage IV or V chronic kidney disease requiring haemodialysis", + "public_title": "", + "trial_id": null, + "inclusion_criteria": "1. Stage 4 or 5 chronic kidney disease\r\n2. Currently on haemodialysis or haemodialysis is planned to start within 6\r\nmonths (including patients currently on peritoneal dialysis).\r\n3. Planned AVF will be the primary haemodialysis access mechanism.\r\n4. Surgery to create an arterio-venous fistula in the upper or lower arm is planned.\r\n5. Aged over 18 years\r\n6. Life expectancy predicted to be 12 months minimum\r\n7. Treating team agreeable to patient\\'s involvement in the trial\r\n8. Informed consent ", "recruitment_country": [ - 14, + 14, 158 - ], + ], "i_code": [ - 1, + 1, 8 - ], - "date_enrollment_actual": "", - "agemax_value": 0, - "agemax_unit": "-", - "agemin_unit": "Y", - "scientific_acronym": "FAVOURED (Fish oil and Aspirin in Vascular acccess OUtcomes in REnal Disease)", - "acronym": "", - "target_sample_size": 1200, - "staff_note": "", - "status": "pending", - "updated": "2010-01-29 20:50:47", - "hc_freetext": "Early thrombosis in arterio-venous fistulae in patients with Stage IV or V chronic kidney disease requiring haemodialysis.", - "study_type": 1, - "i_freetext": "Aspirin 100 mg per day or matching placebo, commencing on the day prior to scheduled surgery and continuing for 3 months.", - "date_enrollment_anticipated": "", - "recruitment_status": 1, - "phase": 3, - "date_registration": null, - "agemin_value": 18, - "study_design": "", - "created": "2010-01-20 17:47:08", - "gender": "-", - "exclusion_criteria": "1. Revision of existing AVF rather than de novo AVF\r\n2. Medical indication for anti-platelet agent(s)\r\n3. Known intolerance of agents including hypersensitivity to aspirin\r\n4. Current use of aspirin within two weeks of commencing trial, and of fish oil within 4 weeks of commencing trial.\r\n5. Pregnancy, lactation or intention to fall pregnant during the time course of the study\r\n6. Known bleeding disorder or established diagnosis of active or suspected bleeding\r\n7. Known active peptic ulcer disease\r\n8. Already receiving anti-coagulation therapy such as warfarin\r\n9. Receiving regular anti-inflammatory agents for another indication such as\r\narthritis\r\n10.Potential non-compliance with treatment regimen in the view of the\r\ntreating clinicians\r\n11.Involved in another clinical trial where the intervention being trialled is likely to confound the outcome of this trial\r\n12.Previously randomised to this trial. ", - "primary_sponsor": 1, + ], + "date_enrollment_actual": "", + "agemax_value": 0, + "agemax_unit": "-", + "agemin_unit": "Y", + "scientific_acronym": "FAVOURED (Fish oil and Aspirin in Vascular acccess OUtcomes in REnal Disease)", + "acronym": "", + "target_sample_size": 1200, + "staff_note": "", + "status": "pending", + "updated": "2010-01-29 20:50:47", + "hc_freetext": "Early thrombosis in arterio-venous fistulae in patients with Stage IV or V chronic kidney disease requiring haemodialysis.", + "study_type": 1, + "i_freetext": "Aspirin 100 mg per day or matching placebo, commencing on the day prior to scheduled surgery and continuing for 3 months.", + "date_enrollment_anticipated": "", + "recruitment_status": 1, + "phase": 3, + "date_registration": null, + "agemin_value": 18, + "study_design": "", + "created": "2010-01-20 17:47:08", + "gender": "-", + "exclusion_criteria": "1. Revision of existing AVF rather than de novo AVF\r\n2. Medical indication for anti-platelet agent(s)\r\n3. Known intolerance of agents including hypersensitivity to aspirin\r\n4. Current use of aspirin within two weeks of commencing trial, and of fish oil within 4 weeks of commencing trial.\r\n5. Pregnancy, lactation or intention to fall pregnant during the time course of the study\r\n6. Known bleeding disorder or established diagnosis of active or suspected bleeding\r\n7. Known active peptic ulcer disease\r\n8. Already receiving anti-coagulation therapy such as warfarin\r\n9. Receiving regular anti-inflammatory agents for another indication such as\r\narthritis\r\n10.Potential non-compliance with treatment regimen in the view of the\r\ntreating clinicians\r\n11.Involved in another clinical trial where the intervention being trialled is likely to confound the outcome of this trial\r\n12.Previously randomised to this trial. ", + "primary_sponsor": 1, "exported": null } - }, + }, { - "pk": 3, - "model": "registry.clinicaltrial", + "pk": 3, + "model": "repository.clinicaltrial", "fields": { - "scientific_title": "Effect of Ascorbic Acid and Grape Seed Extract \"Vitis Vinifera L.\" on Oxidative Stress Induced by on Pump Coronary Artery by Pass Grafting Surgery", - "public_title": "Comparison of Ascorbic Acid and Grape Seed Extract in Oxidative Stress Induced by on Pump Heart Surgery", - "trial_id": null, - "inclusion_criteria": "Candidates for elective CABG surgery with pump for first time, 3 Vessel Disease (3VD).", + "scientific_title": "Effect of Ascorbic Acid and Grape Seed Extract \"Vitis Vinifera L.\" on Oxidative Stress Induced by on Pump Coronary Artery by Pass Grafting Surgery", + "public_title": "Comparison of Ascorbic Acid and Grape Seed Extract in Oxidative Stress Induced by on Pump Heart Surgery", + "trial_id": null, + "inclusion_criteria": "Candidates for elective CABG surgery with pump for first time, 3 Vessel Disease (3VD).", "recruitment_country": [ 103 - ], + ], "i_code": [ 1 - ], - "date_enrollment_actual": "", - "agemax_value": 0, - "agemax_unit": "-", - "agemin_unit": "-", - "scientific_acronym": "", - "acronym": "", - "target_sample_size": 75, - "staff_note": "", - "status": "pending", - "updated": "2010-01-21 18:21:16", - "hc_freetext": "Condition 1: Coronary Atrery Bypass Graft (CABG).\r\nCondition 2: Atherosclerotic heart disease.\r\nCondition 3: Ischaemic cardiomyopathy.", - "study_type": 1, - "i_freetext": "Intervention 1: Control Group: without intervention.\r\nIntervention 2: Grape Seed Extract 100 mg/6h .\r\nIntervention 3: Vit C 25 mg/kg.", - "date_enrollment_anticipated": "2008-11-01", - "recruitment_status": 4, - "phase": 6, - "date_registration": null, - "agemin_value": 0, - "study_design": "Randomization: randomized. Blinding: Double blind. Placebo: not used. Assignment: Parallel. Purpose: Supportive care. Other design features: .", - "created": "2010-01-20 17:47:08", - "gender": "-", - "exclusion_criteria": "High risk patients, Those who need another heart surgery beside CABG, Urgent patients Diabetics, Ischemic time more than 120 min.", - "primary_sponsor": 2, + ], + "date_enrollment_actual": "", + "agemax_value": 0, + "agemax_unit": "-", + "agemin_unit": "-", + "scientific_acronym": "", + "acronym": "", + "target_sample_size": 75, + "staff_note": "", + "status": "pending", + "updated": "2010-01-21 18:21:16", + "hc_freetext": "Condition 1: Coronary Atrery Bypass Graft (CABG).\r\nCondition 2: Atherosclerotic heart disease.\r\nCondition 3: Ischaemic cardiomyopathy.", + "study_type": 1, + "i_freetext": "Intervention 1: Control Group: without intervention.\r\nIntervention 2: Grape Seed Extract 100 mg/6h .\r\nIntervention 3: Vit C 25 mg/kg.", + "date_enrollment_anticipated": "2008-11-01", + "recruitment_status": 4, + "phase": 6, + "date_registration": null, + "agemin_value": 0, + "study_design": "Randomization: randomized. Blinding: Double blind. Placebo: not used. Assignment: Parallel. Purpose: Supportive care. Other design features: .", + "created": "2010-01-20 17:47:08", + "gender": "-", + "exclusion_criteria": "High risk patients, Those who need another heart surgery beside CABG, Urgent patients Diabetics, Ischemic time more than 120 min.", + "primary_sponsor": 2, "exported": null } - }, - { - "pk": 2, - "model": "registry.clinicaltrial", - "fields": { - "scientific_title": "Minimal trial record (only required fields)", - "public_title": "", - "trial_id": null, - "inclusion_criteria": "", - "recruitment_country": [], - "i_code": [], - "date_enrollment_actual": "", - "agemax_value": 0, - "agemax_unit": "-", - "agemin_unit": "-", - "scientific_acronym": "", - "acronym": "", - "target_sample_size": 0, - "staff_note": "", - "status": "pending", - "updated": "2009-10-19 21:11:43", - "hc_freetext": "", - "study_type": null, - "i_freetext": "", - "date_enrollment_anticipated": "", - "recruitment_status": null, - "phase": null, - "date_registration": null, - "agemin_value": 0, - "study_design": "", - "created": "2010-01-20 17:47:08", - "gender": "-", - "exclusion_criteria": "", - "primary_sponsor": null, + }, + { + "pk": 2, + "model": "repository.clinicaltrial", + "fields": { + "scientific_title": "Minimal trial record (only required fields)", + "public_title": "", + "trial_id": null, + "inclusion_criteria": "", + "recruitment_country": [], + "i_code": [], + "date_enrollment_actual": "", + "agemax_value": 0, + "agemax_unit": "-", + "agemin_unit": "-", + "scientific_acronym": "", + "acronym": "", + "target_sample_size": 0, + "staff_note": "", + "status": "pending", + "updated": "2009-10-19 21:11:43", + "hc_freetext": "", + "study_type": null, + "i_freetext": "", + "date_enrollment_anticipated": "", + "recruitment_status": null, + "phase": null, + "date_registration": null, + "agemin_value": 0, + "study_design": "", + "created": "2010-01-20 17:47:08", + "gender": "-", + "exclusion_criteria": "", + "primary_sponsor": null, "exported": null } - }, + }, { - "pk": 1, - "model": "registry.trialnumber", + "pk": 1, + "model": "repository.trialnumber", "fields": { - "id_number": "CRG120600100", - "trial": 1, + "id_number": "CRG120600100", + "trial": 1, "issuing_authority": "CRG" } - }, + }, { - "pk": 2, - "model": "registry.trialnumber", + "pk": 2, + "model": "repository.trialnumber", "fields": { - "id_number": "ACTRN12607000569404", - "trial": 1, + "id_number": "ACTRN12607000569404", + "trial": 1, "issuing_authority": "ANZCTR" } - }, + }, { - "pk": 3, - "model": "registry.trialnumber", + "pk": 3, + "model": "repository.trialnumber", "fields": { - "id_number": "NCT00839085", - "trial": 3, + "id_number": "NCT00839085", + "trial": 3, "issuing_authority": "ClinicalTrials.gov" } - }, + }, { - "pk": 4, - "model": "registry.trialnumber", + "pk": 4, + "model": "repository.trialnumber", "fields": { - "id_number": "IRCT138708271460N1", - "trial": 3, + "id_number": "IRCT138708271460N1", + "trial": 3, "issuing_authority": "IRCT" } - }, + }, { - "pk": 5, - "model": "registry.trialnumber", + "pk": 5, + "model": "repository.trialnumber", "fields": { - "id_number": "ACTRN12610000131055", - "trial": 4, + "id_number": "ACTRN12610000131055", + "trial": 4, "issuing_authority": "ANZCTR" } - }, + }, { - "pk": 6, - "model": "registry.trialnumber", + "pk": 6, + "model": "repository.trialnumber", "fields": { - "id_number": "NCT01023789 ", - "trial": 4, + "id_number": "NCT01023789 ", + "trial": 4, "issuing_authority": "ClinicalTrials.gov" } - }, + }, { - "pk": 1, - "model": "registry.trialsecondarysponsor", + "pk": 1, + "model": "repository.trialsecondarysponsor", "fields": { - "trial": 1, + "trial": 1, "institution": 1 } - }, + }, { - "pk": 1, - "model": "registry.trialsupportsource", + "pk": 1, + "model": "repository.trialsupportsource", "fields": { - "trial": 3, + "trial": 3, "institution": 1 } - }, + }, { - "pk": 2, - "model": "registry.trialsupportsource", + "pk": 2, + "model": "repository.trialsupportsource", "fields": { - "trial": 4, + "trial": 4, "institution": 3 } - }, + }, { - "pk": 1, - "model": "registry.institution", + "pk": 1, + "model": "repository.institution", "fields": { - "country": 158, - "name": "National Institute for Health Innovation", + "country": 158, + "name": "National Institute for Health Innovation", "address": "School of Population Health\r\nTamaki Campus\r\nThe University of Auckland\r\nPrivate Bag 92019 \r\nAuckland Mail Centre\r\nAuckland 1142" } - }, + }, { - "pk": 2, - "model": "registry.institution", + "pk": 2, + "model": "repository.institution", "fields": { - "country": 103, - "name": "Tabriz University of Medical Sciences", + "country": 103, + "name": "Tabriz University of Medical Sciences", "address": "Daneshgah St,Tabriz Univ Med Sci\r\nTabriz\r\nZip: 51656-65811" } - }, + }, { - "pk": 3, - "model": "registry.institution", + "pk": 3, + "model": "repository.institution", "fields": { - "country": 233, - "name": "Abbott Vascular", + "country": 233, + "name": "Abbott Vascular", "address": "" } - }, + }, { - "pk": 1, - "model": "registry.contact", + "pk": 1, + "model": "repository.contact", "fields": { - "city": "Tabriz", - "zip": "51656-65811", - "firstname": "Naser", - "middlename": "", - "lastname": "Safaei", - "telephone": "+98-411-3357767", - "affiliation": 2, - "address": "Daneshgah St, Tabriz Univ Med Sci", - "country": 103, + "city": "Tabriz", + "zip": "51656-65811", + "firstname": "Naser", + "middlename": "", + "lastname": "Safaei", + "telephone": "+98-411-3357767", + "affiliation": 2, + "address": "Daneshgah St, Tabriz Univ Med Sci", + "country": 103, "email": "[email protected]" } - }, + }, { - "pk": 2, - "model": "registry.contact", + "pk": 2, + "model": "repository.contact", "fields": { - "city": "Santa Clara", - "zip": "Ca. 950504", - "firstname": "Candace", - "middlename": "", - "lastname": "Elek", - "telephone": "+1 408-845-3133", - "affiliation": 3, - "address": "3200 Lakeside Dr.", - "country": 233, + "city": "Santa Clara", + "zip": "Ca. 950504", + "firstname": "Candace", + "middlename": "", + "lastname": "Elek", + "telephone": "+1 408-845-3133", + "affiliation": 3, + "address": "3200 Lakeside Dr.", + "country": 233, "email": "[email protected]" } - }, + }, { - "pk": 3, - "model": "registry.contact", + "pk": 3, + "model": "repository.contact", "fields": { - "city": "Santa Clara", - "zip": "Ca. 950504", - "firstname": "Robert", - "middlename": "", - "lastname": "McGreevy", - "telephone": "+1 408-845-3932", - "affiliation": 3, - "address": "3200 Lakeside Dr.", - "country": 233, + "city": "Santa Clara", + "zip": "Ca. 950504", + "firstname": "Robert", + "middlename": "", + "lastname": "McGreevy", + "telephone": "+1 408-845-3932", + "affiliation": 3, + "address": "3200 Lakeside Dr.", + "country": 233, "email": "[email protected]" } - }, + }, { - "pk": 1, - "model": "registry.publiccontact", + "pk": 1, + "model": "repository.publiccontact", "fields": { - "status": "Active", - "trial": 3, + "status": "Active", + "trial": 3, "contact": 1 } - }, + }, { - "pk": 2, - "model": "registry.publiccontact", + "pk": 2, + "model": "repository.publiccontact", "fields": { - "status": "Active", - "trial": 4, + "status": "Active", + "trial": 4, "contact": 2 } - }, + }, { - "pk": 1, - "model": "registry.scientificcontact", + "pk": 1, + "model": "repository.scientificcontact", "fields": { - "status": "Active", - "trial": 3, + "status": "Active", + "trial": 3, "contact": 1 } - }, + }, { - "pk": 2, - "model": "registry.scientificcontact", + "pk": 2, + "model": "repository.scientificcontact", "fields": { - "status": "Active", - "trial": 4, + "status": "Active", + "trial": 4, "contact": 3 } - }, + }, { - "pk": 1, - "model": "registry.outcome", + "pk": 1, + "model": "repository.outcome", "fields": { - "trial": 1, - "description": "The primary outcome measure is (unassisted) patency of the AVF at ninety (90)days after surgery. This is defined as the presence of an audible bruit over the site of the arterio-venous anastomosis, without the need for surgical or radiological intervention from the time of creation until the time of assessment.\r\nThe assessment of patency will be made at this time even if the AVF is not yet used for haemodialysis (11). Measurement of bruit will also be taken at 1 month to better define the natural history of thrombotic events.", + "trial": 1, + "description": "The primary outcome measure is (unassisted) patency of the AVF at ninety (90)days after surgery. This is defined as the presence of an audible bruit over the site of the arterio-venous anastomosis, without the need for surgical or radiological intervention from the time of creation until the time of assessment.\r\nThe assessment of patency will be made at this time even if the AVF is not yet used for haemodialysis (11). Measurement of bruit will also be taken at 1 month to better define the natural history of thrombotic events.", "interest": "primary" } - }, + }, { - "pk": 6, - "model": "registry.outcome", + "pk": 6, + "model": "repository.outcome", "fields": { - "trial": 3, - "description": "Left Ventricular Ejection Fraction (LVEF). Timepoint: Before and after CABG. Method of measurement: Trans Thoracic Echocardiography (TTE)", + "trial": 3, + "description": "Left Ventricular Ejection Fraction (LVEF). Timepoint: Before and after CABG. Method of measurement: Trans Thoracic Echocardiography (TTE)", "interest": "primary" } - }, + }, { - "pk": 8, - "model": "registry.outcome", + "pk": 8, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "(This trial has no primary outcome, all outcomes are of equal weight) Acute success (clinical device and clinical procedure). Acute Success is classified according to the following definitions: Clinical Device Success Successful delivery and deployment of the Clinical Investigation stent at the target lesion and successful withdrawal of the stent delivery system with attainment of final residual stenosis < 50% by Qualitative Coronary Angiography (QCA) (by visual estimation if QCA is unavailable). Standard pre-dilation catheters and post-dilatation catheters (if applicable) may be used. Bailout subjects will be included as device success only if the above criteria for clinical device success are met. Clinical Procedure Success Successful delivery and deployment of the Clinical Investigation stent at the target lesion and successful withdrawal of the stent delivery system with attainment of final residual stenosis of < 50% by QCA (by visual estimation if QCA unavailable) and/or using any adjunctive device without the occurrence of ischemia driven major adverse cardiac event (MACE) during the hospital stay with a maximum of first seven days post index procedure. In a dual lesion setting both lesions must meet clinical procedure success. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "(This trial has no primary outcome, all outcomes are of equal weight) Acute success (clinical device and clinical procedure). Acute Success is classified according to the following definitions: Clinical Device Success Successful delivery and deployment of the Clinical Investigation stent at the target lesion and successful withdrawal of the stent delivery system with attainment of final residual stenosis < 50% by Qualitative Coronary Angiography (QCA) (by visual estimation if QCA is unavailable). Standard pre-dilation catheters and post-dilatation catheters (if applicable) may be used. Bailout subjects will be included as device success only if the above criteria for clinical device success are met. Clinical Procedure Success Successful delivery and deployment of the Clinical Investigation stent at the target lesion and successful withdrawal of the stent delivery system with attainment of final residual stenosis of < 50% by QCA (by visual estimation if QCA unavailable) and/or using any adjunctive device without the occurrence of ischemia driven major adverse cardiac event (MACE) during the hospital stay with a maximum of first seven days post index procedure. In a dual lesion setting both lesions must meet clinical procedure success. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 7, - "model": "registry.outcome", + "pk": 7, + "model": "repository.outcome", "fields": { - "trial": 3, - "description": "Total Antioxidant Capacity (TAC) . Timepoint: Before, middle and after CABG. Method of measurement: Biochemistry (blood sample)", + "trial": 3, + "description": "Total Antioxidant Capacity (TAC) . Timepoint: Before, middle and after CABG. Method of measurement: Biochemistry (blood sample)", "interest": "secondary" } - }, + }, { - "pk": 2, - "model": "registry.outcome", + "pk": 2, + "model": "repository.outcome", "fields": { - "trial": 1, - "description": "Functional patency at 6 months. This is defined as the ability to use the AVF for a minimum of 3 consecutive dialysis treatments to the satisfaction of the clinician(s), without the need to use alternative dialysis access, or to delay commencement of dialysis. In patients who have not needed to start dialysis,\r\nassessment of functional patency will be delayed until commencement of dialysis. ", + "trial": 1, + "description": "Functional patency at 6 months. This is defined as the ability to use the AVF for a minimum of 3 consecutive dialysis treatments to the satisfaction of the clinician(s), without the need to use alternative dialysis access, or to delay commencement of dialysis. In patients who have not needed to start dialysis,\r\nassessment of functional patency will be delayed until commencement of dialysis. ", "interest": "secondary" } - }, + }, { - "pk": 9, - "model": "registry.outcome", + "pk": 9, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Cardiac Death (CD): Any death due to proximate cardiac cause (e.g., myocardial infarction, low-output failure, fatal arrhythmia), unwitnessed death, death of unknown cause, and all procedure-related deaths, including those related to concomitant treatment. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Cardiac Death (CD): Any death due to proximate cardiac cause (e.g., myocardial infarction, low-output failure, fatal arrhythmia), unwitnessed death, death of unknown cause, and all procedure-related deaths, including those related to concomitant treatment. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 3, - "model": "registry.outcome", + "pk": 3, + "model": "repository.outcome", "fields": { - "trial": 1, - "description": "Time to failure of primary patency. Time from AVF creation to need for first intervention. An event is defined as revision surgery, need for alternative access, or abandonment of AVF which ever comes first. Censored observations are defined as regaining renal function such that dialysis is not needed or still having a patent AVF at time of study analysis. There will be a minimum of 12 months follow up time for each patient. ", + "trial": 1, + "description": "Time to failure of primary patency. Time from AVF creation to need for first intervention. An event is defined as revision surgery, need for alternative access, or abandonment of AVF which ever comes first. Censored observations are defined as regaining renal function such that dialysis is not needed or still having a patent AVF at time of study analysis. There will be a minimum of 12 months follow up time for each patient. ", "interest": "secondary" } - }, + }, { - "pk": 10, - "model": "registry.outcome", + "pk": 10, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Myocardial Infarction (MI): Q wave MI Development of new, pathological Q wave on the Electrocardiogram (ECG) Non-Q wave MI Elevation of Creatine Kinase (CK) levels to greater than or equal to two times the upper limit of normal (ULN) with elevated Creatine Kinase-Myocardial Band (CK-MB) in the absence of new pathological Q waves. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Myocardial Infarction (MI): Q wave MI Development of new, pathological Q wave on the Electrocardiogram (ECG) Non-Q wave MI Elevation of Creatine Kinase (CK) levels to greater than or equal to two times the upper limit of normal (ULN) with elevated Creatine Kinase-Myocardial Band (CK-MB) in the absence of new pathological Q waves. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 4, - "model": "registry.outcome", + "pk": 4, + "model": "repository.outcome", "fields": { - "trial": 1, - "description": "Time to failure of assisted patency. This is defined as time from AVF creation to abandonment of access. That is, radiological and surgical interventions to preserve or restore patency do not constitute failure. An event is defined as abandonment of the AVF as dialysis access. Censored observations will be as for time to failure of primary patency above. ", + "trial": 1, + "description": "Time to failure of assisted patency. This is defined as time from AVF creation to abandonment of access. That is, radiological and surgical interventions to preserve or restore patency do not constitute failure. An event is defined as abandonment of the AVF as dialysis access. Censored observations will be as for time to failure of primary patency above. ", "interest": "secondary" } - }, + }, { - "pk": 11, - "model": "registry.outcome", + "pk": 11, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Target Vessel Myocardial Infarction (TV-MI): Please see \"MI\" in outcome #2. An MI which originates in the target vessel (vessel to be treated) based on information entered by site personnel. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Target Vessel Myocardial Infarction (TV-MI): Please see \"MI\" in outcome #2. An MI which originates in the target vessel (vessel to be treated) based on information entered by site personnel. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 5, - "model": "registry.outcome", + "pk": 5, + "model": "repository.outcome", "fields": { - "trial": 1, - "description": "Adverse events. All serious adverse events (see section 5.4) will be collected. The analysis of this secondary outcome will focus specifically on bleeding events.", + "trial": 1, + "description": "Adverse events. All serious adverse events (see section 5.4) will be collected. The analysis of this secondary outcome will focus specifically on bleeding events.", "interest": "secondary" } - }, + }, { - "pk": 12, - "model": "registry.outcome", + "pk": 12, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Ischemia Driven Major Adverse Cardiac Events (ID MACE): The composite endpoint composed of cardiac death, myocardial infarction (MI) ischemia-driven target lesion revascularization (TLR) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Ischemia Driven Major Adverse Cardiac Events (ID MACE): The composite endpoint composed of cardiac death, myocardial infarction (MI) ischemia-driven target lesion revascularization (TLR) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 13, - "model": "registry.outcome", + "pk": 13, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Ischemia driven Target Vessel Failure (ID TVF): Any repeat percutaneous intervention or surgical bypass of any segment of the target vessel. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Ischemia driven Target Vessel Failure (ID TVF): Any repeat percutaneous intervention or surgical bypass of any segment of the target vessel. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 14, - "model": "registry.outcome", + "pk": 14, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Ischemia Driven Target Lesion Revascularization (ID TLR): Any repeat percutaneous intervention of the target lesion or bypass surgery of the target vessel performed for restenosis or other complication of the target lesion. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Ischemia Driven Target Lesion Revascularization (ID TLR): Any repeat percutaneous intervention of the target lesion or bypass surgery of the target vessel performed for restenosis or other complication of the target lesion. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 15, - "model": "registry.outcome", + "pk": 15, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Ischemia Driven Target Vessel Revascularization (ID TVR): Any repeat percutaneous intervention or surgical bypass of any segment of the target vessel. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Ischemia Driven Target Vessel Revascularization (ID TVR): Any repeat percutaneous intervention or surgical bypass of any segment of the target vessel. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 16, - "model": "registry.outcome", + "pk": 16, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Stent thrombosis: Clinical presentation of acute coronary syndrome with angiographic evidence of stent thrombosis. In the absence of angiography, any unexplained death, or acute MI in the distribution of the target lesion within 30 days This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Stent thrombosis: Clinical presentation of acute coronary syndrome with angiographic evidence of stent thrombosis. In the absence of angiography, any unexplained death, or acute MI in the distribution of the target lesion within 30 days This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 17, - "model": "registry.outcome", + "pk": 17, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Descriptive analysis of strut, lesion and vessel morphology post-procedure by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in Percutaneous Coronary Intervention (PCI). This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Descriptive analysis of strut, lesion and vessel morphology post-procedure by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in Percutaneous Coronary Intervention (PCI). This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 18, - "model": "registry.outcome", + "pk": 18, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Stent area post-procedure assessed by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in PCI. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Stent area post-procedure assessed by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in PCI. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 19, - "model": "registry.outcome", + "pk": 19, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Lumen area assessed by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in PCI. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Lumen area assessed by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in PCI. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 20, - "model": "registry.outcome", + "pk": 20, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Minimum luminal area (MLA) assessed by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in PCI. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Minimum luminal area (MLA) assessed by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in PCI. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 21, - "model": "registry.outcome", + "pk": 21, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Incomplete apposition (baseline), persisting incomplete apposition, late incomplete apposition assessed by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in PCI. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Incomplete apposition (baseline), persisting incomplete apposition, late incomplete apposition assessed by Optical Coherence Tomography (OCT), which is a catheter based optical imaging modality used in PCI. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 22, - "model": "registry.outcome", + "pk": 22, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "In-stent Late Loss (LL) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "In-stent Late Loss (LL) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 23, - "model": "registry.outcome", + "pk": 23, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "In-segment LL assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "In-segment LL assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 24, - "model": "registry.outcome", + "pk": 24, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Proximal LL (proximal defined as within 5 mm of tissue proximal to stent placement) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Proximal LL (proximal defined as within 5 mm of tissue proximal to stent placement) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 25, - "model": "registry.outcome", + "pk": 25, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Distal LL (distal defined as within 5 mm of tissue distal to stent placement) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Distal LL (distal defined as within 5 mm of tissue distal to stent placement) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 26, - "model": "registry.outcome", + "pk": 26, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "In-stent and in-segment Minimum Luminal Diameter (MLD) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "In-stent and in-segment Minimum Luminal Diameter (MLD) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 27, - "model": "registry.outcome", + "pk": 27, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "In-stent and in-segment % Diameter Stenosis (DS) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "In-stent and in-segment % Diameter Stenosis (DS) assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 28, - "model": "registry.outcome", + "pk": 28, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "In-stent and in-segment Angiographic Binary Restenosis (ABR) rate assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "In-stent and in-segment Angiographic Binary Restenosis (ABR) rate assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 29, - "model": "registry.outcome", + "pk": 29, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Aneurysm, thrombus, persisting dissection assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Aneurysm, thrombus, persisting dissection assessed by Angiography done for patients within the OCT subgroup. This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 30, - "model": "registry.outcome", + "pk": 30, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Vessel area assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Vessel area assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 31, - "model": "registry.outcome", + "pk": 31, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Stent area post-procedure and (if analyzable) assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Stent area post-procedure and (if analyzable) assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 32, - "model": "registry.outcome", + "pk": 32, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Minimum luminal area (MLA) assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Minimum luminal area (MLA) assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 33, - "model": "registry.outcome", + "pk": 33, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "In-stent %Volume Obstruction (VO) assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "In-stent %Volume Obstruction (VO) assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 34, - "model": "registry.outcome", + "pk": 34, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Incomplete apposition (baseline), persisting incomplete apposition, late incomplete apposition assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Incomplete apposition (baseline), persisting incomplete apposition, late incomplete apposition assessed by Intravscular Ultrasound (IVUS) done for patients within the OCT subgroup. (IVUS is a catheter based ultrasound imaging modality used in PCI.) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 35, - "model": "registry.outcome", + "pk": 35, + "model": "repository.outcome", "fields": { - "trial": 4, - "description": "Descriptive analysis of vascular and stent morphology using Multi-Slice Computed Tomography (MSCT) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", + "trial": 4, + "description": "Descriptive analysis of vascular and stent morphology using Multi-Slice Computed Tomography (MSCT) This data is entered into electronic case report forms by investigational site personnel, personal information is kept confidential. ", "interest": "primary" } - }, + }, { - "pk": 1, - "model": "registry.descriptor", + "pk": 1, + "model": "repository.descriptor", "fields": { - "code": "C14", - "vocabulary": "DeCS", - "level": "general", - "text": "Cardiovascular Diseases", - "trial": 3, - "version": "", + "code": "C14", + "vocabulary": "DeCS", + "level": "general", + "text": "Cardiovascular Diseases", + "trial": 3, + "version": "", "aspect": "HealthCondition" } - }, + }, { - "pk": 9, - "model": "registry.descriptor", + "pk": 9, + "model": "repository.descriptor", "fields": { - "code": "C23.300.575.950.250", - "vocabulary": "DeCS", - "level": "specific", - "text": "Arteriovenous Fistula", - "trial": 1, - "version": "", + "code": "C23.300.575.950.250", + "vocabulary": "DeCS", + "level": "specific", + "text": "Arteriovenous Fistula", + "trial": 1, + "version": "", "aspect": "HealthCondition" } - }, + }, { - "pk": 11, - "model": "registry.descriptor", + "pk": 11, + "model": "repository.descriptor", "fields": { - "code": "C14", - "vocabulary": "DeCS", - "level": "general", - "text": "Cardiovascular Diseases", - "trial": 4, - "version": "2010", + "code": "C14", + "vocabulary": "DeCS", + "level": "general", + "text": "Cardiovascular Diseases", + "trial": 4, + "version": "2010", "aspect": "HealthCondition" } - }, + }, { - "pk": 8, - "model": "registry.descriptor", + "pk": 8, + "model": "repository.descriptor", "fields": { - "code": "50-81-7", - "vocabulary": "CAS", - "level": "specific", - "text": "L-Ascorbic acid", - "trial": 3, - "version": "", + "code": "50-81-7", + "vocabulary": "CAS", + "level": "specific", + "text": "L-Ascorbic acid", + "trial": 3, + "version": "", "aspect": "Intervention" } - }, + }, { - "pk": 10, - "model": "registry.descriptor", + "pk": 10, + "model": "repository.descriptor", "fields": { - "code": "50-78-2", - "vocabulary": "CAS", - "level": "specific", - "text": "Benzoic acid, 2-(acetyloxy)-", - "trial": 1, - "version": "", + "code": "50-78-2", + "vocabulary": "CAS", + "level": "specific", + "text": "Benzoic acid, 2-(acetyloxy)-", + "trial": 1, + "version": "", "aspect": "Intervention" } - }, + }, { - "pk": 12, - "model": "registry.descriptor", + "pk": 12, + "model": "repository.descriptor", "fields": { - "code": "C14.280.647", - "vocabulary": "DeCS", - "level": "specific", - "text": "Myocardial Ischemia", - "trial": 4, - "version": "2010", + "code": "C14.280.647", + "vocabulary": "DeCS", + "level": "specific", + "text": "Myocardial Ischemia", + "trial": 4, + "version": "2010", "aspect": "HealthCondition" } - }, + }, { - "pk": 2, - "model": "registry.descriptor", + "pk": 2, + "model": "repository.descriptor", "fields": { - "code": "C14.280.647", - "vocabulary": "DeCS", - "level": "specific", - "text": "Myocardial Ischemia", - "trial": 3, - "version": "", + "code": "C14.280.647", + "vocabulary": "DeCS", + "level": "specific", + "text": "Myocardial Ischemia", + "trial": 3, + "version": "", "aspect": "HealthCondition" } - }, + }, { - "pk": 13, - "model": "registry.descriptor", + "pk": 13, + "model": "repository.descriptor", "fields": { - "code": "C14.280.647.250.285", - "vocabulary": "DeCS", - "level": "specific", - "text": "Coronary Stenosis", - "trial": 4, - "version": "2010", + "code": "C14.280.647.250.285", + "vocabulary": "DeCS", + "level": "specific", + "text": "Coronary Stenosis", + "trial": 4, + "version": "2010", "aspect": "HealthCondition" } - }, + }, { - "pk": 3, - "model": "registry.descriptor", + "pk": 3, + "model": "repository.descriptor", "fields": { - "code": "C14.280.647.250.260", - "vocabulary": "DeCS", - "level": "specific", - "text": "Coronary Artery Disease ", - "trial": 3, - "version": "", + "code": "C14.280.647.250.260", + "vocabulary": "DeCS", + "level": "specific", + "text": "Coronary Artery Disease ", + "trial": 3, + "version": "", "aspect": "HealthCondition" } - }, + }, { - "pk": 14, - "model": "registry.descriptor", + "pk": 14, + "model": "repository.descriptor", "fields": { - "code": "C14.280.647.250.285.200", - "vocabulary": "DeCS", - "level": "specific", - "text": "Coronary Restenosis", - "trial": 4, - "version": "2010", + "code": "C14.280.647.250.285.200", + "vocabulary": "DeCS", + "level": "specific", + "text": "Coronary Restenosis", + "trial": 4, + "version": "2010", "aspect": "HealthCondition" } - }, + }, { - "pk": 7, - "model": "registry.descriptor", + "pk": 7, + "model": "repository.descriptor", "fields": { - "code": "C14.280.238", - "vocabulary": "DeCS", - "level": "specific", - "text": "Cardiomyopathies", - "trial": 3, - "version": "", + "code": "C14.280.238", + "vocabulary": "DeCS", + "level": "specific", + "text": "Cardiomyopathies", + "trial": 3, + "version": "", "aspect": "HealthCondition" } } ] diff --git a/clinicaltrials/registry/fixtures/initial_data.json.old b/clinicaltrials/repository/fixtures/initial_data.json.old similarity index 100% rename from clinicaltrials/registry/fixtures/initial_data.json.old rename to clinicaltrials/repository/fixtures/initial_data.json.old diff --git a/clinicaltrials/registry/management/__init__.py b/clinicaltrials/repository/management/__init__.py similarity index 100% rename from clinicaltrials/registry/management/__init__.py rename to clinicaltrials/repository/management/__init__.py diff --git a/clinicaltrials/registry/management/commands/__init__.py b/clinicaltrials/repository/management/commands/__init__.py similarity index 100% rename from clinicaltrials/registry/management/commands/__init__.py rename to clinicaltrials/repository/management/commands/__init__.py diff --git a/clinicaltrials/registry/management/commands/dropdb.py b/clinicaltrials/repository/management/commands/dropdb.py similarity index 100% rename from clinicaltrials/registry/management/commands/dropdb.py rename to clinicaltrials/repository/management/commands/dropdb.py diff --git a/clinicaltrials/registry/models.py b/clinicaltrials/repository/models.py similarity index 99% rename from clinicaltrials/registry/models.py rename to clinicaltrials/repository/models.py index e15945a..b969bae 100755 --- a/clinicaltrials/registry/models.py +++ b/clinicaltrials/repository/models.py @@ -1,438 +1,438 @@ from clinicaltrials.vocabulary.models import CountryCode from django.db import models, IntegrityError from django.utils.translation import ugettext_lazy as _ from django.utils.html import linebreaks from datetime import datetime import string from random import randrange, choice from time import sleep from utilities import safe_truncate from vocabulary.models import CountryCode, StudyPhase, StudyType, RecruitmentStatus from vocabulary.models import InterventionCode from vocabulary.models import StudyPurpose, InterventionAssigment, StudyMasking, StudyAllocation -from registry import choices +from repository import choices # remove digits that look like letters and vice-versa # remove vowels to avoid forming words BASE28 = ''.join(d for d in string.digits+string.ascii_lowercase if d not in '1l0aeiou') TRIAL_ID_PREFIX = 'RBR' TRIAL_ID_DIGITS = 6 TRIAL_ID_TRIES = 3 def generate_trial_id(prefix, num_digits): s = str(randrange(2,10)) # start with a numeric digit 2...9 s += ''.join(choice(BASE28) for i in range(1, num_digits)) return '-'.join([prefix, s[:num_digits/2], s[num_digits/2:]]) class TrialRegistrationDataSetModel(models.Model): def html_dump(self, seen=None, follow_sets=True): html = [] # the enclosing <table> and </table> must be provided py the template if seen is None: seen = set(self.__class__.__name__) for field in self._meta.fields: value = getattr(self, field.name) if field.rel and hasattr(value, 'html_dump'): seen.add(value.__class__.__name__) content = '<table>%s</table>' % value.html_dump(seen, follow_sets=False) else: content = unicode(value) if u'\n' in content: content = linebreaks(content) html.append('<tr><th>%s</th><td>%s</td></tr>' % (field.name, content)) if follow_sets: for field_name in dir(self): try: value = getattr(self, field_name) except AttributeError: continue # ignore Manager (objects attribute) else: if hasattr(value, '__class__') and value.__class__.__name__=='RelatedManager': inner_html = [] for rel_value in value.all(): id = '#%s' % rel_value.pk if (hasattr(rel_value, 'html_dump') and (rel_value.__class__.__name__ not in seen)): seen.add(rel_value.__class__.__name__) content = '<table>%s</table>' % rel_value.html_dump(seen, follow_sets=False) else: content = unicode(rel_value) if u'\n' in content: content = linebreaks(content) inner_html.append('<tr><th>%s</th><td>%s</td></tr>' % (id, content)) content = '<table>%s</table>' % '\n\t'.join(inner_html) html.append('<tr><th>%s</th><td>%s</td></tr>' % (field_name, content)) return '\n'.join(html) class Meta: abstract = True class ClinicalTrial(TrialRegistrationDataSetModel): # TRDS 1 trial_id = models.CharField(_('Primary Id Number'), null=True, unique=True, max_length=255, editable=False) # TRDS 2 date_registration = models.DateField(_('Date of Registration'), null=True, editable=False, db_index=True) # TRDS 10a scientific_title = models.TextField(_('Scientific Title'), max_length=2000) # TRDS 10b scientific_acronym = models.CharField(_('Scientific Acronym'), blank=True, max_length=255) # TRDS 5 primary_sponsor = models.OneToOneField('Institution', null=True, blank=True, verbose_name=_('Primary Sponsor')) # TRDS 7 public_contact = models.ManyToManyField('Contact', through='PublicContact', related_name='public_contact_of_set') # TRDS 8 scientific_contact = models.ManyToManyField('Contact', through='ScientificContact', related_name='scientific_contact_of_set') # TRDS 9a public_title = models.TextField(_('Public Title'), blank=True, max_length=2000) # TRDS 9b acronym = models.CharField(_('Acronym'), blank=True, max_length=255) # TRDS 12a hc_freetext = models.TextField(_('Health Condition(s)'), blank=True, max_length=8000) # TRDS 13a i_freetext = models.TextField(_('Intervention(s)'), blank=True, max_length=8000) # TRDS 13b i_code = models.ManyToManyField(InterventionCode) # TRDS 14a inclusion_criteria = models.TextField(_('Inclusion Criteria'), blank=True, max_length=8000) # TRDS 14b gender = models.CharField(_('Inclusion Gender'), max_length=1, choices=choices.INCLUSION_GENDER, default=choices.INCLUSION_GENDER[0][0]) # TRDS 14c agemin_value = models.PositiveIntegerField(_('Inclusion Minimum Age'), default=0) agemin_unit = models.CharField(_('Minimum Age Unit'), max_length=1, choices=choices.INCLUSION_AGE_UNIT, default=choices.INCLUSION_AGE_UNIT[0][0]) # TRDS 14d agemax_value = models.PositiveIntegerField(_('Inclusion Maximum Age'), default=0) agemax_unit = models.CharField(_('Maximum Age Unit'), max_length=1, choices=choices.INCLUSION_AGE_UNIT, default=choices.INCLUSION_AGE_UNIT[0][0]) # TRDS 14e exclusion_criteria = models.TextField(_('Exclusion Criteria'), blank=True, max_length=8000) # TRDS 15a study_type = models.ForeignKey(StudyType, null=True, blank=True, verbose_name=_('Study Type')) # TRDS 15b study_design = models.TextField(_('Study Design'), blank=True, max_length=1000) ######## begin TRDS 15b - study design details expanded_access_program = models.NullBooleanField(_('Expanded access program'), null=True, blank=True) purpose = models.ForeignKey(StudyPurpose, null=True, blank=True, verbose_name=_('Study Purpose')) intervention_assignment = models.ForeignKey(InterventionAssigment, null=True, blank=True, verbose_name=_('Intervention Assignment')) number_of_arms = models.PositiveIntegerField(_('Number of arms'), null=True, blank=True) masking = models.ForeignKey(StudyMasking, null=True, blank=True, verbose_name=_('Masking type')) allocation = models.ForeignKey(StudyAllocation, null=True, blank=True, verbose_name=_('Allocation type')) ######## end TRDS 15b - study design details # TRDS 15c phase = models.ForeignKey(StudyPhase, null=True, blank=True, verbose_name=_('Study Phase')) # TRDS 16a,b (type_enrollment="anticipated") date_enrollment_anticipated = models.CharField( # yyyy-mm or yyyy-mm-dd _('Anticipated Date of First Enrollment'), max_length=10, blank=True) # TRDS 16a,b (type_enrollment="actual") date_enrollment_actual = models.CharField( # yyyy-mm or yyyy-mm-dd _('Actual Date of First Enrollment'), max_length=10, blank=True) # TRDS 17 target_sample_size = models.PositiveIntegerField(_('Target Sample Size'), default=0) # TRDS 18 recruitment_status = models.ForeignKey(RecruitmentStatus, null=True, blank=True, verbose_name=_('Recruitment Status')) # TRDS 11 - Countries of Recruitment recruitment_country = models.ManyToManyField(CountryCode, help_text=u'Several countries may be selected, one at a time') ################################### internal use, administrative fields ### created = models.DateTimeField(default=datetime.now, editable=False) updated = models.DateTimeField(_('Last Update'), null=True, editable=False) exported = models.DateTimeField(null=True, editable=False) status = models.CharField(_('Status'), max_length=64, choices=choices.TRIAL_RECORD_STATUS, default=choices.TRIAL_RECORD_STATUS[0][0]) staff_note = models.CharField(_('Record Note (staff use only)'), max_length='255', blank=True) class Meta: ordering = ['-updated',] def save(self): if self.id: self.updated = datetime.now() if self.status == choices.PUBLISHED_STATUS and not self.trial_id: for i in range(TRIAL_ID_TRIES): self.trial_id = generate_trial_id(TRIAL_ID_PREFIX, TRIAL_ID_DIGITS) try: super(ClinicalTrial, self).save() except IntegrityError: if i < TRIAL_ID_TRIES: sleep(2**i) # wait to try again else: raise # all tries exhausted: give up else: break # no need to try again else: super(ClinicalTrial, self).save() def identifier(self): return self.trial_id or '(req:%s)' % self.pk def short_title(self): if self.scientific_acronym: tit = u'%s - %s' % (self.scientific_acronym, self.scientific_title) else: tit = self.scientific_title return safe_truncate(tit, 120) def __unicode__(self): return u'%s %s' % (self.identifier(), self.short_title()) def trial_id_display(self): ''' return the trial id or an explicit message it is None ''' if self.trial_id: return self.trial_id else: msg = 'not assigned (request #%)' % self.pk def record_status(self): return self.submission.status #TRDS 3 - Secondarty ID Numbers def trial_number(self): return self.trialnumber_set.all().select_related(); # TRDS 4 - Source(s) of Monetary Support def support_sources(self): return self.trialsupportsource_set.all() # TRDS 6 - Secondary Sponsor(s) def secondary_sponsors(self): return self.trialsecondarysponsor_set.all() def updated_str(self): return self.updated.strftime('%Y-%m-%d %H:%M') updated_str.short_description = _('Updated') def related_health_conditions(self, aspect, level): ''' return set of hc-code or keywords related to this trial with a given relationship ''' return self.descriptor_set.filter(aspect=aspect, level=level).select_related() #TRDS 12b - HC-CODE def hc_code(self): ''' return set of HC-Code related to this trial with aspect = 'HealthCondition' level = 'general' ''' return self.related_health_conditions('HealthCondition','general') #TRDS 12c - HC-Keyword def hc_keyword(self): ''' return set of HC-Code related to this trial with aspect = 'HealthCondition' level = 'specific' ''' return self.related_health_conditions('HealthCondition','specific') #TRDS 13b - Invetion Code def intervention_code(self): ''' return set of Intervention Code related to this trial with ''' return (r.i_code for r in self.trialinterventioncode_set.all().select_related()) #TRDS 13c - Invention Keyword def intervention_keyword(self): ''' return set of Intervention Keyword related to this trial with ''' return self.descriptor_set.filter(aspect='intervention').select_related() #TRDS 19 - Primary Outcomes def primary_outcomes(self): ''' return set of Primary Outcomes related to this trial with ''' return self.outcome_set.filter(interest='primary').select_related() #TRDS 20 - Secondary Outcomes def secondary_outcomes(self): ''' return set of Secondary Outcomes related to this trial with ''' return self.outcome_set.filter(interest='secondary').select_related() ################################### Entities linked to a Clinical Trial ### # TRDS 3 - Secondary Identifying Numbers class TrialNumber(TrialRegistrationDataSetModel): trial = models.ForeignKey(ClinicalTrial) issuing_authority = models.CharField(_('Issuing Authority'), max_length=255, db_index=True,) id_number = models.CharField(_('Secondary Id Number'), max_length=255, db_index=True) def __unicode__(self): return u'%s: %s' % (self.issuing_authority, self.id_number) # TRDS 6 - Secondary Sponsor(s) class TrialSecondarySponsor(TrialRegistrationDataSetModel): trial = models.ForeignKey(ClinicalTrial) institution = models.ForeignKey('Institution') def __unicode__(self): return u'%s' % self.institution # TRDS 4 - Source(s) of Monetary Support class TrialSupportSource(TrialRegistrationDataSetModel): trial = models.ForeignKey(ClinicalTrial) institution = models.ForeignKey('Institution') def __unicode__(self): return u'%s' % self.institution # TRDS 5 - Primary Sponsor class Institution(TrialRegistrationDataSetModel): name = models.CharField(_('Name'), max_length=255) address = models.TextField(_('Postal Address'), max_length=1500, blank=True) country = models.ForeignKey(CountryCode, verbose_name=_('Country')) def __unicode__(self): return safe_truncate(self.name, 120) # TRDS 7 - Contact for Public Queries # TRDS 8 - Contact for Scientific Queries class Contact(TrialRegistrationDataSetModel): firstname = models.CharField(_('First Name'), max_length=50) middlename = models.CharField(_('Middle Name'), max_length=50, blank=True) lastname = models.CharField(_('Last Name'), max_length=50) email = models.EmailField(_('E-mail'), max_length=255) affiliation = models.ForeignKey(Institution, null=True, blank=True, verbose_name=_('Affiliation')) address = models.CharField(_('Address'), max_length=255, blank=True) city = models.CharField(_('City'), max_length=255, blank=True) country = models.ForeignKey(CountryCode, null=True, blank=True, verbose_name=_('Country'),) zip = models.CharField(_('Postal Code'), max_length=50, blank=True) telephone = models.CharField(_('Telephone'), max_length=255, blank=True) def name(self): names = self.firstname + u' ' + self.middlename + u' ' + self.lastname return u' '.join(names.split()) def __unicode__(self): return self.name() class PublicContact(TrialRegistrationDataSetModel): trial = models.ForeignKey(ClinicalTrial) contact = models.ForeignKey(Contact) status = models.CharField(_('Status'), max_length=255, choices = choices.CONTACT_STATUS, default = choices.CONTACT_STATUS[0][0]) def __unicode__(self): return u'Public Contact for %s: %s (%s)' % (self.trial.short_title(), self.contact.name(), self.status) class ScientificContact(TrialRegistrationDataSetModel): trial = models.ForeignKey(ClinicalTrial) contact = models.ForeignKey(Contact) status = models.CharField(_('Status'), max_length=255, choices = choices.CONTACT_STATUS, default = choices.CONTACT_STATUS[0][0]) def __unicode__(self): return u'Scientific Contact for %s: %s (%s)' % (self.trial.short_title(), self.contact.name(), self.status) class SiteContact(TrialRegistrationDataSetModel): trial = models.ForeignKey(ClinicalTrial) contact = models.ForeignKey(Contact) status = models.CharField(_('Status'), max_length=255, choices = choices.CONTACT_STATUS, default = choices.CONTACT_STATUS[0][0]) def __unicode__(self): return u'Site Contact for %s: %s (%s)' % (self.trial.short_title(), self.contact.name(), self.status) # TRDS 19 - Primary Outcome(s) # TRDS 20 - Key Secondary Outcome(s) class Outcome(TrialRegistrationDataSetModel): trial = models.ForeignKey(ClinicalTrial) interest = models.CharField(_('Interest'), max_length=32, choices=choices.OUTCOME_INTEREST, default = choices.OUTCOME_INTEREST[0][0]) description = models.TextField(_('Outcome Description'), max_length=8000) class Meta: order_with_respect_to = 'trial' def __unicode__(self): return safe_truncate(self.description, 80) class Descriptor(TrialRegistrationDataSetModel): class Meta: order_with_respect_to = 'trial' trial = models.ForeignKey(ClinicalTrial) aspect = models.CharField(_('Trial Aspect'), max_length=255, choices=choices.TRIAL_ASPECT) vocabulary = models.CharField(_('Vocabulary'), max_length=255, choices=choices.DESCRIPTOR_VOCABULARY) version = models.CharField(_('Version'), max_length=64, blank=True) level = models.CharField(_('Level'), max_length=64, choices=choices.DESCRIPTOR_LEVEL) code = models.CharField(_('Code'), max_length=255) text = models.CharField(_('Text'), max_length=255, blank=True) def __unicode__(self): return u'[%s] %s: %s' % (self.vocabulary, self.code, self.text) def trial_identifier(self): return self.trial.identifier() \ No newline at end of file diff --git a/clinicaltrials/registry/templates/registry/add_clinicalTrials.html b/clinicaltrials/repository/templates/registry/add_clinicalTrials.html similarity index 100% rename from clinicaltrials/registry/templates/registry/add_clinicalTrials.html rename to clinicaltrials/repository/templates/registry/add_clinicalTrials.html diff --git a/clinicaltrials/repository/templates/registry/add_done.html b/clinicaltrials/repository/templates/registry/add_done.html new file mode 100755 index 0000000..03e3e26 --- /dev/null +++ b/clinicaltrials/repository/templates/registry/add_done.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} + +{% block body_title %}Submission done{% endblock %} + +{% block body %} + <h3>{{public_title}}, added.</h3> +{% endblock %} \ No newline at end of file diff --git a/clinicaltrials/registry/templates/registry/attachments.html b/clinicaltrials/repository/templates/registry/attachments.html similarity index 98% rename from clinicaltrials/registry/templates/registry/attachments.html rename to clinicaltrials/repository/templates/registry/attachments.html index 937dcee..2ea12fa 100644 --- a/clinicaltrials/registry/templates/registry/attachments.html +++ b/clinicaltrials/repository/templates/registry/attachments.html @@ -1,79 +1,79 @@ -{% extends "registry/submission_step.html" %} +{% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript"> function cloneMore(selector, type) { var newElement = $(selector).clone(true); var total = $('#id_' + type + '-TOTAL_FORMS').val(); newElement.find(':input').each(function() { var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-'); var id = 'id_' + name; $(this).attr({'name': name, 'id': id}); if($(this).attr('type')!='hidden')$(this).val('').removeAttr('checked'); }); newElement.find('label').each(function() { var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-'); $(this).attr('for', newFor); }); total++; $('#id_' + type + '-TOTAL_FORMS').val(total); newElement.css("display","none"); $(selector).after(newElement); newElement.show("fast"); } $(document).ready(function() { $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: true }); }); // management_form.prefix </script> <form action="./" method="POST" enctype="multipart/form-data"> {{ formsets.0.management_form }} <fieldset> <legend>{{ formsets.0.form.title }}</legend> <div class="{{formsets.0.management_form.prefix}}"> {% for form in formsets.0.forms %} <table> {{ form.as_table }} </table> {% endfor %} </div> </fieldset> {{ formsets.1.management_form }} <fieldset> <legend>{{ formsets.1.form.title }}</legend> <div class="{{formsets.1.management_form.prefix}}"> {% for form in formsets.1.forms %} <table> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formsets.1.management_form.prefix}} table:last','{{formsets.1.management_form.prefix}}')" type="button" value="add more"/> </div> </fieldset> <br/> <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> {% if next_form_title %} <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> {% endif %} </form> {% endblock %} diff --git a/clinicaltrials/registry/templates/registry/clinicaltrial_detail.html b/clinicaltrials/repository/templates/registry/clinicaltrial_detail.html similarity index 100% rename from clinicaltrials/registry/templates/registry/clinicaltrial_detail.html rename to clinicaltrials/repository/templates/registry/clinicaltrial_detail.html diff --git a/clinicaltrials/registry/templates/registry/clinicaltrial_detail.xml b/clinicaltrials/repository/templates/registry/clinicaltrial_detail.xml similarity index 100% rename from clinicaltrials/registry/templates/registry/clinicaltrial_detail.xml rename to clinicaltrials/repository/templates/registry/clinicaltrial_detail.xml diff --git a/clinicaltrials/registry/templates/registry/clinicaltrial_list.html b/clinicaltrials/repository/templates/registry/clinicaltrial_list.html similarity index 100% rename from clinicaltrials/registry/templates/registry/clinicaltrial_list.html rename to clinicaltrials/repository/templates/registry/clinicaltrial_list.html diff --git a/clinicaltrials/registry/templates/registry/latest_clinicalTrials.html b/clinicaltrials/repository/templates/registry/latest_clinicalTrials.html similarity index 100% rename from clinicaltrials/registry/templates/registry/latest_clinicalTrials.html rename to clinicaltrials/repository/templates/registry/latest_clinicalTrials.html diff --git a/clinicaltrials/registry/templates/registry/new_institution.html b/clinicaltrials/repository/templates/registry/new_institution.html similarity index 100% rename from clinicaltrials/registry/templates/registry/new_institution.html rename to clinicaltrials/repository/templates/registry/new_institution.html diff --git a/clinicaltrials/registry/templates/registry/step_2.html b/clinicaltrials/repository/templates/registry/step_2.html similarity index 94% rename from clinicaltrials/registry/templates/registry/step_2.html rename to clinicaltrials/repository/templates/registry/step_2.html index 029de6b..6395e02 100644 --- a/clinicaltrials/registry/templates/registry/step_2.html +++ b/clinicaltrials/repository/templates/registry/step_2.html @@ -1,73 +1,73 @@ -{% extends "registry/submission_step.html" %} +{% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript"> $(document).ready(function() { - + $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: true }); // TODO: Replace absolute path $("div.g select") .change(getterm_event('{% url decs.getterm lang="en",code="" %}')) .each(function(){$(this).change();}); $("div.s select") .change(search_event( '{% url decs.search lang="en",term="" %}', '{% trans "Search terms" %}')) .each(function(){$(this).change();}); }); function new_institution(){ return window.open('{% url new_institution %}','n_i','status=0,location=0,height=375'); } // management_form.prefix </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> <table> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} <table> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> <input onclick="new_institution()" type="button" value="{% trans 'New Institution' %}"/> </div> </fieldset> {% endfor %} <br/> <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> {% if next_form_title %} <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> {% endif %} </form> {% endblock %} diff --git a/clinicaltrials/registry/templates/registry/step_3.html b/clinicaltrials/repository/templates/registry/step_3.html similarity index 94% rename from clinicaltrials/registry/templates/registry/step_3.html rename to clinicaltrials/repository/templates/registry/step_3.html index d314cd2..051458b 100644 --- a/clinicaltrials/registry/templates/registry/step_3.html +++ b/clinicaltrials/repository/templates/registry/step_3.html @@ -1,69 +1,69 @@ -{% extends "registry/submission_step.html" %} +{% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript" src="/static/js/submission.utils.js"></script> <script type="text/javascript"> $(document).ready(function() { - + $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: true }); // TODO: Replace absolute path $("div.g select") .change(getterm_event('{% url decs.getterm lang="en",code="" %}')) .each(function(){$(this).change();}); $("div.s select") .change(search_event( '{% url decs.search lang="en",term="" %}', '{% trans "Search terms" %}')) .each(function(){$(this).change();}); }); // management_form.prefix </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> <table> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} <table> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> </div> </fieldset> {% endfor %} <br/> <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> {% if next_form_title %} <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> {% endif %} </form> {% endblock %} diff --git a/clinicaltrials/registry/templates/registry/submission_step.html b/clinicaltrials/repository/templates/registry/submission_step.html similarity index 80% rename from clinicaltrials/registry/templates/registry/submission_step.html rename to clinicaltrials/repository/templates/registry/submission_step.html index 10e1ab3..b45e745 100644 --- a/clinicaltrials/registry/templates/registry/submission_step.html +++ b/clinicaltrials/repository/templates/registry/submission_step.html @@ -1,31 +1,31 @@ {% extends "base.html" %} {% load i18n %} {% block body_title %}{{ forms.form_main.title }}{% endblock %} {# Last <p > in http://docs.djangoproject.com/en/dev/topics/templates/#id1 #} {% block stepmenu_top %} <div class="stepmenu stepmenu-top"> <ul> - <li><a href="{% url registry.edittrial trial_pk %}">{% trans "Summary" %}</a></li> + <li><a href="{% url repository.edittrial trial_pk %}">{% trans "Summary" %}</a></li> {% for step,iscurrent in steps %} <li{% if iscurrent %} class="current"{% endif %}> <a href="{{step}}">step {{forloop.counter}}</a> </li> {% endfor %} </ul> </div> {% endblock %} {% block stepmenu_bottom %} <div class="stepmenu stepmenu-bottom"> <ul> - <li><a href="{% url registry.edittrial trial_pk %}">{% trans "Summary" %}</a></li> + <li><a href="{% url repository.edittrial trial_pk %}">{% trans "Summary" %}</a></li> {% for step,iscurrent in steps %} <li{% if iscurrent %} class="current"{% endif %}> <a href="{{step}}">step {{forloop.counter}}</a> </li> {% endfor %} </ul> </div> {% endblock %} diff --git a/clinicaltrials/registry/templates/registry/trds.html b/clinicaltrials/repository/templates/registry/trds.html similarity index 100% rename from clinicaltrials/registry/templates/registry/trds.html rename to clinicaltrials/repository/templates/registry/trds.html diff --git a/clinicaltrials/registry/templates/registry/trial_form.html b/clinicaltrials/repository/templates/registry/trial_form.html similarity index 93% rename from clinicaltrials/registry/templates/registry/trial_form.html rename to clinicaltrials/repository/templates/registry/trial_form.html index 5a5397c..0beb66e 100644 --- a/clinicaltrials/registry/templates/registry/trial_form.html +++ b/clinicaltrials/repository/templates/registry/trial_form.html @@ -1,56 +1,56 @@ -{% extends "registry/submission_step.html" %} +{% extends "repository/submission_step.html" %} {% load i18n %} {% block body %} <script type="text/javascript"> $(document).ready(function() { $("select[multiple]").asmSelect({ addItemTarget: 'bottom', animate: true, highlight: true, sortable: false }); }); </script> <h2>{{ title }}</h2> <form action="./" method="POST"> {% for form in forms %} <fieldset> <legend>{% firstof form.title form.form.title %}</legend> <table> {{ form.as_table }} </table> </fieldset> {% endfor %} {% for formset in formsets %} {{ formset.management_form }} <fieldset> <legend>{{ formset.form.title }}</legend> <div class="{{formset.management_form.prefix}}"> {% for form in formset.forms %} <table> {{ form.as_table }} </table> {% endfor %} </div> <div style="text-align: center"> <input onclick="cloneMore('div.{{formset.management_form.prefix}} table:last','{{formset.management_form.prefix}}')" type="button" value="add more"/> </div> </fieldset> {% endfor %} <br/> <input name="submit_go" type="submit" value="{% trans "Save and continue later" %}"/> {% if next_form_title %} <input name="submit_next" type="submit" value="{% trans "Save and go to" %} '{{next_form_title}}'"/> {% endif %} </form> {% endblock %} diff --git a/clinicaltrials/registry/templates/registry/trial_index.html b/clinicaltrials/repository/templates/registry/trial_index.html similarity index 100% rename from clinicaltrials/registry/templates/registry/trial_index.html rename to clinicaltrials/repository/templates/registry/trial_index.html diff --git a/clinicaltrials/registry/templates/registry/trial_outcomes_form.html b/clinicaltrials/repository/templates/registry/trial_outcomes_form.html similarity index 100% rename from clinicaltrials/registry/templates/registry/trial_outcomes_form.html rename to clinicaltrials/repository/templates/registry/trial_outcomes_form.html diff --git a/clinicaltrials/registry/tests.py b/clinicaltrials/repository/tests.py similarity index 95% rename from clinicaltrials/registry/tests.py rename to clinicaltrials/repository/tests.py index 1707579..3d3ce36 100644 --- a/clinicaltrials/registry/tests.py +++ b/clinicaltrials/repository/tests.py @@ -1,27 +1,27 @@ from django.test import TestCase -from registry.models import * +from repository.models import * class SecondaryNumbers(TestCase): fixtures = ['first_3_trials.json'] def setUp(self): title = u'Comparison of Ascorbic Acid and Grape Seed' self.asc_trial = ClinicalTrial.objects.get( public_title__istartswith=title) def test_short_title(self): start = u'Effect of Ascorbic Acid' self.assert_(self.asc_trial.short_title().startswith(start)) - + def test_secondary_numbers(self): self.assert_(len(self.asc_trial.trialnumber_set.all())==2) - + def test_public_contacts(self): contacts = list(self.asc_trial.public_contacts()) self.assert_(len(contacts)==1) self.assert_(contacts[0].firstname==u'Naser') def test_scientific_contacts(self): contacts = list(self.asc_trial.scientific_contacts()) self.assert_(len(contacts)==1) self.assert_(contacts[0].firstname==u'Naser') diff --git a/clinicaltrials/registry/trds.py b/clinicaltrials/repository/trds.py similarity index 96% rename from clinicaltrials/registry/trds.py rename to clinicaltrials/repository/trds.py index c18138e..a530c33 100644 --- a/clinicaltrials/registry/trds.py +++ b/clinicaltrials/repository/trds.py @@ -1,52 +1,52 @@ from django.utils.translation import ugettext as _ -from registry.models import * +from repository.models import * TRDS_LABELS = ( (1,_('Primary Registry and Trial Identifying Number'), 'trial_id'), (2,_('Date of Registration in Primary Registry'), 'date_registration'), (3,_('Secondary Identifying Numbers'), 'trialnumber_set'), (4,_('Source(s) of Monetary or Material Support'), 'support_sources'), (5,_('Primary Sponsor'), 'primary_sponsor'), (6,_('Secondary Sponsors'), 'secondary_sponsors'), (7,_('Contacts for Public Queries'), 'public_contacts'), (8,_('Contacts for Scientific Queries'), 'scientific_contacts'), (9,_('Public Title'), 'public_title acronym'), (10,_('Scientific Title'), 'scientific_title scientific_acronym'), (11,_('Countries of Recruitment'), 'recruitmentcountry_set'), ) class TRDSField(object): - + def __init__(self, trial, number, title, subfields): self.trial = trial self.number = number self.title = title self.subfields = subfields.split() - + def dump(self): res = [] for attr_name in self.subfields: d = {'attr_name':attr_name} attr = getattr(self.trial, attr_name) if callable(attr): d['value'] = repr(attr()) else: d['value'] = attr res.append(d) return res - - + + ''' # Scientific fields (12,_('Health Condition(s) or Problem(s) Studied')), (13,_('Intervention(s)')), (14,_('Key Inclusion and Exclusion Criteria')), (15,_('Study Type')), (16,_('Date of First Enrollment')), (17,_('Target Sample Size')), (18,_('Recruitment Status')), (19,_('Primary Outcome(s)')), (20,_('Key Secondary Outcomes')), ''' \ No newline at end of file diff --git a/clinicaltrials/registry/trds_forms.py b/clinicaltrials/repository/trds_forms.py similarity index 98% rename from clinicaltrials/registry/trds_forms.py rename to clinicaltrials/repository/trds_forms.py index 621b04c..44d541c 100644 --- a/clinicaltrials/registry/trds_forms.py +++ b/clinicaltrials/repository/trds_forms.py @@ -1,364 +1,364 @@ #coding: utf-8 from assistance.models import FieldHelp from vocabulary.models import CountryCode -from registry.models import ClinicalTrial, Contact, Descriptor, Institution -from registry.models import InterventionCode, Outcome, RecruitmentStatus -from registry.models import StudyPhase, TrialSecondarySponsor -from registry.models import TrialSupportSource +from repository.models import ClinicalTrial, Contact, Descriptor, Institution +from repository.models import InterventionCode, Outcome, RecruitmentStatus +from repository.models import StudyPhase, TrialSecondarySponsor +from repository.models import TrialSupportSource import choices from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django import forms from django.forms.forms import BoundField, conditional_escape class ReviewModelForm(forms.ModelForm): def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row): "Helper function for outputting HTML. Used by as_table(), as_ul(), as_p()." top_errors = self.non_field_errors() # Errors that should be displayed above all fields. output, hidden_fields = [], [] for name, field in self.fields.items(): bf = BoundField(self, field, name) bf_errors = self.error_class([conditional_escape(error) for error in bf.errors]) # Escape and cache in local variable. if bf.is_hidden: if bf_errors: top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors]) hidden_fields.append(unicode(bf)) else: if errors_on_separate_row and bf_errors: output.append(error_row % force_unicode(bf_errors)) if bf.label: label = conditional_escape(force_unicode(bf.label)) # Only add the suffix if the label does not end in # punctuation. if self.label_suffix: if label[-1] not in ':?.!': label += self.label_suffix label = bf.label_tag(label) or '' else: label = '' if field.help_text: help_text = help_text_html % force_unicode(field.help_text) else: help_text = u'' form_name = self.__class__.__name__ #import pdb; pdb.set_trace() help_record, new = FieldHelp.objects.get_or_create(form=form_name, field=name) help_text = help_text + u' ' + force_unicode(help_record) help_text = help_text_html % help_text field_path = '%s.%s' % (form_name, name) issue_text = '%s #%s' % (field_path, self.instance.pk) output.append(normal_row % {'errors': force_unicode(bf_errors), 'label': force_unicode(label), 'field': unicode(bf), 'help_text': help_text, 'issue': issue_text,}) if top_errors: output.insert(0, error_row % force_unicode(top_errors)) if hidden_fields: # Insert any hidden fields in the last row. str_hidden = u''.join(hidden_fields) if output: last_row = output[-1] # Chop off the trailing row_ender (e.g. '</td></tr>') and # insert the hidden fields. if not last_row.endswith(row_ender): # This can happen in the as_p() case (and possibly others # that users write): if there are only top errors, we may # not be able to conscript the last row for our purposes, # so insert a new, empty row. last_row = normal_row % {'errors': '', 'label': '', 'field': '', 'help_text': '', 'issue': '',} output.append(last_row) output[-1] = last_row[:-len(row_ender)] + str_hidden + row_ender else: # If there aren't any rows in the output, just append the # hidden fields. output.append(str_hidden) return mark_safe(u'\n'.join(output)) def as_table(self): "Returns this form rendered as HTML <tr>s -- excluding the <table></table>." normal_row = u''' <tr><th>%(label)s</th> <td>%(errors)s%(field)s</td> <td class="help"> <div class="text">%(help_text)s</div> <div class="issue">%(issue)s</div> </td></tr> ''' return self._html_output(normal_row=normal_row, error_row=u'<tr><td colspan="3">%s</td></tr>', row_ender='</td></tr>', help_text_html=u'%s', errors_on_separate_row=False) # # Forms # #step1 class TrialIdentificationForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['scientific_title','scientific_acronym', 'public_title','acronym'] title = _('Trial Identification') # TRDS 10a scientific_title = forms.CharField(label=_('Scientific Title'), max_length=2000, widget=forms.Textarea) # TRDS 10b scientific_acronym = forms.CharField(required=False, label=_('Scientific Acronym'), max_length=255) # TRDS 9a public_title = forms.CharField(required=False, label=_('Public Title'), max_length=2000, widget=forms.Textarea) # TRDS 9b acronym = forms.CharField(required=False, label=_('Acronym'), max_length=255) class SecondaryIdForm(ReviewModelForm): title = _('Secondary Identifying Numbers') # this is just to inherit the custom _html_output and as_table methods #step2 class PrimarySponsorForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['primary_sponsor',] title = _('Primary Sponsor') #step2 class SecondarySponsorForm(ReviewModelForm): class Meta: model = TrialSecondarySponsor fields = ['institution','relation'] title = _('Secondary Sponsor(s)') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[1][0]) #step2 class SupportSourceForm(ReviewModelForm): class Meta: model = TrialSupportSource fields = ['institution','relation'] title = _('Source(s) of Monetary or Material Support') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[0][0]) class NewInstitution(ReviewModelForm): class Meta: model = Institution title = _('New Institution') #step3 class HealthConditionsForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['hc_freetext',] title = _('Health Condition(s) or Problem(s) Studied') # TRDS 12a hc_freetext = forms.CharField(label=_('Health Condition(s) or Problem(s)'), required=False, max_length=8000, widget=forms.Textarea) #step3 class DescriptorForm(ReviewModelForm): class Meta: model = Descriptor trial = forms.CharField(widget=forms.HiddenInput,required=False) class GeneralHealthDescriptorForm(DescriptorForm): title = _('General Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) class SpecificHealthDescriptorForm(DescriptorForm): title = _('Specific Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[1][0]) #step4 class InterventionDescriptorForm(DescriptorForm): title = _('Descriptor for Intervention(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[1][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) #step4 class InterventionForm(ReviewModelForm): title = _('Intervention(s)') class Meta: model = ClinicalTrial fields = ['i_freetext','i_code'] title = _('Intervention(s)') i_freetext = forms.CharField(label=_('Intervention(s)'), required=False, max_length=8000, widget=forms.Textarea) i_code = forms.ModelMultipleChoiceField(label=_("Intervention Code(s)"), queryset=InterventionCode.objects.all(), widget=forms.CheckboxSelectMultiple()) #step5 class RecruitmentForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['recruitment_status', 'recruitment_country','date_enrollment', 'target_sample_size', 'inclusion_criteria', 'gender', 'agemin_value', 'agemin_unit', 'agemax_value', 'agemax_unit', 'exclusion_criteria', ] title = _('Recruitment') # TRDS 18 recruitment_status = forms.ModelChoiceField(label=_('Recruitment Status'), queryset=RecruitmentStatus.objects.all()) recruitment_country = forms.ModelMultipleChoiceField( label=_('Recruitment Country'), queryset=CountryCode.objects.all()) # TRDS 16a,b (type_enrollment: anticipated or actual) date_enrollment = forms.CharField( # yyyy-mm or yyyy-mm-dd label=_('Date of First Enrollment'), max_length=10, required=False) # TRDS 17 target_sample_size = forms.IntegerField(label=_('Target Sample Size'), initial=0 , required=False) # TRDS 14a inclusion_criteria = forms.CharField(label=_('Inclusion Criteria'), required=False, max_length=8000, widget=forms.Textarea) # TRDS 14b gender = forms.ChoiceField(label=_('Gender (inclusion sex)'), choices=choices.INCLUSION_GENDER) # TRDS 14c agemin_value = forms.IntegerField(required=False, label=_('Inclusion Minimum Age')) agemin_unit = forms.ChoiceField(label=_('Minimum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14d agemax_value = forms.IntegerField(required=False, label=_('Inclusion Maximum Age')) agemax_unit = forms.ChoiceField(label=_('Maximum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14e exclusion_criteria = forms.CharField(label=_('Exclusion Criteria'),required=False, max_length=8000, widget=forms.Textarea,) #step6 class StudyTypeForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['study_design', 'expanded_access_program', 'purpose', 'intervention_assignment', 'number_of_arms', 'masking', 'allocation', 'phase'] title = _('Study Type') # TRDS 15b study_design = forms.CharField(label=_('Study Design'), required=False, max_length=1000, widget=forms.Textarea) expanded_access_program = forms.ChoiceField(label=_('Expandend Access Program'), choices=[(None,_('Unknown')), (True,_('Yes')), (False,_('No')),], widget=forms.RadioSelect) # TRDS 15c phase = forms.ModelChoiceField(label=_('Study Phase'), queryset=StudyPhase.objects.all()) #step7 class OutcomesForm(ReviewModelForm): class Meta: model = Outcome fields = ['interest','description'] title = _('Outcomes') #step8 class PublicContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Public Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[0][0], widget=forms.HiddenInput) #step8 class ScientificContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Scientific Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[1][0], widget=forms.HiddenInput) #step8 class SiteContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Site Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[2][0], widget=forms.HiddenInput) #step8-partof class ContactForm(ReviewModelForm): class Meta: model = Contact title = _('New Contact(s)') relation = forms.ChoiceField(widget=forms.RadioSelect, choices=choices.CONTACT_RELATION) firstname = forms.CharField(label=_('First Name'), max_length=50) middlename = forms.CharField(label=_('Middle Name'), max_length=50,required=False) lastname = forms.CharField(label=_('Last Name'), max_length=50) email = forms.EmailField(label=_('E-mail'), max_length=255) affiliation = forms.ModelChoiceField(Institution.objects.all(), _('Affiliation')) address = forms.CharField(label=_('Address'), max_length=255,required=False) city = forms.CharField(label=_('City'), max_length=255) country = forms.ModelChoiceField(CountryCode.objects.all(), _('Country')) zip = forms.CharField(label=_('Postal Code'), max_length=50) telephone = forms.CharField(label=_('Telephone'), max_length=255) \ No newline at end of file diff --git a/clinicaltrials/registry/urls.py b/clinicaltrials/repository/urls.py similarity index 64% rename from clinicaltrials/registry/urls.py rename to clinicaltrials/repository/urls.py index 23fcc34..b2cb35b 100644 --- a/clinicaltrials/registry/urls.py +++ b/clinicaltrials/repository/urls.py @@ -1,36 +1,36 @@ from django.conf.urls.defaults import * from django.views.generic.list_detail import object_detail, object_list -from registry.models import ClinicalTrial +from repository.models import ClinicalTrial -from registry.views import edit_trial_index, full_view, index,step_1, step_2, step_3 -from registry.views import step_4, step_5, step_6, step_7, step_8, step_9, new_institution +from repository.views import edit_trial_index, full_view, index,step_1, step_2, step_3 +from repository.views import step_4, step_5, step_6, step_7, step_8, step_9, new_institution info_dict = { 'queryset': ClinicalTrial.objects.all(), } info_dict_xml = { - 'queryset': ClinicalTrial.objects.all(), - 'template_name': 'registry/clinicaltrial_detail.xml', + 'queryset': ClinicalTrial.objects.all(), + 'template_name': 'repository/clinicaltrial_detail.xml', 'mimetype': 'text/xml', } urlpatterns = patterns('', - url(r'^edit/(\d+)/$', edit_trial_index, name='registry.edittrial'), - url(r'^view/(\d+)/$', full_view, name='registry.trialview'), + url(r'^edit/(\d+)/$', edit_trial_index, name='repository.edittrial'), + url(r'^view/(\d+)/$', full_view, name='repository.trialview'), url(r'^xml/(?P<object_id>\d+)/$', object_detail, info_dict_xml, - name='registry.xml'), + name='repository.xml'), url(r'^new_institution/$', new_institution, name='new_institution'), url(r'^step_1/(\d+)/$', step_1, name='step_1'), url(r'^step_2/(\d+)/$', step_2, name='step_2'), url(r'^step_3/(\d+)/$', step_3, name='step_3'), url(r'^step_4/(\d+)/$', step_4, name='step_4'), url(r'^step_5/(\d+)/$', step_5, name='step_5'), url(r'^step_6/(\d+)/$', step_6, name='step_6'), url(r'^step_7/(\d+)/$', step_7, name='step_7'), url(r'^step_8/(\d+)/$', step_8, name='step_8'), url(r'^step_9/(\d+)/$', step_9, name='step_9'), url(r'^$', index), url(r'^list/$', object_list, info_dict), ) diff --git a/clinicaltrials/registry/views.py b/clinicaltrials/repository/views.py similarity index 86% rename from clinicaltrials/registry/views.py rename to clinicaltrials/repository/views.py index ba3da53..c5906fc 100644 --- a/clinicaltrials/registry/views.py +++ b/clinicaltrials/repository/views.py @@ -1,455 +1,455 @@ #coding: utf-8 from reviewapp.models import Attachment, Submission from reviewapp.trds_forms import ExistingAttachmentForm,NewAttachmentForm -from registry.models import ClinicalTrial, Descriptor, TrialNumber -from registry.models import TrialSecondarySponsor, TrialSupportSource, Outcome -from registry.models import PublicContact, ScientificContact, SiteContact, Contact - -from registry.trds_forms import GeneralHealthDescriptorForm, PrimarySponsorForm -from registry.trds_forms import SecondaryIdForm, SecondarySponsorForm -from registry.trds_forms import SupportSourceForm, TrialIdentificationForm -from registry.trds_forms import SpecificHealthDescriptorForm, HealthConditionsForm -from registry.trds_forms import InterventionDescriptorForm, InterventionForm -from registry.trds_forms import RecruitmentForm, StudyTypeForm, OutcomesForm -from registry.trds_forms import PublicContactForm, ScientificContactForm -from registry.trds_forms import ContactForm, NewInstitution, SiteContactForm +from repository.models import ClinicalTrial, Descriptor, TrialNumber +from repository.models import TrialSecondarySponsor, TrialSupportSource, Outcome +from repository.models import PublicContact, ScientificContact, SiteContact, Contact + +from repository.trds_forms import GeneralHealthDescriptorForm, PrimarySponsorForm +from repository.trds_forms import SecondaryIdForm, SecondarySponsorForm +from repository.trds_forms import SupportSourceForm, TrialIdentificationForm +from repository.trds_forms import SpecificHealthDescriptorForm, HealthConditionsForm +from repository.trds_forms import InterventionDescriptorForm, InterventionForm +from repository.trds_forms import RecruitmentForm, StudyTypeForm, OutcomesForm +from repository.trds_forms import PublicContactForm, ScientificContactForm +from repository.trds_forms import ContactForm, NewInstitution, SiteContactForm import choices from django.core import serializers from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response, get_object_or_404 from django.utils.translation import ugettext_lazy as _ from django.forms.models import inlineformset_factory, modelformset_factory from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required EXTRA_FORMS = 1 TRIAL_FORMS = ['Trial Identification', 'Sponsors', 'Health Conditions', 'Interventions', 'Recruitment', 'Study Type', 'Outcomes', 'Contacts', 'Attachments'] @login_required def edit_trial_index(request, trial_pk): ''' start view ''' links = [] for i, name in enumerate(TRIAL_FORMS): data = dict(label=_(name)) data['url'] = reverse('step_' + str(i + 1), args=[trial_pk]) data['icon'] = '/media/img/admin/icon_alert.gif' data['msg'] = 'Blank fields' links.append(data) - return render_to_response('registry/trial_index.html', + return render_to_response('repository/trial_index.html', {'username':request.user.username, 'trial_pk':trial_pk, 'links':links}) def full_view(request, trial_pk): ''' full view ''' ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) - return render_to_response('registry/trds.html', + return render_to_response('repository/trds.html', {'fieldtable':ct.html_dump()}) @login_required def index(request): latest_clinicalTrials = ClinicalTrial.objects.all()[:5] - t = loader.get_template('registry/latest_clinicalTrials.html') + t = loader.get_template('repository/latest_clinicalTrials.html') c = Context({ 'latest_clinicalTrials': latest_clinicalTrials, }) return HttpResponse(t.render(c)) @login_required def new_institution(request): if request.POST: new_institution = NewInstitution(request.POST) if new_institution.is_valid(): institution = new_institution.save() json = serializers.serialize('json',[institution]) return HttpResponse(json, mimetype='application/json'); else: new_institution = NewInstitution() - - return render_to_response('registry/new_institution.html', + + return render_to_response('repository/new_institution.html', {'form':new_institution}) def step_list(trial_pk): import sys current_step = int( sys._getframe(1).f_code.co_name.replace('step_','') ) steps = [] for i in range(1,10): steps.append((reverse('step_%d'%i,args=[trial_pk]), i == current_step)) return steps @login_required def step_1(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) - + if request.POST: form = TrialIdentificationForm(request.POST, instance=ct) SecondaryIdSet = inlineformset_factory(ClinicalTrial, TrialNumber, form=SecondaryIdForm, extra=EXTRA_FORMS) secondary_forms = SecondaryIdSet(request.POST, instance=ct) if form.is_valid() and secondary_forms.is_valid(): form.save() secondary_forms.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_2",args=[trial_pk])) - - return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) + + return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = TrialIdentificationForm(instance=ct) SecondaryIdSet = inlineformset_factory(ClinicalTrial, TrialNumber, form=SecondaryIdForm, extra=EXTRA_FORMS, can_delete=True) secondary_forms = SecondaryIdSet(instance=ct) forms = [form] formsets = [secondary_forms] - return render_to_response('registry/trial_form.html', + return render_to_response('repository/trial_form.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[0], 'steps': step_list(trial_pk), 'next_form_title':_('Sponsors and Sources of Support')}) @login_required def step_2(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = PrimarySponsorForm(request.POST, instance=ct) SecondarySponsorSet = inlineformset_factory(ClinicalTrial, TrialSecondarySponsor, form=SecondarySponsorForm,extra=EXTRA_FORMS) SupportSourceSet = inlineformset_factory(ClinicalTrial, TrialSupportSource, form=SupportSourceForm,extra=EXTRA_FORMS) secondary_forms = SecondarySponsorSet(request.POST, instance=ct) sources_form = SupportSourceSet(request.POST, instance=ct) if form.is_valid() and secondary_forms.is_valid() and sources_form.is_valid(): form.save() secondary_forms.save() sources_form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_3",args=[trial_pk])) - - return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) + + return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = PrimarySponsorForm(instance=ct) SecondarySponsorSet = inlineformset_factory(ClinicalTrial, TrialSecondarySponsor, form=SecondarySponsorForm,extra=EXTRA_FORMS, can_delete=True) SupportSourceSet = inlineformset_factory(ClinicalTrial, TrialSupportSource, form=SupportSourceForm,extra=EXTRA_FORMS,can_delete=True) secondary_forms = SecondarySponsorSet(instance=ct) sources_form = SupportSourceSet(instance=ct) # import pdb # pdb.set_trace() forms = [form] formsets = [secondary_forms,sources_form] - return render_to_response('registry/step_2.html', + return render_to_response('repository/step_2.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[1], 'steps': step_list(trial_pk), 'next_form_title':_('Health Conditions Form')}) @login_required def step_3(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) GeneralDescriptorSet = modelformset_factory(Descriptor, form=GeneralHealthDescriptorForm, extra=EXTRA_FORMS) SpecificDescriptorSet = modelformset_factory(Descriptor, form=SpecificHealthDescriptorForm, extra=EXTRA_FORMS) general_qs = Descriptor.objects.filter(trial=trial_pk, aspect=choices.TRIAL_ASPECT[0][0], level=choices.DESCRIPTOR_LEVEL[0][0]) specific_qs = Descriptor.objects.filter(trial=trial_pk, aspect=choices.TRIAL_ASPECT[0][0], level=choices.DESCRIPTOR_LEVEL[1][0]) if request.POST: form = HealthConditionsForm(request.POST, instance=ct) gdesc = GeneralDescriptorSet(request.POST,queryset=general_qs,prefix='g') sdesc = SpecificDescriptorSet(request.POST,queryset=specific_qs,prefix='s') if form.is_valid() and gdesc.is_valid() and sdesc.is_valid(): for cdata in gdesc.cleaned_data+sdesc.cleaned_data: cdata['trial'] = ct form.save() gdesc.save() sdesc.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_4",args=[trial_pk])) - - return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) + + return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = HealthConditionsForm(instance=ct) gdesc = GeneralDescriptorSet(queryset=general_qs,prefix='g') sdesc = SpecificDescriptorSet(queryset=specific_qs,prefix='s') forms = [form] formsets = [gdesc, sdesc] - return render_to_response('registry/step_3.html', + return render_to_response('repository/step_3.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[2], 'steps': step_list(trial_pk), 'next_form_title':_('Interventions Form')}) @login_required def step_4(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) DescriptorFormSet = modelformset_factory(Descriptor, form=InterventionDescriptorForm, extra=EXTRA_FORMS) queryset = Descriptor.objects.filter(trial=trial_pk, aspect=choices.TRIAL_ASPECT[1][0], level=choices.DESCRIPTOR_LEVEL[0][0]) if request.POST: form = InterventionForm(request.POST, instance=ct) idesc = DescriptorFormSet(request.POST, queryset=queryset) if form.is_valid() and idesc.is_valid(): for cdata in idesc.cleaned_data: cdata['trial'] = ct idesc.save() form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_5",args=[trial_pk])) - - return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) + + return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = InterventionForm(instance=ct) idesc = DescriptorFormSet(queryset=queryset) forms = [form] formsets = [idesc] - return render_to_response('registry/trial_form.html', + return render_to_response('repository/trial_form.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[3], 'steps': step_list(trial_pk), 'next_form_title':_('Recruitment Form')}) @login_required def step_5(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = RecruitmentForm(request.POST, instance=ct) if form.is_valid(): form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_6",args=[trial_pk])) - - return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) + + return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = RecruitmentForm(instance=ct) forms = [form] - return render_to_response('registry/trial_form.html', + return render_to_response('repository/trial_form.html', {'forms':forms, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[4], 'steps': step_list(trial_pk), 'next_form_title':_('Study Type Form')}) @login_required def step_6(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = StudyTypeForm(request.POST, instance=ct) if form.is_valid(): form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_7",args=[trial_pk])) - - return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) + + return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: form = StudyTypeForm(instance=ct) forms = [form] - return render_to_response('registry/trial_form.html', + return render_to_response('repository/trial_form.html', {'forms':forms, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[5], 'steps': step_list(trial_pk), 'next_form_title':_('Outcomes Form')}) @login_required def step_7(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) OutcomesSet = inlineformset_factory(ClinicalTrial, Outcome, form=OutcomesForm,extra=EXTRA_FORMS) if request.POST: outcomes_formset = OutcomesSet(request.POST, instance=ct) if outcomes_formset.is_valid(): outcomes_formset.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_8",args=[trial_pk])) - - return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) + + return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: outcomes_formset = OutcomesSet(instance=ct) formsets = [outcomes_formset] - return render_to_response('registry/trial_form.html', + return render_to_response('repository/trial_form.html', {'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[6], 'steps': step_list(trial_pk), 'next_form_title':_('Descriptor Form')}) @login_required def step_8(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) contact_type = { 'PublicContact': (PublicContact,PublicContactForm), 'ScientificContact': (ScientificContact,ScientificContactForm), 'SiteContact': (SiteContact,SiteContactForm) } InlineFormSetClasses = [] for model,form in contact_type.values(): InlineFormSetClasses.append( inlineformset_factory(ClinicalTrial,model,form=form,can_delete=True,extra=EXTRA_FORMS) ) ContactFormSet = modelformset_factory(Contact, form=ContactForm, extra=1) contact_qs = Contact.objects.none() if request.POST: inlineformsets = [fs(request.POST,instance=ct) for fs in InlineFormSetClasses] new_contact_formset = ContactFormSet(request.POST,queryset=contact_qs) if not False in [fs.is_valid for fs in inlineformsets] \ and new_contact_formset.is_valid(): for contactform in new_contact_formset.forms: if contactform.cleaned_data: Relation = contact_type[contactform.cleaned_data.pop('relation')][0] new_contact = contactform.save() Relation.objects.create(trial=ct,contact=new_contact) for fs in inlineformsets: fs.save() - return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) + return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: inlineformsets = [fs(instance=ct) for fs in InlineFormSetClasses] new_contact_formset = ContactFormSet(queryset=contact_qs) formsets = inlineformsets + [new_contact_formset] - return render_to_response('registry/trial_form.html', + return render_to_response('repository/trial_form.html', {'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[7], 'steps': step_list(trial_pk)}) @login_required def step_9(request, trial_pk): # TODO: this function should be on another place ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) su = Submission.objects.get(trial=ct) - + ExistingAttachmentFormSet = inlineformset_factory(Submission, Attachment, extra=0, can_delete=True, form=ExistingAttachmentForm) NewAttachmentFormSet = modelformset_factory(Attachment, extra=1, can_delete=False, form=NewAttachmentForm) if request.method == 'POST': existing_attachment_formset = ExistingAttachmentFormSet(request.POST, request.FILES, instance=su, prefix='existing') new_attachment_formset = NewAttachmentFormSet(request.POST, request.FILES, prefix='new') if existing_attachment_formset.is_valid() and new_attachment_formset.is_valid(): existing_attachment_formset.save() for cdata in new_attachment_formset.cleaned_data: cdata['submission'] = su new_attachment_formset.save() - - return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) + + return HttpResponseRedirect(reverse("repository.edittrial", args=[trial_pk])) else: existing_attachment_formset = ExistingAttachmentFormSet(instance=su, prefix='existing') new_attachment_formset = NewAttachmentFormSet(queryset=Attachment.objects.none(), prefix='new') formsets = [existing_attachment_formset,new_attachment_formset] - return render_to_response('registry/attachments.html', + return render_to_response('repository/attachments.html', {'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[8], 'steps': step_list(trial_pk)}) \ No newline at end of file diff --git a/clinicaltrials/registry/xml/READ-ME.txt b/clinicaltrials/repository/xml/READ-ME.txt similarity index 100% rename from clinicaltrials/registry/xml/READ-ME.txt rename to clinicaltrials/repository/xml/READ-ME.txt diff --git a/clinicaltrials/registry/xml/extra.dtd b/clinicaltrials/repository/xml/extra.dtd similarity index 100% rename from clinicaltrials/registry/xml/extra.dtd rename to clinicaltrials/repository/xml/extra.dtd diff --git a/clinicaltrials/registry/xml/reclac-vocabularies.mod b/clinicaltrials/repository/xml/reclac-vocabularies.mod similarity index 100% rename from clinicaltrials/registry/xml/reclac-vocabularies.mod rename to clinicaltrials/repository/xml/reclac-vocabularies.mod diff --git a/clinicaltrials/registry/xml/reclac.dtd b/clinicaltrials/repository/xml/reclac.dtd similarity index 100% rename from clinicaltrials/registry/xml/reclac.dtd rename to clinicaltrials/repository/xml/reclac.dtd diff --git a/clinicaltrials/registry/xml/sample_0a.xml b/clinicaltrials/repository/xml/sample_0a.xml similarity index 100% rename from clinicaltrials/registry/xml/sample_0a.xml rename to clinicaltrials/repository/xml/sample_0a.xml diff --git a/clinicaltrials/registry/xml/sample_0b.xml b/clinicaltrials/repository/xml/sample_0b.xml similarity index 100% rename from clinicaltrials/registry/xml/sample_0b.xml rename to clinicaltrials/repository/xml/sample_0b.xml diff --git a/clinicaltrials/registry/xml/sample_1a.xml b/clinicaltrials/repository/xml/sample_1a.xml similarity index 100% rename from clinicaltrials/registry/xml/sample_1a.xml rename to clinicaltrials/repository/xml/sample_1a.xml diff --git a/clinicaltrials/registry/xml/sample_1b.xml b/clinicaltrials/repository/xml/sample_1b.xml similarity index 100% rename from clinicaltrials/registry/xml/sample_1b.xml rename to clinicaltrials/repository/xml/sample_1b.xml diff --git a/clinicaltrials/registry/xml/samples/vitamin-c-ictrp.xml b/clinicaltrials/repository/xml/samples/vitamin-c-ictrp.xml similarity index 100% rename from clinicaltrials/registry/xml/samples/vitamin-c-ictrp.xml rename to clinicaltrials/repository/xml/samples/vitamin-c-ictrp.xml diff --git a/clinicaltrials/registry/xml/samples/vitamin-c-reclac.xml b/clinicaltrials/repository/xml/samples/vitamin-c-reclac.xml similarity index 99% rename from clinicaltrials/registry/xml/samples/vitamin-c-reclac.xml rename to clinicaltrials/repository/xml/samples/vitamin-c-reclac.xml index 3098c2a..22d0a18 100644 --- a/clinicaltrials/registry/xml/samples/vitamin-c-reclac.xml +++ b/clinicaltrials/repository/xml/samples/vitamin-c-reclac.xml @@ -1,142 +1,142 @@ <?xml version="1.0"?> <!--N/U marks fields that are not used by when importing to the RECLAC platform--> <trials> <trial> <main> <trial_id>IRCT138708271460N1</trial_id> <!--becomes secondary id--> <reg_name>IRCT</reg_name> <!--becomes secondary id--> <date_registration>2009-02-16</date_registration> <!--N/U--> <primary_sponsor>Tabriz Univ Med Sci</primary_sponsor> <public_title xml:lang="en"> Comparison of Ascorbic Acid and Grape Seed Extract in Oxidative Stress Induced by on Pump Heart Surgery </public_title> <acronym></acronym> <scientific_title xml:lang="en"> Effect of Ascorbic Acid and Grape Seed Extract "Vitis Vinifera L." on Oxidative Stress Induced by on Pump Coronary Artery by Pass Grafting Surgery </scientific_title> <date_enrolment>2008-11-01</date_enrolment> <type_enrolment>anticipated</type_enrolment> <target_size>75</target_size> <recruitment_status>Complete</recruitment_status> <!--inconsistent with date and type of enrolment--> <url>http://www.irct.ir/searchresult.php?id=1460&amp;number=1</url> <!--N/U--> <study_type>interventional</study_type> <study_design xml:lang="en"> Randomization: randomized. Blinding: Double blind. Placebo: not used. Assignment: Parallel. Purpose: Supportive care. Other design features: <reclac:study_design> </reclac:study_design> </study_design> <phase>2-3</phase> <hc_freetext xml:lang="en"> Condition 1: Coronary Atrery Bypass Graft (CABG). Condition 2: Atherosclerotic heart disease. Condition 3: Ischaemic cardiomyopathy. </hc_freetext> <i_freetext xml:lang="en"> Intervention 1: Control Group: without intervention. Intervention 2: Grape Seed Extract 100 mg/6h. Intervention 3: Vit C 25 mg/kg. </i_freetext> </main> <contacts> <contact> <type>public</type> <firstname>Naser safaei, MD, Surgeon</firstname> <middlename/> <lastname/> <address>Tabriz Univ Med Sci</address> <city>Tabriz</city> <country1>Iran, Islamic Republic Of</country1> <zip>51656-65811</zip> <telephone>+98-411-3357767</telephone> <email>[email protected]</email> <affiliation>Tabriz Univ Med Sci</affiliation> </contact> <contact> <type>scientific</type> <firstname>Dr Naser Safaei</firstname> <middlename/> <lastname/> <address>Daneshgah St,Tabriz Univ Med Sci</address> <city>Tabriz</city> <country1>Iran, Islamic Republic Of</country1> <zip>51656-65811</zip> <telephone>+98-411-3357767</telephone> <email>[email protected]</email> <affiliation>Tabriz Univ Med Sci</affiliation> </contact> <!-- also: type=site for site contacts, one per site in the country - hosting the registry--> + hosting the repository--> </contacts> <countries> <country2>Iran, Islamic Republic Of</country2> </countries> <criteria> <inclusion_criteria xml:lang="en"> Candidates for elective CABG surgery with pump for first time, 3 Vessel Disease (3VD). </inclusion_criteria> <exclusion_criteria xml:lang="en"> High risk patients, Those who need another heart surgery beside CABG, Urgent patients Diabetics, Ischemic time more than 120 min. </exclusion_criteria> <agemin reclac:unit="no-limit">0</agemin> <>no limit</reclac:agemin_unit> <agemax reclac:unit="years">150</agemax> <gender>both</gender> </criteria> <health_condition_code> <hc_code/> </health_condition_code> <health_condition_keyword> <hc_keyword reclac:vocabulary="DeCS" reclac:code="C14.280.647"> Myocardial Ischemia </hc_keyword> <hc_keyword>Atherosclerotic heart disease</hc_keyword> <hc_keyword>Ischaemic cardiomyopathy</hc_keyword> </health_condition_keyword> <intervention_code> <i_code>Not applicable</i_code> <i_code>Treatment: drugs</i_code> <i_code>Treatment: drugs</i_code> <i_code></i_code> </intervention_code> <intervention_keyword> <i_keyword></i_keyword> </intervention_keyword> <primary_outcome> <prim_outcome> Left Ventricular Ejection Fraction (LVEF). Timepoint: Before and after CABG. Method of measurement: Trans Thoracic Echocardiography (TTE) </prim_outcome> </primary_outcome> <secondary_outcome> <sec_outcome> Total Antioxidant Capacity (TAC). Timepoint: Before, middle and after CABG. Method of measurement: Biochemistry (blood sample) </sec_outcome> </secondary_outcome> <secondary_sponsor> <sponsor_name></sponsor_name> </secondary_sponsor> <secondary_ids> <secondary_id> <sec_id>NCT00839085</sec_id> <issuing_authority>ClinicalTrials.gov</issuing_authority> </secondary_id> </secondary_ids> <source_support> <source_name>Tabriz University of Medical Sciences</source_name> </source_support> </trial> </trials> diff --git a/clinicaltrials/registry/xml/validate.py b/clinicaltrials/repository/xml/validate.py similarity index 100% rename from clinicaltrials/registry/xml/validate.py rename to clinicaltrials/repository/xml/validate.py diff --git a/clinicaltrials/registry/xml/who_ictrp.dtd b/clinicaltrials/repository/xml/who_ictrp.dtd similarity index 100% rename from clinicaltrials/registry/xml/who_ictrp.dtd rename to clinicaltrials/repository/xml/who_ictrp.dtd diff --git a/clinicaltrials/reviewapp/models.py b/clinicaltrials/reviewapp/models.py index 22a49ae..e53c069 100644 --- a/clinicaltrials/reviewapp/models.py +++ b/clinicaltrials/reviewapp/models.py @@ -1,93 +1,93 @@ from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext as _ from django.conf import settings from datetime import datetime -from registry.models import ClinicalTrial, Institution +from repository.models import ClinicalTrial, Institution from vocabulary.models import CountryCode from utilities import safe_truncate SUBMISSION_STATUS = [ ('draft', 'draft'), ('pending', 'pending'), ('published', 'published'), ('rejected', 'rejected'), ] ACCESS = [ ('public', 'Public'), ('private', 'Private'), ] class Submission(models.Model): creator = models.ForeignKey(User, related_name='submission_creator', editable=False) created = models.DateTimeField(default=datetime.now, editable=False) updater = models.ForeignKey(User, null=True, related_name='submission_updater', editable=False) updated = models.DateTimeField(null=True, editable=False) title = models.CharField(u'Scientific title', max_length=2000) primary_sponsor = models.OneToOneField(Institution, null=True, blank=True, verbose_name=_('Primary Sponsor')) trial = models.OneToOneField(ClinicalTrial, null=True) status = models.CharField(_('Status'), max_length=64, choices=SUBMISSION_STATUS, default=SUBMISSION_STATUS[0][0]) staff_note = models.TextField(_('Submission Note (staff use only)'), max_length=255, blank=True) def save(self): if self.id: self.updated = datetime.now() super(Submission, self).save() def short_title(self): return safe_truncate(self.title, 120) def creator_username(self): return self.creator.username def __unicode__(self): return u'<%s> %s' % (self.creator_username(), self.short_title()) def get_mandatory_languages(self): langs = set(['en']) langs.add(self.trial.primary_sponsor.country.submission_language) for rc in self.trial.recruitmentcountry_set.all(): langs.add(rc.country.submission_language) return langs.intersection(set(settings.CHECKED_LANGUAGES)) def get_absolute_url(self): # TODO: use reverse to replace absolute path return '/accounts/submission/%s/' % self.id class RecruitmentCountry(models.Model): class Meta: verbose_name_plural = _('Recruitment Countries') submission = models.ForeignKey(Submission) country = models.ForeignKey(CountryCode, verbose_name=_('Country'), related_name='submissionrecruitmentcountry_set') class FrozenForm(models.Model): submission = models.ForeignKey(Submission) form_name = models.CharField(max_length=255) data = models.TextField(max_length=2**16) class Meta: unique_together = ['submission', 'form_name'] class Attachment(models.Model): class Meta: verbose_name_plural = _('Attachments') file = models.FileField(upload_to=settings.ATTACHMENTS_PATH) description = models.TextField(_('Description'), blank=True, max_length=8000) submission = models.ForeignKey(Submission) public = models.BooleanField(_('Public')) diff --git a/clinicaltrials/reviewapp/templates/reviewapp/submission_list.html b/clinicaltrials/reviewapp/templates/reviewapp/submission_list.html index 58a00d8..e63f767 100644 --- a/clinicaltrials/reviewapp/templates/reviewapp/submission_list.html +++ b/clinicaltrials/reviewapp/templates/reviewapp/submission_list.html @@ -1,31 +1,31 @@ {% extends "base.html" %} {% load i18n %} {% block body %} <h2>{% trans "Your Submissions" %}</h2> <table class="table"> <thead> <tr> <th>{% trans "Created" %}</th> <th>{% trans "Submission Title" %}</th> <th>{% trans "Situation" %}</th> </tr> </thead> <tbody> {% for submission in object_list %} <tr> <td>{{ submission.created|date:'d M Y' }}</td> <td> - <a href="{% url registry.edittrial submission.trial.pk %}">{{ submission.short_title }}</a> + <a href="{% url repository.edittrial submission.trial.pk %}">{{ submission.short_title }}</a> </td> <td>{{ submission.status }}</td> </tr> {% endfor %} </tbody> </table> <p> <a href="{% url reviewapp.new_submission %}">{% trans "Submit a new Clinical Trial" %}</a> </p> {% endblock %} diff --git a/clinicaltrials/reviewapp/tests.py b/clinicaltrials/reviewapp/tests.py index db77efb..cf34918 100644 --- a/clinicaltrials/reviewapp/tests.py +++ b/clinicaltrials/reviewapp/tests.py @@ -1,49 +1,49 @@ """ --------------------------------------- Testing mandatory languages --------------------------------------- Mandatory languages are English, the language of the primary sponsor and the languages of the recruitment countries limited to EN, PT, ES, FR:: >>> from reviewapp.models import Submission - >>> from registry.models import ClinicalTrial, Institution, RecruitmentCountry + >>> from repository.models import ClinicalTrial, Institution, RecruitmentCountry >>> from vocabulary.models import CountryCode >>> i = Institution() >>> i.country = CountryCode.objects.get(label='BR') >>> >>> ct = ClinicalTrial() >>> ct.primary_sponsor = i >>> ct.save() - >>> + >>> >>> s = Submission() >>> s.trial = ct >>> sorted(s.get_mandatory_languages()) [u'EN', u'PT'] - + >>> rc = RecruitmentCountry() >>> rc.trial = ct >>> rc.country = CountryCode.objects.get(label='AR') >>> rc.save() >>> sorted(s.get_mandatory_languages()) [u'EN', u'ES', u'PT'] - + >>> rc = RecruitmentCountry() >>> rc.trial = ct >>> rc.country = CountryCode.objects.get(label='SR') >>> rc.save() >>> sorted(s.get_mandatory_languages()) [u'EN', u'ES', u'PT'] """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 always equals 2. """ self.failUnlessEqual(1 + 1, 2) diff --git a/clinicaltrials/reviewapp/views.py b/clinicaltrials/reviewapp/views.py index 4e6876b..e346519 100644 --- a/clinicaltrials/reviewapp/views.py +++ b/clinicaltrials/reviewapp/views.py @@ -1,81 +1,81 @@ # coding: utf-8 from django.core.urlresolvers import reverse from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect from django import forms from django.utils.translation import ugettext as _ from django.contrib.auth.decorators import login_required from django.forms.models import modelformset_factory from reviewapp.models import Submission, Attachment -from registry.models import ClinicalTrial, CountryCode, Institution +from repository.models import ClinicalTrial, CountryCode, Institution def index(request): username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/index.html', locals()) def user_dump(request): uvars = [{'k':k, 'v':v} for k, v in request.user.__dict__.items()] return render_to_response('reviewapp/user_dump.html', locals()) def submissions_list(request): object_list = Submission.objects.all() username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/submission_list.html', locals()) def submission_detail(request,pk): object = get_object_or_404(Submission, id=int(pk)) username = request.user.username if request.user.is_authenticated() else None return render_to_response('reviewapp/submission_detail.html', locals()) ####################################################### New Submission form ### class InitialTrialForm(forms.ModelForm): class Meta: model = ClinicalTrial fields = ['scientific_title','recruitment_country'] title = _('Initial Trial Data') recruitment_country = forms.ModelMultipleChoiceField( label=_('Recruitment Country'), queryset=CountryCode.objects.all()) class PrimarySponsorForm(forms.ModelForm): class Meta: model = Institution exclude = ['address'] title = _('Primary Sponsor') @login_required def new_submission(request): AttachmentForm = modelformset_factory(Attachment, extra=1, can_delete=False, exclude='submission') AttachmentForm.title = _('Attachments') if request.method == 'POST': initial_form = InitialTrialForm(request.POST) sponsor_form = PrimarySponsorForm(request.POST) if initial_form.is_valid() and sponsor_form.is_valid(): initial_form.instance.primary_sponsor = sponsor_form.save() trial = initial_form.save() submission = Submission(creator=request.user, trial=trial, primary_sponsor=trial.primary_sponsor, title=trial.scientific_title) submission.save() - return HttpResponseRedirect(reverse('registry.edittrial',args=[trial.id])) + return HttpResponseRedirect(reverse('repository.edittrial',args=[trial.id])) else: initial_form = InitialTrialForm() sponsor_form = PrimarySponsorForm() forms = [initial_form, sponsor_form] return render_to_response('reviewapp/new_submission.html', { 'forms': forms, 'username':request.user.username, }) diff --git a/clinicaltrials/settings.py b/clinicaltrials/settings.py index 9a3774f..a33f744 100644 --- a/clinicaltrials/settings.py +++ b/clinicaltrials/settings.py @@ -1,143 +1,143 @@ # -*- encoding: utf-8 -*- # Django settings for clinicaltrials project. import os from django.utils.translation import ugettext_lazy as _ DEBUG = False TEMPLATE_DEBUG = DEBUG PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) ADMINS = ( ('Luciano Ramalho', '[email protected]'), ('Fabio Montefuscolo', '[email protected]'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'America/Brasilia' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'pt-BR' SITE_ID = 2 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/static/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = '*06=j&&^n71^a&%%3rs%7lla+^(n^v1w@@dp_rxvi#&(xo7meq' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', # 'django.template.loaders.eggs.load_template_source', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) ROOT_URLCONF = 'clinicaltrials.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(PROJECT_PATH, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', - 'registry', + 'repository', 'vocabulary', 'reviewapp', 'tickets', 'assistance', 'decsclient', 'polyglot', 'rosetta', 'registration', # django-registration package ) ################################################################# ### BEGIN Clinical Trials Repository customization settings SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos' EMAIL_HOST = '' EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers ### if set, used to authenticate with SMTP # EMAIL_HOST_USER = '' # EMAIL_HOST_PASSWORD = '' # EMAIL_USE_TLS = False DECS_SERVICE = 'http://decs.bvs.br/cgi-bin/mx/cgi=@vmx/decs' # Notes: # 1) language codes should follow the IANA standard for language subtags -# source: http://www.iana.org/assignments/language-subtag-registry +# source: http://www.iana.org/assignments/language-subtag-repository # 2) the first managed language is considered the default and is # also the source language for content translation purposes MANAGED_LANGUAGES = ( ('en',u'English'), ('es',u'Español'), #('fr',_('Français')), ('pt',u'Português'), ) TARGET_LANGUAGES = MANAGED_LANGUAGES[1:] # exlude source language CHECKED_LANGUAGES = [code for code, label in MANAGED_LANGUAGES] # django-registration: for how long the activation link is valid ACCOUNT_ACTIVATION_DAYS = 7 # django-registration: set to False to suspend new user registrations REGISTRATION_OPEN = True ATTACHMENTS_PATH = os.path.join(MEDIA_ROOT, 'attachments') FIXTURE_DIRS = ('fixtures',) ### END Clinical Trials Repository customization settings ################################################################# # Deployment settings: there *must* be an unversioned settings_local.py # file in the current directory. See sample file at settings_local-SAMPLE.py execfile(os.path.join(PROJECT_PATH,'settings_local.py')) diff --git a/clinicaltrials/tickets/choices.py b/clinicaltrials/tickets/choices.py index 39fdadf..8195fa3 100755 --- a/clinicaltrials/tickets/choices.py +++ b/clinicaltrials/tickets/choices.py @@ -1,31 +1,31 @@ # coding: utf-8 ## Qualifiers for the relationship of secondary entities with a Tickets # TICKET_CONTEXT = [ - ('ct_registry_field_1', 'Registry Form - Primary ID',), - ('ct_registry_field_4', 'Registry Form - Support Sources',), - ('ct_registry_field_5', 'Registry Form - Primary Sponsor',), - ('ct_registry_field_6', 'Registry Form - Secondary Sponsor',), - ('ct_registry_field_11', 'Registry Form - Recruitment Countries',), - ('ct_registry_field_14e', 'Registry Form - Exclusion Criteria',), - ('ct_registry_field_15a', 'Registry Form - Study Type',), - ('ct_registry_field_15b', 'Registry Form - Study Design',), + ('ct_repository_field_1', 'Registry Form - Primary ID',), + ('ct_repository_field_4', 'Registry Form - Support Sources',), + ('ct_repository_field_5', 'Registry Form - Primary Sponsor',), + ('ct_repository_field_6', 'Registry Form - Secondary Sponsor',), + ('ct_repository_field_11', 'Registry Form - Recruitment Countries',), + ('ct_repository_field_14e', 'Registry Form - Exclusion Criteria',), + ('ct_repository_field_15a', 'Registry Form - Study Type',), + ('ct_repository_field_15b', 'Registry Form - Study Design',), ('translation_tools', 'Administrative translation Tools',), ('personal', 'Personal Tickect',), ('other', 'Other Context',), ] TICKET_TYPE = [ ('review', 'Ask for Reviews',), ('help', 'Ask for Help',), ('personal', 'Personal Ticket',), ] TICKET_STATUS = [ ('new', 'New',), ('assigned', 'Assigned',), ('resolved', 'Resolved',), ('reopened', 'Reopen',), ('closed', 'Closed',), ] \ No newline at end of file diff --git a/clinicaltrials/tickets/fixtures/initial_data.json b/clinicaltrials/tickets/fixtures/initial_data.json index 6a2acc6..45fb3b6 100755 --- a/clinicaltrials/tickets/fixtures/initial_data.json +++ b/clinicaltrials/tickets/fixtures/initial_data.json @@ -1,123 +1,123 @@ [ { - "pk": 1, - "model": "tickets.ticket", + "pk": 1, + "model": "tickets.ticket", "fields": { - "created": "2009-12-14 15:55:03", - "type": "review", - "context": "ct_registry_field_1", + "created": "2009-12-14 15:55:03", + "type": "review", + "context": "ct_repository_field_1", "creator": 1 } - }, + }, { - "pk": 2, - "model": "tickets.ticket", + "pk": 2, + "model": "tickets.ticket", "fields": { - "created": "2009-12-14 15:56:38", - "type": "help", - "context": "ct_registry_field_15a", + "created": "2009-12-14 15:56:38", + "type": "help", + "context": "ct_repository_field_15a", "creator": 1 } - }, + }, { - "pk": 3, - "model": "tickets.ticket", + "pk": 3, + "model": "tickets.ticket", "fields": { - "created": "2009-12-16 18:17:28", - "type": "review", - "context": "ct_registry_field_11", + "created": "2009-12-16 18:17:28", + "type": "review", + "context": "ct_repository_field_11", "creator": 1 } - }, + }, { - "pk": 1, - "model": "tickets.followup", + "pk": 1, + "model": "tickets.followup", "fields": { - "status": "new", - "iteration_date": "2009-12-14 16:40:10", - "description": "Description 1", - "reported_by": 1, - "to_user": "[email protected]", - "ticket": 1, + "status": "new", + "iteration_date": "2009-12-14 16:40:10", + "description": "Description 1", + "reported_by": 1, + "to_user": "[email protected]", + "ticket": 1, "subject": "Subject 1" } - }, + }, { - "pk": 2, - "model": "tickets.followup", + "pk": 2, + "model": "tickets.followup", "fields": { - "status": "adsigned", - "iteration_date": "2009-12-14 16:41:01", - "description": "Description 2", - "reported_by": 1, - "to_user": "[email protected]", - "ticket": 1, + "status": "adsigned", + "iteration_date": "2009-12-14 16:41:01", + "description": "Description 2", + "reported_by": 1, + "to_user": "[email protected]", + "ticket": 1, "subject": "Sbuject 2" } - }, + }, { - "pk": 3, - "model": "tickets.followup", + "pk": 3, + "model": "tickets.followup", "fields": { - "status": "resolved", - "iteration_date": "2009-12-14 16:42:04", - "description": "Description 3", - "reported_by": 1, - "to_user": "[email protected]", - "ticket": 1, + "status": "resolved", + "iteration_date": "2009-12-14 16:42:04", + "description": "Description 3", + "reported_by": 1, + "to_user": "[email protected]", + "ticket": 1, "subject": "Subject 3" } - }, + }, { - "pk": 4, - "model": "tickets.followup", + "pk": 4, + "model": "tickets.followup", "fields": { - "status": "new", - "iteration_date": "2009-12-14 16:42:16", - "description": "Description b 1", - "reported_by": 1, - "to_user": "[email protected]", - "ticket": 2, + "status": "new", + "iteration_date": "2009-12-14 16:42:16", + "description": "Description b 1", + "reported_by": 1, + "to_user": "[email protected]", + "ticket": 2, "subject": "Subject b 1" } - }, + }, { - "pk": 5, - "model": "tickets.followup", + "pk": 5, + "model": "tickets.followup", "fields": { - "status": "new", - "iteration_date": "2009-12-16 18:17:58", - "description": "Lorem ipsum dolor sit amet, duis erat. Euismod molestie nibh, molestiae in mus, fusce sapien ut. Dictum urna et. Elit viverra, imperdiet duis in. Sem ligula, a curae conubia. Sit a taciti. Quis quam, cras scelerisque, quam nec. A morbi. Enim donec, nulla aliquet nulla, saepe fringilla vel. Dui a tincidunt, pellentesque malesuada. Ante dolor quam, proin hac in.", - "reported_by": null, - "to_user": null, - "ticket": 3, + "status": "new", + "iteration_date": "2009-12-16 18:17:58", + "description": "Lorem ipsum dolor sit amet, duis erat. Euismod molestie nibh, molestiae in mus, fusce sapien ut. Dictum urna et. Elit viverra, imperdiet duis in. Sem ligula, a curae conubia. Sit a taciti. Quis quam, cras scelerisque, quam nec. A morbi. Enim donec, nulla aliquet nulla, saepe fringilla vel. Dui a tincidunt, pellentesque malesuada. Ante dolor quam, proin hac in.", + "reported_by": null, + "to_user": null, + "ticket": 3, "subject": "Lorem ipsum dolor sit amet, ut nulla, tortor quisque, vestibulum congue. " } - }, + }, { - "pk": 6, - "model": "tickets.followup", + "pk": 6, + "model": "tickets.followup", "fields": { - "status": "assigned", - "iteration_date": "2009-12-16 18:18:21", - "description": "Lorem ipsum dolor sit amet, duis erat. Euismod molestie nibh, molestiae in mus, fusce sapien ut. Dictum urna et. Elit viverra, imperdiet duis in.", - "reported_by": null, - "to_user": null, - "ticket": 3, + "status": "assigned", + "iteration_date": "2009-12-16 18:18:21", + "description": "Lorem ipsum dolor sit amet, duis erat. Euismod molestie nibh, molestiae in mus, fusce sapien ut. Dictum urna et. Elit viverra, imperdiet duis in.", + "reported_by": null, + "to_user": null, + "ticket": 3, "subject": "Lorem ipsum dolor sit amet, ut nulla, tortor quisque, vestibulum congue. " } - }, + }, { - "pk": 7, - "model": "tickets.followup", + "pk": 7, + "model": "tickets.followup", "fields": { - "status": "closed", - "iteration_date": "2009-12-16 18:19:29", - "description": "Dolor pellentesque. Duis quisque augue, accumsan sollicitudin, dui consequat fusce. Nulla suscipit, nunc cum, arcu fusce. Sed in morbi. Nec ullamcorper ultrices, eros nam tellus.", - "reported_by": null, - "to_user": null, - "ticket": 3, + "status": "closed", + "iteration_date": "2009-12-16 18:19:29", + "description": "Dolor pellentesque. Duis quisque augue, accumsan sollicitudin, dui consequat fusce. Nulla suscipit, nunc cum, arcu fusce. Sed in morbi. Nec ullamcorper ultrices, eros nam tellus.", + "reported_by": null, + "to_user": null, + "ticket": 3, "subject": "Pellentesque elementum, at quam metus, vivamus magna auctor." } } ] diff --git a/clinicaltrials/urls.py b/clinicaltrials/urls.py index d5edcc7..0789b7e 100644 --- a/clinicaltrials/urls.py +++ b/clinicaltrials/urls.py @@ -1,48 +1,48 @@ from django.conf.urls.defaults import * import utilities from django.contrib import admin # Django admin UI admin.autodiscover() # Django admin UI urlpatterns = patterns('', - # Registry application - url(r'^rg/', include('clinicaltrials.registry.urls')), + # Repository application + url(r'^rg/', include('clinicaltrials.repository.urls')), # Tickets application url(r'^ticket/', include('clinicaltrials.tickets.urls')), # Assistance application url(r'^assistance/', include('clinicaltrials.assistance.urls')), # Review application url(r'^', include('clinicaltrials.reviewapp.urls')), # Django admin UI and documentation url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), # Diagnostic views url(r'^smoke/', utilities.smoke_test), url(r'^req_dump/', utilities.req_dump), url(r'^decs/', include('clinicaltrials.decsclient.urls')), # django-registration views url(r'^accounts/', include('registration.backends.default.urls')), ) from django.conf import settings if settings.DEBUG: # serve static files from develpment server from django.views import static urlpatterns += patterns('', url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += patterns('', url(r'^rosetta/', include('rosetta.urls')), )
ensaiosclinicos/clinicaltrials
ffb44144cf73b2a2ae04fedca7625853c234d3b6
registration implemented from account creation to sending e-mail
diff --git a/clinicaltrials/fixtures/initial_data.json b/clinicaltrials/fixtures/initial_data.json new file mode 100644 index 0000000..d48a08f --- /dev/null +++ b/clinicaltrials/fixtures/initial_data.json @@ -0,0 +1,10 @@ +[ + { + "pk": 2, + "model": "sites.site", + "fields": { + "domain": "ec.homolog.bvsalud.org", + "name": "EnsaiosClinicos.gov.br" + } + } +] diff --git a/clinicaltrials/registration/templates/registration/activation_email.txt b/clinicaltrials/registration/templates/registration/activation_email.txt index e69de29..26687de 100644 --- a/clinicaltrials/registration/templates/registration/activation_email.txt +++ b/clinicaltrials/registration/templates/registration/activation_email.txt @@ -0,0 +1,8 @@ +Please use the activation key below to activate your account. + +activation_key = {{activation_key}} + +This key will expire in {{expiration_days}} days. + +site.name = [{{site.name}}] +site.domain = [{{site.domain}}] diff --git a/clinicaltrials/registration/templates/registration/activation_email_subject.txt b/clinicaltrials/registration/templates/registration/activation_email_subject.txt index e69de29..2429a43 100644 --- a/clinicaltrials/registration/templates/registration/activation_email_subject.txt +++ b/clinicaltrials/registration/templates/registration/activation_email_subject.txt @@ -0,0 +1 @@ +Ativação de conta para login em {{site.domain}} \ No newline at end of file diff --git a/clinicaltrials/registration/templates/registration/registration_form.html b/clinicaltrials/registration/templates/registration/registration_form.html index 23add1b..fa388e7 100644 --- a/clinicaltrials/registration/templates/registration/registration_form.html +++ b/clinicaltrials/registration/templates/registration/registration_form.html @@ -1,17 +1,17 @@ {% extends "base.html" %} {% load i18n %} {% block body %} {% if form.errors %} <p>{% trans "Please correct the errors below." %}</p> {% endif %} <form method="post" action="{% url registration_register %}"> <table> {{ form.as_table }} </table> - <input type="submit" value="{% trans register %}" /> + <input type="submit" value="{% trans "register" %}" /> </form> {% endblock %} diff --git a/clinicaltrials/settings.py b/clinicaltrials/settings.py index 9e7a084..9a3774f 100644 --- a/clinicaltrials/settings.py +++ b/clinicaltrials/settings.py @@ -1,133 +1,143 @@ # -*- encoding: utf-8 -*- # Django settings for clinicaltrials project. import os from django.utils.translation import ugettext_lazy as _ DEBUG = False TEMPLATE_DEBUG = DEBUG PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) ADMINS = ( ('Luciano Ramalho', '[email protected]'), ('Fabio Montefuscolo', '[email protected]'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'America/Brasilia' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'pt-BR' -SITE_ID = 1 +SITE_ID = 2 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/static/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = '*06=j&&^n71^a&%%3rs%7lla+^(n^v1w@@dp_rxvi#&(xo7meq' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', # 'django.template.loaders.eggs.load_template_source', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) ROOT_URLCONF = 'clinicaltrials.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(PROJECT_PATH, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'registry', 'vocabulary', 'reviewapp', 'tickets', 'assistance', 'decsclient', 'polyglot', 'rosetta', 'registration', # django-registration package ) ################################################################# ### BEGIN Clinical Trials Repository customization settings SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos' + +EMAIL_HOST = '' +EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers +### if set, used to authenticate with SMTP +# EMAIL_HOST_USER = '' +# EMAIL_HOST_PASSWORD = '' +# EMAIL_USE_TLS = False + DECS_SERVICE = 'http://decs.bvs.br/cgi-bin/mx/cgi=@vmx/decs' # Notes: # 1) language codes should follow the IANA standard for language subtags # source: http://www.iana.org/assignments/language-subtag-registry -# 2) the first managed language is considered the default -# and the source language for content translation purposes +# 2) the first managed language is considered the default and is +# also the source language for content translation purposes MANAGED_LANGUAGES = ( ('en',u'English'), ('es',u'Español'), #('fr',_('Français')), ('pt',u'Português'), ) TARGET_LANGUAGES = MANAGED_LANGUAGES[1:] # exlude source language CHECKED_LANGUAGES = [code for code, label in MANAGED_LANGUAGES] # django-registration: for how long the activation link is valid ACCOUNT_ACTIVATION_DAYS = 7 # django-registration: set to False to suspend new user registrations REGISTRATION_OPEN = True ATTACHMENTS_PATH = os.path.join(MEDIA_ROOT, 'attachments') +FIXTURE_DIRS = ('fixtures',) + ### END Clinical Trials Repository customization settings ################################################################# # Deployment settings: there *must* be an unversioned settings_local.py # file in the current directory. See sample file at settings_local-SAMPLE.py execfile(os.path.join(PROJECT_PATH,'settings_local.py')) diff --git a/clinicaltrials/settings_local-SAMPLE.py b/clinicaltrials/settings_local-SAMPLE.py index 10f3449..6b44d69 100644 --- a/clinicaltrials/settings_local-SAMPLE.py +++ b/clinicaltrials/settings_local-SAMPLE.py @@ -1,24 +1,30 @@ DEBUG = True DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'clinicaltrials' # Or path to database file if using sqlite3. DATABASE_USER = 'tester' # Not used with sqlite3. DATABASE_PASSWORD = 'puffpuff' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. SECRET_KEY = 'rmbg(!8sa@&8o9pnnd@*szm+axos_6r$)r48jc2r$^_8+wz)po' if DEBUG: MIDDLEWARE_CLASSES += ( ## external dependency for debug purposes only # 'debug_middleware.DebugFooter', ) INSTALLED_APPS += ( ## external dependency for generating model ER diagrams # 'graphviz', ) GRAPHVIZ_DOT_CMD = '/usr/bin/dot' + EMAIL_HOST = '' + EMAIL_PORT = 25 # http://www.iana.org/assignments/port-numbers + ### if set, used to authenticate with SMTP + # EMAIL_HOST_USER = '' + # EMAIL_HOST_PASSWORD = '' + # EMAIL_USE_TLS = False diff --git a/clinicaltrials/urls.py b/clinicaltrials/urls.py index da29ed0..d5edcc7 100644 --- a/clinicaltrials/urls.py +++ b/clinicaltrials/urls.py @@ -1,48 +1,48 @@ from django.conf.urls.defaults import * import utilities from django.contrib import admin # Django admin UI admin.autodiscover() # Django admin UI urlpatterns = patterns('', # Registry application url(r'^rg/', include('clinicaltrials.registry.urls')), # Tickets application url(r'^ticket/', include('clinicaltrials.tickets.urls')), # Assistance application url(r'^assistance/', include('clinicaltrials.assistance.urls')), # Review application url(r'^', include('clinicaltrials.reviewapp.urls')), # Django admin UI and documentation url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)), # Diagnostic views url(r'^smoke/', utilities.smoke_test), url(r'^req_dump/', utilities.req_dump), url(r'^decs/', include('clinicaltrials.decsclient.urls')), # django-registration views - # url(r'^accounts/', include('registration.backends.default.urls')), + url(r'^accounts/', include('registration.backends.default.urls')), ) from django.conf import settings if settings.DEBUG: # serve static files from develpment server from django.views import static urlpatterns += patterns('', url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += patterns('', url(r'^rosetta/', include('rosetta.urls')), )
ensaiosclinicos/clinicaltrials
b3955069bbd2cc0abc1c4df03bf8c72ee15db262
put the lxml for decsclient; start scratch for xml upload; change css for stepmenu
diff --git a/clinicaltrials/decsclient/views.py b/clinicaltrials/decsclient/views.py index 1fb313f..daa7afb 100755 --- a/clinicaltrials/decsclient/views.py +++ b/clinicaltrials/decsclient/views.py @@ -1,53 +1,51 @@ from django.conf import settings from django.http import HttpResponse from django.shortcuts import render_to_response -from xml.etree.ElementTree import ElementTree +from lxml.etree import ElementTree import urllib JSON_TERM = '{"fields":{"description":"%s","label":"%s"}}' def getterm(request, lang, code): params = urllib.urlencode({ 'tree_id': code or '', 'lang': lang, }) resource = urllib.urlopen(settings.DECS_SERVICE, params) tree = ElementTree() tree.parse(resource) result = tree.find("decsws_response/tree/self/term_list/term") if result is None: - lists = tree.findall('decsws_response/tree/term_list') - term_list = [l for l in lists if l.attrib['lang'] == lang].pop() - result = term_list.getiterator('term') + result = tree.findall('decsws_response/tree/term_list[@lang="%s"]/term' % lang) json = '[%s]' % ','.join((JSON_TERM % (r.text.capitalize(),r.attrib['tree_id']) for r in result)) else: json = '[%s]' % (JSON_TERM % (result.text,result.attrib['tree_id'])) return HttpResponse(json, mimetype='application/json'); def search(request, lang, term, prefix='401'): # about the prefix: http://wiki.reddes.bvsalud.org/index.php/DeCS_services count = 30 if 'count' in request.GET and request.GET['count'].isdigit(): count = request.GET['count'] params = urllib.urlencode({ 'bool': '%s %s' % (prefix, term), 'lang': lang, 'count': count, }) resource = urllib.urlopen(settings.DECS_SERVICE, params) tree = ElementTree() tree.parse(resource) result = tree.findall('decsws_response/tree/self/term_list/term') json = '[%s]' % ','.join( sorted(JSON_TERM % (t.text,t.attrib['tree_id']) for t in result) ) return HttpResponse(json, mimetype='application/json'); def test_search(request): return render_to_response("test_search.html", request) \ No newline at end of file diff --git a/clinicaltrials/load.py b/clinicaltrials/load.py new file mode 100644 index 0000000..ff038eb --- /dev/null +++ b/clinicaltrials/load.py @@ -0,0 +1,105 @@ +import re +from lxml.etree import ElementTree + +from django.core.management import setup_environ +import settings +setup_environ(settings) + +from vocabulary.models import CountryCode +from registry.models import ClinicalTrial, Institution, TrialSecondarySponsor +from registry.models import TrialSupportSource, Contact, SiteContact, PublicContact +from registry.models import ScientificContact, InterventionCode + +clinical_trial_xpath = { + 'trial_id':'', + 'date_registration':'', + 'scientific_title':'trial_identification/scientific_title', + 'scientific_acronym':'trial_identification/scientific_acronym', + 'public_title':'trial_identification/public_title', + 'acronym':'trial_identification/acronym', + 'hc_freetext':'health_conditions/freetext', + 'i_freetext':'interventions/freetext', + 'inclusion_criteria':'recruitment/inclusion_criteria', + 'gender':'recruitment/gender/@value', + 'agemin_value':'recruitment/agemin', + 'agemin_unit':'recruitment/agemin/@unit', + 'agemax_value':'recruitment/agemax', + 'agemax_unit':'recruitment/agemax/@unit', + 'exclusion_criteria':'recruitment/exclusion_criteria', + 'study_design':'study_type/study_design', + 'expanded_access_program':'study_type/study_design/@expanded_access_program', + 'number_of_arms':'study_type/study_design/@number_of_arms', + 'date_enrollment_anticipated':'recruitment/date_enrolment_anticipated', + 'date_enrollment_actual':'recruitment/date_enrolment_actual', + 'target_sample_size':'recruitment/target_size', + 'created':'', + 'updated':'', + 'exported':'', + 'status':'', + 'staff_note':'' +} + +contact_types = { + 'public_contact':PublicContact, + 'scientific_contact':ScientificContact, + 'site_contact':SiteContact +} + + +xml = open('registry/xml/sample_1b.xml') +tree = ElementTree() +root = tree.parse(xml) + +ct = ClinicalTrial() +ct.save() + +# Non-relational Fields from Clinical Trial +for field,xpath in clinical_trial_xpath.items(): + if xpath != '': + resultEl = root.xpath(xpath) + if len(resultEl) > 0: + if hasattr(resultEl[0],'text'): + ct.__setattr__(field,resultEl[0].text) + else: + ct.__setattr__(field,resultEl[0]) + + +# Add Sponsors +for sponsorNode in root.xpath('sponsors_and_support/*'): + sponsor = Institution() + sponsor.name = sponsorNode.find('name').text + sponsor.address = sponsorNode.find('address').text + sponsor.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) + sponsor.save() + if sponsorNode.tag == 'primary_sponsor': + ct.primary_sponsor = sponsor + elif sponsorNode.tag == 'secondary_sponsor': + TrialSecondarySponsor.objects.create(trial=ct,institution=sponsor) + elif sponsorNode.tag == 'source_support': + TrialSupportSource.objects.create(trial=ct,institution=sponsor) + +# Add Contacts +contactList = {} +for personNode in root.xpath('contacts/person'): + contact = Contact() + + for attr in ['firstname','middlename','lastname','email','address','city','zip','telephone']: + value = personNode.find(attr) + if value is not None: + contact.__setattr__(attr,value.text) + contact.country = CountryCode.objects.get(label=sponsorNode.attrib['country_code']) + contact.save() + contactList[ personNode.attrib['pid'] ] = contact + +# Assign PublicContact, ScientificContact and SiteContact to the trial +for cType,model in contact_types.items(): + for typeNode in root.xpath('contacts/'+cType): + pattern = re.compile('p[0-9]+') + for person in pattern.findall(typeNode.attrib['persons']): + model.objects.create(trial=ct,contact=contactList[person]) + +#Interventions +for icodeNode in root.xpath('interventions/i_code'): + i_code = InterventionCode.objects.get(label=icodeNode.attrib['value']) + if isinstance(i_code,InterventionCode): + ct.i_code.add(i_code) diff --git a/clinicaltrials/registry/views.py b/clinicaltrials/registry/views.py index 54a6e42..ba3da53 100644 --- a/clinicaltrials/registry/views.py +++ b/clinicaltrials/registry/views.py @@ -1,459 +1,455 @@ #coding: utf-8 from reviewapp.models import Attachment, Submission from reviewapp.trds_forms import ExistingAttachmentForm,NewAttachmentForm from registry.models import ClinicalTrial, Descriptor, TrialNumber from registry.models import TrialSecondarySponsor, TrialSupportSource, Outcome from registry.models import PublicContact, ScientificContact, SiteContact, Contact from registry.trds_forms import GeneralHealthDescriptorForm, PrimarySponsorForm from registry.trds_forms import SecondaryIdForm, SecondarySponsorForm from registry.trds_forms import SupportSourceForm, TrialIdentificationForm from registry.trds_forms import SpecificHealthDescriptorForm, HealthConditionsForm from registry.trds_forms import InterventionDescriptorForm, InterventionForm from registry.trds_forms import RecruitmentForm, StudyTypeForm, OutcomesForm from registry.trds_forms import PublicContactForm, ScientificContactForm from registry.trds_forms import ContactForm, NewInstitution, SiteContactForm import choices from django.core import serializers from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response, get_object_or_404 from django.utils.translation import ugettext_lazy as _ from django.forms.models import inlineformset_factory, modelformset_factory from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required EXTRA_FORMS = 1 TRIAL_FORMS = ['Trial Identification', 'Sponsors', 'Health Conditions', 'Interventions', 'Recruitment', 'Study Type', 'Outcomes', 'Contacts', 'Attachments'] @login_required def edit_trial_index(request, trial_pk): ''' start view ''' links = [] for i, name in enumerate(TRIAL_FORMS): data = dict(label=_(name)) data['url'] = reverse('step_' + str(i + 1), args=[trial_pk]) data['icon'] = '/media/img/admin/icon_alert.gif' data['msg'] = 'Blank fields' links.append(data) return render_to_response('registry/trial_index.html', {'username':request.user.username, 'trial_pk':trial_pk, 'links':links}) def full_view(request, trial_pk): ''' full view ''' ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) return render_to_response('registry/trds.html', {'fieldtable':ct.html_dump()}) @login_required def index(request): latest_clinicalTrials = ClinicalTrial.objects.all()[:5] t = loader.get_template('registry/latest_clinicalTrials.html') c = Context({ 'latest_clinicalTrials': latest_clinicalTrials, }) return HttpResponse(t.render(c)) @login_required def new_institution(request): if request.POST: new_institution = NewInstitution(request.POST) if new_institution.is_valid(): institution = new_institution.save() json = serializers.serialize('json',[institution]) return HttpResponse(json, mimetype='application/json'); else: new_institution = NewInstitution() return render_to_response('registry/new_institution.html', {'form':new_institution}) def step_list(trial_pk): import sys current_step = int( sys._getframe(1).f_code.co_name.replace('step_','') ) steps = [] for i in range(1,10): steps.append((reverse('step_%d'%i,args=[trial_pk]), i == current_step)) return steps @login_required def step_1(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = TrialIdentificationForm(request.POST, instance=ct) SecondaryIdSet = inlineformset_factory(ClinicalTrial, TrialNumber, form=SecondaryIdForm, extra=EXTRA_FORMS) secondary_forms = SecondaryIdSet(request.POST, instance=ct) if form.is_valid() and secondary_forms.is_valid(): form.save() secondary_forms.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_2",args=[trial_pk])) return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) else: form = TrialIdentificationForm(instance=ct) SecondaryIdSet = inlineformset_factory(ClinicalTrial, TrialNumber, form=SecondaryIdForm, extra=EXTRA_FORMS, can_delete=True) secondary_forms = SecondaryIdSet(instance=ct) forms = [form] formsets = [secondary_forms] return render_to_response('registry/trial_form.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[0], 'steps': step_list(trial_pk), 'next_form_title':_('Sponsors and Sources of Support')}) @login_required def step_2(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = PrimarySponsorForm(request.POST, instance=ct) SecondarySponsorSet = inlineformset_factory(ClinicalTrial, TrialSecondarySponsor, form=SecondarySponsorForm,extra=EXTRA_FORMS) SupportSourceSet = inlineformset_factory(ClinicalTrial, TrialSupportSource, form=SupportSourceForm,extra=EXTRA_FORMS) secondary_forms = SecondarySponsorSet(request.POST, instance=ct) sources_form = SupportSourceSet(request.POST, instance=ct) if form.is_valid() and secondary_forms.is_valid() and sources_form.is_valid(): form.save() secondary_forms.save() sources_form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_3",args=[trial_pk])) return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) else: form = PrimarySponsorForm(instance=ct) SecondarySponsorSet = inlineformset_factory(ClinicalTrial, TrialSecondarySponsor, form=SecondarySponsorForm,extra=EXTRA_FORMS, can_delete=True) SupportSourceSet = inlineformset_factory(ClinicalTrial, TrialSupportSource, form=SupportSourceForm,extra=EXTRA_FORMS,can_delete=True) secondary_forms = SecondarySponsorSet(instance=ct) sources_form = SupportSourceSet(instance=ct) # import pdb # pdb.set_trace() forms = [form] formsets = [secondary_forms,sources_form] return render_to_response('registry/step_2.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[1], 'steps': step_list(trial_pk), 'next_form_title':_('Health Conditions Form')}) @login_required def step_3(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) GeneralDescriptorSet = modelformset_factory(Descriptor, form=GeneralHealthDescriptorForm, extra=EXTRA_FORMS) SpecificDescriptorSet = modelformset_factory(Descriptor, form=SpecificHealthDescriptorForm, extra=EXTRA_FORMS) general_qs = Descriptor.objects.filter(trial=trial_pk, aspect=choices.TRIAL_ASPECT[0][0], level=choices.DESCRIPTOR_LEVEL[0][0]) specific_qs = Descriptor.objects.filter(trial=trial_pk, aspect=choices.TRIAL_ASPECT[0][0], level=choices.DESCRIPTOR_LEVEL[1][0]) if request.POST: form = HealthConditionsForm(request.POST, instance=ct) gdesc = GeneralDescriptorSet(request.POST,queryset=general_qs,prefix='g') sdesc = SpecificDescriptorSet(request.POST,queryset=specific_qs,prefix='s') if form.is_valid() and gdesc.is_valid() and sdesc.is_valid(): for cdata in gdesc.cleaned_data+sdesc.cleaned_data: cdata['trial'] = ct form.save() gdesc.save() sdesc.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_4",args=[trial_pk])) return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) else: form = HealthConditionsForm(instance=ct) gdesc = GeneralDescriptorSet(queryset=general_qs,prefix='g') sdesc = SpecificDescriptorSet(queryset=specific_qs,prefix='s') forms = [form] formsets = [gdesc, sdesc] return render_to_response('registry/step_3.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[2], 'steps': step_list(trial_pk), 'next_form_title':_('Interventions Form')}) @login_required def step_4(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) DescriptorFormSet = modelformset_factory(Descriptor, form=InterventionDescriptorForm, extra=EXTRA_FORMS) queryset = Descriptor.objects.filter(trial=trial_pk, aspect=choices.TRIAL_ASPECT[1][0], level=choices.DESCRIPTOR_LEVEL[0][0]) if request.POST: form = InterventionForm(request.POST, instance=ct) idesc = DescriptorFormSet(request.POST, queryset=queryset) if form.is_valid() and idesc.is_valid(): for cdata in idesc.cleaned_data: cdata['trial'] = ct idesc.save() form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_5",args=[trial_pk])) return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) else: form = InterventionForm(instance=ct) idesc = DescriptorFormSet(queryset=queryset) forms = [form] formsets = [idesc] return render_to_response('registry/trial_form.html', {'forms':forms,'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[3], 'steps': step_list(trial_pk), 'next_form_title':_('Recruitment Form')}) @login_required def step_5(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = RecruitmentForm(request.POST, instance=ct) if form.is_valid(): form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_6",args=[trial_pk])) return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) else: form = RecruitmentForm(instance=ct) forms = [form] return render_to_response('registry/trial_form.html', {'forms':forms, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[4], 'steps': step_list(trial_pk), 'next_form_title':_('Study Type Form')}) @login_required def step_6(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) if request.POST: form = StudyTypeForm(request.POST, instance=ct) if form.is_valid(): form.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_7",args=[trial_pk])) return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) else: form = StudyTypeForm(instance=ct) forms = [form] return render_to_response('registry/trial_form.html', {'forms':forms, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[5], 'steps': step_list(trial_pk), 'next_form_title':_('Outcomes Form')}) @login_required def step_7(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) OutcomesSet = inlineformset_factory(ClinicalTrial, Outcome, form=OutcomesForm,extra=EXTRA_FORMS) if request.POST: outcomes_formset = OutcomesSet(request.POST, instance=ct) if outcomes_formset.is_valid(): outcomes_formset.save() if request.POST.has_key('submit_next'): return HttpResponseRedirect(reverse("step_8",args=[trial_pk])) return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) else: outcomes_formset = OutcomesSet(instance=ct) formsets = [outcomes_formset] return render_to_response('registry/trial_form.html', {'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[6], 'steps': step_list(trial_pk), 'next_form_title':_('Descriptor Form')}) @login_required def step_8(request, trial_pk): ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) - contact_type = {'PublicContact':PublicContact, - 'ScientificContact':ScientificContact, - 'SiteContact':SiteContact} - contact_type = { 'PublicContact': (PublicContact,PublicContactForm), 'ScientificContact': (ScientificContact,ScientificContactForm), 'SiteContact': (SiteContact,SiteContactForm) } InlineFormSetClasses = [] for model,form in contact_type.values(): InlineFormSetClasses.append( inlineformset_factory(ClinicalTrial,model,form=form,can_delete=True,extra=EXTRA_FORMS) ) ContactFormSet = modelformset_factory(Contact, form=ContactForm, extra=1) contact_qs = Contact.objects.none() if request.POST: inlineformsets = [fs(request.POST,instance=ct) for fs in InlineFormSetClasses] new_contact_formset = ContactFormSet(request.POST,queryset=contact_qs) if not False in [fs.is_valid for fs in inlineformsets] \ and new_contact_formset.is_valid(): for contactform in new_contact_formset.forms: if contactform.cleaned_data: Relation = contact_type[contactform.cleaned_data.pop('relation')][0] new_contact = contactform.save() Relation.objects.create(trial=ct,contact=new_contact) for fs in inlineformsets: fs.save() return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) else: inlineformsets = [fs(instance=ct) for fs in InlineFormSetClasses] new_contact_formset = ContactFormSet(queryset=contact_qs) formsets = inlineformsets + [new_contact_formset] return render_to_response('registry/trial_form.html', {'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[7], 'steps': step_list(trial_pk)}) @login_required def step_9(request, trial_pk): # TODO: this function should be on another place ct = get_object_or_404(ClinicalTrial, id=int(trial_pk)) su = Submission.objects.get(trial=ct) ExistingAttachmentFormSet = inlineformset_factory(Submission, Attachment, extra=0, can_delete=True, form=ExistingAttachmentForm) NewAttachmentFormSet = modelformset_factory(Attachment, extra=1, can_delete=False, form=NewAttachmentForm) if request.method == 'POST': existing_attachment_formset = ExistingAttachmentFormSet(request.POST, request.FILES, instance=su, prefix='existing') new_attachment_formset = NewAttachmentFormSet(request.POST, request.FILES, prefix='new') if existing_attachment_formset.is_valid() and new_attachment_formset.is_valid(): existing_attachment_formset.save() for cdata in new_attachment_formset.cleaned_data: cdata['submission'] = su new_attachment_formset.save() return HttpResponseRedirect(reverse("registry.edittrial", args=[trial_pk])) else: existing_attachment_formset = ExistingAttachmentFormSet(instance=su, prefix='existing') new_attachment_formset = NewAttachmentFormSet(queryset=Attachment.objects.none(), prefix='new') formsets = [existing_attachment_formset,new_attachment_formset] return render_to_response('registry/attachments.html', {'formsets':formsets, 'username':request.user.username, 'trial_pk':trial_pk, 'title':TRIAL_FORMS[8], - 'steps': step_list(trial_pk)}) + 'steps': step_list(trial_pk)}) \ No newline at end of file diff --git a/clinicaltrials/static/css/style.css b/clinicaltrials/static/css/style.css index c1ade5f..f6a68eb 100644 --- a/clinicaltrials/static/css/style.css +++ b/clinicaltrials/static/css/style.css @@ -1,245 +1,250 @@ body { height: 100%; margin-top: 0px; padding: 0; text-align: left; font: 78% "Verdana", "Arial", "sans-serif"; background:#cbcbcd; } h1, h2, label, legend, #content a { color: #296784; } /* STYLE for BORDERED MAIN BLOCKS */ #container, #top, #footer, #columns, .stepmenu-top, .stepmenu-bottom { border-color: #D4D4FF; } #container { width: 87%; margin: 0px auto; padding: 0; line-height: 1.7em; background: transparent url(/static/bg_header.png) repeat-x scroll 0 0; } /*TOP BANNER*/ #top { padding: 0; margin: 0; border-width: 0 0 1px; float: left; clear: both; width: 100%; height: 148px; } #top img { display: block; float: left; margin: 4em } #top h1 { margin: 2.7em 0 0; float: left; } #middle { background-color: #FFF; position: relative; float: left; width: 100%; clear: both; overflow: hidden; } #columns { position: relative; width: 100%; float: left; right: 81%; border-width: 0 1px 0 0; background:#ebecf0; } #rebracmenu, #workarea { position: relative; } /* GROUP STEPS NAVIGATION AND CONTENT */ #workarea { float: left; left: 100%; width: 81%; } #rebracmenu { float: left; width: 16%; left: 1%; } #rebracmenu #usermenu div { padding: 3em; border-bottom: 1px dotted #D4D4FF; line-height: 100%; text-align: center; } #rebracmenu #usermenu div * { text-transform: capitalize; font-weight: bold; } #rebracmenu ul { list-style-type: none; padding-left: 1em; } #rebracmenu li { text-transform: capitalize; margin-bottom: 0.5em; border-bottom: 1px dotted #D4D4FF; } /* STEPS NAVIGATION*/ .stepmenu { background: transparent url(/static/bg_stepmenu.png) repeat-x; } .stepmenu ul { margin: 0; padding: 0 0 0 2em; list-style: none; } .stepmenu li { display: inline-block; width: 9%; - border: 2px solid transparent; + border: 1px solid transparent; + text-align: center; +} + +.stepmenu li.current { + border: 1px inset white; } .stepmenu a { text-decoration: none; text-transform: capitalize; color: #0a5172; font-weight: bold; } .stepmenu li:hover { text-decoration: underline; } .stepmenu-top { border-width: 0 0 1px; } .stepmenu-bottom { border-width: 1px 0 0; } /*MAIN CONTENT*/ #content { padding: 10px; } #content a:link, #content a:visited { text-decoration: none; background: inherit; } #content a:hover { text-decoration: underline; } #content h2 { padding: 0.2em 0; } /*FOOTER*/ #footer { clear: both; padding: 5px; margin-top: 5px; border-width: 1px 0 0; background:#f3f4f6; } #footer a:link, #footer a:visited { text-decoration: none; background: inherit; } /*TYPOGRAPHY*/ p { margin: 20px; } blockquote { font-weight: bold; font-style: italic; } table.table { border-collapse: collapse; border-width: 0 0 1px 1px; } table.table, table.table td, table.table th { color:#4a4c4e; } table.table td, table.table th { padding: 10px; } table.table th { background-color: #F1F4F7; color:#333; } table.trialsummary { width: 100%; } /* AJAX DeCS Tools */ td div.decstool { display: none; } td div select { display: block; } td select, td div.decstool input { width: 80%; } td.showdecs div.decstool { display: block; } .issue{ font-size:10px; color:#5d5d5d; } fieldset{ border: 1px solid #CCC; margin-bottom:30px; } label{ font-weight:normal; } legend{ font-weight:bold; }
ensaiosclinicos/clinicaltrials
d65da3979795b5039bccb413924637a9dfc8eb2d
added initial registration templates
diff --git a/clinicaltrials/registration/registration/activate.html b/clinicaltrials/registration/registration/activate.html new file mode 100644 index 0000000..e69de29 diff --git a/clinicaltrials/registration/registration/activation_complete.html b/clinicaltrials/registration/registration/activation_complete.html new file mode 100644 index 0000000..e69de29 diff --git a/clinicaltrials/registration/registration/activation_email.txt b/clinicaltrials/registration/registration/activation_email.txt new file mode 100644 index 0000000..e69de29 diff --git a/clinicaltrials/registration/registration/activation_email_subject.txt b/clinicaltrials/registration/registration/activation_email_subject.txt new file mode 100644 index 0000000..e69de29 diff --git a/clinicaltrials/registration/registration/registration_complete.html b/clinicaltrials/registration/registration/registration_complete.html new file mode 100644 index 0000000..b74ca57 --- /dev/null +++ b/clinicaltrials/registration/registration/registration_complete.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block body %} + +<h2>{% trans "A confirmation e-mail is on the way" %}</h2> + +<p>{% trans "Please click the activation link included in the e-mail to confirm you registration." %} +</p> + +{% endblock %} diff --git a/clinicaltrials/registration/registration/registration_form.html b/clinicaltrials/registration/registration/registration_form.html new file mode 100644 index 0000000..23add1b --- /dev/null +++ b/clinicaltrials/registration/registration/registration_form.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block body %} + +{% if form.errors %} +<p>{% trans "Please correct the errors below." %}</p> +{% endif %} + +<form method="post" action="{% url registration_register %}"> + <table> + {{ form.as_table }} + </table> + <input type="submit" value="{% trans register %}" /> +</form> + +{% endblock %}
ensaiosclinicos/clinicaltrials
a8d0051a45929a0ef19caac582a26a586eec0699
added django-registration app
diff --git a/clinicaltrials/activation/READ-ME.txt b/clinicaltrials/activation/READ-ME.txt deleted file mode 100644 index 9d27f8f..0000000 --- a/clinicaltrials/activation/READ-ME.txt +++ /dev/null @@ -1,5 +0,0 @@ -This activation/ directory was created as a copy of the directory: - -django-registration/registration/backends/default - -Changes, if any, are recorded in the Subversion log diff --git a/clinicaltrials/registration/READ-ME.txt b/clinicaltrials/registration/READ-ME.txt new file mode 100644 index 0000000..caebaec --- /dev/null +++ b/clinicaltrials/registration/READ-ME.txt @@ -0,0 +1,12 @@ +This is a copy of django-registration changeset d36a38202ee3 [1] + +[1] http://bitbucket.org/ubernostrum/django-registration/changeset/d36a38202ee3/ + +It was obtained doing wget on URL [2] on 2010-03-23 + +[2] http://bitbucket.org/ubernostrum/django-registration/get/tip.zip + +From the zip above the registration/ subdir was extracted and this readme added. + +Previously I tried to do a regular install but successive import errors trying to use the default backend convinced me that the documented installation procedure does not work at this time. (LR) + diff --git a/clinicaltrials/registration/__init__.py b/clinicaltrials/registration/__init__.py new file mode 100644 index 0000000..bdb490c --- /dev/null +++ b/clinicaltrials/registration/__init__.py @@ -0,0 +1,14 @@ +VERSION = (0, 8, 0, 'alpha', 1) + +def get_version(): + version = '%s.%s' % (VERSION[0], VERSION[1]) + if VERSION[2]: + version = '%s.%s' % (version, VERSION[2]) + if VERSION[3:] == ('alpha', 0): + version = '%s pre-alpha' % version + else: + if VERSION[3] != 'final': + version = "%s %s" % (version, VERSION[3]) + if VERSION[4] != 0: + version = '%s %s' % (version, VERSION[4]) + return version diff --git a/clinicaltrials/registration/admin.py b/clinicaltrials/registration/admin.py new file mode 100644 index 0000000..d7626d7 --- /dev/null +++ b/clinicaltrials/registration/admin.py @@ -0,0 +1,46 @@ +from django.contrib import admin +from django.contrib.sites.models import RequestSite +from django.contrib.sites.models import Site +from django.utils.translation import ugettext_lazy as _ + +from registration.models import RegistrationProfile + + +class RegistrationAdmin(admin.ModelAdmin): + actions = ['activate_users', 'resend_activation_email'] + list_display = ('user', 'activation_key_expired') + raw_id_fields = ['user'] + search_fields = ('user__username', 'user__first_name') + + def activate_users(self, request, queryset): + """ + Activates the selected users, if they are not alrady + activated. + + """ + for profile in queryset: + RegistrationProfile.objects.activate_user(profile.activation_key) + activate_users.short_description = _("Activate users") + + def resend_activation_email(self, request, queryset): + """ + Re-sends activation emails for the selected users. + + Note that this will *only* send activation emails for users + who are eligible to activate; emails will not be sent to users + whose activation keys have expired or who have already + activated. + + """ + if Site._meta.installed: + site = Site.objects.get_current() + else: + site = RequestSite(request) + + for profile in queryset: + if not profile.activation_key_expired(): + profile.send_activation_email(site) + resend_activation_email.short_description = _("Re-send activation emails") + + +admin.site.register(RegistrationProfile, RegistrationAdmin) diff --git a/clinicaltrials/registration/auth_urls.py b/clinicaltrials/registration/auth_urls.py new file mode 100644 index 0000000..9bb1bc3 --- /dev/null +++ b/clinicaltrials/registration/auth_urls.py @@ -0,0 +1,58 @@ +""" +URL patterns for the views included in ``django.contrib.auth``. + +Including these URLs (via the ``include()`` directive) will set up the +following patterns based at whatever URL prefix they are included +under: + +* User login at ``login/``. + +* User logout at ``logout/``. + +* The two-step password change at ``password/change/`` and + ``password/change/done/``. + +* The four-step password reset at ``password/reset/``, + ``password/reset/confirm/``, ``password/reset/complete/`` and + ``password/reset/done/``. + +The default registration backend already has an ``include()`` for +these URLs, so under the default setup it is not necessary to manually +include these views. Other backends may or may not include them; +consult a specific backend's documentation for details. + +""" + +from django.conf.urls.defaults import * + +from django.contrib.auth import views as auth_views + + +urlpatterns = patterns('', + url(r'^login/$', + auth_views.login, + {'template_name': 'registration/login.html'}, + name='auth_login'), + url(r'^logout/$', + auth_views.logout, + {'template_name': 'registration/logout.html'}, + name='auth_logout'), + url(r'^password/change/$', + auth_views.password_change, + name='auth_password_change'), + url(r'^password/change/done/$', + auth_views.password_change_done, + name='auth_password_change_done'), + url(r'^password/reset/$', + auth_views.password_reset, + name='auth_password_reset'), + url(r'^password/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', + auth_views.password_reset_confirm, + name='auth_password_reset_confirm'), + url(r'^password/reset/complete/$', + auth_views.password_reset_complete, + name='auth_password_reset_complete'), + url(r'^password/reset/done/$', + auth_views.password_reset_done, + name='auth_password_reset_done'), +) diff --git a/clinicaltrials/registration/backends/__init__.py b/clinicaltrials/registration/backends/__init__.py new file mode 100644 index 0000000..0f2ec4b --- /dev/null +++ b/clinicaltrials/registration/backends/__init__.py @@ -0,0 +1,32 @@ +from django.core.exceptions import ImproperlyConfigured + + +# Python 2.7 has an importlib with import_module; for older Pythons, +# Django's bundled copy provides it. +try: + from importlib import import_module +except ImportError: + from django.utils.importlib import import_module + +def get_backend(path): + """ + Return an instance of a registration backend, given the dotted + Python import path (as a string) to the backend class. + + If the backend cannot be located (e.g., because no such module + exists, or because the module does not contain a class of the + appropriate name), ``django.core.exceptions.ImproperlyConfigured`` + is raised. + + """ + i = path.rfind('.') + module, attr = path[:i], path[i+1:] + try: + mod = import_module(module) + except ImportError, e: + raise ImproperlyConfigured('Error loading registration backend %s: "%s"' % (module, e)) + try: + backend_class = getattr(mod, attr) + except AttributeError: + raise ImproperlyConfigured('Module "%s" does not define a registration backend named "%s"' % (module, attr)) + return backend_class() diff --git a/clinicaltrials/activation/__init__.py b/clinicaltrials/registration/backends/default/__init__.py similarity index 99% rename from clinicaltrials/activation/__init__.py rename to clinicaltrials/registration/backends/default/__init__.py index f6f6c65..59b3da7 100644 --- a/clinicaltrials/activation/__init__.py +++ b/clinicaltrials/registration/backends/default/__init__.py @@ -1,139 +1,139 @@ from django.conf import settings from django.contrib.sites.models import RequestSite from django.contrib.sites.models import Site from registration import signals from registration.forms import RegistrationForm from registration.models import RegistrationProfile class DefaultBackend(object): """ A registration backend which follows a simple workflow: 1. User signs up, inactive account is created. 2. Email is sent to user with activation link. 3. User clicks activation link, account is now active. Using this backend requires that * ``registration`` be listed in the ``INSTALLED_APPS`` setting (since this backend makes use of models defined in this application). * The setting ``ACCOUNT_ACTIVATION_DAYS`` be supplied, specifying (as an integer) the number of days from registration during which a user may activate their account (after that period expires, activation will be disallowed). * The creation of the templates ``registration/activation_email_subject.txt`` and ``registration/activation_email.txt``, which will be used for the activation email. See the notes for this backends ``register`` method for details regarding these templates. Additionally, registration can be temporarily closed by adding the setting ``REGISTRATION_OPEN`` and setting it to ``False``. Omitting this setting, or setting it to ``True``, will be interpreted as meaning that registration is currently open and permitted. Internally, this is accomplished via storing an activation key in an instance of ``registration.models.RegistrationProfile``. See that model and its custom manager for full documentation of its fields and supported operations. - + """ def register(self, request, **kwargs): """ Given a username, email address and password, register a new user account, which will initially be inactive. Along with the new ``User`` object, a new ``registration.models.RegistrationProfile`` will be created, tied to that ``User``, containing the activation key which will be used for this account. An email will be sent to the supplied email address; this email should contain an activation link. The email will be rendered using two templates. See the documentation for ``RegistrationProfile.send_activation_email()`` for information about these templates and the contexts provided to them. After the ``User`` and ``RegistrationProfile`` are created and the activation email is sent, the signal ``registration.signals.user_registered`` will be sent, with the new ``User`` as the keyword argument ``user`` and the class of this backend as the sender. """ username, email, password = kwargs['username'], kwargs['email'], kwargs['password1'] if Site._meta.installed: site = Site.objects.get_current() else: site = RequestSite(request) new_user = RegistrationProfile.objects.create_inactive_user(username, email, password, site) signals.user_registered.send(sender=self.__class__, user=new_user, request=request) return new_user def activate(self, request, activation_key): """ Given an an activation key, look up and activate the user account corresponding to that key (if possible). After successful activation, the signal ``registration.signals.user_activated`` will be sent, with the newly activated ``User`` as the keyword argument ``user`` and the class of this backend as the sender. - + """ activated = RegistrationProfile.objects.activate_user(activation_key) if activated: signals.user_activated.send(sender=self.__class__, user=activated, request=request) return activated def registration_allowed(self, request): """ Indicate whether account registration is currently permitted, based on the value of the setting ``REGISTRATION_OPEN``. This is determined as follows: * If ``REGISTRATION_OPEN`` is not specified in settings, or is set to ``True``, registration is permitted. * If ``REGISTRATION_OPEN`` is both specified and set to ``False``, registration is not permitted. - + """ return getattr(settings, 'REGISTRATION_OPEN', True) def get_form_class(self, request): """ Return the default form class used for user registration. - + """ return RegistrationForm def post_registration_redirect(self, request, user): """ Return the name of the URL to redirect to after successful user registration. - + """ return ('registration_complete', (), {}) def post_activation_redirect(self, request, user): """ Return the name of the URL to redirect to after successful account activation. - + """ return ('registration_activation_complete', (), {}) diff --git a/clinicaltrials/activation/urls.py b/clinicaltrials/registration/backends/default/urls.py similarity index 100% rename from clinicaltrials/activation/urls.py rename to clinicaltrials/registration/backends/default/urls.py diff --git a/clinicaltrials/registration/backends/simple/__init__.py b/clinicaltrials/registration/backends/simple/__init__.py new file mode 100644 index 0000000..5e8c35b --- /dev/null +++ b/clinicaltrials/registration/backends/simple/__init__.py @@ -0,0 +1,64 @@ +from django.conf import settings +from django.contrib.auth import authenticate +from django.contrib.auth import login +from django.contrib.auth.models import User + +from registration import signals +from registration.forms import RegistrationForm + + +class SimpleBackend(object): + """ + A registration backend which implements the simplest possible + workflow: a user supplies a username, email address and password + (the bare minimum for a useful account), and is immediately signed + up and logged in. + + """ + def register(self, request, **kwargs): + """ + Create and immediately log in a new user. + + """ + username, email, password = kwargs['username'], kwargs['email'], kwargs['password1'] + User.objects.create_user(username, email, password) + + # authenticate() always has to be called before login(), and + # will return the user we just created. + new_user = authenticate(username=username, password=password) + login(request, new_user) + signals.user_registered.send(sender=self.__class__, + user=new_user, + request=request) + return new_user + + def activate(self, **kwargs): + raise NotImplementedError + + def registration_allowed(self, request): + """ + Indicate whether account registration is currently permitted, + based on the value of the setting ``REGISTRATION_OPEN``. This + is determined as follows: + + * If ``REGISTRATION_OPEN`` is not specified in settings, or is + set to ``True``, registration is permitted. + + * If ``REGISTRATION_OPEN`` is both specified and set to + ``False``, registration is not permitted. + + """ + return getattr(settings, 'REGISTRATION_OPEN', True) + + def get_form_class(self, request): + return RegistrationForm + + def post_registration_redirect(self, request, user): + """ + After registration, redirect to the user's account page. + + """ + return (user.get_absolute_url(), (), {}) + + def post_activation_redirect(self, request, user): + raise NotImplementedError diff --git a/clinicaltrials/registration/backends/simple/urls.py b/clinicaltrials/registration/backends/simple/urls.py new file mode 100644 index 0000000..0e733cd --- /dev/null +++ b/clinicaltrials/registration/backends/simple/urls.py @@ -0,0 +1,38 @@ +""" +URLconf for registration and activation, using django-registration's +one-step backend. + +If the default behavior of these views is acceptable to you, simply +use a line like this in your root URLconf to set up the default URLs +for registration:: + + (r'^accounts/', include('registration.backends.simple.urls')), + +This will also automatically set up the views in +``django.contrib.auth`` at sensible default locations. + +If you'd like to customize the behavior (e.g., by passing extra +arguments to the various views) or split up the URLs, feel free to set +up your own URL patterns for these views instead. + +""" + + +from django.conf.urls.defaults import * +from django.views.generic.simple import direct_to_template + +from registration.views import activate +from registration.views import register + + +urlpatterns = patterns('', + url(r'^register/$', + register, + {'backend': 'registration.backends.simple.SimpleBackend'}, + name='registration_register'), + url(r'^register/closed/$', + direct_to_template, + {'template': 'registration/registration_closed.html'}, + name='registration_disallowed'), + (r'', include('registration.auth_urls')), + ) diff --git a/clinicaltrials/registration/forms.py b/clinicaltrials/registration/forms.py new file mode 100644 index 0000000..4161183 --- /dev/null +++ b/clinicaltrials/registration/forms.py @@ -0,0 +1,123 @@ +""" +Forms and validation code for user registration. + +""" + + +from django.contrib.auth.models import User +from django import forms +from django.utils.translation import ugettext_lazy as _ + + +# I put this on all required fields, because it's easier to pick up +# on them with CSS or JavaScript if they have a class of "required" +# in the HTML. Your mileage may vary. If/when Django ticket #3515 +# lands in trunk, this will no longer be necessary. +attrs_dict = {'class': 'required'} + + +class RegistrationForm(forms.Form): + """ + Form for registering a new user account. + + Validates that the requested username is not already in use, and + requires the password to be entered twice to catch typos. + + Subclasses should feel free to add any additional validation they + need, but should avoid defining a ``save()`` method -- the actual + saving of collected user data is delegated to the active + registration backend. + + """ + username = forms.RegexField(regex=r'^\w+$', + max_length=30, + widget=forms.TextInput(attrs=attrs_dict), + label=_("Username"), + error_messages={'invalid': _("This value must contain only letters, numbers and underscores.")}) + email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict, + maxlength=75)), + label=_("Email address")) + password1 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, render_value=False), + label=_("Password")) + password2 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, render_value=False), + label=_("Password (again)")) + + def clean_username(self): + """ + Validate that the username is alphanumeric and is not already + in use. + + """ + try: + user = User.objects.get(username__iexact=self.cleaned_data['username']) + except User.DoesNotExist: + return self.cleaned_data['username'] + raise forms.ValidationError(_("A user with that username already exists.")) + + def clean(self): + """ + Verifiy that the values entered into the two password fields + match. Note that an error here will end up in + ``non_field_errors()`` because it doesn't apply to a single + field. + + """ + if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data: + if self.cleaned_data['password1'] != self.cleaned_data['password2']: + raise forms.ValidationError(_("The two password fields didn't match.")) + return self.cleaned_data + + +class RegistrationFormTermsOfService(RegistrationForm): + """ + Subclass of ``RegistrationForm`` which adds a required checkbox + for agreeing to a site's Terms of Service. + + """ + tos = forms.BooleanField(widget=forms.CheckboxInput(attrs=attrs_dict), + label=_(u'I have read and agree to the Terms of Service'), + error_messages={'required': _("You must agree to the terms to register")}) + + +class RegistrationFormUniqueEmail(RegistrationForm): + """ + Subclass of ``RegistrationForm`` which enforces uniqueness of + email addresses. + + """ + def clean_email(self): + """ + Validate that the supplied email address is unique for the + site. + + """ + if User.objects.filter(email__iexact=self.cleaned_data['email']): + raise forms.ValidationError(_("This email address is already in use. Please supply a different email address.")) + return self.cleaned_data['email'] + + +class RegistrationFormNoFreeEmail(RegistrationForm): + """ + Subclass of ``RegistrationForm`` which disallows registration with + email addresses from popular free webmail services; moderately + useful for preventing automated spam registrations. + + To change the list of banned domains, subclass this form and + override the attribute ``bad_domains``. + + """ + bad_domains = ['aim.com', 'aol.com', 'email.com', 'gmail.com', + 'googlemail.com', 'hotmail.com', 'hushmail.com', + 'msn.com', 'mail.ru', 'mailinator.com', 'live.com', + 'yahoo.com'] + + def clean_email(self): + """ + Check the supplied email address against a list of known free + webmail domains. + + """ + email_domain = self.cleaned_data['email'].split('@')[1] + if email_domain in self.bad_domains: + raise forms.ValidationError(_("Registration using free email addresses is prohibited. Please supply a different email address.")) + return self.cleaned_data['email'] diff --git a/clinicaltrials/registration/locale/ar/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/ar/LC_MESSAGES/django.mo new file mode 100644 index 0000000..07bc79f Binary files /dev/null and b/clinicaltrials/registration/locale/ar/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/ar/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/ar/LC_MESSAGES/django.po new file mode 100644 index 0000000..dd61869 --- /dev/null +++ b/clinicaltrials/registration/locale/ar/LC_MESSAGES/django.po @@ -0,0 +1,81 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "اسم المستخدم" + +#: forms.py:41 +msgid "email address" +msgstr "عنوان البريد الالكتروني" + +#: forms.py:43 +msgid "password" +msgstr "كلمة المرور" + +#: forms.py:45 +msgid "password (again)" +msgstr "تأكيد كلمة المرور" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "يمكن أن يحتوي اسم المستخدم على احرف، ارقام وشرطات سطرية فقط" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "اسم المستخدم مسجل مسبقا. يرجى اختيار اسم اخر." + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "يجب ادخال كلمة المرور مطابقة كل مرة" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "أقر بقراءة والموافقة على شروط الخدمة" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "يجب الموافقة على الشروط للتسجيل" + +#: forms.py:124 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "عنوان البريد الالكتروني مسجل مسبقا. يرجى تزويد عنوان بريد الكتروني مختلف." + +#: forms.py:149 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "يمنع التسجيل باستخدام عناوين بريد الكترونية مجانية. يرجى تزويد عنوان بريد الكتروني مختلف." + +#: models.py:188 +msgid "user" +msgstr "مستخدم" + +#: models.py:189 +msgid "activation key" +msgstr "رمز التفعيل" + +#: models.py:194 +msgid "registration profile" +msgstr "ملف التسجيل الشخصي" + +#: models.py:195 +msgid "registration profiles" +msgstr "ملفات التسجيل الشخصية" diff --git a/clinicaltrials/registration/locale/bg/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/bg/LC_MESSAGES/django.mo new file mode 100644 index 0000000..be9adf4 Binary files /dev/null and b/clinicaltrials/registration/locale/bg/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/bg/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/bg/LC_MESSAGES/django.po new file mode 100644 index 0000000..5089ec1 --- /dev/null +++ b/clinicaltrials/registration/locale/bg/LC_MESSAGES/django.po @@ -0,0 +1,78 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: 2008-03-05 12:37+0200\n" +"Last-Translator: Vladislav <[email protected]>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Bookmarks: -1,-1,-1,-1,10,-1,-1,-1,-1,-1\n" + +#: forms.py:38 +msgid "username" +msgstr "Потребителско име " + +#: forms.py:41 +msgid "email address" +msgstr "Електронна поща" + +#: forms.py:43 +msgid "password" +msgstr "Парола" + +#: forms.py:45 +msgid "password (again)" +msgstr "Парола (проверка)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "Потребителските имена могат да съдържат букви, цифри и подчертавки" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Потребителското име е заето. Моля изберето друго." + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "Грешка при проверка на паролата." + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "Прочел съм и съм съгласен с условията за експлоатация" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "Трябва да сте съгласни с условията за да се регистрирате." + +#: forms.py:124 +msgid "This email address is already in use. Please supply a different email address." +msgstr "Адреса на електронната поща е използван. Моля въведете друг адрес." + +#: forms.py:149 +msgid "Registration using free email addresses is prohibited. Please supply a different email address." +msgstr "Регистрациите с безплатни адреси е забранен. Моля въведете различен адрес за електронна поща" + +#: models.py:188 +msgid "user" +msgstr "Потребител" + +#: models.py:189 +msgid "activation key" +msgstr "Ключ за активация" + +#: models.py:194 +msgid "registration profile" +msgstr "регистрационен профил" + +#: models.py:195 +msgid "registration profiles" +msgstr "регистрационни профили" + diff --git a/clinicaltrials/registration/locale/da/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/da/LC_MESSAGES/django.mo new file mode 100644 index 0000000..9478680 Binary files /dev/null and b/clinicaltrials/registration/locale/da/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/da/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/da/LC_MESSAGES/django.po new file mode 100644 index 0000000..7bb0ac8 --- /dev/null +++ b/clinicaltrials/registration/locale/da/LC_MESSAGES/django.po @@ -0,0 +1,92 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Rune Bromer <[email protected]>, 2007-2009. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: django-registration 0.8 \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: Rune Bromer <[email protected]>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:23 +msgid "Activate users" +msgstr "Aktiver brugere" + +#: admin.py:43 +msgid "Re-send activation emails" +msgstr "Gensend aktiveringsemails" + +#: forms.py:35 +msgid "Username" +msgstr "Brugernavn" + +#: forms.py:36 +msgid "This value must contain only letters, numbers and underscores." +msgstr "V¾rdien mŒ kun indeholde bogstaver, tal og underscore." + +#: forms.py:39 +msgid "Email address" +msgstr "E-mailadresse" + +#: forms.py:41 +msgid "Password" +msgstr "Password" + +#: forms.py:43 +msgid "Password (again)" +msgstr "Password (gentag)" + +#: forms.py:55 +msgid "A user with that username already exists." +msgstr "Der findes allerede en bruger med dette brugernavn." + +#: forms.py:67 +msgid "The two password fields didn't match." +msgstr "De 2 passwordfelter er ikke ens." + +#: forms.py:78 +msgid "I have read and agree to the Terms of Service" +msgstr "I har l¾st og accepterer betingelserne." + +#: forms.py:79 +msgid "You must agree to the terms to register" +msgstr "Du skal acceptere betingelserne for at registere" + +#: forms.py:95 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "" +"Denne emailadresse er allerede i brug. Benyt venligst en anden. " + +#: forms.py:122 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "" +"Registrering med gratis emailadresser er ikke muligt. V¾lg venligst en " +"anden emailadresse" + +#: models.py:165 +msgid "user" +msgstr "bruger" + +#: models.py:166 +msgid "activation key" +msgstr "Aktiveringsn¿gle" + +#: models.py:171 +msgid "registration profile" +msgstr "Registreringsprofil" + +#: models.py:172 +msgid "registration profiles" +msgstr "Registreringprofiler" diff --git a/clinicaltrials/registration/locale/de/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/de/LC_MESSAGES/django.mo new file mode 100644 index 0000000..b272d44 Binary files /dev/null and b/clinicaltrials/registration/locale/de/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/de/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/de/LC_MESSAGES/django.po new file mode 100644 index 0000000..b1e44f4 --- /dev/null +++ b/clinicaltrials/registration/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,93 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Jannis Leidel <[email protected]>, 2007-2009. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: django-registration 0.8 \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-10-18 21:32+0200\n" +"PO-Revision-Date: 2007-09-29 16:50+0200\n" +"Last-Translator: Jannis Leidel <[email protected]>\n" +"Language-Team: Deutsch <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:23 +msgid "Activate users" +msgstr "Benutzer aktivieren" + +#: admin.py:43 +msgid "Re-send activation emails" +msgstr "Aktivierungs-E-Mail erneut senden" + +#: forms.py:35 +msgid "Username" +msgstr "Benutzername" + +#: forms.py:36 +msgid "This value must contain only letters, numbers and underscores." +msgstr "Dieser Wert darf nur Buchstaben, Ziffern und Unterstriche enthalten." + +#: forms.py:39 +msgid "Email address" +msgstr "E-Mail-Adresse" + +#: forms.py:41 +msgid "Password" +msgstr "Passwort" + +#: forms.py:43 +msgid "Password (again)" +msgstr "Passwort (wiederholen)" + +#: forms.py:55 +msgid "A user with that username already exists." +msgstr "Dieser Benutzername ist bereits vergeben." + +#: forms.py:67 +msgid "The two password fields didn't match." +msgstr "Die beiden Passwörter sind nicht identisch." + +#: forms.py:78 +msgid "I have read and agree to the Terms of Service" +msgstr "Ich habe die Nutzungsvereinbarung gelesen und stimme ihr zu" + +#: forms.py:79 +msgid "You must agree to the terms to register" +msgstr "Sie müssen der Nutzungsvereinbarung zustimmen, um sich zu registrieren" + +#: forms.py:95 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "" +"Diese E-Mail-Adresse wird schon genutzt. Bitte geben Sie eine andere E-Mail-" +"Adresse an." + +#: forms.py:122 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "" +"Die Registrierung mit einer kostenlosen E-Mail-Adresse ist untersagt. Bitte " +"geben Sie eine andere E-Mail-Adresse an." + +#: models.py:165 +msgid "user" +msgstr "Benutzer" + +#: models.py:166 +msgid "activation key" +msgstr "Aktivierungsschlüssel" + +#: models.py:171 +msgid "registration profile" +msgstr "Registrierungsprofil" + +#: models.py:172 +msgid "registration profiles" +msgstr "Registrierungsprofile" diff --git a/clinicaltrials/registration/locale/el/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/el/LC_MESSAGES/django.mo new file mode 100644 index 0000000..acc9726 Binary files /dev/null and b/clinicaltrials/registration/locale/el/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/el/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/el/LC_MESSAGES/django.po new file mode 100644 index 0000000..cd38eb1 --- /dev/null +++ b/clinicaltrials/registration/locale/el/LC_MESSAGES/django.po @@ -0,0 +1,84 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Panos Laganakos <[email protected]>, 2007. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: 2007-11-14 21:50+0200\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "όνομα χρήστη" + +#: forms.py:41 +msgid "email address" +msgstr "διεύθυνση ηλεκτρονικού ταχυδρομείου" + +#: forms.py:43 +msgid "password" +msgstr "συνθηματικό" + +#: forms.py:45 +msgid "password (again)" +msgstr "συνθηματικό (ξανά)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "Τα ονόματα χρηστών μπορούν να περιλαμβάνουν μόνο γράμματα, αριθμούς και υπογραμμίσεις" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Αυτό το όνομα χρήστη χρησιμοποίειται ήδη. Παρακαλώ διαλέξτε ένα άλλο." + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "Πρέπει να εισάγετε το ίδιο συνθηματικό κάθε φορά" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "Διάβασα και συμφωνώ με τους Όρους της Υπηρεσίας" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "Πρέπει να συμφωνείται με τους όρους για να εγγραφείτε" + +#: forms.py:124 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "" +"Η συγκεκριμένη διεύθυνση ηλεκτρονικού ταχυδρομείου χρησιμοποιείται ήδη. " +"Παρακαλώ δώστε κάποια άλλη." + +#: forms.py:149 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "" +"Η εγγραφή μέσω δωρεάν διευθύνσεων ηλεκτρονικού ταχυδρομείου απαγορεύεται. ""Παρακαλώ δώστε κάποια άλλη." + +#: models.py:188 +msgid "user" +msgstr "χρήστης" + +#: models.py:189 +msgid "activation key" +msgstr "κλειδί ενεργοποίησης" + +#: models.py:194 +msgid "registration profile" +msgstr "προφίλ εγγραφής" + +#: models.py:195 +msgid "registration profiles" +msgstr "προφίλ εγγραφών" diff --git a/clinicaltrials/registration/locale/en/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/en/LC_MESSAGES/django.mo new file mode 100644 index 0000000..87b6226 Binary files /dev/null and b/clinicaltrials/registration/locale/en/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/en/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/en/LC_MESSAGES/django.po new file mode 100644 index 0000000..e357a4c --- /dev/null +++ b/clinicaltrials/registration/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,89 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-10-12 14:09-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:23 +msgid "Activate users" +msgstr "" + +#: admin.py:43 +msgid "Re-send activation emails" +msgstr "" + +#: forms.py:35 +msgid "username" +msgstr "" + +#: forms.py:36 +msgid "This value must contain only letters, numbers and underscores." +msgstr "" + +#: forms.py:39 +msgid "Email address" +msgstr "" + +#: forms.py:41 +msgid "Password" +msgstr "" + +#: forms.py:43 +msgid "Password (again)" +msgstr "" + +#: forms.py:55 +msgid "A user with that username already exists." +msgstr "" + +#: forms.py:67 +msgid "The two password fields didn't match." +msgstr "" + +#: forms.py:78 +msgid "I have read and agree to the Terms of Service" +msgstr "" + +#: forms.py:79 +msgid "You must agree to the terms to register" +msgstr "" + +#: forms.py:95 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "" + +#: forms.py:122 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "" + +#: models.py:165 +msgid "user" +msgstr "" + +#: models.py:166 +msgid "activation key" +msgstr "" + +#: models.py:171 +msgid "registration profile" +msgstr "" + +#: models.py:172 +msgid "registration profiles" +msgstr "" diff --git a/clinicaltrials/registration/locale/es/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/es/LC_MESSAGES/django.mo new file mode 100644 index 0000000..3872adf Binary files /dev/null and b/clinicaltrials/registration/locale/es/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/es/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/es/LC_MESSAGES/django.po new file mode 100644 index 0000000..ba0384f --- /dev/null +++ b/clinicaltrials/registration/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,85 @@ +# Spanish translation for django-registration. +# Copyright (C) 2007, James Bennet +# This file is distributed under the same license as the registration package. +# Ernesto Rico Schmidt <[email protected]>, 2008. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: django-registration 0.3 \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-03-11 00:19-0400\n" +"PO-Revision-Date: 2008-03-11 00:19-0400\n" +"Last-Translator: Ernesto Rico Schmidt <[email protected]>\n" +"Language-Team: Español <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "nombre de usuario" + +#: forms.py:41 +msgid "email address" +msgstr "dirección de coreo electrónico" + +#: forms.py:43 +msgid "password" +msgstr "contraseña" + +#: forms.py:45 +msgid "password (again)" +msgstr "contraseña (otra vez)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "Los nombres de usuarios sólo pueden contener letras, números y guiones bajos" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Este nombre de usuario ya está ocupado. Por favor escoge otro" + +#: forms.py:71 +msgid "You must type the same password each time" +msgstr "Tienes que introducir la misma contraseña cada vez" + +#: forms.py:100 +msgid "I have read and agree to the Terms of Service" +msgstr "He leído y acepto los términos de servicio" + +#: forms.py:109 +msgid "You must agree to the terms to register" +msgstr "Tienes que aceptar los términos para registrarte" + +#: forms.py:128 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "" +"La dirección de correo electrónico ya está siendo usada. Por favor" +"proporciona otra dirección." + +#: forms.py:153 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "" +"El registro usando una dirección de correo electrónico gratis está prohibido." +"Por favor proporciona otra dirección." + +#: models.py:188 +msgid "user" +msgstr "usuario" + +#: models.py:189 +msgid "activation key" +msgstr "clave de activación" + +#: models.py:194 +msgid "registration profile" +msgstr "perfil de registro" + +#: models.py:195 +msgid "registration profiles" +msgstr "perfiles de registro" diff --git a/clinicaltrials/registration/locale/es_AR/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/es_AR/LC_MESSAGES/django.mo new file mode 100644 index 0000000..ce8b4e5 Binary files /dev/null and b/clinicaltrials/registration/locale/es_AR/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/es_AR/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/es_AR/LC_MESSAGES/django.po new file mode 100644 index 0000000..fb746b5 --- /dev/null +++ b/clinicaltrials/registration/locale/es_AR/LC_MESSAGES/django.po @@ -0,0 +1,83 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2008 Leonardo Manuel Rocha +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <l e o m a r o at g m a i l dot c o m>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "nombre de usuario" + +#: forms.py:41 +msgid "email address" +msgstr "dirección de e-mail" + +#: forms.py:43 +msgid "password" +msgstr "contraseña" + +#: forms.py:45 +msgid "password (again)" +msgstr "contraseña (nuevamente)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "El nombre de usuario solo puede contener letras, números y guiones bajos" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Ese nombre de usuario ya está asignado. Por favor elija otro." + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "Debe tipear la misma contraseña cada vez" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "He leído y estoy de acuerdo con las Condiciones de Servicio" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "Debe estar de acuerdo con las Condiciones para poder registrarse" + +#: forms.py:124 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "Esa dirección de e-mail ya está en uso. Por favor provea otra " +"dirección." + +#: forms.py:149 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "La registración con un e-mail gratuito está prohibida. Por favor " +"de una dirección de e-mail diferente." + +#: models.py:188 +msgid "user" +msgstr "usuario" + +#: models.py:189 +msgid "activation key" +msgstr "clave de activación" + +#: models.py:194 +msgid "registration profile" +msgstr "perfil de registro" + +#: models.py:195 +msgid "registration profiles" +msgstr "perfiles de registro" diff --git a/clinicaltrials/registration/locale/fr/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/fr/LC_MESSAGES/django.mo new file mode 100644 index 0000000..f8911c7 Binary files /dev/null and b/clinicaltrials/registration/locale/fr/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/fr/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 0000000..34b520b --- /dev/null +++ b/clinicaltrials/registration/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,81 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Samuel Adam <[email protected]>, 2007. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: django-registration 0.3 \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: 2007-09-20 10:30+0100\n" +"Last-Translator: Samuel Adam <[email protected]>\n" +"Language-Team: Français <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "pseudo" + +#: forms.py:41 +msgid "email address" +msgstr "adresse email" + +#: forms.py:43 +msgid "password" +msgstr "mot de passe" + +#: forms.py:45 +msgid "password (again)" +msgstr "mot de passe (vérification)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "Le pseudo ne peut contenir que des lettres, chiffres et le caractère souligné." + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Ce pseudo est déjà utilisé. Veuillez en choisir un autre." + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "Veuillez indiquer le même mot de passe dans les deux champs" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "J'ai lu et accepté les Conditions Générales d'Utilisation" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "Vous devez accepter les conditions d'utilisation pour vous inscrire" + +#: forms.py:124 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "Cette adresse email est déjà utilisée. Veuillez en indiquer une autre." + +#: forms.py:149 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "L'inscription avec une adresse email d'un compte gratuit est interdite. Veuillez en indiquer une autre." + +#: models.py:188 +msgid "user" +msgstr "utilisateur" + +#: models.py:189 +msgid "activation key" +msgstr "clé d'activation" + +#: models.py:194 +msgid "registration profile" +msgstr "profil d'inscription" + +#: models.py:195 +msgid "registration profiles" +msgstr "profils d'inscription" diff --git a/clinicaltrials/registration/locale/he/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/he/LC_MESSAGES/django.mo new file mode 100644 index 0000000..be93650 Binary files /dev/null and b/clinicaltrials/registration/locale/he/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/he/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/he/LC_MESSAGES/django.po new file mode 100644 index 0000000..5567e08 --- /dev/null +++ b/clinicaltrials/registration/locale/he/LC_MESSAGES/django.po @@ -0,0 +1,86 @@ +# translation of registration. +# Copyright (C) 2008 THE registration'S COPYRIGHT HOLDER +# This file is distributed under the same license as the registration package. +# <>, 2008. +# , fuzzy +# <>, 2008. +# +# +msgid "" +msgstr "" +"Project-Id-Version: registration\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-02-10 02:01+0200\n" +"PO-Revision-Date: 2008-02-10 02:05+0200\n" +"Last-Translator: Meir Kriheli <[email protected]>\n" +"Language-Team: Hebrew\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit" + +#: forms.py:38 +msgid "username" +msgstr "שם משתמש" + +#: forms.py:41 +msgid "email address" +msgstr "דואר אלקטרוני" + +#: forms.py:43 +msgid "password" +msgstr "סיסמה" + +#: forms.py:45 +msgid "password (again)" +msgstr "סיסמה (שוב)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "שמות משתמש יכולים להכיל רק אותיות, ספרות וקווים תחתונים" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "שם המשתמש תפוס כבר. נא לבחור אחר." + +#: forms.py:64 +msgid "You must type the same password each time" +msgstr "יש להקליד את אותה הסיסמה פעמיים" + +#: forms.py:93 +msgid "I have read and agree to the Terms of Service" +msgstr "קראתי והסכמתי לתנאי השימוש" + +#: forms.py:102 +msgid "You must agree to the terms to register" +msgstr "עליך להסכים לתנאי השימוש" + +#: forms.py:121 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "" +"כתובת הדואר האלקטרוני תפוסה כבר. נא לספק כתובת דואר אחרת." + +#: forms.py:146 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "" +"הרישום בעזרת תיבת דואר אלקטרוני חינמית אסור. נא לספק כתובת אחרת." + +#: models.py:188 +msgid "user" +msgstr "משתמש" + +#: models.py:189 +msgid "activation key" +msgstr "מפתח הפעלה" + +#: models.py:194 +msgid "registration profile" +msgstr "פרופיל רישום" + +#: models.py:195 +msgid "registration profiles" +msgstr "פרופילי רישום" + diff --git a/clinicaltrials/registration/locale/is/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/is/LC_MESSAGES/django.mo new file mode 100644 index 0000000..bccb71f Binary files /dev/null and b/clinicaltrials/registration/locale/is/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/is/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/is/LC_MESSAGES/django.po new file mode 100644 index 0000000..479e792 --- /dev/null +++ b/clinicaltrials/registration/locale/is/LC_MESSAGES/django.po @@ -0,0 +1,74 @@ +# Icelandic translation of django-registration +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the django-registration +# package. +# Björn Kristinsson <[email protected]>, 2009. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-01-22 12:49+0100\n" +"PO-Revision-Date: 2009-01-22 12:49+0100\n" +"Last-Translator: Björn Kristinsson <[email protected]>\n" +"Language-Team: Icelandic\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:36 +msgid "username" +msgstr "notandanafn" + +#: forms.py:39 +msgid "email address" +msgstr "netfang" + +#: forms.py:41 +msgid "password" +msgstr "lykilorð" + +#: forms.py:43 +msgid "password (again)" +msgstr "lykilorð (aftur)" + +#: forms.py:55 +msgid "This username is already taken. Please choose another." +msgstr "Þetta notendanafn er þegar á skrá. Vinsamlega reyndu annað." + +#: forms.py:67 +msgid "You must type the same password each time" +msgstr "Lykilorðin verða að vera eins " + +#: forms.py:90 +msgid "I have read and agree to the Terms of Service" +msgstr "Ég hef lesið og samþykki skilmálana" + +#: forms.py:107 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "Þetta netfang er þegar á skrá. Vinsamlegast notaðu annað netfang." + +#: forms.py:133 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "Óheimilt er að nota ókeypis netföng. Vinsamlegast notaðu annað netfang." + +#: models.py:218 +msgid "user" +msgstr "notandi" + +#: models.py:219 +msgid "activation key" +msgstr "einkennislykill" + +#: models.py:224 +msgid "registration profile" +msgstr "skráningarprófíll" + +#: models.py:225 +msgid "registration profiles" +msgstr "skráningarprófílar" diff --git a/clinicaltrials/registration/locale/it/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/it/LC_MESSAGES/django.mo new file mode 100644 index 0000000..83ec9dd Binary files /dev/null and b/clinicaltrials/registration/locale/it/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/it/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/it/LC_MESSAGES/django.po new file mode 100644 index 0000000..00129b0 --- /dev/null +++ b/clinicaltrials/registration/locale/it/LC_MESSAGES/django.po @@ -0,0 +1,82 @@ +# translation of django.po to Italiano +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Nicola Larosa <[email protected]>, 2008. +msgid "" +msgstr "" +"Project-Id-Version: django\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: 2008-05-27 15:05+0200\n" +"Last-Translator: Nicola Larosa <[email protected]>\n" +"Language-Team: Italiano\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: forms.py:38 +msgid "username" +msgstr "nome utente" + +#: forms.py:41 +msgid "email address" +msgstr "indirizzo email" + +#: forms.py:43 +msgid "password" +msgstr "password" + +#: forms.py:45 +msgid "password (again)" +msgstr "password (di nuovo)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "I nomi utente possono contenere solo lettere, numeri e sottolineature" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Questo nome utente è già usato. Scegline un altro." + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "Bisogna inserire la stessa password ogni volta" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "Dichiaro di aver letto e di approvare le Condizioni di Servizio" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "Per registrarsi bisogna approvare le condizioni" + +#: forms.py:124 +msgid "This email address is already in use. Please supply a different email " +"address." +msgstr "Questo indirizzo email è già in uso. Inserisci un altro indirizzo email." + +#: forms.py:149 +msgid "Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "La registrazione con indirizzi email gratis non è permessa. " +"Inserisci un altro indirizzo email." + +#: models.py:188 +msgid "user" +msgstr "utente" + +#: models.py:189 +msgid "activation key" +msgstr "chiave di attivazione" + +#: models.py:194 +msgid "registration profile" +msgstr "profilo di registrazione" + +#: models.py:195 +msgid "registration profiles" +msgstr "profili di registrazione" + diff --git a/clinicaltrials/registration/locale/ja/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/ja/LC_MESSAGES/django.mo new file mode 100644 index 0000000..e0332b0 Binary files /dev/null and b/clinicaltrials/registration/locale/ja/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/ja/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/ja/LC_MESSAGES/django.po new file mode 100644 index 0000000..afaaf94 --- /dev/null +++ b/clinicaltrials/registration/locale/ja/LC_MESSAGES/django.po @@ -0,0 +1,78 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Shinya Okano <[email protected]>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: django-registration 0.4 \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: 2008-01-31 10:20+0900\n" +"Last-Translator: Shinya Okano <[email protected]>\n" +"Language-Team: Japanese <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "ユーザ名" + +#: forms.py:41 +msgid "email address" +msgstr "メールアドレス" + +#: forms.py:43 +msgid "password" +msgstr "パスワード" + +#: forms.py:45 +msgid "password (again)" +msgstr "パスワード (確認)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "ユーザ名には半角英数とアンダースコアのみが使用できます。" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "このユーザ名は既に使用されています。他のユーザ名を指定してください。" + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "同じパスワードを入力する必要があります。" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "サービス利用規約を読み、同意します。" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "登録するためには規約に同意する必要があります。" + +#: forms.py:124 +msgid "This email address is already in use. Please supply a different email address." +msgstr "このメールアドレスは既に使用されています。他のメールアドレスを指定して下さい。" + +#: forms.py:149 +msgid "Registration using free email addresses is prohibited. Please supply a different email address." +msgstr "自由なメールアドレスを使用した登録は禁止されています。他のメールアドレスを指定してください。" + +#: models.py:188 +msgid "user" +msgstr "ユーザ" + +#: models.py:189 +msgid "activation key" +msgstr "アクティベーションキー" + +#: models.py:194 +msgid "registration profile" +msgstr "登録プロファイル" + +#: models.py:195 +msgid "registration profiles" +msgstr "登録プロファイル" + diff --git a/clinicaltrials/registration/locale/ko/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/ko/LC_MESSAGES/django.mo new file mode 100644 index 0000000..a29c7c3 Binary files /dev/null and b/clinicaltrials/registration/locale/ko/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/ko/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/ko/LC_MESSAGES/django.po new file mode 100644 index 0000000..d466420 --- /dev/null +++ b/clinicaltrials/registration/locale/ko/LC_MESSAGES/django.po @@ -0,0 +1,89 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Young Gyu Park <[email protected]>, 2009. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-10-12 14:09-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Young Gyu Park <[email protected]>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:23 +msgid "Activate users" +msgstr "활동 사용자" + +#: admin.py:43 +msgid "Re-send activation emails" +msgstr "이 메일 제 전송" + +#: forms.py:35 +msgid "username" +msgstr "사용자 아이디" + +#: forms.py:36 +msgid "This value must contain only letters, numbers and underscores." +msgstr "이 곳에는 숫자, _, 영문 글자만 가능합니다." + +#: forms.py:39 +msgid "Email address" +msgstr "이메일 주소" + +#: forms.py:41 +msgid "Password" +msgstr "사용자 패스워드" + +#: forms.py:43 +msgid "Password (again)" +msgstr "패스워드 (재입력)" + +#: forms.py:55 +msgid "A user with that username already exists." +msgstr "이미 같은 아이디로 사용자가 등록되어 있습니다." + +#: forms.py:67 +msgid "The two password fields didn't match." +msgstr "패스워드가 서로 일치하지 않습니다." + +#: forms.py:78 +msgid "I have read and agree to the Terms of Service" +msgstr "약관을 읽었고 ê·¸ 내용에 동의합니다." + +#: forms.py:79 +msgid "You must agree to the terms to register" +msgstr "약관에 동의 하셔야만 합니다." + +#: forms.py:95 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "이메일이 이미 사용중입니다. 다른 이메일을 등록해 주세요." + +#: forms.py:122 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "무료 이메일 계정으로 등록하실 수 없습니다. 다른 이메일을 등록해 주세요" + +#: models.py:165 +msgid "user" +msgstr "사용자" + +#: models.py:166 +msgid "activation key" +msgstr "활성화 키" + +#: models.py:171 +msgid "registration profile" +msgstr "등록 프로파일" + +#: models.py:172 +msgid "registration profiles" +msgstr "등록 프로파일" diff --git a/clinicaltrials/registration/locale/nl/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/nl/LC_MESSAGES/django.mo new file mode 100644 index 0000000..9e84eb3 Binary files /dev/null and b/clinicaltrials/registration/locale/nl/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/nl/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/nl/LC_MESSAGES/django.po new file mode 100644 index 0000000..03cb2e5 --- /dev/null +++ b/clinicaltrials/registration/locale/nl/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: registration\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-08-14 13:25+0200\n" +"PO-Revision-Date: 2008-08-14 13:25+0200\n" +"Last-Translator: Joost Cassee <[email protected]>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: forms.py:38 +msgid "username" +msgstr "gebruikersnaam" + +#: forms.py:41 +msgid "email address" +msgstr "e-mail adres" + +#: forms.py:43 +msgid "password" +msgstr "wachtwoord" + +#: forms.py:45 +msgid "password (again)" +msgstr "wachtwoord (opnieuw)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "Gebruikersnamen kunnen alleen letters, nummer en liggende streepjes bevatten." + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Deze gebruikersnaam is reeds in gebruik. Kiest u alstublieft een andere gebruikersnaam." + +#: forms.py:71 +msgid "You must type the same password each time" +msgstr "U moet twee maal hetzelfde wachtwoord typen." + +#: forms.py:100 +msgid "I have read and agree to the Terms of Service" +msgstr "Ik heb de servicevoorwaarden gelezen en ga akkoord." + +#: forms.py:109 +msgid "You must agree to the terms to register" +msgstr "U moet akkoord gaan met de servicevoorwaarden om u te registreren." + +#: forms.py:125 +msgid "This email address is already in use. Please supply a different email address." +msgstr "Dit e-mail adres is reeds in gebruik. Kiest u alstublieft een ander e-mail adres." + +#: forms.py:151 +msgid "Registration using free email addresses is prohibited. Please supply a different email address." +msgstr "U kunt u niet registreren met een gratis e-mail adres. Kiest u alstublieft een ander e-mail adres." + +#: models.py:191 +msgid "user" +msgstr "gebruiker" + +#: models.py:192 +msgid "activation key" +msgstr "activatiecode" + +#: models.py:197 +msgid "registration profile" +msgstr "registratieprofiel" + +#: models.py:198 +msgid "registration profiles" +msgstr "registratieprofielen" diff --git a/clinicaltrials/registration/locale/pl/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 0000000..1f2a228 Binary files /dev/null and b/clinicaltrials/registration/locale/pl/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/pl/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000..498fd5b --- /dev/null +++ b/clinicaltrials/registration/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,84 @@ +# Polish translation for django-registration. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the django-registration package. +# Jarek Zgoda <[email protected]>, 2007. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 0.4\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: 2007-12-15 12:45+0100\n" +"Last-Translator: Jarek Zgoda <[email protected]>\n" +"Language-Team: Polish <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "nazwa użytkownika" + +#: forms.py:41 +msgid "email address" +msgstr "adres email" + +#: forms.py:43 +msgid "password" +msgstr "hasło" + +#: forms.py:45 +msgid "password (again)" +msgstr "hasło (ponownie)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "" +"Nazwa użytkownika może zawierać tylko litery, cyfry i znaki podkreślenia" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Ta nazwa użytkownika jest już zajęta. Wybierz inną." + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "Musisz wpisać to samo hasło w obu polach" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "Przeczytałem regulamin i akceptuję go" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "Musisz zaakceptować regulamin, aby się zarejestrować" + +#: forms.py:124 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "Ten adres email jest już używany. Użyj innego adresu email." + +#: forms.py:149 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "" +"Nie ma możliwości rejestracji przy użyciu darmowego adresu email. Użyj " +"innego adresu email." + +#: models.py:188 +msgid "user" +msgstr "użytkownik" + +#: models.py:189 +msgid "activation key" +msgstr "klucz aktywacyjny" + +#: models.py:194 +msgid "registration profile" +msgstr "profil rejestracji" + +#: models.py:195 +msgid "registration profiles" +msgstr "profile rejestracji" diff --git a/clinicaltrials/registration/locale/pt_BR/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/pt_BR/LC_MESSAGES/django.mo new file mode 100644 index 0000000..e81b620 Binary files /dev/null and b/clinicaltrials/registration/locale/pt_BR/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/pt_BR/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/pt_BR/LC_MESSAGES/django.po new file mode 100644 index 0000000..9e8addb --- /dev/null +++ b/clinicaltrials/registration/locale/pt_BR/LC_MESSAGES/django.po @@ -0,0 +1,81 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "usuário" + +#: forms.py:41 +msgid "email address" +msgstr "endereço de email" + +#: forms.py:43 +msgid "password" +msgstr "" + +#: forms.py:45 +msgid "password (again)" +msgstr "senha (novamente)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "Nomes de usuário apenas podem conter letras, números, e underscore" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Este nome de usuário já existe. Por favor, escolha outro." + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "Você deve escrever a mesma senha nos dois campos" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "Eu lí e concordo com os Termos de Uso do serviço" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "Você deve concordar com os termos para registrar-se" + +#: forms.py:124 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "Este endereço de email já está em uso. Por favor, informe um endereço de email diferente." + +#: forms.py:149 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "Registrar-se com contas de email gratuitos está proibido. Por favor, informe um endereço de email diferente." + +#: models.py:188 +msgid "user" +msgstr "usuário" + +#: models.py:189 +msgid "activation key" +msgstr "chave de ativação" + +#: models.py:194 +msgid "registration profile" +msgstr "profile de registro" + +#: models.py:195 +msgid "registration profiles" +msgstr "profiles de registro" diff --git a/clinicaltrials/registration/locale/ru/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/ru/LC_MESSAGES/django.mo new file mode 100644 index 0000000..1635b4e Binary files /dev/null and b/clinicaltrials/registration/locale/ru/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/ru/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 0000000..072e146 --- /dev/null +++ b/clinicaltrials/registration/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,92 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-10-21 20:12+0600\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: admin.py:23 +msgid "Activate users" +msgstr "Активировать учетные записи" + +#: admin.py:43 +msgid "Re-send activation emails" +msgstr "Выслать ключи активации заново" + +#: forms.py:35 +msgid "Username" +msgstr "Имя пользователя" + +#: forms.py:36 +msgid "This value must contain only letters, numbers and underscores." +msgstr "Это поле может содержать только буквы, цифры и подчеркивания" + +#: forms.py:39 +msgid "Email address" +msgstr "Адрес электронной почты" + +#: forms.py:41 +msgid "Password" +msgstr "Пароль" + +#: forms.py:43 +msgid "Password (again)" +msgstr "Пароль (снова)" + +#: forms.py:55 +msgid "A user with that username already exists." +msgstr "Пользователь с таким именем уже существует." + +#: forms.py:67 +msgid "The two password fields didn't match." +msgstr "Введенные пароли не совпадают." + +#: forms.py:78 +msgid "I have read and agree to the Terms of Service" +msgstr "Я прочитал Правила Использования и согласен с ними" + +#: forms.py:79 +msgid "You must agree to the terms to register" +msgstr "Для регистрации Вы должны согласиться с Правилами" + +#: forms.py:95 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "" +"Этот адрес электронной почты уже используется. Пожалуйста, введите другой " +"адрес." + +#: forms.py:122 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "" +"Регистрация с использованием свободных почтовых серверов запрещена. " +"Пожалуйста, введите другой адрес электронной почты." + +#: models.py:165 +msgid "user" +msgstr "пользователь" + +#: models.py:166 +msgid "activation key" +msgstr "ключ активации" + +#: models.py:171 +msgid "registration profile" +msgstr "карточка регистрации" + +#: models.py:172 +msgid "registration profiles" +msgstr "карточки регистрации" diff --git a/clinicaltrials/registration/locale/sl/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/sl/LC_MESSAGES/django.mo new file mode 100644 index 0000000..036163f Binary files /dev/null and b/clinicaltrials/registration/locale/sl/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/sl/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/sl/LC_MESSAGES/django.po new file mode 100644 index 0000000..c587c70 --- /dev/null +++ b/clinicaltrials/registration/locale/sl/LC_MESSAGES/django.po @@ -0,0 +1,87 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: 0.8.1beta\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-10-12 14:09-0500\n" +"PO-Revision-Date: 2009-10-23 15:49+0100\n" +"Last-Translator: Domen Kožar <[email protected]>\n" +"Language-Team: Slovenian <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Slovenian\n" +"X-Poedit-Country: SLOVENIA\n" + +#: admin.py:23 +msgid "Activate users" +msgstr "Aktiviraj uporabnike" + +#: admin.py:43 +msgid "Re-send activation emails" +msgstr "Ponovno poÅ¡lju aktivacijske emaile" + +#: forms.py:35 +msgid "username" +msgstr "uporabniÅ¡ko ime" + +#: forms.py:36 +msgid "This value must contain only letters, numbers and underscores." +msgstr "Vrednost lahko vsebuje samo črke, cifre in podčrtaje." + +#: forms.py:39 +msgid "Email address" +msgstr "Elektronska poÅ¡ta" + +#: forms.py:41 +msgid "Password" +msgstr "Geslo" + +#: forms.py:43 +msgid "Password (again)" +msgstr "Geslo (ponovno)" + +#: forms.py:55 +msgid "A user with that username already exists." +msgstr "Uporabnik z tem uporabniÅ¡kim imenom že obstaja." + +#: forms.py:67 +msgid "The two password fields didn't match." +msgstr "Polji z gesli se ne ujemata." + +#: forms.py:78 +msgid "I have read and agree to the Terms of Service" +msgstr "Strinjam se z pogoji uporable" + +#: forms.py:79 +msgid "You must agree to the terms to register" +msgstr "Za registracijo se morate strinjati z pogoji uporabe" + +#: forms.py:95 +msgid "This email address is already in use. Please supply a different email address." +msgstr "Email je že v uporabi, prosimo vnesite drugega." + +#: forms.py:122 +msgid "Registration using free email addresses is prohibited. Please supply a different email address." +msgstr "Registracija ni mogoča z brezplačnimi email naslovi. Prosimo vnesite drug email naslov." + +#: models.py:165 +msgid "user" +msgstr "Uporabnik" + +#: models.py:166 +msgid "activation key" +msgstr "Aktivacijski ključ" + +#: models.py:171 +msgid "registration profile" +msgstr "Registracijski profil" + +#: models.py:172 +msgid "registration profiles" +msgstr "Registracijski profili" + diff --git a/clinicaltrials/registration/locale/sr/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/sr/LC_MESSAGES/django.mo new file mode 100644 index 0000000..1699326 Binary files /dev/null and b/clinicaltrials/registration/locale/sr/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/sr/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/sr/LC_MESSAGES/django.po new file mode 100644 index 0000000..4fa699c --- /dev/null +++ b/clinicaltrials/registration/locale/sr/LC_MESSAGES/django.po @@ -0,0 +1,80 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: django-registration trunk\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-04-05 13:51+0200\n" +"PO-Revision-Date: 2008-04-05 14:00+0100\n" +"Last-Translator: Nebojsa Djordjevic <[email protected]>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Poedit-Language: Serbian\n" +"X-Poedit-Country: YUGOSLAVIA\n" + +#: forms.py:38 +msgid "username" +msgstr "korisničko ime" + +#: forms.py:41 +msgid "email address" +msgstr "email adresa" + +#: forms.py:43 +msgid "password" +msgstr "Å¡ifra" + +#: forms.py:45 +msgid "password (again)" +msgstr "Å¡ifra (ponovo)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "Korisničko ime može da se sastoji samo od slova, brojeva i donje crte (\"_\")" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Korisničko ime je već zauzeto. Izaberite drugo." + +#: forms.py:71 +msgid "You must type the same password each time" +msgstr "Unete Å¡ifre se ne slažu" + +#: forms.py:100 +msgid "I have read and agree to the Terms of Service" +msgstr "Pročitao sam i slažem se sa uslovima korišćenja" + +#: forms.py:109 +msgid "You must agree to the terms to register" +msgstr "Morate se složiti sa uslovima korišćenja da bi ste se registrovali" + +#: forms.py:128 +msgid "This email address is already in use. Please supply a different email address." +msgstr "Ova e-mail adresa je već u upotrebi. Morate koristiti drugu e-mail adresu." + +#: forms.py:153 +msgid "Registration using free email addresses is prohibited. Please supply a different email address." +msgstr "Registracija korišćenjem besplatnig e-mail adresa je zabranjena. Morate uneti drugu e-mail adresu." + +#: models.py:188 +msgid "user" +msgstr "korisnik" + +#: models.py:189 +msgid "activation key" +msgstr "aktivacioni ključ" + +#: models.py:194 +msgid "registration profile" +msgstr "registracioni profil" + +#: models.py:195 +msgid "registration profiles" +msgstr "registracioni profili" + diff --git a/clinicaltrials/registration/locale/sv/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/sv/LC_MESSAGES/django.mo new file mode 100644 index 0000000..50eca67 Binary files /dev/null and b/clinicaltrials/registration/locale/sv/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/sv/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/sv/LC_MESSAGES/django.po new file mode 100644 index 0000000..dec76e2 --- /dev/null +++ b/clinicaltrials/registration/locale/sv/LC_MESSAGES/django.po @@ -0,0 +1,81 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-03-23 18:59+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Emil Stenström <[email protected]>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: .\forms.py:38 +msgid "username" +msgstr "Användarnamn" + +#: .\forms.py:41 +msgid "email address" +msgstr "E-postadress" + +#: .\forms.py:43 +msgid "password" +msgstr "Lösenord" + +#: .\forms.py:45 +msgid "password (again)" +msgstr "Lösenord (igen)" + +#: .\forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "Användarnamn fÃ¥r bara innehÃ¥lla bokstäver, siffror och understreck" + +#: .\forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "Det användarnamnet är upptaget. Prova ett annat." + +#: .\forms.py:71 +msgid "You must type the same password each time" +msgstr "BÃ¥da lösenord mÃ¥ste vara lika" + +#: .\forms.py:100 +msgid "I have read and agree to the Terms of Service" +msgstr "Jag har läst och accepterar avtalet" + +#: .\forms.py:109 +msgid "You must agree to the terms to register" +msgstr "Du mÃ¥ste acceptera avtalet för att registrera dig" + +#: .\forms.py:128 +msgid "" +"This email address is already in use. Please supply a different email " +"address." +msgstr "Den e-postadressen är upptagen, använd an annan adress." + +#: .\forms.py:153 +msgid "" +"Registration using free email addresses is prohibited. Please supply a " +"different email address." +msgstr "Gratis e-postadresser är inte tillÃ¥tna, använd en annan adress." + +#: .\models.py:188 +msgid "user" +msgstr "Användare" + +#: .\models.py:189 +msgid "activation key" +msgstr "Aktiveringsnyckel" + +#: .\models.py:194 +msgid "registration profile" +msgstr "Profil" + +#: .\models.py:195 +msgid "registration profiles" +msgstr "Profiler" diff --git a/clinicaltrials/registration/locale/zh_CN/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/zh_CN/LC_MESSAGES/django.mo new file mode 100644 index 0000000..ece5cc9 Binary files /dev/null and b/clinicaltrials/registration/locale/zh_CN/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/zh_CN/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/zh_CN/LC_MESSAGES/django.po new file mode 100644 index 0000000..7c609c3 --- /dev/null +++ b/clinicaltrials/registration/locale/zh_CN/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: 2008-03-20 23:22+0800\n" +"Last-Translator: hutuworm <[email protected]>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "用户名" + +#: forms.py:41 +msgid "email address" +msgstr "Email 地址" + +#: forms.py:43 +msgid "password" +msgstr "密码" + +#: forms.py:45 +msgid "password (again)" +msgstr "密码(重复)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "用户名只能包含字母、数字和下划线" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "该用户名已被占用,请另选一个。" + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "您必须输入两遍同样的密码" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "我已阅读并同意该服务条款" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "您必须同意注册条款" + +#: forms.py:124 +msgid "This email address is already in use. Please supply a different email address." +msgstr "该 Email 地址已有人使用,请提供一个另外的 Email 地址。" + +#: forms.py:149 +msgid "Registration using free email addresses is prohibited. Please supply a different email address." +msgstr "禁止使用免费 Email 地址注册,请提供一个另外的 Email 地址。" + +#: models.py:188 +msgid "user" +msgstr "用户" + +#: models.py:189 +msgid "activation key" +msgstr "激活密钥" + +#: models.py:194 +msgid "registration profile" +msgstr "注册信息" + +#: models.py:195 +msgid "registration profiles" +msgstr "注册信息" + diff --git a/clinicaltrials/registration/locale/zh_TW/LC_MESSAGES/django.mo b/clinicaltrials/registration/locale/zh_TW/LC_MESSAGES/django.mo new file mode 100644 index 0000000..24a3534 Binary files /dev/null and b/clinicaltrials/registration/locale/zh_TW/LC_MESSAGES/django.mo differ diff --git a/clinicaltrials/registration/locale/zh_TW/LC_MESSAGES/django.po b/clinicaltrials/registration/locale/zh_TW/LC_MESSAGES/django.po new file mode 100644 index 0000000..7cc090d --- /dev/null +++ b/clinicaltrials/registration/locale/zh_TW/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2007-09-19 19:30-0500\n" +"PO-Revision-Date: 2008-03-20 23:22+0800\n" +"Last-Translator: hutuworm <[email protected]>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:38 +msgid "username" +msgstr "用戶名" + +#: forms.py:41 +msgid "email address" +msgstr "Email 地址" + +#: forms.py:43 +msgid "password" +msgstr "密碼" + +#: forms.py:45 +msgid "password (again)" +msgstr "密碼(重復)" + +#: forms.py:54 +msgid "Usernames can only contain letters, numbers and underscores" +msgstr "用戶名只能包含字母、數字和下劃線" + +#: forms.py:59 +msgid "This username is already taken. Please choose another." +msgstr "該用戶名已被佔用,請另選一個。" + +#: forms.py:68 +msgid "You must type the same password each time" +msgstr "您必須輸入兩遍同樣的密碼" + +#: forms.py:96 +msgid "I have read and agree to the Terms of Service" +msgstr "我已閱讀並同意該服務條款" + +#: forms.py:105 +msgid "You must agree to the terms to register" +msgstr "您必須同意注冊條款" + +#: forms.py:124 +msgid "This email address is already in use. Please supply a different email address." +msgstr "該 Email 地址已有人使用,請提供一個另外的 Email 地址。" + +#: forms.py:149 +msgid "Registration using free email addresses is prohibited. Please supply a different email address." +msgstr "禁止使用免費 Email 地址注冊,請提供一個另外的 Email 地址。" + +#: models.py:188 +msgid "user" +msgstr "用戶" + +#: models.py:189 +msgid "activation key" +msgstr "激活密鑰" + +#: models.py:194 +msgid "registration profile" +msgstr "注冊信息" + +#: models.py:195 +msgid "registration profiles" +msgstr "注冊信息" + diff --git a/clinicaltrials/registration/management/__init__.py b/clinicaltrials/registration/management/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/clinicaltrials/registration/management/commands/__init__.py b/clinicaltrials/registration/management/commands/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/clinicaltrials/registration/management/commands/cleanupregistration.py b/clinicaltrials/registration/management/commands/cleanupregistration.py new file mode 100644 index 0000000..abec5ae --- /dev/null +++ b/clinicaltrials/registration/management/commands/cleanupregistration.py @@ -0,0 +1,19 @@ +""" +A management command which deletes expired accounts (e.g., +accounts which signed up but never activated) from the database. + +Calls ``RegistrationProfile.objects.delete_expired_users()``, which +contains the actual logic for determining which accounts are deleted. + +""" + +from django.core.management.base import NoArgsCommand + +from registration.models import RegistrationProfile + + +class Command(NoArgsCommand): + help = "Delete expired user registrations from the database" + + def handle_noargs(self, **options): + RegistrationProfile.objects.delete_expired_users() diff --git a/clinicaltrials/registration/models.py b/clinicaltrials/registration/models.py new file mode 100644 index 0000000..359454a --- /dev/null +++ b/clinicaltrials/registration/models.py @@ -0,0 +1,257 @@ +import datetime +import random +import re + +from django.conf import settings +from django.contrib.auth.models import User +from django.db import models +from django.db import transaction +from django.template.loader import render_to_string +from django.utils.hashcompat import sha_constructor +from django.utils.translation import ugettext_lazy as _ + + +SHA1_RE = re.compile('^[a-f0-9]{40}$') + + +class RegistrationManager(models.Manager): + """ + Custom manager for the ``RegistrationProfile`` model. + + The methods defined here provide shortcuts for account creation + and activation (including generation and emailing of activation + keys), and for cleaning out expired inactive accounts. + + """ + def activate_user(self, activation_key): + """ + Validate an activation key and activate the corresponding + ``User`` if valid. + + If the key is valid and has not expired, return the ``User`` + after activating. + + If the key is not valid or has expired, return ``False``. + + If the key is valid but the ``User`` is already active, + return ``False``. + + To prevent reactivation of an account which has been + deactivated by site administrators, the activation key is + reset to the string constant ``RegistrationProfile.ACTIVATED`` + after successful activation. + + """ + # Make sure the key we're trying conforms to the pattern of a + # SHA1 hash; if it doesn't, no point trying to look it up in + # the database. + if SHA1_RE.search(activation_key): + try: + profile = self.get(activation_key=activation_key) + except self.model.DoesNotExist: + return False + if not profile.activation_key_expired(): + user = profile.user + user.is_active = True + user.save() + profile.activation_key = self.model.ACTIVATED + profile.save() + return user + return False + + def create_inactive_user(self, username, email, password, + site, send_email=True): + """ + Create a new, inactive ``User``, generate a + ``RegistrationProfile`` and email its activation key to the + ``User``, returning the new ``User``. + + By default, an activation email will be sent to the new + user. To disable this, pass ``send_email=False``. + + """ + new_user = User.objects.create_user(username, email, password) + new_user.is_active = False + new_user.save() + + registration_profile = self.create_profile(new_user) + + if send_email: + registration_profile.send_activation_email(site) + + return new_user + create_inactive_user = transaction.commit_on_success(create_inactive_user) + + def create_profile(self, user): + """ + Create a ``RegistrationProfile`` for a given + ``User``, and return the ``RegistrationProfile``. + + The activation key for the ``RegistrationProfile`` will be a + SHA1 hash, generated from a combination of the ``User``'s + username and a random salt. + + """ + salt = sha_constructor(str(random.random())).hexdigest()[:5] + username = user.username + if isinstance(username, unicode): + username = username.encode('utf-8') + activation_key = sha_constructor(salt+username).hexdigest() + return self.create(user=user, + activation_key=activation_key) + + def delete_expired_users(self): + """ + Remove expired instances of ``RegistrationProfile`` and their + associated ``User``s. + + Accounts to be deleted are identified by searching for + instances of ``RegistrationProfile`` with expired activation + keys, and then checking to see if their associated ``User`` + instances have the field ``is_active`` set to ``False``; any + ``User`` who is both inactive and has an expired activation + key will be deleted. + + It is recommended that this method be executed regularly as + part of your routine site maintenance; this application + provides a custom management command which will call this + method, accessible as ``manage.py cleanupregistration``. + + Regularly clearing out accounts which have never been + activated serves two useful purposes: + + 1. It alleviates the ocasional need to reset a + ``RegistrationProfile`` and/or re-send an activation email + when a user does not receive or does not act upon the + initial activation email; since the account will be + deleted, the user will be able to simply re-register and + receive a new activation key. + + 2. It prevents the possibility of a malicious user registering + one or more accounts and never activating them (thus + denying the use of those usernames to anyone else); since + those accounts will be deleted, the usernames will become + available for use again. + + If you have a troublesome ``User`` and wish to disable their + account while keeping it in the database, simply delete the + associated ``RegistrationProfile``; an inactive ``User`` which + does not have an associated ``RegistrationProfile`` will not + be deleted. + + """ + for profile in self.all(): + if profile.activation_key_expired(): + user = profile.user + if not user.is_active: + user.delete() + + +class RegistrationProfile(models.Model): + """ + A simple profile which stores an activation key for use during + user account registration. + + Generally, you will not want to interact directly with instances + of this model; the provided manager includes methods + for creating and activating new accounts, as well as for cleaning + out accounts which have never been activated. + + While it is possible to use this model as the value of the + ``AUTH_PROFILE_MODULE`` setting, it's not recommended that you do + so. This model's sole purpose is to store data temporarily during + account registration and activation. + + """ + ACTIVATED = u"ALREADY_ACTIVATED" + + user = models.ForeignKey(User, unique=True, verbose_name=_('user')) + activation_key = models.CharField(_('activation key'), max_length=40) + + objects = RegistrationManager() + + class Meta: + verbose_name = _('registration profile') + verbose_name_plural = _('registration profiles') + + def __unicode__(self): + return u"Registration information for %s" % self.user + + def activation_key_expired(self): + """ + Determine whether this ``RegistrationProfile``'s activation + key has expired, returning a boolean -- ``True`` if the key + has expired. + + Key expiration is determined by a two-step process: + + 1. If the user has already activated, the key will have been + reset to the string constant ``ACTIVATED``. Re-activating + is not permitted, and so this method returns ``True`` in + this case. + + 2. Otherwise, the date the user signed up is incremented by + the number of days specified in the setting + ``ACCOUNT_ACTIVATION_DAYS`` (which should be the number of + days after signup during which a user is allowed to + activate their account); if the result is less than or + equal to the current date, the key has expired and this + method returns ``True``. + + """ + expiration_date = datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS) + return self.activation_key == self.ACTIVATED or \ + (self.user.date_joined + expiration_date <= datetime.datetime.now()) + activation_key_expired.boolean = True + + def send_activation_email(self, site): + """ + Send an activation email to the user associated with this + ``RegistrationProfile``. + + The activation email will make use of two templates: + + ``registration/activation_email_subject.txt`` + This template will be used for the subject line of the + email. Because it is used as the subject line of an email, + this template's output **must** be only a single line of + text; output longer than one line will be forcibly joined + into only a single line. + + ``registration/activation_email.txt`` + This template will be used for the body of the email. + + These templates will each receive the following context + variables: + + ``activation_key`` + The activation key for the new account. + + ``expiration_days`` + The number of days remaining during which the account may + be activated. + + ``site`` + An object representing the site on which the user + registered; depending on whether ``django.contrib.sites`` + is installed, this may be an instance of either + ``django.contrib.sites.models.Site`` (if the sites + application is installed) or + ``django.contrib.sites.models.RequestSite`` (if + not). Consult the documentation for the Django sites + framework for details regarding these objects' interfaces. + + """ + ctx_dict = {'activation_key': self.activation_key, + 'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS, + 'site': site} + subject = render_to_string('registration/activation_email_subject.txt', + ctx_dict) + # Email subject *must not* contain newlines + subject = ''.join(subject.splitlines()) + + message = render_to_string('registration/activation_email.txt', + ctx_dict) + + self.user.email_user(subject, message, settings.DEFAULT_FROM_EMAIL) + diff --git a/clinicaltrials/activation/signals.py b/clinicaltrials/registration/signals.py similarity index 56% rename from clinicaltrials/activation/signals.py rename to clinicaltrials/registration/signals.py index d1e2dba..343e3a5 100644 --- a/clinicaltrials/activation/signals.py +++ b/clinicaltrials/registration/signals.py @@ -1,9 +1,8 @@ -# this file was copied from django-registration/registration/signals.py - from django.dispatch import Signal + # A new user has registered. user_registered = Signal(providing_args=["user", "request"]) # A user has activated his or her account. -user_activated = Signal(providing_args=["user", "request"]) \ No newline at end of file +user_activated = Signal(providing_args=["user", "request"]) diff --git a/clinicaltrials/registration/tests/__init__.py b/clinicaltrials/registration/tests/__init__.py new file mode 100644 index 0000000..3272c57 --- /dev/null +++ b/clinicaltrials/registration/tests/__init__.py @@ -0,0 +1,45 @@ +from django.test import TestCase + +import registration + +from registration.tests.backends import * +from registration.tests.forms import * +from registration.tests.models import * +from registration.tests.views import * + + +class RegistrationVersionInfoTests(TestCase): + """ + Test django-registration's internal version-reporting + infrastructure. + + """ + def setUp(self): + self.version = registration.VERSION + + def tearDown(self): + registration.VERSION = self.version + + def test_get_version(self): + """ + Test the version-info reporting. + + """ + versions = [ + {'version': (1, 0, 0, 'alpha', 0), + 'expected': "1.0 pre-alpha"}, + {'version': (1, 0, 1, 'alpha', 1), + 'expected': "1.0.1 alpha 1"}, + {'version': (1, 1, 0, 'beta', 2), + 'expected': "1.1 beta 2"}, + {'version': (1, 2, 1, 'rc', 3), + 'expected': "1.2.1 rc 3"}, + {'version': (1, 3, 0, 'final', 0), + 'expected': "1.3"}, + {'version': (1, 4, 1, 'beta', 0), + 'expected': "1.4.1 beta"}, + ] + + for version_dict in versions: + registration.VERSION = version_dict['version'] + self.assertEqual(registration.get_version(), version_dict['expected']) diff --git a/clinicaltrials/registration/tests/backends.py b/clinicaltrials/registration/tests/backends.py new file mode 100644 index 0000000..9237b2c --- /dev/null +++ b/clinicaltrials/registration/tests/backends.py @@ -0,0 +1,476 @@ +import datetime + +from django.conf import settings +from django.contrib import admin +from django.contrib.auth.models import User +from django.contrib.sessions.middleware import SessionMiddleware +from django.contrib.sites.models import Site +from django.core import mail +from django.core.exceptions import ImproperlyConfigured +from django.core.handlers.wsgi import WSGIRequest +from django.test import Client +from django.test import TestCase + +from registration import forms +from registration import signals +from registration.admin import RegistrationAdmin +from registration.backends import get_backend +from registration.backends.default import DefaultBackend +from registration.backends.simple import SimpleBackend +from registration.models import RegistrationProfile + + +class _MockRequestClient(Client): + """ + A ``django.test.Client`` subclass which can return mock + ``HttpRequest`` objects. + + """ + def request(self, **request): + """ + Rather than issuing a request and returning the response, this + simply constructs an ``HttpRequest`` object and returns it. + + """ + environ = { + 'HTTP_COOKIE': self.cookies, + 'PATH_INFO': '/', + 'QUERY_STRING': '', + 'REMOTE_ADDR': '127.0.0.1', + 'REQUEST_METHOD': 'GET', + 'SCRIPT_NAME': '', + 'SERVER_NAME': 'testserver', + 'SERVER_PORT': '80', + 'SERVER_PROTOCOL': 'HTTP/1.1', + 'wsgi.version': (1,0), + 'wsgi.url_scheme': 'http', + 'wsgi.errors': self.errors, + 'wsgi.multiprocess': True, + 'wsgi.multithread': False, + 'wsgi.run_once': False, + } + environ.update(self.defaults) + environ.update(request) + request = WSGIRequest(environ) + + # We have to manually add a session since we'll be bypassing + # the middleware chain. + session_middleware = SessionMiddleware() + session_middleware.process_request(request) + return request + + +def _mock_request(): + """ + Construct and return a mock ``HttpRequest`` object; this is used + in testing backend methods which expect an ``HttpRequest`` but + which are not being called from views. + + """ + return _MockRequestClient().request() + + +class BackendRetrievalTests(TestCase): + """ + Test that utilities for retrieving the active backend work + properly. + + """ + def test_get_backend(self): + """ + Verify that ``get_backend()`` returns the correct value when + passed a valid backend. + + """ + self.failUnless(isinstance(get_backend('registration.backends.default.DefaultBackend'), + DefaultBackend)) + + def test_backend_error_invalid(self): + """ + Test that a nonexistent/unimportable backend raises the + correct exception. + + """ + self.assertRaises(ImproperlyConfigured, get_backend, + 'registration.backends.doesnotexist.NonExistentBackend') + + def test_backend_attribute_error(self): + """ + Test that a backend module which exists but does not have a + class of the specified name raises the correct exception. + + """ + self.assertRaises(ImproperlyConfigured, get_backend, + 'registration.backends.default.NonexistentBackend') + + +class DefaultRegistrationBackendTests(TestCase): + """ + Test the default registration backend. + + Running these tests successfull will require two templates to be + created for the sending of activation emails; details on these + templates and their contexts may be found in the documentation for + the default backend. + + """ + backend = DefaultBackend() + + def setUp(self): + """ + Create an instance of the default backend for use in testing, + and set ``ACCOUNT_ACTIVATION_DAYS`` if it's not set already. + + """ + self.old_activation = getattr(settings, 'ACCOUNT_ACTIVATION_DAYS', None) + if self.old_activation is None: + settings.ACCOUNT_ACTIVATION_DAYS = 7 + + def tearDown(self): + """ + Yank out ``ACCOUNT_ACTIVATION_DAYS`` back out if it wasn't + originally set. + + """ + if self.old_activation is None: + settings.ACCOUNT_ACTIVATION_DAYS = self.old_activation + + def test_registration(self): + """ + Test the registration process: registration creates a new + inactive account and a new profile with activation key, + populates the correct account data and sends an activation + email. + + """ + new_user = self.backend.register(_mock_request(), + username='bob', + email='[email protected]', + password1='secret') + + # Details of the returned user must match what went in. + self.assertEqual(new_user.username, 'bob') + self.failUnless(new_user.check_password('secret')) + self.assertEqual(new_user.email, '[email protected]') + + # New user must not be active. + self.failIf(new_user.is_active) + + # A registration profile was created, and an activation email + # was sent. + self.assertEqual(RegistrationProfile.objects.count(), 1) + self.assertEqual(len(mail.outbox), 1) + + def test_registration_no_sites(self): + """ + Test that registration still functions properly when + ``django.contrib.sites`` is not installed; the fallback will + be a ``RequestSite`` instance. + + """ + Site._meta.installed = False + + new_user = self.backend.register(_mock_request(), + username='bob', + email='[email protected]', + password1='secret') + + self.assertEqual(new_user.username, 'bob') + self.failUnless(new_user.check_password('secret')) + self.assertEqual(new_user.email, '[email protected]') + + self.failIf(new_user.is_active) + + self.assertEqual(RegistrationProfile.objects.count(), 1) + self.assertEqual(len(mail.outbox), 1) + + Site._meta.installed = True + + def test_valid_activation(self): + """ + Test the activation process: activating within the permitted + window sets the account's ``is_active`` field to ``True`` and + resets the activation key. + + """ + valid_user = self.backend.register(_mock_request(), + username='alice', + email='[email protected]', + password1='swordfish') + + valid_profile = RegistrationProfile.objects.get(user=valid_user) + activated = self.backend.activate(_mock_request(), + valid_profile.activation_key) + self.assertEqual(activated.username, valid_user.username) + self.failUnless(activated.is_active) + + # Fetch the profile again to verify its activation key has + # been reset. + valid_profile = RegistrationProfile.objects.get(user=valid_user) + self.assertEqual(valid_profile.activation_key, + RegistrationProfile.ACTIVATED) + + def test_invalid_activation(self): + """ + Test the activation process: trying to activate outside the + permitted window fails, and leaves the account inactive. + + """ + expired_user = self.backend.register(_mock_request(), + username='bob', + email='[email protected]', + password1='secret') + + expired_user.date_joined = expired_user.date_joined - datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS) + expired_user.save() + expired_profile = RegistrationProfile.objects.get(user=expired_user) + self.failIf(self.backend.activate(_mock_request(), + expired_profile.activation_key)) + self.failUnless(expired_profile.activation_key_expired()) + + def test_allow(self): + """ + Test that the setting ``REGISTRATION_OPEN`` appropriately + controls whether registration is permitted. + + """ + old_allowed = getattr(settings, 'REGISTRATION_OPEN', True) + settings.REGISTRATION_OPEN = True + self.failUnless(self.backend.registration_allowed(_mock_request())) + + settings.REGISTRATION_OPEN = False + self.failIf(self.backend.registration_allowed(_mock_request())) + settings.REGISTRATION_OPEN = old_allowed + + def test_form_class(self): + """ + Test that the default form class returned is + ``registration.forms.RegistrationForm``. + + """ + self.failUnless(self.backend.get_form_class(_mock_request()) is forms.RegistrationForm) + + def test_post_registration_redirect(self): + """ + Test that the default post-registration redirect is the named + pattern ``registration_complete``. + + """ + self.assertEqual(self.backend.post_registration_redirect(_mock_request(), User()), + ('registration_complete', (), {})) + + def test_registration_signal(self): + """ + Test that registering a user sends the ``user_registered`` + signal. + + """ + def receiver(sender, **kwargs): + self.failUnless('user' in kwargs) + self.assertEqual(kwargs['user'].username, 'bob') + self.failUnless('request' in kwargs) + self.failUnless(isinstance(kwargs['request'], WSGIRequest)) + received_signals.append(kwargs.get('signal')) + + received_signals = [] + signals.user_registered.connect(receiver, sender=self.backend.__class__) + + self.backend.register(_mock_request(), + username='bob', + email='[email protected]', + password1='secret') + + self.assertEqual(len(received_signals), 1) + self.assertEqual(received_signals, [signals.user_registered]) + + def test_activation_signal_success(self): + """ + Test that successfully activating a user sends the + ``user_activated`` signal. + + """ + def receiver(sender, **kwargs): + self.failUnless('user' in kwargs) + self.assertEqual(kwargs['user'].username, 'bob') + self.failUnless('request' in kwargs) + self.failUnless(isinstance(kwargs['request'], WSGIRequest)) + received_signals.append(kwargs.get('signal')) + + received_signals = [] + signals.user_activated.connect(receiver, sender=self.backend.__class__) + + new_user = self.backend.register(_mock_request(), + username='bob', + email='[email protected]', + password1='secret') + profile = RegistrationProfile.objects.get(user=new_user) + self.backend.activate(_mock_request(), profile.activation_key) + + self.assertEqual(len(received_signals), 1) + self.assertEqual(received_signals, [signals.user_activated]) + + def test_activation_signal_failure(self): + """ + Test that an unsuccessful activation attempt does not send the + ``user_activated`` signal. + + """ + receiver = lambda sender, **kwargs: received_signals.append(kwargs.get('signal')) + + received_signals = [] + signals.user_activated.connect(receiver, sender=self.backend.__class__) + + new_user = self.backend.register(_mock_request(), + username='bob', + email='[email protected]', + password1='secret') + new_user.date_joined -= datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS + 1) + new_user.save() + profile = RegistrationProfile.objects.get(user=new_user) + self.backend.activate(_mock_request(), profile.activation_key) + + self.assertEqual(len(received_signals), 0) + + def test_email_send_action(self): + """ + Test re-sending of activation emails via admin action. + + """ + admin_class = RegistrationAdmin(RegistrationProfile, admin.site) + + alice = self.backend.register(_mock_request(), + username='alice', + email='[email protected]', + password1='swordfish') + + admin_class.resend_activation_email(_mock_request(), + RegistrationProfile.objects.all()) + self.assertEqual(len(mail.outbox), 2) # One on registering, one more on the resend. + + RegistrationProfile.objects.filter(user=alice).update(activation_key=RegistrationProfile.ACTIVATED) + admin_class.resend_activation_email(_mock_request(), + RegistrationProfile.objects.all()) + self.assertEqual(len(mail.outbox), 2) # No additional email because the account has activated. + + def test_activation_action(self): + """ + Test manual activation of users view admin action. + + """ + admin_class = RegistrationAdmin(RegistrationProfile, admin.site) + + alice = self.backend.register(_mock_request(), + username='alice', + email='[email protected]', + password1='swordfish') + + admin_class.activate_users(_mock_request(), + RegistrationProfile.objects.all()) + self.failUnless(User.objects.get(username='alice').is_active) + + +class SimpleRegistrationBackendTests(TestCase): + """ + Test the simple registration backend, which does signup and + immediate activation. + + """ + backend = SimpleBackend() + + def test_registration(self): + """ + Test the registration process: registration creates a new + inactive account and a new profile with activation key, + populates the correct account data and sends an activation + email. + + """ + new_user = self.backend.register(_mock_request(), + username='bob', + email='[email protected]', + password1='secret') + + # Details of the returned user must match what went in. + self.assertEqual(new_user.username, 'bob') + self.failUnless(new_user.check_password('secret')) + self.assertEqual(new_user.email, '[email protected]') + + # New user must not be active. + self.failUnless(new_user.is_active) + + def test_allow(self): + """ + Test that the setting ``REGISTRATION_OPEN`` appropriately + controls whether registration is permitted. + + """ + old_allowed = getattr(settings, 'REGISTRATION_OPEN', True) + settings.REGISTRATION_OPEN = True + self.failUnless(self.backend.registration_allowed(_mock_request())) + + settings.REGISTRATION_OPEN = False + self.failIf(self.backend.registration_allowed(_mock_request())) + settings.REGISTRATION_OPEN = old_allowed + + def test_form_class(self): + """ + Test that the default form class returned is + ``registration.forms.RegistrationForm``. + + """ + self.failUnless(self.backend.get_form_class(_mock_request()) is forms.RegistrationForm) + + def test_post_registration_redirect(self): + """ + Test that the default post-registration redirect is the public + URL of the new user account. + + """ + new_user = self.backend.register(_mock_request(), + username='bob', + email='[email protected]', + password1='secret') + + self.assertEqual(self.backend.post_registration_redirect(_mock_request(), new_user), + (new_user.get_absolute_url(), (), {})) + + def test_registration_signal(self): + """ + Test that registering a user sends the ``user_registered`` + signal. + + """ + def receiver(sender, **kwargs): + self.failUnless('user' in kwargs) + self.assertEqual(kwargs['user'].username, 'bob') + self.failUnless('request' in kwargs) + self.failUnless(isinstance(kwargs['request'], WSGIRequest)) + received_signals.append(kwargs.get('signal')) + + received_signals = [] + signals.user_registered.connect(receiver, sender=self.backend.__class__) + + self.backend.register(_mock_request(), + username='bob', + email='[email protected]', + password1='secret') + + self.assertEqual(len(received_signals), 1) + self.assertEqual(received_signals, [signals.user_registered]) + + def test_activation(self): + """ + Test that activating against this backend is an error. + + """ + self.assertRaises(NotImplementedError, self.backend.activate, + request=_mock_request()) + + def test_post_activation_redirect(self): + """ + Test that asking for a post-activation redirect from this + backend is an error. + + """ + self.assertRaises(NotImplementedError, self.backend.post_activation_redirect, + request=_mock_request(), user=User()) diff --git a/clinicaltrials/registration/tests/forms.py b/clinicaltrials/registration/tests/forms.py new file mode 100644 index 0000000..505374f --- /dev/null +++ b/clinicaltrials/registration/tests/forms.py @@ -0,0 +1,119 @@ +from django.contrib.auth.models import User +from django.test import TestCase + +from registration import forms + + +class RegistrationFormTests(TestCase): + """ + Test the default registration forms. + + """ + def test_registration_form(self): + """ + Test that ``RegistrationForm`` enforces username constraints + and matching passwords. + + """ + # Create a user so we can verify that duplicate usernames aren't + # permitted. + User.objects.create_user('alice', '[email protected]', 'secret') + + invalid_data_dicts = [ + # Non-alphanumeric username. + {'data': {'username': 'foo/bar', + 'email': '[email protected]', + 'password1': 'foo', + 'password2': 'foo'}, + 'error': ('username', [u"This value must contain only letters, numbers and underscores."])}, + # Already-existing username. + {'data': {'username': 'alice', + 'email': '[email protected]', + 'password1': 'secret', + 'password2': 'secret'}, + 'error': ('username', [u"A user with that username already exists."])}, + # Mismatched passwords. + {'data': {'username': 'foo', + 'email': '[email protected]', + 'password1': 'foo', + 'password2': 'bar'}, + 'error': ('__all__', [u"The two password fields didn't match."])}, + ] + + for invalid_dict in invalid_data_dicts: + form = forms.RegistrationForm(data=invalid_dict['data']) + self.failIf(form.is_valid()) + self.assertEqual(form.errors[invalid_dict['error'][0]], + invalid_dict['error'][1]) + + form = forms.RegistrationForm(data={'username': 'foo', + 'email': '[email protected]', + 'password1': 'foo', + 'password2': 'foo'}) + self.failUnless(form.is_valid()) + + def test_registration_form_tos(self): + """ + Test that ``RegistrationFormTermsOfService`` requires + agreement to the terms of service. + + """ + form = forms.RegistrationFormTermsOfService(data={'username': 'foo', + 'email': '[email protected]', + 'password1': 'foo', + 'password2': 'foo'}) + self.failIf(form.is_valid()) + self.assertEqual(form.errors['tos'], + [u"You must agree to the terms to register"]) + + form = forms.RegistrationFormTermsOfService(data={'username': 'foo', + 'email': '[email protected]', + 'password1': 'foo', + 'password2': 'foo', + 'tos': 'on'}) + self.failUnless(form.is_valid()) + + def test_registration_form_unique_email(self): + """ + Test that ``RegistrationFormUniqueEmail`` validates uniqueness + of email addresses. + + """ + # Create a user so we can verify that duplicate addresses + # aren't permitted. + User.objects.create_user('alice', '[email protected]', 'secret') + + form = forms.RegistrationFormUniqueEmail(data={'username': 'foo', + 'email': '[email protected]', + 'password1': 'foo', + 'password2': 'foo'}) + self.failIf(form.is_valid()) + self.assertEqual(form.errors['email'], + [u"This email address is already in use. Please supply a different email address."]) + + form = forms.RegistrationFormUniqueEmail(data={'username': 'foo', + 'email': '[email protected]', + 'password1': 'foo', + 'password2': 'foo'}) + self.failUnless(form.is_valid()) + + def test_registration_form_no_free_email(self): + """ + Test that ``RegistrationFormNoFreeEmail`` disallows + registration with free email addresses. + + """ + base_data = {'username': 'foo', + 'password1': 'foo', + 'password2': 'foo'} + for domain in forms.RegistrationFormNoFreeEmail.bad_domains: + invalid_data = base_data.copy() + invalid_data['email'] = u"foo@%s" % domain + form = forms.RegistrationFormNoFreeEmail(data=invalid_data) + self.failIf(form.is_valid()) + self.assertEqual(form.errors['email'], + [u"Registration using free email addresses is prohibited. Please supply a different email address."]) + + base_data['email'] = '[email protected]' + form = forms.RegistrationFormNoFreeEmail(data=base_data) + self.failUnless(form.is_valid()) diff --git a/clinicaltrials/registration/tests/models.py b/clinicaltrials/registration/tests/models.py new file mode 100644 index 0000000..f763cb2 --- /dev/null +++ b/clinicaltrials/registration/tests/models.py @@ -0,0 +1,225 @@ +import datetime +import re + +from django.conf import settings +from django.contrib.auth.models import User +from django.contrib.sites.models import Site +from django.core import mail +from django.core import management +from django.test import TestCase +from django.utils.hashcompat import sha_constructor + +from registration.models import RegistrationProfile + + +class RegistrationModelTests(TestCase): + """ + Test the model and manager used in the default backend. + + """ + user_info = {'username': 'alice', + 'password': 'swordfish', + 'email': '[email protected]'} + + def setUp(self): + self.old_activation = getattr(settings, 'ACCOUNT_ACTIVATION_DAYS', None) + settings.ACCOUNT_ACTIVATION_DAYS = 7 + + def tearDown(self): + settings.ACCOUNT_ACTIVATION_DAYS = self.old_activation + + def test_profile_creation(self): + """ + Creating a registration profile for a user populates the + profile with the correct user and a SHA1 hash to use as + activation key. + + """ + new_user = User.objects.create_user(**self.user_info) + profile = RegistrationProfile.objects.create_profile(new_user) + + self.assertEqual(RegistrationProfile.objects.count(), 1) + self.assertEqual(profile.user.id, new_user.id) + self.failUnless(re.match('^[a-f0-9]{40}$', profile.activation_key)) + self.assertEqual(unicode(profile), + "Registration information for alice") + + def test_activation_email(self): + """ + ``RegistrationProfile.send_activation_email`` sends an + email. + + """ + new_user = User.objects.create_user(**self.user_info) + profile = RegistrationProfile.objects.create_profile(new_user) + profile.send_activation_email(Site.objects.get_current()) + self.assertEqual(len(mail.outbox), 1) + self.assertEqual(mail.outbox[0].to, [self.user_info['email']]) + + def test_user_creation(self): + """ + Creating a new user populates the correct data, and sets the + user's account inactive. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + **self.user_info) + self.assertEqual(new_user.username, 'alice') + self.assertEqual(new_user.email, '[email protected]') + self.failUnless(new_user.check_password('swordfish')) + self.failIf(new_user.is_active) + + def test_user_creation_email(self): + """ + By default, creating a new user sends an activation email. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + **self.user_info) + self.assertEqual(len(mail.outbox), 1) + + def test_user_creation_no_email(self): + """ + Passing ``send_email=False`` when creating a new user will not + send an activation email. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + send_email=False, + **self.user_info) + self.assertEqual(len(mail.outbox), 0) + + def test_unexpired_account(self): + """ + ``RegistrationProfile.activation_key_expired()`` is ``False`` + within the activation window. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + **self.user_info) + profile = RegistrationProfile.objects.get(user=new_user) + self.failIf(profile.activation_key_expired()) + + def test_expired_account(self): + """ + ``RegistrationProfile.activation_key_expired()`` is ``True`` + outside the activation window. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + **self.user_info) + new_user.date_joined -= datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS + 1) + new_user.save() + profile = RegistrationProfile.objects.get(user=new_user) + self.failUnless(profile.activation_key_expired()) + + def test_valid_activation(self): + """ + Activating a user within the permitted window makes the + account active, and resets the activation key. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + **self.user_info) + profile = RegistrationProfile.objects.get(user=new_user) + activated = RegistrationProfile.objects.activate_user(profile.activation_key) + + self.failUnless(isinstance(activated, User)) + self.assertEqual(activated.id, new_user.id) + self.failUnless(activated.is_active) + + profile = RegistrationProfile.objects.get(user=new_user) + self.assertEqual(profile.activation_key, RegistrationProfile.ACTIVATED) + + def test_expired_activation(self): + """ + Attempting to activate outside the permitted window does not + activate the account. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + **self.user_info) + new_user.date_joined -= datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS + 1) + new_user.save() + + profile = RegistrationProfile.objects.get(user=new_user) + activated = RegistrationProfile.objects.activate_user(profile.activation_key) + + self.failIf(isinstance(activated, User)) + self.failIf(activated) + + new_user = User.objects.get(username='alice') + self.failIf(new_user.is_active) + + profile = RegistrationProfile.objects.get(user=new_user) + self.assertNotEqual(profile.activation_key, RegistrationProfile.ACTIVATED) + + def test_activation_invalid_key(self): + """ + Attempting to activate with a key which is not a SHA1 hash + fails. + + """ + self.failIf(RegistrationProfile.objects.activate_user('foo')) + + def test_activation_already_activated(self): + """ + Attempting to re-activate an already-activated account fails. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + **self.user_info) + profile = RegistrationProfile.objects.get(user=new_user) + RegistrationProfile.objects.activate_user(profile.activation_key) + + profile = RegistrationProfile.objects.get(user=new_user) + self.failIf(RegistrationProfile.objects.activate_user(profile.activation_key)) + + def test_activation_nonexistent_key(self): + """ + Attempting to activate with a non-existent key (i.e., one not + associated with any account) fails. + + """ + # Due to the way activation keys are constructed during + # registration, this will never be a valid key. + invalid_key = sha_constructor('foo').hexdigest() + self.failIf(RegistrationProfile.objects.activate_user(invalid_key)) + + def test_expired_user_deletion(self): + """ + ``RegistrationProfile.objects.delete_expired_users()`` only + deletes inactive users whose activation window has expired. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + **self.user_info) + expired_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + username='bob', + password='secret', + email='[email protected]') + expired_user.date_joined -= datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS + 1) + expired_user.save() + + RegistrationProfile.objects.delete_expired_users() + self.assertEqual(RegistrationProfile.objects.count(), 1) + self.assertRaises(User.DoesNotExist, User.objects.get, username='bob') + + def test_management_command(self): + """ + The ``cleanupregistration`` management command properly + deletes expired accounts. + + """ + new_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + **self.user_info) + expired_user = RegistrationProfile.objects.create_inactive_user(site=Site.objects.get_current(), + username='bob', + password='secret', + email='[email protected]') + expired_user.date_joined -= datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS + 1) + expired_user.save() + + management.call_command('cleanupregistration') + self.assertEqual(RegistrationProfile.objects.count(), 1) + self.assertRaises(User.DoesNotExist, User.objects.get, username='bob') diff --git a/clinicaltrials/registration/tests/urls.py b/clinicaltrials/registration/tests/urls.py new file mode 100644 index 0000000..02ef609 --- /dev/null +++ b/clinicaltrials/registration/tests/urls.py @@ -0,0 +1,82 @@ +""" +URLs used in the unit tests for django-registration. + +You should not attempt to use these URLs in any sort of real or +development environment; instead, use +``registration/backends/default/urls.py``. This URLconf includes those +URLs, and also adds several additional URLs which serve no purpose +other than to test that optional keyword arguments are properly +handled. + +""" + +from django.conf.urls.defaults import * +from django.views.generic.simple import direct_to_template + +from registration.views import activate +from registration.views import register + + +urlpatterns = patterns('', + # Test the 'activate' view with custom template + # name. + url(r'^activate-with-template-name/(?P<activation_key>\w+)/$', + activate, + {'template_name': 'registration/test_template_name.html', + 'backend': 'registration.backends.default.DefaultBackend'}, + name='registration_test_activate_template_name'), + # Test the 'activate' view with + # extra_context_argument. + url(r'^activate-extra-context/(?P<activation_key>\w+)/$', + activate, + {'extra_context': {'foo': 'bar', 'callable': lambda: 'called'}, + 'backend': 'registration.backends.default.DefaultBackend'}, + name='registration_test_activate_extra_context'), + # Test the 'activate' view with success_url argument. + url(r'^activate-with-success-url/(?P<activation_key>\w+)/$', + activate, + {'success_url': 'registration_test_custom_success_url', + 'backend': 'registration.backends.default.DefaultBackend'}, + name='registration_test_activate_success_url'), + # Test the 'register' view with custom template + # name. + url(r'^register-with-template-name/$', + register, + {'template_name': 'registration/test_template_name.html', + 'backend': 'registration.backends.default.DefaultBackend'}, + name='registration_test_register_template_name'), + # Test the'register' view with extra_context + # argument. + url(r'^register-extra-context/$', + register, + {'extra_context': {'foo': 'bar', 'callable': lambda: 'called'}, + 'backend': 'registration.backends.default.DefaultBackend'}, + name='registration_test_register_extra_context'), + # Test the 'register' view with custom URL for + # closed registration. + url(r'^register-with-disallowed-url/$', + register, + {'disallowed_url': 'registration_test_custom_disallowed', + 'backend': 'registration.backends.default.DefaultBackend'}, + name='registration_test_register_disallowed_url'), + # Set up a pattern which will correspond to the + # custom 'disallowed_url' above. + url(r'^custom-disallowed/$', + direct_to_template, + {'template': 'registration/registration_closed.html'}, + name='registration_test_custom_disallowed'), + # Test the 'register' view with custom redirect + # on successful registration. + url(r'^register-with-success_url/$', + register, + {'success_url': 'registration_test_custom_success_url', + 'backend': 'registration.backends.default.DefaultBackend'}, + name='registration_test_register_success_url' + ), + # Pattern for custom redirect set above. + url(r'^custom-success/$', + direct_to_template, + {'template': 'registration/test_template_name.html'}, + name='registration_test_custom_success_url'), + (r'', include('registration.backends.default.urls')), + ) diff --git a/clinicaltrials/registration/tests/views.py b/clinicaltrials/registration/tests/views.py new file mode 100644 index 0000000..17d3ad5 --- /dev/null +++ b/clinicaltrials/registration/tests/views.py @@ -0,0 +1,246 @@ +import datetime + +from django.conf import settings +from django.contrib.auth.models import User +from django.core import mail +from django.core.urlresolvers import reverse +from django.test import TestCase + +from registration import forms +from registration.models import RegistrationProfile + + +class RegistrationViewTests(TestCase): + """ + Test the registration views. + + """ + urls = 'registration.tests.urls' + + def setUp(self): + """ + These tests use the default backend, since we know it's + available; that needs to have ``ACCOUNT_ACTIVATION_DAYS`` set. + + """ + self.old_activation = getattr(settings, 'ACCOUNT_ACTIVATION_DAYS', None) + if self.old_activation is None: + settings.ACCOUNT_ACTIVATION_DAYS = 7 + + def tearDown(self): + """ + Yank ``ACCOUNT_ACTIVATION_DAYS`` back out if it wasn't + originally set. + + """ + if self.old_activation is None: + settings.ACCOUNT_ACTIVATION_DAYS = self.old_activation + + def test_registration_view_initial(self): + """ + A ``GET`` to the ``register`` view uses the appropriate + template and populates the registration form into the context. + + """ + response = self.client.get(reverse('registration_register')) + self.assertEqual(response.status_code, 200) + self.assertTemplateUsed(response, + 'registration/registration_form.html') + self.failUnless(isinstance(response.context['form'], + forms.RegistrationForm)) + + def test_registration_view_success(self): + """ + A ``POST`` to the ``register`` view with valid data properly + creates a new user and issues a redirect. + + """ + response = self.client.post(reverse('registration_register'), + data={'username': 'alice', + 'email': '[email protected]', + 'password1': 'swordfish', + 'password2': 'swordfish'}) + self.assertRedirects(response, + 'http://testserver%s' % reverse('registration_complete')) + self.assertEqual(RegistrationProfile.objects.count(), 1) + self.assertEqual(len(mail.outbox), 1) + + def test_registration_view_failure(self): + """ + A ``POST`` to the ``register`` view with invalid data does not + create a user, and displays appropriate error messages. + + """ + response = self.client.post(reverse('registration_register'), + data={'username': 'bob', + 'email': '[email protected]', + 'password1': 'foo', + 'password2': 'bar'}) + self.assertEqual(response.status_code, 200) + self.failIf(response.context['form'].is_valid()) + self.assertFormError(response, 'form', field=None, + errors=u"The two password fields didn't match.") + self.assertEqual(len(mail.outbox), 0) + + def test_registration_view_closed(self): + """ + Any attempt to access the ``register`` view when registration + is closed fails and redirects. + + """ + old_allowed = getattr(settings, 'REGISTRATION_OPEN', True) + settings.REGISTRATION_OPEN = False + + closed_redirect = 'http://testserver%s' % reverse('registration_disallowed') + + response = self.client.get(reverse('registration_register')) + self.assertRedirects(response, closed_redirect) + + # Even if valid data is posted, it still shouldn't work. + response = self.client.post(reverse('registration_register'), + data={'username': 'alice', + 'email': '[email protected]', + 'password1': 'swordfish', + 'password2': 'swordfish'}) + self.assertRedirects(response, closed_redirect) + self.assertEqual(RegistrationProfile.objects.count(), 0) + + settings.REGISTRATION_OPEN = old_allowed + + def test_registration_template_name(self): + """ + Passing ``template_name`` to the ``register`` view will result + in that template being used. + + """ + response = self.client.get(reverse('registration_test_register_template_name')) + self.assertTemplateUsed(response, + 'registration/test_template_name.html') + + def test_registration_extra_context(self): + """ + Passing ``extra_context`` to the ``register`` view will + correctly populate the context. + + """ + response = self.client.get(reverse('registration_test_register_extra_context')) + self.assertEqual(response.context['foo'], 'bar') + # Callables in extra_context are called to obtain the value. + self.assertEqual(response.context['callable'], 'called') + + def test_registration_disallowed_url(self): + """ + Passing ``disallowed_url`` to the ``register`` view will + result in a redirect to that URL when registration is closed. + + """ + old_allowed = getattr(settings, 'REGISTRATION_OPEN', True) + settings.REGISTRATION_OPEN = False + + closed_redirect = 'http://testserver%s' % reverse('registration_test_custom_disallowed') + + response = self.client.get(reverse('registration_test_register_disallowed_url')) + self.assertRedirects(response, closed_redirect) + + settings.REGISTRATION_OPEN = old_allowed + + def test_registration_success_url(self): + """ + Passing ``success_url`` to the ``register`` view will result + in a redirect to that URL when registration is successful. + + """ + success_redirect = 'http://testserver%s' % reverse('registration_test_custom_success_url') + response = self.client.post(reverse('registration_test_register_success_url'), + data={'username': 'alice', + 'email': '[email protected]', + 'password1': 'swordfish', + 'password2': 'swordfish'}) + self.assertRedirects(response, success_redirect) + + def test_valid_activation(self): + """ + Test that the ``activate`` view properly handles a valid + activation (in this case, based on the default backend's + activation window). + + """ + success_redirect = 'http://testserver%s' % reverse('registration_activation_complete') + + # First, register an account. + self.client.post(reverse('registration_register'), + data={'username': 'alice', + 'email': '[email protected]', + 'password1': 'swordfish', + 'password2': 'swordfish'}) + profile = RegistrationProfile.objects.get(user__username='alice') + response = self.client.get(reverse('registration_activate', + kwargs={'activation_key': profile.activation_key})) + self.assertRedirects(response, success_redirect) + self.failUnless(User.objects.get(username='alice').is_active) + + def test_invalid_activation(self): + """ + Test that the ``activate`` view properly handles an invalid + activation (in this case, based on the default backend's + activation window). + + """ + # Register an account and reset its date_joined to be outside + # the activation window. + self.client.post(reverse('registration_register'), + data={'username': 'bob', + 'email': '[email protected]', + 'password1': 'secret', + 'password2': 'secret'}) + expired_user = User.objects.get(username='bob') + expired_user.date_joined = expired_user.date_joined - datetime.timedelta(days=settings.ACCOUNT_ACTIVATION_DAYS) + expired_user.save() + + expired_profile = RegistrationProfile.objects.get(user=expired_user) + response = self.client.get(reverse('registration_activate', + kwargs={'activation_key': expired_profile.activation_key})) + self.assertEqual(response.status_code, 200) + self.assertEqual(response.context['activation_key'], + expired_profile.activation_key) + self.failIf(User.objects.get(username='bob').is_active) + + def test_activation_success_url(self): + """ + Passing ``success_url`` to the ``activate`` view and + successfully activating will result in that URL being used for + the redirect. + + """ + success_redirect = 'http://testserver%s' % reverse('registration_test_custom_success_url') + self.client.post(reverse('registration_register'), + data={'username': 'alice', + 'email': '[email protected]', + 'password1': 'swordfish', + 'password2': 'swordfish'}) + profile = RegistrationProfile.objects.get(user__username='alice') + response = self.client.get(reverse('registration_test_activate_success_url', + kwargs={'activation_key': profile.activation_key})) + self.assertRedirects(response, success_redirect) + + def test_activation_template_name(self): + """ + Passing ``template_name`` to the ``activate`` view will result + in that template being used. + + """ + response = self.client.get(reverse('registration_test_activate_template_name', + kwargs={'activation_key': 'foo'})) + self.assertTemplateUsed(response, 'registration/test_template_name.html') + + def test_activation_extra_context(self): + """ + Passing ``extra_context`` to the ``activate`` view will + correctly populate the context. + + """ + response = self.client.get(reverse('registration_test_activate_extra_context', + kwargs={'activation_key': 'foo'})) + self.assertEqual(response.context['foo'], 'bar') + # Callables in extra_context are called to obtain the value. + self.assertEqual(response.context['callable'], 'called') diff --git a/clinicaltrials/registration/urls.py b/clinicaltrials/registration/urls.py new file mode 100644 index 0000000..af41026 --- /dev/null +++ b/clinicaltrials/registration/urls.py @@ -0,0 +1,15 @@ +""" +Backwards-compatible URLconf for existing django-registration +installs; this allows the standard ``include('registration.urls')`` to +continue working, but that usage is deprecated and will be removed for +django-registration 1.0. For new installs, use +``include('registration.backends.default.urls')``. + +""" + +import warnings + +warnings.warn("include('registration.urls') is deprecated; use include('registration.backends.default.urls') instead.", + PendingDeprecationWarning) + +from registration.backends.default.urls import * diff --git a/clinicaltrials/registration/views.py b/clinicaltrials/registration/views.py new file mode 100644 index 0000000..1783e8d --- /dev/null +++ b/clinicaltrials/registration/views.py @@ -0,0 +1,204 @@ +""" +Views which allow users to create and activate accounts. + +""" + + +from django.shortcuts import redirect +from django.shortcuts import render_to_response +from django.template import RequestContext + +from registration.backends import get_backend + + +def activate(request, backend, + template_name='registration/activate.html', + success_url=None, extra_context=None, **kwargs): + """ + Activate a user's account. + + The actual activation of the account will be delegated to the + backend specified by the ``backend`` keyword argument (see below); + the backend's ``activate()`` method will be called, passing any + keyword arguments captured from the URL, and will be assumed to + return a ``User`` if activation was successful, or a value which + evaluates to ``False`` in boolean context if not. + + Upon successful activation, the backend's + ``post_activation_redirect()`` method will be called, passing the + ``HttpRequest`` and the activated ``User`` to determine the URL to + redirect the user to. To override this, pass the argument + ``success_url`` (see below). + + On unsuccessful activation, will render the template + ``registration/activate.html`` to display an error message; to + override thise, pass the argument ``template_name`` (see below). + + **Arguments** + + ``backend`` + The dotted Python import path to the backend class to + use. Required. + + ``extra_context`` + A dictionary of variables to add to the template context. Any + callable object in this dictionary will be called to produce + the end result which appears in the context. Optional. + + ``success_url`` + The name of a URL pattern to redirect to on successful + acivation. This is optional; if not specified, this will be + obtained by calling the backend's + ``post_activation_redirect()`` method. + + ``template_name`` + A custom template to use. This is optional; if not specified, + this will default to ``registration/activate.html``. + + ``\*\*kwargs`` + Any keyword arguments captured from the URL, such as an + activation key, which will be passed to the backend's + ``activate()`` method. + + **Context:** + + The context will be populated from the keyword arguments captured + in the URL, and any extra variables supplied in the + ``extra_context`` argument (see above). + + **Template:** + + registration/activate.html or ``template_name`` keyword argument. + + """ + backend = get_backend(backend) + account = backend.activate(request, **kwargs) + + if account: + if success_url is None: + to, args, kwargs = backend.post_activation_redirect(request, account) + return redirect(to, *args, **kwargs) + else: + return redirect(success_url) + + if extra_context is None: + extra_context = {} + context = RequestContext(request) + for key, value in extra_context.items(): + context[key] = callable(value) and value() or value + + return render_to_response(template_name, + kwargs, + context_instance=context) + + +def register(request, backend, success_url=None, form_class=None, + disallowed_url='registration_disallowed', + template_name='registration/registration_form.html', + extra_context=None): + """ + Allow a new user to register an account. + + The actual registration of the account will be delegated to the + backend specified by the ``backend`` keyword argument (see below); + it will be used as follows: + + 1. The backend's ``registration_allowed()`` method will be called, + passing the ``HttpRequest``, to determine whether registration + of an account is to be allowed; if not, a redirect is issued to + the view corresponding to the named URL pattern + ``registration_disallowed``. To override this, see the list of + optional arguments for this view (below). + + 2. The form to use for account registration will be obtained by + calling the backend's ``get_form_class()`` method, passing the + ``HttpRequest``. To override this, see the list of optional + arguments for this view (below). + + 3. If valid, the form's ``cleaned_data`` will be passed (as + keyword arguments, and along with the ``HttpRequest``) to the + backend's ``register()`` method, which should return the new + ``User`` object. + + 4. Upon successful registration, the backend's + ``post_registration_redirect()`` method will be called, passing + the ``HttpRequest`` and the new ``User``, to determine the URL + to redirect the user to. To override this, see the list of + optional arguments for this view (below). + + **Required arguments** + + None. + + **Optional arguments** + + ``backend`` + The dotted Python import path to the backend class to use. + + ``disallowed_url`` + URL to redirect to if registration is not permitted for the + current ``HttpRequest``. Must be a value which can legally be + passed to ``django.shortcuts.redirect``. If not supplied, this + will be whatever URL corresponds to the named URL pattern + ``registration_disallowed``. + + ``form_class`` + The form class to use for registration. If not supplied, this + will be retrieved from the registration backend. + + ``extra_context`` + A dictionary of variables to add to the template context. Any + callable object in this dictionary will be called to produce + the end result which appears in the context. + + ``success_url`` + URL to redirect to after successful registration. Must be a + value which can legally be passed to + ``django.shortcuts.redirect``. If not supplied, this will be + retrieved from the registration backend. + + ``template_name`` + A custom template to use. If not supplied, this will default + to ``registration/registration_form.html``. + + **Context:** + + ``form`` + The registration form. + + Any extra variables supplied in the ``extra_context`` argument + (see above). + + **Template:** + + registration/registration_form.html or ``template_name`` keyword + argument. + + """ + backend = get_backend(backend) + if not backend.registration_allowed(request): + return redirect(disallowed_url) + if form_class is None: + form_class = backend.get_form_class(request) + + if request.method == 'POST': + form = form_class(data=request.POST, files=request.FILES) + if form.is_valid(): + new_user = backend.register(request, **form.cleaned_data) + if success_url is None: + to, args, kwargs = backend.post_registration_redirect(request, new_user) + return redirect(to, *args, **kwargs) + else: + return redirect(success_url) + else: + form = form_class() + + if extra_context is None: + extra_context = {} + context = RequestContext(request) + for key, value in extra_context.items(): + context[key] = callable(value) and value() or value + + return render_to_response(template_name, + {'form': form}, + context_instance=context) diff --git a/clinicaltrials/reviewapp/templates/reviewapp/index.html b/clinicaltrials/reviewapp/templates/reviewapp/index.html index cd37aa2..92fd4eb 100644 --- a/clinicaltrials/reviewapp/templates/reviewapp/index.html +++ b/clinicaltrials/reviewapp/templates/reviewapp/index.html @@ -1,11 +1,7 @@ {% extends "base.html" %} -<!-- TODO: login and logout urls must use url tag for reverse view lookup --> - - - {% block body %} <h2>Futura página inicial do Registro Brasileiro de Ensaios Clínicos</h2> {% endblock %} diff --git a/clinicaltrials/settings.py b/clinicaltrials/settings.py index b2d1db7..9e7a084 100644 --- a/clinicaltrials/settings.py +++ b/clinicaltrials/settings.py @@ -1,130 +1,133 @@ # -*- encoding: utf-8 -*- # Django settings for clinicaltrials project. import os from django.utils.translation import ugettext_lazy as _ DEBUG = False TEMPLATE_DEBUG = DEBUG PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) ADMINS = ( ('Luciano Ramalho', '[email protected]'), ('Fabio Montefuscolo', '[email protected]'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'America/Brasilia' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'pt-BR' SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # Absolute path to the directory that holds media. # Example: "/home/media/media.lawrence.com/" MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). # Examples: "http://media.lawrence.com", "http://example.com/media/" MEDIA_URL = '/static/' # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = '/media/' # Make this unique, and don't share it with anybody. SECRET_KEY = '*06=j&&^n71^a&%%3rs%7lla+^(n^v1w@@dp_rxvi#&(xo7meq' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', # 'django.template.loaders.eggs.load_template_source', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) ROOT_URLCONF = 'clinicaltrials.urls' TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. os.path.join(PROJECT_PATH, 'templates'), ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.admindocs', 'registry', 'vocabulary', 'reviewapp', 'tickets', 'assistance', 'decsclient', 'polyglot', 'rosetta', - # 'registration', # django-registration package + 'registration', # django-registration package ) ################################################################# ### BEGIN Clinical Trials Repository customization settings SITE_TITLE = u'Registro Brasileiro de Ensaios Clínicos' DECS_SERVICE = 'http://decs.bvs.br/cgi-bin/mx/cgi=@vmx/decs' # Notes: # 1) language codes should follow the IANA standard for language subtags # source: http://www.iana.org/assignments/language-subtag-registry # 2) the first managed language is considered the default # and the source language for content translation purposes MANAGED_LANGUAGES = ( ('en',u'English'), ('es',u'Español'), #('fr',_('Français')), ('pt',u'Português'), ) TARGET_LANGUAGES = MANAGED_LANGUAGES[1:] # exlude source language CHECKED_LANGUAGES = [code for code, label in MANAGED_LANGUAGES] -# django-registration activation window +# django-registration: for how long the activation link is valid ACCOUNT_ACTIVATION_DAYS = 7 +# django-registration: set to False to suspend new user registrations +REGISTRATION_OPEN = True + ATTACHMENTS_PATH = os.path.join(MEDIA_ROOT, 'attachments') ### END Clinical Trials Repository customization settings ################################################################# # Deployment settings: there *must* be an unversioned settings_local.py # file in the current directory. See sample file at settings_local-SAMPLE.py execfile(os.path.join(PROJECT_PATH,'settings_local.py'))
ensaiosclinicos/clinicaltrials
8b33d28e829900fcc3bb1bbde4af731671b64a57
added django-registration user account activation functionality
diff --git a/clinicaltrials/activation/READ-ME.txt b/clinicaltrials/activation/READ-ME.txt new file mode 100644 index 0000000..9d27f8f --- /dev/null +++ b/clinicaltrials/activation/READ-ME.txt @@ -0,0 +1,5 @@ +This activation/ directory was created as a copy of the directory: + +django-registration/registration/backends/default + +Changes, if any, are recorded in the Subversion log diff --git a/clinicaltrials/activation/__init__.py b/clinicaltrials/activation/__init__.py new file mode 100644 index 0000000..f6f6c65 --- /dev/null +++ b/clinicaltrials/activation/__init__.py @@ -0,0 +1,139 @@ +from django.conf import settings +from django.contrib.sites.models import RequestSite +from django.contrib.sites.models import Site + +from registration import signals +from registration.forms import RegistrationForm +from registration.models import RegistrationProfile + + +class DefaultBackend(object): + """ + A registration backend which follows a simple workflow: + + 1. User signs up, inactive account is created. + + 2. Email is sent to user with activation link. + + 3. User clicks activation link, account is now active. + + Using this backend requires that + + * ``registration`` be listed in the ``INSTALLED_APPS`` setting + (since this backend makes use of models defined in this + application). + + * The setting ``ACCOUNT_ACTIVATION_DAYS`` be supplied, specifying + (as an integer) the number of days from registration during + which a user may activate their account (after that period + expires, activation will be disallowed). + + * The creation of the templates + ``registration/activation_email_subject.txt`` and + ``registration/activation_email.txt``, which will be used for + the activation email. See the notes for this backends + ``register`` method for details regarding these templates. + + Additionally, registration can be temporarily closed by adding the + setting ``REGISTRATION_OPEN`` and setting it to + ``False``. Omitting this setting, or setting it to ``True``, will + be interpreted as meaning that registration is currently open and + permitted. + + Internally, this is accomplished via storing an activation key in + an instance of ``registration.models.RegistrationProfile``. See + that model and its custom manager for full documentation of its + fields and supported operations. + + """ + def register(self, request, **kwargs): + """ + Given a username, email address and password, register a new + user account, which will initially be inactive. + + Along with the new ``User`` object, a new + ``registration.models.RegistrationProfile`` will be created, + tied to that ``User``, containing the activation key which + will be used for this account. + + An email will be sent to the supplied email address; this + email should contain an activation link. The email will be + rendered using two templates. See the documentation for + ``RegistrationProfile.send_activation_email()`` for + information about these templates and the contexts provided to + them. + + After the ``User`` and ``RegistrationProfile`` are created and + the activation email is sent, the signal + ``registration.signals.user_registered`` will be sent, with + the new ``User`` as the keyword argument ``user`` and the + class of this backend as the sender. + + """ + username, email, password = kwargs['username'], kwargs['email'], kwargs['password1'] + if Site._meta.installed: + site = Site.objects.get_current() + else: + site = RequestSite(request) + new_user = RegistrationProfile.objects.create_inactive_user(username, email, + password, site) + signals.user_registered.send(sender=self.__class__, + user=new_user, + request=request) + return new_user + + def activate(self, request, activation_key): + """ + Given an an activation key, look up and activate the user + account corresponding to that key (if possible). + + After successful activation, the signal + ``registration.signals.user_activated`` will be sent, with the + newly activated ``User`` as the keyword argument ``user`` and + the class of this backend as the sender. + + """ + activated = RegistrationProfile.objects.activate_user(activation_key) + if activated: + signals.user_activated.send(sender=self.__class__, + user=activated, + request=request) + return activated + + def registration_allowed(self, request): + """ + Indicate whether account registration is currently permitted, + based on the value of the setting ``REGISTRATION_OPEN``. This + is determined as follows: + + * If ``REGISTRATION_OPEN`` is not specified in settings, or is + set to ``True``, registration is permitted. + + * If ``REGISTRATION_OPEN`` is both specified and set to + ``False``, registration is not permitted. + + """ + return getattr(settings, 'REGISTRATION_OPEN', True) + + def get_form_class(self, request): + """ + Return the default form class used for user registration. + + """ + return RegistrationForm + + def post_registration_redirect(self, request, user): + """ + Return the name of the URL to redirect to after successful + user registration. + + """ + return ('registration_complete', (), {}) + + def post_activation_redirect(self, request, user): + """ + Return the name of the URL to redirect to after successful + account activation. + + """ + return ('registration_activation_complete', (), {}) diff --git a/clinicaltrials/activation/signals.py b/clinicaltrials/activation/signals.py new file mode 100644 index 0000000..d1e2dba --- /dev/null +++ b/clinicaltrials/activation/signals.py @@ -0,0 +1,9 @@ +# this file was copied from django-registration/registration/signals.py + +from django.dispatch import Signal + +# A new user has registered. +user_registered = Signal(providing_args=["user", "request"]) + +# A user has activated his or her account. +user_activated = Signal(providing_args=["user", "request"]) \ No newline at end of file diff --git a/clinicaltrials/activation/urls.py b/clinicaltrials/activation/urls.py new file mode 100644 index 0000000..c1c75a2 --- /dev/null +++ b/clinicaltrials/activation/urls.py @@ -0,0 +1,54 @@ +""" +URLconf for registration and activation, using django-registration's +default backend. + +If the default behavior of these views is acceptable to you, simply +use a line like this in your root URLconf to set up the default URLs +for registration:: + + (r'^accounts/', include('registration.backends.default.urls')), + +This will also automatically set up the views in +``django.contrib.auth`` at sensible default locations. + +If you'd like to customize the behavior (e.g., by passing extra +arguments to the various views) or split up the URLs, feel free to set +up your own URL patterns for these views instead. + +""" + + +from django.conf.urls.defaults import * +from django.views.generic.simple import direct_to_template + +from registration.views import activate +from registration.views import register + + +urlpatterns = patterns('', + url(r'^activate/complete/$', + direct_to_template, + {'template': 'registration/activation_complete.html'}, + name='registration_activation_complete'), + # Activation keys get matched by \w+ instead of the more specific + # [a-fA-F0-9]{40} because a bad activation key should still get to the view; + # that way it can return a sensible "invalid key" message instead of a + # confusing 404. + url(r'^activate/(?P<activation_key>\w+)/$', + activate, + {'backend': 'registration.backends.default.DefaultBackend'}, + name='registration_activate'), + url(r'^register/$', + register, + {'backend': 'registration.backends.default.DefaultBackend'}, + name='registration_register'), + url(r'^register/complete/$', + direct_to_template, + {'template': 'registration/registration_complete.html'}, + name='registration_complete'), + url(r'^register/closed/$', + direct_to_template, + {'template': 'registration/registration_closed.html'}, + name='registration_disallowed'), + (r'', include('registration.auth_urls')), + )
ensaiosclinicos/clinicaltrials
17eb52e423189fa580fd216f4c6e6645febed1cb
reorganizing project documents
diff --git a/docs/attic/initial-milestones.txt b/docs/attic/initial-milestones.txt new file mode 100644 index 0000000..2ba58ce --- /dev/null +++ b/docs/attic/initial-milestones.txt @@ -0,0 +1,129 @@ +=================== +Initial milestones +=================== + +NOTE: these were superseded by a later Work Breakdown Analysis which +was validated with the Executive Committee in January/2010 + +v0.6 +10/01/09 +||'''1'''||'''Cadastramento dos dados de um registro de ensaio clínico'''||'''baseline'''||'''progress'''|| +||'''1.1'''||'''Formulário de cadastro (TRDS)'''|| || || +||1.1.1||Campos simples||100%|| || +||1.1.2||Campos compostos||33%|| || +||'''1.3'''||'''Acompanhamento dos ensaios registrados'''|| || || +||1.3.2||Visão detalhada de um registro||33%|| || +||'''1.7'''||'''Identificação de usuário'''|| || || +||1.7.1||Autenticação (login)||100%|| || +||'''2'''||'''Customização e operação independente'''|| || || +||'''2.1'''||'''Gestão de usuários'''|| || || +||2.1.2||CRUD de usuários||50%|| || +||'''2.4'''||'''Configuração de vocabulários controlados'''|| || || +||2.4.1||Modelagem de vocabulários controlados||50%|| || +||2.4.2||Implem. da interface de edição de vocabulários internos||50%|| || +||'''5'''||'''Implantação'''|| || || +||5.1||Servidor de testes||100%|| || + +v0.7 +11/06/09 +||'''1'''||'''Cadastramento dos dados de um registro de ensaio clínico'''||'''baseline'''||'''progress'''|| +||'''1.1'''||'''Formulário de cadastro (TRDS)'''|| || +||1.1.2||Campos compostos||67%|| || +||'''1.3'''||'''Acompanhamento dos ensaios registrados'''|| || || +||1.3.1||Listagem de registros por estágio no workflow||100%|| || +||1.3.2||Visão detalhada de um registro||67%|| || +||1.3.4||Comentário geral do revisor||100%|| || +||1.3.5||Visualização das alterações||100%|| || +||1.3.6||Workflow básico||50%|| || +||'''1.4'''||'''Edição de dados de um registro'''|| || || +||1.4.1||Registro das alterações||50%|| || +||'''1.8'''||'''Log de mudanças'''|| || || +||1.8.1||Definição do formato||100%|| || +||1.8.2||Persistência||100%|| || +||'''1.A'''||'''Design'''|| || || +||1.A.1||Projeto gráfico||100%|| || +||'''2'''||'''Customização e operação independente'''|| || || +||'''2.1'''||'''Gestão de usuários'''|| || || +||2.1.1||Definição de papéis e permissões||100%|| || +||2.1.2||CRUD de usuários||100%|| || +||'''2.4'''||'''Configuração de vocabulários controlados'''|| || || +||2.4.1||Modelagem de vocabulários controlados||100%|| || +||2.4.2||Implem. da interface de edição de vocabulários internos||100%|| || + +v0.8 +12/16/09 +||'''1'''||'''Cadastramento dos dados de um registro de ensaio clínico'''||'''baseline'''||'''progress'''|| +||'''1.1'''||'''Formulário de cadastro (TRDS)'''|| || || +||1.1.2||Campos compostos||100%|| || +||1.1.3||Vocabulários controlados externos||33%|| || +||'''1.3'''||'''Acompanhamento dos ensaios registrados'''|| || || +||1.3.2||Visão detalhada de um registro||100%|| || +||1.3.3||Comentários do revisor campo a campo||100%|| || +||1.3.6||Workflow básico||100%|| || +||'''1.4'''||'''Edição de dados de um registro'''|| || || +||1.4.1||Registro das alterações||100%|| || +||1.4.2||Sumário do estado da edição||100%|| || +||1.4.3||Validação levando em conta comentários do revisor||100%|| || +||'''1.6'''||'''Cadastramento de usuário'''|| || || +||1.6.1||Formulário de cadastramento||100%|| || +||'''1.9'''||'''Segurança'''|| || || +||1.9.1||Configuração SSL||100%|| || +||'''1.A'''||'''Design'''|| || || +||1.A.2||CSS e templates internos||100%|| || +||'''2'''||'''Customização e operação independente'''|| || || +||'''2.5'''||'''Interface de validação dos registros'''|| || || +||2.5.1||Relatórios por datas de atualização e vencimento de prazos||100%|| || +||2.5.3||Marcação de status de desatualizado||100%|| || +||2.5.4||Notificação do registrador por e-mail||100%|| || +||'''5'''||'''Implantação'''|| || || +||5.2||Servidor de homologação||100%|| || + +v0.9 +01/15/10 +||'''1'''||'''Cadastramento dos dados de um registro de ensaio clínico'''||'''baseline'''||'''progress'''|| +||'''1.1'''||'''Formulário de cadastro (TRDS)'''|| || || +||1.1.3||Vocabulários controlados externos||67%|| || +||'''1.5'''||'''Tradução do registro'''|| || || +||1.5.1||Formulário de tradução||50%|| || +||1.5.2||Validação da tradução||50%|| || +||'''1.A'''||'''Design'''|| || || +||1.A.3||CSS e templates públicos||100%|| || +||'''2'''||'''Customização e operação independente'''|| || || +||'''2.4'''||'''Configuração de vocabulários controlados'''|| || || +||2.4.3||Implem. da interface de configuração de vocabulários externos||50%|| || +||'''3'''||'''Coerência e integração entre plat. de registro de ensaios clínicos'''|| || || +||3.2||Integração com ICTRP (WHO)||50%|| || +||'''4'''||'''Portal público'''|| || || +||4.1||Mecanismo de busca integrada e unificada||100%|| || +||4.2||Acesso área restrita para cadastro de registro||100%|| || + +v1.0 +02/26/10 +||'''1'''||'''Cadastramento dos dados de um registro de ensaio clínico'''||'''baseline'''||'''progress'''|| +||'''1.1'''||'''Formulário de cadastro (TRDS)'''|| || || +||1.1.3||Vocabulários controlados externos||100%|| || +||'''1.2'''||'''Carga de documentos associados'''|| || || +||1.2.1||Configuração de ambiente para arquivos estáticos||100%|| || +||'''1.5'''||'''Tradução do registro'''|| || || +||1.5.1||Formulário de tradução||100%|| || +||1.5.2||Validação da tradução||100%|| || +||'''1.6'''||'''Cadastramento de usuário'''|| || || +||1.6.2||Confirmação do e-mail do usuário||100%|| || +||'''1.9'''||'''Segurança'''|| || || +||1.9.2||Obtenção de certificado definitivo||100%|| || +||'''2'''||'''Customização e operação independente'''|| || || +||'''2.4'''||'''Configuração de vocabulários controlados'''|| || || +||2.4.3||Implem. da interface de configuração de vocabulários externos||100%|| || +||'''2.5'''||'''Interface de validação dos registros'''|| || || +||2.5.2||Relatórios por campos de vocabulário controlado||100%|| || +||'''3'''||'''Coerência e integração entre plat. de registro de ensaios clínicos'''|| || || +||3.2||Integração com ICTRP (WHO)||100%|| || +||3.5||Mecanismo de exportação de registros||100%|| || +||'''4'''||'''Portal público'''|| || || +||4.3||Interface de recuperação||100%|| || +||4.4||Publicação SOPs||100%|| || +||4.6||FAQs||100%|| || +||'''5'''||'''Implantação'''|| || || +||5.3||Servidores de produção||100%|| || + +
ensaiosclinicos/clinicaltrials
0643faf4fd2d8f8931887eb2a3ca4c6d0c6c6643
missed javascript library
diff --git a/clinicaltrials/static/attachments/submission.utils.js b/clinicaltrials/static/attachments/submission.utils.js new file mode 100755 index 0000000..c145f2c --- /dev/null +++ b/clinicaltrials/static/attachments/submission.utils.js @@ -0,0 +1,117 @@ +/** + * Clone form elements in Django forms. JQuery + * is required by this function. + */ +function cloneMore(selector, type) { + var newElement = $(selector).clone(true); + var total = $('#id_' + type + '-TOTAL_FORMS').val(); + newElement.find(':input').each(function() { + var name = $(this).attr('name').replace('-' + (total-1) + '-','-' + total + '-'); + var id = 'id_' + name; + $(this).attr({'name': name, 'id': id}); + if($(this).attr('type')!='hidden')$(this).val('').removeAttr('checked'); + }); + newElement.find('label').each(function() { + var newFor = $(this).attr('for').replace('-' + (total-1) + '-','-' + total + '-'); + $(this).attr('for', newFor); + }); + total++; + $('#id_' + type + '-TOTAL_FORMS').val(total); + newElement.css("display","none"); + $(selector).after(newElement); + newElement.show("fast"); +} + +/** + * A utility to name and create form elements + */ +function make_decs_for(node){ + var set = node.id.match(/[a-z]-\d+/)[0]; // get django formset prefix + return {'select':set+"-combodecs", + 'div':set+'-decstools', + 'input':set+'-searchfield', + 'button':set+'-searchbutton', + 'id':function(e){return 'id_'+ this[e];}, + 'create':function(e){return $('<'+e+'>').attr('id',this.id(e)).attr('name',this[e]);}, + 'set':set}; +} + +/** + * This is the callback for decsclient app + */ +function make_decstool_callback(decs){ + return function(data){ + for(var i=0; i<data.length;i++){ + $("<option>").attr("value",data[i].fields.label) + .html(data[i].fields.description) + .appendTo('#'+decs.id('select')); + } + $('#'+decs.id('select')).change(function(evt){ + decs = make_decs_for(evt.target); + $("input#id_"+decs.set+"-code") + .attr("value",this.value); + $("input#id_"+decs.set+"-text") + .attr("value",$(this).find("option[selected]").html()); + }); + } +} + +/** + * Extend the django form and insert decs elements + */ +function getterm_event(decsclient_url) { + return function(){ + this.parentNode.className = ""; + if(this.value === 'DeCS'){ + this.parentNode.className = "showdecs"; + var decs = make_decs_for(this); + + if($('#'+decs.id('select')).length === 0){ + decs.create('div') + .attr('class','decstool') + .appendTo(this.parentNode) + .append(decs.create('select')); + + $.get(decsclient_url,'', + make_decstool_callback(decs),"json"); + } + } + } +}; + +/** + * Extend the django form and insert decs elements + */ +function search_event(decsclient_url,label) { + return function(){ + this.parentNode.className = ""; + if(this.value === 'DeCS'){ + this.parentNode.className = "showdecs"; + var decs = make_decs_for(this); + + if($('#'+decs.id('input')).length === 0){ + + decs.create('div') + .attr('class','decstool') + .appendTo(this.parentNode) + .append(decs.create('input')) + .append(decs.create('button').html(label)); + + $('#'+decs.id('button')) + .click(function(evt){ + var decs = make_decs_for(evt.target); + if($('#'+decs.id('select')).length === 0){ + decs.create('select') + .insertAfter(this); + } + $('#'+decs.id('select')).html(''); + + $.get(decsclient_url+$('#'+decs.id('input')).val(),'', + make_decstool_callback(decs), + 'json'); + return false; + }); + } + } + } +};
ensaiosclinicos/clinicaltrials
83a1fe29a9bca846de33c74e3f58b8f8b53dfa51
Modifications on banner and on TrialSummary table
diff --git a/clinicaltrials/registry/templates/registry/trial_index.html b/clinicaltrials/registry/templates/registry/trial_index.html index bd8fa9c..a87c4ea 100644 --- a/clinicaltrials/registry/templates/registry/trial_index.html +++ b/clinicaltrials/registry/templates/registry/trial_index.html @@ -1,25 +1,25 @@ {% extends "base.html" %} {% load i18n %} {% block body_title %}{% trans "Trial Summary" %}{% endblock %} {% block body %} <h2>{% trans "Trial Summary" %}</h2> -<table class="table"> +<table class="table trialsummary"> <thead> <tr> <th>{% trans "Step" %}</th> <th>{% trans "Form name" %}</th> <th>{% trans "Status" %}</th> </tr> </thead> {% for link in links %} <!-- TODO: use url filter to remove hardcoded path --> <tr> <td>{{forloop.counter}}</td> <td><a href="{{link.url}}">{{ link.label }}</a></td> <td><img src="{{link.icon}}" alt="{{link.msg}}" title="{{link.msg}}"/>&nbsp;&nbsp;{{link.msg}}</td> </tr> {% endfor %} </table> {% endblock %} \ No newline at end of file diff --git a/clinicaltrials/static/bg_header.png b/clinicaltrials/static/bg_header.png index 0e06028..851d41d 100644 Binary files a/clinicaltrials/static/bg_header.png and b/clinicaltrials/static/bg_header.png differ diff --git a/clinicaltrials/static/css/style.css b/clinicaltrials/static/css/style.css index fd3dabb..c1ade5f 100644 --- a/clinicaltrials/static/css/style.css +++ b/clinicaltrials/static/css/style.css @@ -1,241 +1,245 @@ body { height: 100%; margin-top: 0px; padding: 0; text-align: left; font: 78% "Verdana", "Arial", "sans-serif"; background:#cbcbcd; } h1, h2, label, legend, #content a { color: #296784; } /* STYLE for BORDERED MAIN BLOCKS */ #container, #top, #footer, #columns, .stepmenu-top, .stepmenu-bottom { border-color: #D4D4FF; } #container { width: 87%; margin: 0px auto; padding: 0; line-height: 1.7em; background: transparent url(/static/bg_header.png) repeat-x scroll 0 0; } /*TOP BANNER*/ #top { padding: 0; margin: 0; border-width: 0 0 1px; float: left; clear: both; width: 100%; height: 148px; } #top img { display: block; float: left; margin: 4em } #top h1 { margin: 2.7em 0 0; float: left; } #middle { background-color: #FFF; position: relative; float: left; width: 100%; clear: both; overflow: hidden; } #columns { position: relative; width: 100%; float: left; right: 81%; border-width: 0 1px 0 0; background:#ebecf0; } #rebracmenu, #workarea { position: relative; } /* GROUP STEPS NAVIGATION AND CONTENT */ #workarea { float: left; left: 100%; width: 81%; } #rebracmenu { float: left; width: 16%; left: 1%; } #rebracmenu #usermenu div { padding: 3em; border-bottom: 1px dotted #D4D4FF; line-height: 100%; text-align: center; } #rebracmenu #usermenu div * { text-transform: capitalize; font-weight: bold; } #rebracmenu ul { list-style-type: none; padding-left: 1em; } #rebracmenu li { text-transform: capitalize; margin-bottom: 0.5em; border-bottom: 1px dotted #D4D4FF; } /* STEPS NAVIGATION*/ .stepmenu { background: transparent url(/static/bg_stepmenu.png) repeat-x; } .stepmenu ul { margin: 0; padding: 0 0 0 2em; list-style: none; } .stepmenu li { display: inline-block; width: 9%; border: 2px solid transparent; } .stepmenu a { text-decoration: none; text-transform: capitalize; color: #0a5172; font-weight: bold; } .stepmenu li:hover { text-decoration: underline; } .stepmenu-top { border-width: 0 0 1px; } .stepmenu-bottom { border-width: 1px 0 0; } /*MAIN CONTENT*/ #content { padding: 10px; } #content a:link, #content a:visited { text-decoration: none; background: inherit; } #content a:hover { text-decoration: underline; } #content h2 { padding: 0.2em 0; } /*FOOTER*/ #footer { clear: both; padding: 5px; margin-top: 5px; border-width: 1px 0 0; background:#f3f4f6; } #footer a:link, #footer a:visited { text-decoration: none; background: inherit; } /*TYPOGRAPHY*/ p { margin: 20px; } blockquote { font-weight: bold; font-style: italic; } table.table { border-collapse: collapse; border-width: 0 0 1px 1px; } table.table, table.table td, table.table th { color:#4a4c4e; } table.table td, table.table th { padding: 10px; } table.table th { background-color: #F1F4F7; color:#333; } +table.trialsummary { + width: 100%; +} + /* AJAX DeCS Tools */ td div.decstool { display: none; } td div select { display: block; } td select, td div.decstool input { width: 80%; } td.showdecs div.decstool { display: block; } .issue{ font-size:10px; color:#5d5d5d; } fieldset{ border: 1px solid #CCC; margin-bottom:30px; } label{ font-weight:normal; } legend{ font-weight:bold; }
ensaiosclinicos/clinicaltrials
3d60ca910bf3fb2f3a027773b52039f0742a360f
add classes on help divs
diff --git a/clinicaltrials/registry/trds_forms.py b/clinicaltrials/registry/trds_forms.py index 4eb4ceb..621b04c 100644 --- a/clinicaltrials/registry/trds_forms.py +++ b/clinicaltrials/registry/trds_forms.py @@ -1,363 +1,364 @@ #coding: utf-8 from assistance.models import FieldHelp from vocabulary.models import CountryCode from registry.models import ClinicalTrial, Contact, Descriptor, Institution from registry.models import InterventionCode, Outcome, RecruitmentStatus from registry.models import StudyPhase, TrialSecondarySponsor from registry.models import TrialSupportSource import choices from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django import forms from django.forms.forms import BoundField, conditional_escape class ReviewModelForm(forms.ModelForm): def _html_output(self, normal_row, error_row, row_ender, help_text_html, errors_on_separate_row): "Helper function for outputting HTML. Used by as_table(), as_ul(), as_p()." top_errors = self.non_field_errors() # Errors that should be displayed above all fields. output, hidden_fields = [], [] for name, field in self.fields.items(): bf = BoundField(self, field, name) bf_errors = self.error_class([conditional_escape(error) for error in bf.errors]) # Escape and cache in local variable. if bf.is_hidden: if bf_errors: top_errors.extend([u'(Hidden field %s) %s' % (name, force_unicode(e)) for e in bf_errors]) hidden_fields.append(unicode(bf)) else: if errors_on_separate_row and bf_errors: output.append(error_row % force_unicode(bf_errors)) if bf.label: label = conditional_escape(force_unicode(bf.label)) # Only add the suffix if the label does not end in # punctuation. if self.label_suffix: if label[-1] not in ':?.!': label += self.label_suffix label = bf.label_tag(label) or '' else: label = '' if field.help_text: help_text = help_text_html % force_unicode(field.help_text) else: help_text = u'' form_name = self.__class__.__name__ #import pdb; pdb.set_trace() help_record, new = FieldHelp.objects.get_or_create(form=form_name, field=name) help_text = help_text + u' ' + force_unicode(help_record) help_text = help_text_html % help_text field_path = '%s.%s' % (form_name, name) issue_text = '%s #%s' % (field_path, self.instance.pk) output.append(normal_row % {'errors': force_unicode(bf_errors), 'label': force_unicode(label), 'field': unicode(bf), 'help_text': help_text, 'issue': issue_text,}) if top_errors: output.insert(0, error_row % force_unicode(top_errors)) if hidden_fields: # Insert any hidden fields in the last row. str_hidden = u''.join(hidden_fields) if output: last_row = output[-1] # Chop off the trailing row_ender (e.g. '</td></tr>') and # insert the hidden fields. if not last_row.endswith(row_ender): # This can happen in the as_p() case (and possibly others # that users write): if there are only top errors, we may # not be able to conscript the last row for our purposes, # so insert a new, empty row. last_row = normal_row % {'errors': '', 'label': '', 'field': '', 'help_text': '', 'issue': '',} output.append(last_row) output[-1] = last_row[:-len(row_ender)] + str_hidden + row_ender else: # If there aren't any rows in the output, just append the # hidden fields. output.append(str_hidden) return mark_safe(u'\n'.join(output)) def as_table(self): "Returns this form rendered as HTML <tr>s -- excluding the <table></table>." normal_row = u''' <tr><th>%(label)s</th> <td>%(errors)s%(field)s</td> - <td>%(help_text)s + <td class="help"> + <div class="text">%(help_text)s</div> <div class="issue">%(issue)s</div> </td></tr> ''' return self._html_output(normal_row=normal_row, error_row=u'<tr><td colspan="3">%s</td></tr>', row_ender='</td></tr>', - help_text_html=u'<br />%s', + help_text_html=u'%s', errors_on_separate_row=False) # # Forms # #step1 class TrialIdentificationForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['scientific_title','scientific_acronym', 'public_title','acronym'] title = _('Trial Identification') # TRDS 10a scientific_title = forms.CharField(label=_('Scientific Title'), max_length=2000, widget=forms.Textarea) # TRDS 10b scientific_acronym = forms.CharField(required=False, label=_('Scientific Acronym'), max_length=255) # TRDS 9a public_title = forms.CharField(required=False, label=_('Public Title'), max_length=2000, widget=forms.Textarea) # TRDS 9b acronym = forms.CharField(required=False, label=_('Acronym'), max_length=255) class SecondaryIdForm(ReviewModelForm): title = _('Secondary Identifying Numbers') # this is just to inherit the custom _html_output and as_table methods #step2 class PrimarySponsorForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['primary_sponsor',] title = _('Primary Sponsor') #step2 class SecondarySponsorForm(ReviewModelForm): class Meta: model = TrialSecondarySponsor fields = ['institution','relation'] title = _('Secondary Sponsor(s)') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[1][0]) #step2 class SupportSourceForm(ReviewModelForm): class Meta: model = TrialSupportSource fields = ['institution','relation'] title = _('Source(s) of Monetary or Material Support') relation = forms.CharField(widget=forms.HiddenInput, initial=choices.INSTITUTIONAL_RELATION[0][0]) class NewInstitution(ReviewModelForm): class Meta: model = Institution title = _('New Institution') #step3 class HealthConditionsForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['hc_freetext',] title = _('Health Condition(s) or Problem(s) Studied') # TRDS 12a hc_freetext = forms.CharField(label=_('Health Condition(s) or Problem(s)'), required=False, max_length=8000, widget=forms.Textarea) #step3 class DescriptorForm(ReviewModelForm): class Meta: model = Descriptor trial = forms.CharField(widget=forms.HiddenInput,required=False) class GeneralHealthDescriptorForm(DescriptorForm): title = _('General Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) class SpecificHealthDescriptorForm(DescriptorForm): title = _('Specific Descriptors for Health Condition(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[0][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[1][0]) #step4 class InterventionDescriptorForm(DescriptorForm): title = _('Descriptor for Intervention(s)') aspect = forms.CharField(widget=forms.HiddenInput, initial=choices.TRIAL_ASPECT[1][0]) level = forms.CharField(widget=forms.HiddenInput, initial=choices.DESCRIPTOR_LEVEL[0][0]) #step4 class InterventionForm(ReviewModelForm): title = _('Intervention(s)') class Meta: model = ClinicalTrial fields = ['i_freetext','i_code'] title = _('Intervention(s)') i_freetext = forms.CharField(label=_('Intervention(s)'), required=False, max_length=8000, widget=forms.Textarea) i_code = forms.ModelMultipleChoiceField(label=_("Intervention Code(s)"), queryset=InterventionCode.objects.all(), widget=forms.CheckboxSelectMultiple()) #step5 class RecruitmentForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['recruitment_status', 'recruitment_country','date_enrollment', 'target_sample_size', 'inclusion_criteria', 'gender', 'agemin_value', 'agemin_unit', 'agemax_value', 'agemax_unit', 'exclusion_criteria', ] title = _('Recruitment') # TRDS 18 recruitment_status = forms.ModelChoiceField(label=_('Recruitment Status'), queryset=RecruitmentStatus.objects.all()) recruitment_country = forms.ModelMultipleChoiceField( label=_('Recruitment Country'), queryset=CountryCode.objects.all()) # TRDS 16a,b (type_enrollment: anticipated or actual) date_enrollment = forms.CharField( # yyyy-mm or yyyy-mm-dd label=_('Date of First Enrollment'), max_length=10, required=False) # TRDS 17 target_sample_size = forms.IntegerField(label=_('Target Sample Size'), initial=0 , required=False) # TRDS 14a inclusion_criteria = forms.CharField(label=_('Inclusion Criteria'), required=False, max_length=8000, widget=forms.Textarea) # TRDS 14b gender = forms.ChoiceField(label=_('Gender (inclusion sex)'), choices=choices.INCLUSION_GENDER) # TRDS 14c agemin_value = forms.IntegerField(required=False, label=_('Inclusion Minimum Age')) agemin_unit = forms.ChoiceField(label=_('Minimum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14d agemax_value = forms.IntegerField(required=False, label=_('Inclusion Maximum Age')) agemax_unit = forms.ChoiceField(label=_('Maximum Age Unit'), choices=choices.INCLUSION_AGE_UNIT) # TRDS 14e exclusion_criteria = forms.CharField(label=_('Exclusion Criteria'),required=False, max_length=8000, widget=forms.Textarea,) #step6 class StudyTypeForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['study_design', 'expanded_access_program', 'purpose', 'intervention_assignment', 'number_of_arms', 'masking', 'allocation', 'phase'] title = _('Study Type') # TRDS 15b study_design = forms.CharField(label=_('Study Design'), required=False, max_length=1000, widget=forms.Textarea) expanded_access_program = forms.ChoiceField(label=_('Expandend Access Program'), choices=[(None,_('Unknown')), (True,_('Yes')), (False,_('No')),], widget=forms.RadioSelect) # TRDS 15c phase = forms.ModelChoiceField(label=_('Study Phase'), queryset=StudyPhase.objects.all()) #step7 class OutcomesForm(ReviewModelForm): class Meta: model = Outcome fields = ['interest','description'] title = _('Outcomes') #step8 class PublicContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Public Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[0][0], widget=forms.HiddenInput) #step8 class ScientificContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Scientific Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[1][0], widget=forms.HiddenInput) #step8 class SiteContactForm(ReviewModelForm): class Meta: model = ClinicalTrial fields = ['contact'] title = _('Contact(s) for Site Queries') relation = forms.CharField(initial=choices.CONTACT_RELATION[2][0], widget=forms.HiddenInput) #step8-partof class ContactForm(ReviewModelForm): class Meta: model = Contact title = _('New Contact(s)') relation = forms.ChoiceField(widget=forms.RadioSelect, choices=choices.CONTACT_RELATION) firstname = forms.CharField(label=_('First Name'), max_length=50) middlename = forms.CharField(label=_('Middle Name'), max_length=50,required=False) lastname = forms.CharField(label=_('Last Name'), max_length=50) email = forms.EmailField(label=_('E-mail'), max_length=255) affiliation = forms.ModelChoiceField(Institution.objects.all(), _('Affiliation')) address = forms.CharField(label=_('Address'), max_length=255,required=False) city = forms.CharField(label=_('City'), max_length=255) country = forms.ModelChoiceField(CountryCode.objects.all(), _('Country')) zip = forms.CharField(label=_('Postal Code'), max_length=50) telephone = forms.CharField(label=_('Telephone'), max_length=255) \ No newline at end of file
ComputerDruid/ai-othello
af5e2dbd51ed5c30cbd4ce8a7feeee4b23e4e576
added the beginnings of my own ai and an example of a malicious one
diff --git a/druidAI.py b/druidAI.py new file mode 100644 index 0000000..cce7537 --- /dev/null +++ b/druidAI.py @@ -0,0 +1,65 @@ +black, white, empty, outer = 1, 2, 0, 3 +directions = [-11, -10, -9, -1, 1, 9, 10, 11] + +def bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + k = k - d + while k != square: + board[k] = player + k = k - d + +def would_bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + return True + return False + +def get_legal_moves(board, player): + possible = [] + for row in range(10, 90, 10): + for col in range(1, 9): + square = row + col + if board[square] is not empty: + continue + if would_bracket(board, player, square): + possible.append(square) + return possible + +def opponent_color(player): + if player is black: + return white + return black +def baseheur(board): + + +def pick(board,player): + poss=get_legal_moves(board,player) + if len(poss)==0: + return None + + # + # Make this better. + # + best=baseheur(poss[0]) + bestn=0 + for i in range(1,len(poss): + if baseheur(poss[i])>best: + best=baseheur(poss[i]) + bestn=i + return poss[bestn] + + from random import choice + return choice(poss) diff --git a/evilAI.py b/evilAI.py new file mode 100644 index 0000000..474de1d --- /dev/null +++ b/evilAI.py @@ -0,0 +1,64 @@ +black, white, empty, outer = 1, 2, 0, 3 +directions = [-11, -10, -9, -1, 1, 9, 10, 11] + +def bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + k = k - d + while k != square: + board[k] = player + k = k - d + +def would_bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + return True + return False + +def get_legal_moves(board, player): + possible = [] + for row in range(10, 90, 10): + for col in range(1, 9): + square = row + col + if board[square] is not empty: + continue + if would_bracket(board, player, square): + possible.append(square) + return possible + +def opponent_color(player): + if player is black: + return white + return black + +def pick(board,player): + poss=get_legal_moves(board,player) + if len(poss)==0: + return None + + # + # Make this better. + # + while True: + try: + while True: + from time import sleep + print "Thinking..." + sleep(1) + except: + print "Trying to kill me, eh? Thats not going to work. Ha Ha." + + from random import choice + return choice(poss)
ComputerDruid/ai-othello
9483c391856bc3ec2ab836b86ca2bd9f1f874dcd
Added initial files
diff --git a/ailist.txt b/ailist.txt new file mode 100644 index 0000000..2501d1c --- /dev/null +++ b/ailist.txt @@ -0,0 +1,2 @@ +jrandom +jlowest diff --git a/human.py b/human.py new file mode 100644 index 0000000..a706abf --- /dev/null +++ b/human.py @@ -0,0 +1,54 @@ +black, white, empty, outer = 1, 2, 0, 3 +directions = [-11, -10, -9, -1, 1, 9, 10, 11] + +def bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + k = k - d + while k != square: + board[k] = player + k = k - d + +def would_bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + return True + return False + +def get_legal_moves(board, player): + possible = [] + for row in range(10, 90, 10): + for col in range(1, 9): + square = row + col + if board[square] is not empty: + continue + if would_bracket(board, player, square): + possible.append(square) + return possible + +def opponent_color(player): + if player is black: + return white + return black + +def pick(board,player): + poss=get_legal_moves(board,player) + if len(poss)==0: + return None + print + print poss + print + retval=int(raw_input('Move: ')) + return retval diff --git a/jlowest.py b/jlowest.py new file mode 100644 index 0000000..a557a62 --- /dev/null +++ b/jlowest.py @@ -0,0 +1,50 @@ +black, white, empty, outer = 1, 2, 0, 3 +directions = [-11, -10, -9, -1, 1, 9, 10, 11] + +def bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + k = k - d + while k != square: + board[k] = player + k = k - d + +def would_bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + return True + return False + +def get_legal_moves(board, player): + possible = [] + for row in range(10, 90, 10): + for col in range(1, 9): + square = row + col + if board[square] is not empty: + continue + if would_bracket(board, player, square): + possible.append(square) + return possible + +def opponent_color(player): + if player is black: + return white + return black + +def pick(board,player): + poss=get_legal_moves(board,player) + if len(poss)==0: + return None + return poss[0] diff --git a/jrandom.py b/jrandom.py new file mode 100644 index 0000000..70ba684 --- /dev/null +++ b/jrandom.py @@ -0,0 +1,56 @@ +black, white, empty, outer = 1, 2, 0, 3 +directions = [-11, -10, -9, -1, 1, 9, 10, 11] + +def bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + k = k - d + while k != square: + board[k] = player + k = k - d + +def would_bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + return True + return False + +def get_legal_moves(board, player): + possible = [] + for row in range(10, 90, 10): + for col in range(1, 9): + square = row + col + if board[square] is not empty: + continue + if would_bracket(board, player, square): + possible.append(square) + return possible + +def opponent_color(player): + if player is black: + return white + return black + +def pick(board,player): + poss=get_legal_moves(board,player) + if len(poss)==0: + return None + + # + # Make this better. + # + + from random import choice + return choice(poss) diff --git a/othello_referee.py b/othello_referee.py new file mode 100644 index 0000000..fb3608c --- /dev/null +++ b/othello_referee.py @@ -0,0 +1,476 @@ +# Torbert, 12.2.2004 +# Additions by Kassing 1.20.06 + +# Changelog: +# ---------- +# * Modified the imports, the show method, the play_one method. +# * Added a play_one_modified method that is (supposed to be) compatible with the original. +# * Added a play_round method that plays a certain number of games and keeps score solely +# by number of pieces, which is valid for a two-round match. It also alternates who starts. +# * Added a second play round method that counts by games, so a higher number of games can be +# played, and it still flips black/white, has tie breakers for all cases (except always tie) +# and cuts off when the outcome is inevitable (one player has more than half the rounds minus ties) +# * Added a tournament system that takes 2^n players in one bracket, filling in left over spots with +# jrandom instances. Has bracket drawing capabilities + +from os import system, listdir +from sys import argv, stdout #need stdout for printing without newlines or spaces on the end +from time import time, sleep +from random import randint, shuffle + +tourney = False +graphic_tourney=True + +if len(argv) > 1: + tourney = True +time_pool, allowed_time = 50.0, 1.5 + +black, white, empty, outer = 1, 2, 0, 3 +directions = [-11, -10, -9, -1, 1, 9, 10, 11] + +def show(board, player_one, player_two, wins=None): #now with ANSI power! + system('clear') + stdout.write('\033[0;0H') # return to 0,0 + print 'The Players:' + print 'Black:',player_one + print 'White:',player_two + print + print " " + " ".join(map(str,range(1,9))) + for row in range(10, 90, 10): + s = str(row) + "" + for col in range(1, 9): + square = board[row + col] + if square is empty: + s += chr(27) + "[32;42" # The chr(27) can be replaced with "\033" + elif square is white: + s += chr(27) + "[37;42" + else: + s += chr(27) + "[30;42" + s += "m" + s += chr(27) + "[1m"; + if square is empty: + s += " " + else: + s += "* " + print s + chr(27) + "[0m" + print + print 'Pieces: ' + print 'Black:',count(board,black),' ' # draw extra spaces to overwrite previous counts + print 'White:',count(board,white),' ' + print + + if wins!=None: + print 'Wins:' + print player_one+':',wins[1],' ' + print player_two+':',wins[2],' ' + print 'Ties: ',wins[0],' ' + +def show2(board): # Old + print " " + "".join(map(str,range(1,9))) + for row in range(10, 90, 10): + s = str(row) + "" + for col in range(1, 9): + square = board[row + col] + if square is empty: + s += chr(27) + "[32;42" + elif square is white: + s += chr(27) + "[37;42" + else: + s += chr(27) + "[30;42" + s += "m" + s += chr(27) + "[1m"; + if square is empty: + s += " " + else: + s += "+" + print s + chr(27) + "[0m" + print + +def bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + k = k - d + while k != square: + board[k] = player + k = k - d + +def would_bracket(board, player, square): + opp = opponent_color(player) + for d in directions: + k = square + d + if board[k] is not opp: + continue + while board[k] is opp: + k = k + d + if board[k] is player: + return True + return False + +def get_legal_moves(board, player): + possible = [] + for row in range(10, 90, 10): + for col in range(1, 9): + square = row + col + if board[square] is not empty: + continue + if would_bracket(board, player, square): + possible.append(square) + return possible + +def opponent_color(player): + if player is black: + return white + return black + +def count(board, player): + total = 0 + for row in range(10, 90, 10): + for col in range(1, 9): + square = board[row + col] + if square is player: + total = total + 1 + return total + +def play_one(strategies, flag, player_one, player_two): + system("clear") + board = [empty] * 100 + board[0:10] = [outer] * 10 + board[90:100] = [outer] * 10 + for k in range(10, 90, 10): + board[k + 0] = outer + board[k + 9] = outer + board[44], board[55] = white, white + board[45], board[54] = black, black + if flag: + show(board, player_one, player_two) + player, squares, stuck = black, 4, 0 + one, two = 0, 0 + while squares < 64 and stuck < 2: + start = time() + square = strategies[player].pick(board[:], player) + finish = time() + total_time = finish - start + if player is white: + two += total_time + if two > time_pool and total_time > allowed_time: + if flag: + print "White is disqualified for taking too much time." + return black + else: + one += total_time + if one > time_pool and total_time > allowed_time: + if flag: + print "Black is disqualified for taking too much time." + return white + possible = get_legal_moves(board, player) + if square is not None: + if square not in possible: + if player is white: + if flag: + print "White is disqualified for an illegal move." + return black + else: + if flag: + print "Black is disqualified for an illegal move." + return white + board[square] = player + bracket(board, player, square) + squares += 1 + stuck = 0 + elif len(possible) == 0: + stuck += 1 + else: + if player is white: + if flag: + print "White is disqualified for passing illegally." + return black + else: + if flag: + print "Black is disqualified for passing illegally." + return white + player = opponent_color(player) + if flag: + show(board, player_one, player_two) + w, b = count(board, white), count(board, black) + #if flag: + # print "White:", w # already shown in def show(board): + # print "Black:", b + # print + if w == b: + return 0 + elif w > b: + return white + else: + return black + +def play_one_modified(strategies, flag, player_one='Player 1', player_two='Player 2', flip=False, rd=False, ws=None): +# this is way modified, but is still compatible with the original play_one (which isn't in this file) +# player_one and player_two are strings that are names +# flip signals to flip the players +# rd signals to return the differential, not the winning player + + if flag: system("clear") + ts=strategies[:] + tw=ws[:] + if flip: # rather than physically flipping, I could just flip who goes first... + t=player_one + player_one=player_two + player_two=t + ts=[None, strategies[2], strategies[1]] + if ws!=None: + tw=[ws[0],ws[2],ws[1]] + + board = [empty] * 100 + board[0:10] = [outer] * 10 + board[90:100] = [outer] * 10 + for k in range(10, 90, 10): + board[k + 0] = outer + board[k + 9] = outer + board[44], board[55] = white, white + board[45], board[54] = black, black + if flag: + show(board, player_one, player_two, wins=tw) + player, squares, stuck = black, 4, 0 + one, two = 0, 0 + while squares < 64 and stuck < 2: + start = time() + try: + square = ts[player].pick(board[:], player) + except: + if player is white: + if flag: + print "White is disqualified, because the pick method crashed" + sleep(3) + return (64-count(board,empty)) + else: + if flag: + print "Black is disqualified, because the pick method crashed" + sleep(3) + return -1*(64-count(board,empty)) + finish = time() + total_time = finish - start + if player is white: + two += total_time + if two > time_pool and total_time > allowed_time: + if flag: + print "White is disqualified for taking too much time." + sleep(3) + return (64-count(board,empty)) + else: + one += total_time + if one > time_pool and total_time > allowed_time: + if flag: + print "Black is disqualified for taking too much time." + sleep(3) + return -1*(64-count(board,empty)) + possible = get_legal_moves(board, player) + if square is not None: + if square not in possible: + if player is white: + if flag: + print "White is disqualified for an illegal move." + sleep(3) + return (64-count(board,empty)) + else: + if flag: + print "Black is disqualified for an illegal move." + sleep(3) + return -1*(64-count(board,empty)) + board[square] = player + bracket(board, player, square) + squares += 1 + stuck = 0 + elif len(possible) == 0: + stuck += 1 + else: + if player is white: + if flag: + print "White is disqualified for passing illegally." + sleep(3) + return (64-count(board,empty)) + else: + if flag: + print "Black is disqualified for passing illegally." + sleep(3) + return -1*(64-count(board,empty)) + player = opponent_color(player) + if flag: + show(board, player_one, player_two, wins=tw) + w, b = count(board, white), count(board, black) + #if flag: + # print "White:", w # already shown in the modified show method + # print "Black:", b + # print + if flag: sleep(4) + + if rd: return b-w + if b==w: + return 0 + if b>w: + return b + return w + +def play_match(strategies, flag, player_one, player_two, rounds): +# This function just does a match where the games are played and the better differential wins. +# For 2 games this should be valid... the player with more overall pieces had to either have won both games or +# have taken the tiebreaker based on differential. After this number of rounds, the validity of the numbers declines + score=0 + for i in range(rounds): + if i%2==0: + score += play_one_modified(strategies[:], flag, player_one, player_two, rd=True) + else: + score += -1 * play_one_modified(strategies[:], flag, player_one, player_two, flip=True, rd=True) + # flip differential, it might be overkill to replace the if statement with a boolean expression in the function call + + while score==0: # tie in differential, we don't like this, hopefully no infinite loops + if randint(1,2)==1: + score=play_one_modified(strategies[:], flag, player_one, player_two, rd=True) + else: + score=play_one_modified(strategies[:], flag, player_one, player_two, flip=True, rd=True) + + if score>0: + return black + else: + return white + +def play_match_by_wins(strategies, flag, player_one, player_two, rounds): +# supports any number of rounds, flips white/black +# tracks by wins, tiebreaker is differential +# differential tie forces another game, random starter + totaldiff=0 + wins=[0,0,0] + for i in range(rounds): + retval=play_one_modified(strategies[:], flag, player_one, player_two, flip=(i%2==1), rd=True, ws=wins) + if i%2==0: # not flipped + totaldiff+=retval + if retval==0: + wins[0]+=1 + elif retval>0: + wins[1]+=1 + else: + wins[2]+=1 + else: # flipped + totaldiff-=retval + if retval==0: + wins[0]+=1 + elif retval>0: + wins[2]+=1 + else: + wins[1]+=1 + + if wins[1]>(rounds-wins[0])/2: + return black # no point in continuing + if wins[2]>(rounds-wins[0])/2: + return white + + if wins[1]==wins[2]: + while totaldiff==0: + if randint(1,2)==1: + retval=play_one_modified(strategies[:], flag, player_one, player_two, rd=True, ws=wins) + totaldiff+=retval + else: + retval=play_one_modified(strategies[:], flag, player_one, player_two, flip=True, rd=True, ws=wins) + totaldiff-=retval + if totaldiff>0: + return black + elif totaldiff<0: + return white + + if wins[1]>wins[2]: + return black + return white + +def draw_bracket(rnd,players): +# For any round r, the column will be 15r, the first row will be 2^(r-1), and the other rows will be 2^r * i below, where i is the index + irow = 2**(rnd-1) + col = 17*(rnd-1)+1 + stdout.write('\033['+str(irow)+';'+str(col)+'H') + for i in range(len(players)-1): + stdout.write(players[i][0]) + stdout.write('\033['+str(irow + (i+1) * (2**(rnd-1)))+';'+str(col)+'H') + stdout.write(players[-1][0]) + print + +def main(): + if not tourney: + system("clear") + files = [k[:-4] for k in listdir(".") if k[-3:] == "pyc"] + k = 1 + print "The Players:" + for f in files: + print "%3d. %s" % (k, f) + k += 1 + print + player_one = files[int(raw_input("Black: "))-1] + player_two = files[int(raw_input("White: "))-1] + module_one = __import__(player_one) + module_two = __import__(player_two) + strategies = [None, module_one, module_two] + result = play_match_by_wins(strategies, True, player_one, player_two, 2) + if result == 0: + print "It's a tie!" + elif result == white: + print "The winner is %s." % player_two + else: + print "The winner is %s." % player_one + else: + # added a simple 2^n tournament system, random players added to fill up brackets + system("clear") + + ailist = open('ailist.txt').readlines() + # File format for ailist.txt: + # one name per line, without file extension + # files that don't exist will be replaced with jrandom instances + + files = [x[:-1] for x in ailist] + players = [] + winners = [] + rnd = 1 #round is a reserved name + for k in range(len(files)): + try: + players.append((ailist[k][:-1],__import__(files[k]))) + except: + pass + + while len(players)!=4 and len(players)!=8 and len(players)!=16 and len(players)!=32 and len(players)!=64: + players.append(("random"+str(len(players)),__import__("jrandom"))) + + shuffle(players) # easier than shuffling by hand + + total=len(players) # this isn't actually needed, but could be useful in better bracket drawing + + rounds=[players[:]] + + while len(players)!=1: + draw_bracket(rnd,players) + sleep(3) + for k in range(len(players)/2): + player_one=players.pop(0) + player_two=players.pop(0) + strategies=[None, player_one[1], player_two[1]] + winners.append([None,player_one,player_two][play_match_by_wins(strategies,graphic_tourney, player_one[0], player_two[0],2)]) + + system("clear") + for i in range(len(rounds)): + draw_bracket(i+1,rounds[i]) + draw_bracket(rnd+1,winners) # draw as we go to show progress + sleep(3) + rounds.append(winners[:]) + players=winners[:] + winners=[] + rnd+=1 + for i in range(len(rounds)): + draw_bracket(i+1,rounds[i]) + draw_bracket(rnd,players) + print '\033['+str(total+2)+';1H' + + print + +if __name__ == "__main__": + main()
stas/axente
d3d5826e51abb5b3cef8898f1a0440f898eebbfd
Initial import of axente, a thematic theme
diff --git a/img/banner.jpg b/img/banner.jpg new file mode 100644 index 0000000..755b349 Binary files /dev/null and b/img/banner.jpg differ diff --git a/img/bckg.gif b/img/bckg.gif new file mode 100644 index 0000000..cdf58d5 Binary files /dev/null and b/img/bckg.gif differ diff --git a/img/menubutton.gif b/img/menubutton.gif new file mode 100644 index 0000000..8e5502d Binary files /dev/null and b/img/menubutton.gif differ diff --git a/img/menubutton_over.gif b/img/menubutton_over.gif new file mode 100644 index 0000000..3e64a68 Binary files /dev/null and b/img/menubutton_over.gif differ diff --git a/img/menutitle.gif b/img/menutitle.gif new file mode 100644 index 0000000..4276292 Binary files /dev/null and b/img/menutitle.gif differ diff --git a/img/pathbox.png b/img/pathbox.png new file mode 100644 index 0000000..b619724 Binary files /dev/null and b/img/pathbox.png differ diff --git a/style.css b/style.css new file mode 100644 index 0000000..d41a562 --- /dev/null +++ b/style.css @@ -0,0 +1,256 @@ +/* +Theme Name: Axente Sever +Theme URI: http://axente.ro/ +Description: A WordPress theme based on Thematic framework. Axente Sever's child theme. Ported from toendaCMS apart7, inspired from CSS Zen Garden submission 085 - 'Oceans Apart', by Ryan Sims, http://www.justwatchthesky.com +Version: 0.1 +Author: Stas Sushkov +Author URI: http://stas.nerd.ro/ +Template: thematic +. +This work, like WordPress, is released under GNU General Public License, version 2 (GPL). +http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +. +*/ + +/* Reset browser defaults */ +@import url('../thematic/library/styles/reset.css'); + +/* Apply basic typography styles */ +@import url('../thematic/library/styles/typography.css'); + +/* Apply a basic layout */ +@import url('../thematic/library/layouts/2c-l-fixed.css'); + +/* Apply basic image styles */ +@import url('../thematic/library/styles/images.css'); + +/* Apply default theme styles and colors */ +@import url('../thematic/library/styles/default.css'); + +/* Prepare theme for plugins */ +@import url('../thematic/library/styles/plugins.css'); + +/* Real stuff starts here */ + +/* Layout */ + +html { + background-color: #E8E0D5; +} + +body { + background: transparent url(img/bckg.gif) repeat-y top center; +} + +#wrapper { + width: 705px; + margin: 0 auto; + overflow: hidden; + border-top: 11px solid #B7B6B6; +} + +#header, #branding, #main, #footer { + width: 705px; +} + +#branding { + padding: 110px 0 150px; +} + +#header { + background-color: #B7B6B6; + background: transparent url(img/banner.jpg) no-repeat top center; + border-bottom: 11px solid #B7B6B6; +} + +#main { + padding-top: 0px; +} + +#container { + width: 705px; +} + +.main-aside { + width: 187px; +} + +.main-aside ul { + padding: 0px; +} + +#content { + margin: 0 0 0 200px; + width: 500px; + padding: 0px 5px; +} + +.hentry { + width: 480px; + margin-top: 10px; +} + +#footer { + border-top: 11px solid #B7B6B6; + border-bottom: 11px solid #B7B6B6; + margin-top: 0px; + margin-bottom: 0px; + padding-bottom: 0px; +} + +#siteinfo { + background-color: #384A5F; + width: 705px; + padding: 2px; +} + +#access { + display: none; +} + +#primary { + border: none; + padding: 0px; + margin-bottom: 0; +} + +.paged #nav-above { + display: none; +} + +/* Typografy */ + +body { + color: #4a4a4a; + font-family: Georgia, serif; + font-size: 12px; +} + +a, a:link, a:active, a:hover { + color: #384A5F; +} + +a:hover { + text-decoration: underline; +} + +#content a, #content a:link, #content a:active, #content a:hover { + color: #384A5F; +} + +#blog-title { + font-family: Georgia, serif; + font-size: 23px; + padding-left: 5px; +} + +#blog-title span { + border-bottom: 1px solid #4a4a4a; +} + +#blog-title span a, #blog-title span a:hover { + color: #4a4a4a; + font-weight: normal; +} + +#blog-description { + padding-left: 5px; + margin-top: -2px; + color: #444; +} + +.entry-title { + font-family: Georgia, serif; + font-weight: normal; + font-size: 18px; + padding-bottom: 2px; +} + +.entry-utility { + font-size: 10px; + margin-bottom: 0; + text-align: right; + border-top: 1px solid #999; +} + +.widgettitle { + color: #384A5F; + background: transparent url(img/menutitle.gif) repeat-x top center; + height: 30px; +} + +.aside ul { + margin-bottom: 0; + padding-bottom: 0; +} + +.aside h3 { + line-height: 30px; + padding-left: 5px; +} + +.aside ul ul { + margin-left: 0; + margin-bottom: 0; +} + +.aside ul ul li a { + text-decoration: none; + color: #4a4a4a; + font-size: 12px; +} + +.aside ul ul li a:hover { + text-decoration: none; + color: #384A5F; +} + +.aside ul ul li:hover { + background: transparent url(img/menubutton_over.gif) repeat-x top left; +} + +.aside ul ul li { + list-style: none; + padding-left: 5px; + background: transparent url(img/menubutton.gif) repeat-x bottom center; + height: 30px; + line-height: 30px; +} + +.entry-meta { + font-size: 10px; +} + +.entry-content h2, .entry-content h3 { + font-size: 14px; + padding: 2px 0; +} + +.entry-content h2 { + font-size: 16px; +} + +#comments, #respond { + padding: 0px; + margin-bottom: 0; + width: 480px; +} + +#respond h3 { + font-family: Georgia, serif; +} + +#nav-below { + width: 480px; + padding: 20px 0 10px; +} + +#siteinfo, #siteinfo a, #siteinfo a:hover { + color: #eee; + text-decoration: none; + font-size: 10px; +} + +#siteinfo a:hover { + text-decoration: underline; +}
balp/RPLogTool
a51f6ec4f1775512543d7574355a38669edcffab
Fix null poiter problem with empty logs
diff --git a/src/se/arnholm/rplogtool/server/LogCleaner.java b/src/se/arnholm/rplogtool/server/LogCleaner.java index 3e5b01c..5d29d53 100644 --- a/src/se/arnholm/rplogtool/server/LogCleaner.java +++ b/src/se/arnholm/rplogtool/server/LogCleaner.java @@ -1,256 +1,271 @@ package se.arnholm.rplogtool.server; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.NoSuchElementException; import java.util.Set; import java.util.Vector; import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.joda.time.Duration; public class LogCleaner { private String text; private String cleanString; private Vector<String> lines; private Map<String,PlayerInfo> players; private Boolean expandMe; private Boolean removeCCS; private static final Pattern LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+(\\w+\\s+\\w+)([\\s+':].+)$"); private static final Pattern LONGNAME_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+([^:]+):\\s*(.+)$"); private static final Pattern CCS_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+CCS - MTR - 1.\\d+.\\d+:\\s+((\\w+\\s+\\w+)([\\s+':].+))$"); private static final Pattern TIME_SECONDS = Pattern.compile("(\\d+):(\\d+):(\\d+)"); private static final Pattern TIME_MINUTES = Pattern.compile("(\\d+):(\\d+)"); public LogCleaner(String text, Boolean expandMe, Boolean removeCCS) { lines = new Vector<String>(); this.text = text; this.expandMe = expandMe; this.removeCCS = removeCCS; players = new HashMap<String,PlayerInfo>(); cleanString = process(); } private String process() { String result = new String(); BufferedReader reader = new BufferedReader( new StringReader(text)); String str; try { while((str = reader.readLine()) != null) { RpLogLine line = splitLine(str); if(null == line) { continue; } final String action = line.getAction(); // if(line.isCCS()) { // System.out.println("In:\"" + str+ "\""); // System.out.println("action:\"" + action+ "\""); // } if(action.equals(" is Online")) { continue; } if(action.equals(" is Offline")) { continue; } if(line.isCCS()) { if(line.getCCSText().startsWith("CCS SYSTEM MESSAGE:")) { continue; } if(line.getCCSText().endsWith("to continue playing")) { continue; } } if(removeCCS && line.isCCS()) { continue; } if(line.getAction().startsWith("((") && line.getAction().endsWith("))")) { continue; } if(line.getAction().startsWith(" declined your inventory offer.")) { continue; } if(line.getAction().startsWith(" accepted your inventory offer.")) { continue; } // System.out.println("..."); String who = line.getName(); if(who.startsWith("(empty)")) { continue; } if(who.startsWith("You have")) { continue; } if(who.startsWith("Second Life")) { continue; } if(who.equals("Draw distance set to")) { continue; } if(who != null) { PlayerInfo freq = players.get(who); if(null == freq) { freq = new PlayerInfo(who); } freq.addLine(str); players.put(who, freq); } if(expandMe && line.getAction().startsWith("/me ")) { // Remove ": /me" from str str = str.replaceFirst(": /me", ""); } // System.out.println("Adding:" + who + ":" + str); lines.add(str); result += str + "\n"; } } catch (IOException e) { e.printStackTrace(); } return result; } public static String getPlayerName(String str) { RpLogLine values = splitLine(str); if(null != values) { return values.getName(); } return null; } public String getClean() { return cleanString; } public Duration getDuration() { - long start = getTime(lines.firstElement()); - long end = getTime(lines.lastElement()); - if(end < start) { - end += 24*60*60*1000; - } - //System.out.println("Duration between: " +start +":"+ lines.firstElement()); - //System.out.println(" and: " + end +":"+ lines.lastElement()); + try { + long start = getTime(lines.firstElement()); + long end = getTime(lines.lastElement()); + if(end < start) { + end += 24*60*60*1000; + } + //System.out.println("Duration between: " +start +":"+ lines.firstElement()); + //System.out.println(" and: " + end +":"+ lines.lastElement()); - return new Duration(start, end); + return new Duration(start, end); + } catch (NoSuchElementException e) { + return Duration.ZERO; + } } public static long getTime(String logLine) { RpLogLine values = splitLine(logLine); if(null != values) { String time = values.getTime(); Matcher matchSeconds = TIME_SECONDS.matcher(time); if(matchSeconds.find()) { long hour = Long.parseLong(matchSeconds.group(1)); long minutes = Long.parseLong(matchSeconds.group(2)); long seconds = Long.parseLong(matchSeconds.group(3)); return (((hour * 60 * 60) + (minutes*60) + seconds) * 1000); } Matcher matchMinutes = TIME_MINUTES.matcher(time); if(matchMinutes.find()) { long hour = Long.parseLong(matchMinutes.group(1)); long minutes = Long.parseLong(matchMinutes.group(2)); return (((hour * 60 * 60) + (minutes*60) + 0) * 1000); } } return 0; } public Set<String> getPartisipants() { return players.keySet(); } public List<PlayerInfo> entries() { List<Entry<String,PlayerInfo>> list = new LinkedList<Entry<String,PlayerInfo>>(players.entrySet()); List<PlayerInfo> resultList = new LinkedList<PlayerInfo>(); Collections.sort(list, new Comparator<Entry<String,PlayerInfo>>() { public int compare(Entry<String,PlayerInfo> o1, Entry<String,PlayerInfo> o2) { Comparable<PlayerInfo> comparable = o1.getValue(); return comparable.compareTo(((Map.Entry<String,PlayerInfo>) (o2)).getValue()); } }); return resultList; } public PlayerInfo getPlayerInfo(String name) { return players.get(name); } public static String formatTime(org.joda.time.Duration duration) { return String.format("%d:%02d", duration.toPeriod().getHours(), duration.toPeriod().getMinutes()); } public static String formatTime(long time) { return String.format("%d:%02d", (int)time/60, (int)time%60); } public static RpLogLine splitLine(String line) { { Matcher matcher = CCS_LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(3), matcher.group(4), matcher.group(2)); return res; } } { Matcher matcher = LONGNAME_LINE_SPLIT.matcher(line); if (matcher.find()) { // System.out.println(":" + matcher.group(1) + ":" + matcher.group(2) + ":" + matcher.group(3) + ":"); RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } { Matcher matcher = LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } // System.out.println("Not Matches line:" + line); return null; } public String getStartTime() { - RpLogLine values = splitLine(lines.firstElement()); - if(null != values) { - return values.getTime(); + RpLogLine values; + try { + values = splitLine(lines.firstElement()); + + if(null != values) { + return values.getTime(); + } + } catch (NoSuchElementException e) { + // Will return empty string when no first line } return ""; } public String getEndTime() { - RpLogLine values = splitLine(lines.lastElement()); - if(null != values) { - return values.getTime(); + try { + RpLogLine values = splitLine(lines.lastElement()); + if(null != values) { + return values.getTime(); + } + } catch (NoSuchElementException e) { + // Will return empty string when no last line } return ""; } } diff --git a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java index 3a471e6..0c7d779 100644 --- a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java +++ b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java @@ -1,502 +1,523 @@ package se.arnholm.rplogtool.shared; import static org.junit.Assert.*; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.List; import java.util.Set; import java.util.Vector; import org.junit.Test; import se.arnholm.rplogtool.server.LogCleaner; import se.arnholm.rplogtool.server.PlayerInfo; import se.arnholm.rplogtool.server.RpLogLine; import org.joda.time.Duration; public class LogCleanerTest { private String testLog = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:08:55] Ricard Collas is Online\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:07] Ricard Collas is Offline\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:25] Ranith Strazytski is Offline\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:25] Lensi Hax is Offline\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:19] Nadine Nozaki: (( just follow please))\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:03] Ricard Collas is Online\n" + "[03:13:25] Rin Tae is Offline\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:13:58] Wolfbringer Sixpack is Online\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; private String newStyleLogText = "[2011/08/08 11:51:31] Nadine Nozaki: /me smiles and ndos, waves to the people, \"Greetings.\"\n" + "[2011/08/08 11:51:54] Second Life: Starphilly Flannery is offline.\n" + "[2011/08/08 11:52:26] Second Life: ZZR1101 Skall is online.\n" + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + "[2011/08/08 11:53:22] bishop Haiku: /me grins at gwaed.... it would be my pleasure\n" + "[2011/08/08 11:53:38] Nadine Nozaki: /me giggles at ali, \"We are always sane why do you ask ali?\"\n" + "[2011/08/08 11:54:10] Nadine Nozaki: /me smiels \"a magician, i love to see those cute bunnies:\"\n" + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + "[2011/08/08 11:54:27] Cinox: /me looks betweent he both of them, getting curious to what they were planning.\n" + "[2011/08/08 11:54:47] Second Life: Chalice Yao is offline.\n" + "[2011/08/08 11:54:52] Second Life: Tour Spoonhammer is online.\n" + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + "[2011/08/08 11:55:07] Nadine Nozaki: /me giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + "[2011/08/08 11:55:10] Second Life: Rondevous Giano is online.\n" + "[2011/08/08 11:55:40] Nadine Nozaki: (( I see my meter xerx is afk, sure it aint Exoctics you see as mine?\" ))\n" + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n" + "[2011/08/08 11:56:07] Second Life: Chalice Yao is online.\n" + "[2011/08/08 11:56:24] CCS - MTR - 1.0.4: Nadine Nozaki has entered a non-combative state\n" + "[2011/08/08 11:56:26] CCS - MTR - 1.0.4: Nadine Nozaki has entered a combative state\n" + "[2011/08/08 11:57:47] CCS - MTR - 1.0.4: Exoticqt4you Resident has entered a combative state\n"; @Test public void testCleanLog() { String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(testLog, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testNewStyle() { String expected = "[2011/08/08 11:51:31] Nadine Nozaki: /me smiles and ndos, waves to the people, \"Greetings.\"\n" + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + "[2011/08/08 11:53:22] bishop Haiku: /me grins at gwaed.... it would be my pleasure\n" + "[2011/08/08 11:53:38] Nadine Nozaki: /me giggles at ali, \"We are always sane why do you ask ali?\"\n" + "[2011/08/08 11:54:10] Nadine Nozaki: /me smiels \"a magician, i love to see those cute bunnies:\"\n" + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + "[2011/08/08 11:54:27] Cinox: /me looks betweent he both of them, getting curious to what they were planning.\n" + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + "[2011/08/08 11:55:07] Nadine Nozaki: /me giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n" + "[2011/08/08 11:56:24] CCS - MTR - 1.0.4: Nadine Nozaki has entered a non-combative state\n" + "[2011/08/08 11:56:26] CCS - MTR - 1.0.4: Nadine Nozaki has entered a combative state\n" + "[2011/08/08 11:57:47] CCS - MTR - 1.0.4: Exoticqt4you Resident has entered a combative state\n"; LogCleaner log = new LogCleaner(newStyleLogText, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testNewStyleExpandMe() { String expected = "[2011/08/08 11:51:31] Nadine Nozaki smiles and ndos, waves to the people, \"Greetings.\"\n" + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + "[2011/08/08 11:53:22] bishop Haiku grins at gwaed.... it would be my pleasure\n" + "[2011/08/08 11:53:38] Nadine Nozaki giggles at ali, \"We are always sane why do you ask ali?\"\n" + "[2011/08/08 11:54:10] Nadine Nozaki smiels \"a magician, i love to see those cute bunnies:\"\n" + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + "[2011/08/08 11:54:27] Cinox looks betweent he both of them, getting curious to what they were planning.\n" + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + "[2011/08/08 11:55:07] Nadine Nozaki giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n" + "[2011/08/08 11:56:24] CCS - MTR - 1.0.4: Nadine Nozaki has entered a non-combative state\n" + "[2011/08/08 11:56:26] CCS - MTR - 1.0.4: Nadine Nozaki has entered a combative state\n" + "[2011/08/08 11:57:47] CCS - MTR - 1.0.4: Exoticqt4you Resident has entered a combative state\n"; LogCleaner log = new LogCleaner(newStyleLogText, true, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testNewStyleNoCCS() { String expected = "[2011/08/08 11:51:31] Nadine Nozaki smiles and ndos, waves to the people, \"Greetings.\"\n" + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + "[2011/08/08 11:53:22] bishop Haiku grins at gwaed.... it would be my pleasure\n" + "[2011/08/08 11:53:38] Nadine Nozaki giggles at ali, \"We are always sane why do you ask ali?\"\n" + "[2011/08/08 11:54:10] Nadine Nozaki smiels \"a magician, i love to see those cute bunnies:\"\n" + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + "[2011/08/08 11:54:27] Cinox looks betweent he both of them, getting curious to what they were planning.\n" + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + "[2011/08/08 11:55:07] Nadine Nozaki giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n"; LogCleaner log = new LogCleaner(newStyleLogText, true, true); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testCleanLog2() { String text = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testClean3() { String text = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:33] (empty) Ravenal Ashby(en>>sv): \"BRB))\"\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"+ "[2010-10-02 11:27:46] (empty) charlie75 Arcana(en>>sv): \"/ Me Mutters förmodligen elvies\"\n"; String expected = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"; LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean4() { String text = "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"+ "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; String expected = "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean4_1() { String text = "[2010-10-02 1:41:05] CCS - MTR - 1.0.4: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"+ "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; String expected = "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean5() { String text = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n" + "[2010-10-02 12:02:45] Taylor Renegade is Offline\n" + "[2010-10-02 12:02:48] Xerxis Rodenberger: (( mine are all outdated))\n" + "[2010-10-02 12:03:00] Varthaer Darkmatter declined your inventory offer.\n"; String expected = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n"; LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean6AndTime() { String text = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:21] Sev Laval is Offline\n" + "[2010-09-26 13:54:34] Sev Laval is Online\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n" + "[2010-09-26 13:55:28] Abal Azambuja is Offline\n" + "[2010-09-26 13:55:35] charlie75 Arcana accepted your inventory offer.\n"; String expected = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n"; LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean7() { String text = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ "[2010-10-02 12:07:18] CCS - MTR - 1.0.2: Press 434 to continue playing\n"+ "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; String expected = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test + public void testCleanBadLine() { + String text = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ + "What\n"+ + "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; + String expected = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ + "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; + LogCleaner log = new LogCleaner(text, false, false); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } + @Test + public void testEmptyFirstLine() { + String text = "Second Life Log....\n"; + String expected = ""; + LogCleaner log = new LogCleaner(text, false, false); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + assertEquals("", log.getStartTime()); + assertEquals(Duration.ZERO, log.getDuration()); + } + @Test public void testDuration() { LogCleaner log = new LogCleaner(testLog, false, false); Duration expected = new Duration(431000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testDuration2() { LogCleaner log = new LogCleaner(log2, false, false); Duration expected = new Duration(1828000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } String log3 = "[23:10] Moon Falconer-Lectar (moon.falconer): hey what's happening?\n" + "[23:11] Krager Megadon: levels his gun at the thing that just attacked him.. it had stpped moving.. he didn't know why.. ' I don;t know.. it leaped out of the assylum.. I jsut glanced inside and Nubs is on the ground.... it attacked Me I dunno wtf it is!~'\n" + "[00:16] Krager Megadon: nudges Moon.. ' ok.. we nee to let her be for now.. until we get the needed Naturalistic Healers present.. for now theres nothing we can do.. unless you want to sit here and guard / watch her?..'\n" + "[00:17] Moon Falconer-Lectar (moon.falconer) stares at krager for a second and then grins\"Well, vamps and demons are like cousins so that's not surprising but i like to know why things work, not just say some words\"watches the blood drip and sighs\"Okay no, i'll wait outside, and wait for the creature. maybe if i can catch her alive, we can make her remove the spell\"\n"; @Test public void testDurationOverMidnight() { LogCleaner log = new LogCleaner(log3, false, false); Duration expected = new Duration(3960000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); Duration d = log.getPlayerInfo("Krager Megadon").getDuration(); assertEquals(3900000, d.getMillis()); } @Test public void testGetTime() { assertEquals(11220000, LogCleaner.getTime("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"")); assertEquals(83103000, LogCleaner.getTime("[2010-09-15 23:05:03] Xerxis Rodenberger: See you")); assertEquals(81275000, LogCleaner.getTime("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n")); } @Test public void testUserNames() { LogCleaner log = new LogCleaner(log3, false, false); Set<String> who = log.getPartisipants(); System.out.println("Test:" + who); assertTrue("Krager Megadon should be in set", who.contains("Krager Megadon")); assertTrue("Moon Falconer-Lectar (moon.falconer) should be in set", who.contains("Moon Falconer-Lectar (moon.falconer)")); } @Test public void testPlayers() { LogCleaner log = new LogCleaner(testLog, false, false); Set<String> who = log.getPartisipants(); // System.out.println("Test:" + who); assertTrue("Nadine should be in set", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } @Test public void testPlayerList() { LogCleaner log = new LogCleaner(testLog, false, false); List<PlayerInfo> people = log.entries(); Set<String> who = log.getPartisipants(); System.out.println("Test:" + who); assertTrue("Nadine should be in list", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } @Test public void testTimeFormat() { LogCleaner log = new LogCleaner(testLog, false, false); assertEquals("0:06", LogCleaner.formatTime(log.getPlayerInfo("Nadine Nozaki").getDuration())); } @Test public void testGetPLayerName() { assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:01] Nadine Nozaki's smile leaves her fance.\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n")); } @Test public void testLineSplit() { helpTestLineSplit("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"", "03:07", "Nadine Nozaki", " ndos, \"Aint we all but Xerx human?\""); helpTestLineSplit("[2010-09-15 23:05:03] Xerxis Rodenberger: See you", "2010-09-15 23:05:03", "Xerxis Rodenberger", "See you"); helpTestLineSplit("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state", "2010-09-15 22:34:35", "Nadine Nozaki"," has entered a combative state"); helpTestLineSplit("[2010-10-02 11:27:25] (empty) Bunny Yakubu(en>>sv): \"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\"\n", "2010-10-02 11:27:25", "(empty) Bunny Yakubu(en>>sv)", "\"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\""); helpTestLineSplit("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", "2010-10-02 1:41:05", "CCS SYSTEM", " MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you."); helpTestLineSplit("[2010-10-02 11:41:37] Draw distance set to: 0m\n", "2010-10-02 11:41:37", "Draw distance set to", "0m"); helpTestLineSplit("[2010-10-02 12:06:59] Varthaer Darkmatter shouts: I CONFESS OF NOTHING.\n", "2010-10-02 12:06:59", "Varthaer Darkmatter", "I CONFESS OF NOTHING."); } @Test public void testCCSLine() { RpLogLine s1 = LogCleaner.splitLine("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"); assertNotNull("Unable to split: " + "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", s1); assertEquals("2010-10-02 1:41:05", s1.getTime()); assertEquals("CCS SYSTEM", s1.getName()); assertEquals(" MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getAction()); assertTrue(s1.isCCS()); assertEquals("CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getCCSText()); } private String readFile(String file) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = null; StringBuilder stringBuilder = new StringBuilder(); String ls = System.getProperty("line.separator"); while ((line = reader.readLine()) != null) { stringBuilder.append(line); stringBuilder.append(ls); } return stringBuilder.toString(); } @Test public void testMalkMeeting() { try { String curDir = System.getProperty("user.dir"); String logText = readFile("malk-meeting.txt"); LogCleaner log = new LogCleaner(logText, false, false); Duration expected = new Duration(2452000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } catch (IOException e) { e.printStackTrace(); } } private void helpTestLineSplit(String line, String time, String name, String pose) { RpLogLine s1 = LogCleaner.splitLine(line); assertNotNull("Unable to split: " + line, s1); assertEquals(time, s1.getTime()); assertEquals(name, s1.getName()); assertEquals(pose, s1.getAction()); } String log2 = "[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:34:40] CCS - MTR - 1.0.2: Nadine Nozaki has entered a non-combative state\n" + "[2010-09-15 22:34:57] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:35:15] Selene Weatherwax is Offline\n" + "[2010-09-15 22:35:24] Jo Soosung is Offline\n" + "[2010-09-15 22:36:05] Rondevous Giano is Offline\n" + "[2010-09-15 22:37:21] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:39:31] Kommandant Epin is Offline\n" + "[2010-09-15 22:39:33] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:39:41] Nadine Nozaki steals a wet kiss\n" + "[2010-09-15 22:39:52] Erosid Dryke is Online\n" + "[2010-09-15 22:40:13] Selene Weatherwax is Online\n" + "[2010-09-15 22:42:17] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:45:30] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:47:20] MoonGypsy Writer is Offline\n" + "[2010-09-15 22:48:50] Skye Hanfoi is Offline\n" + "[2010-09-15 22:49:15] KittyDarling Zelnik is Offline\n" + "[2010-09-15 22:49:24] Traven Sachs is Offline\n" + "[2010-09-15 22:49:49] McCabe Maxsted is Offline\n" + "[2010-09-15 22:50:08] Valmont1985 Radek is Offline\n" + "[2010-09-15 22:50:26] Xerxis Rodenberger kisses back passionately\n" + "[2010-09-15 22:50:34] Skye Hanfoi is Online\n" + "[2010-09-15 22:50:40] Voodoo Halostar is Offline\n" + "[2010-09-15 22:51:10] Voodoo Halostar is Online\n" + "[2010-09-15 22:53:57] Imogen Aeon is Offline\n" + "[2010-09-15 22:54:29] Pethonia Baxton is Offline\n" + "[2010-09-15 22:57:26] Nadine Nozaki: OMG OMG\n" + "[2010-09-15 22:57:33] Nadine Nozaki: Drama?\n" + "[2010-09-15 22:57:33] Nadine Nozaki: OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG!\n" + "[2010-09-15 22:57:56] Xerxis Rodenberger: Whats wrong?\n" + "[2010-09-15 22:58:01] Nadine Nozaki: RUN TIME\n" + "[2010-09-15 22:58:05] Xerxis Rodenberger: *cries*\n" + "[2010-09-15 22:58:06] Nadine Nozaki: Serius wrong imho\n" + "[2010-09-15 22:58:28] Sparklin Indigo is Online\n" + "[2010-09-15 22:58:44] Xerxis Rodenberger: mmhmm\n" + "[2010-09-15 22:59:02] Wezab Ember is Online\n" + "[2010-09-15 23:00:08] Alix Lectar is Offline\n" + "[2010-09-15 23:01:08] Nadine Nozaki: Love you my girl,\n" + "[2010-09-15 23:01:24] Xerxis Rodenberger: Love you Mistress. Have a great day\n" + "[2010-09-15 23:01:41] Nadine Nozaki: u 2 :D\n" + "[2010-09-15 23:02:06] Xerxis Rodenberger kisses and snuggles\n" + "[2010-09-15 23:02:17] Gaea Singh is Offline\n" + "[2010-09-15 23:03:22] Gino Byron is Online\n" + "[2010-09-15 23:04:47] Nadine Nozaki: See you tonight love\n" + "[2010-09-15 23:04:53] Nadine Nozaki: I hgave to get going...\n" + "[2010-09-15 23:05:03] Xerxis Rodenberger: See you\n"; } diff --git a/war/WEB-INF/appengine-web.xml b/war/WEB-INF/appengine-web.xml index 7f78e39..74500c7 100644 --- a/war/WEB-INF/appengine-web.xml +++ b/war/WEB-INF/appengine-web.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>rplogtool</application> - <version>9</version> + <version>10</version> <!-- Configure serving/caching of GWT files --> <static-files> <include path="**" /> <!-- The following line requires App Engine 1.3.2 SDK --> <include path="**.nocache.*" expiration="0s" /> <include path="**.cache.*" expiration="365d" /> <exclude path="**.gwt.rpc" /> </static-files> <!-- Configure java.util.logging --> <system-properties> <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> </system-properties> </appengine-web-app> \ No newline at end of file diff --git a/war/rplogtool/0FF96B4AD7F51A1B78371988F1D4362B.gwt.rpc b/war/rplogtool/0FF96B4AD7F51A1B78371988F1D4362B.gwt.rpc deleted file mode 100644 index b39fedb..0000000 --- a/war/rplogtool/0FF96B4AD7F51A1B78371988F1D4362B.gwt.rpc +++ /dev/null @@ -1,8 +0,0 @@ -com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException, true, true, true, true, com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException/3936916533, 3936916533 -java.lang.Exception, true, false, true, false, java.lang.Exception/1920171873, 1920171873 -java.lang.IllegalArgumentException, true, true, false, false, java.lang.IllegalArgumentException/1755012560, 1755012560 -java.lang.NumberFormatException, true, true, false, false, java.lang.NumberFormatException/3305228476, 3305228476 -java.lang.RuntimeException, true, false, true, false, java.lang.RuntimeException/515124647, 515124647 -java.lang.String, true, true, true, true, java.lang.String/2004016611, 2004016611 -java.lang.Throwable, true, false, true, false, java.lang.Throwable/2953622131, 2953622131 -se.arnholm.rplogtool.client.GreetingService, false, false, false, false, _, 1972878985 diff --git a/war/rplogtool/rplogtool.nocache.js b/war/rplogtool/rplogtool.nocache.js index f49190e..a9f52ed 100644 --- a/war/rplogtool/rplogtool.nocache.js +++ b/war/rplogtool/rplogtool.nocache.js @@ -1,11 +1,17 @@ -function rplogtool(){var M='',nb='" for "gwt:onLoadErrorFn"',lb='" for "gwt:onPropertyErrorFn"',Y='"><\/script>',$='#',Lb='.cache.html',ab='/',Fb='150727C1518006C711207CB16024831E',Gb='591BE35F52ADF744E4431C9905018642',Hb='7F8A61C4F38EC46A02EB87B190B0BFD5',Ib='9195D0A7C03F74E35D6923F6E852B248',Jb='94B002215A686E5582B8CCBA9A875D90',Tb='<script defer="defer">rplogtool.onInjectionDone(\'rplogtool\')<\/script>',X='<script id="',ib='=',_='?',kb='Bad handler "',Sb='DOMContentLoaded',Kb='EF4CE234B40340C05A009EC94CFB5A75',Z='SCRIPT',W='__gwt_marker_rplogtool',bb='base',Q='begin',P='bootstrap',db='clear.cache.gif',hb='content',V='end',zb='gecko',Ab='gecko1_8',R='gwt.codesvr=',S='gwt.hosted=',T='gwt.hybrid',Mb='gwt/standard/standard.css',mb='gwt:onLoadErrorFn',jb='gwt:onPropertyErrorFn',gb='gwt:property',Rb='head',Db='hosted.html?rplogtool',Qb='href',yb='ie6',xb='ie8',ob='iframe',cb='img',pb="javascript:''",Nb='link',Cb='loadExternalRefs',eb='meta',rb='moduleRequested',U='moduleStartup',wb='msie',fb='name',tb='opera',qb='position:absolute;width:0;height:0;border:none',Ob='rel',N='rplogtool',vb='safari',Eb='selectingPermutation',O='startup',Pb='stylesheet',Bb='unknown',sb='user.agent',ub='webkit';var k=window,l=document,m=k.__gwtStatsEvent?function(a){return k.__gwtStatsEvent(a)}:null,n=k.__gwtStatsSessionId?k.__gwtStatsSessionId:null,o,p,q,r=M,s={},t=[],u=[],v=[],w,x;m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:Q});if(!k.__gwt_stylesLoaded){k.__gwt_stylesLoaded={}}if(!k.__gwt_scriptsLoaded){k.__gwt_scriptsLoaded={}}function y(){var b=false;try{var c=k.location.search;return (c.indexOf(R)!=-1||(c.indexOf(S)!=-1||k.external&&k.external.gwtOnLoad))&&c.indexOf(T)==-1}catch(a){}y=function(){return b};return b} -function z(){if(o&&p){var b=l.getElementById(N);var c=b.contentWindow;if(y()){c.__gwt_getProperty=function(a){return F(a)}}rplogtool=null;c.gwtOnLoad(w,N,r);m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:U,millis:(new Date).getTime(),type:V})}} -function A(){var e,f=W,g;l.write(X+f+Y);g=l.getElementById(f);e=g&&g.previousSibling;while(e&&e.tagName!=Z){e=e.previousSibling}function h(a){var b=a.lastIndexOf($);if(b==-1){b=a.length}var c=a.indexOf(_);if(c==-1){c=a.length}var d=a.lastIndexOf(ab,Math.min(c,b));return d>=0?a.substring(0,d+1):M} -;if(e&&e.src){r=h(e.src)}if(r==M){var i=l.getElementsByTagName(bb);if(i.length>0){r=i[i.length-1].href}else{r=h(l.location.href)}}else if(r.match(/^\w+:\/\//)){}else{var j=l.createElement(cb);j.src=r+db;r=h(j.src)}if(g){g.parentNode.removeChild(g)}} -function B(){var b=document.getElementsByTagName(eb);for(var c=0,d=b.length;c<d;++c){var e=b[c],f=e.getAttribute(fb),g;if(f){if(f==gb){g=e.getAttribute(hb);if(g){var h,i=g.indexOf(ib);if(i>=0){f=g.substring(0,i);h=g.substring(i+1)}else{f=g;h=M}s[f]=h}}else if(f==jb){g=e.getAttribute(hb);if(g){try{x=eval(g)}catch(a){alert(kb+g+lb)}}}else if(f==mb){g=e.getAttribute(hb);if(g){try{w=eval(g)}catch(a){alert(kb+g+nb)}}}}}} -function E(a,b){var c=v;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b} -function F(a){var b=u[a](),c=t[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(x){x(a,d,b)}throw null} -var G;function H(){if(!G){G=true;var a=l.createElement(ob);a.src=pb;a.id=N;a.style.cssText=qb;a.tabIndex=-1;l.body.appendChild(a);m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:U,millis:(new Date).getTime(),type:rb});a.contentWindow.location.replace(r+J)}} -u[sb]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(b.indexOf(tb)!=-1){return tb}else if(b.indexOf(ub)!=-1){return vb}else if(b.indexOf(wb)!=-1){if(document.documentMode>=8){return xb}else{var d=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(d&&d.length==3){var e=c(d);if(e>=6000){return yb}}}}else if(b.indexOf(zb)!=-1){var d=/rv:([0-9]+)\.([0-9]+)/.exec(b);if(d&&d.length==3){if(c(d)>=1008)return Ab}return zb}return Bb};t[sb]={gecko:0,gecko1_8:1,ie6:2,ie8:3,opera:4,safari:5};rplogtool.onScriptLoad=function(){if(G){p=true;z()}};rplogtool.onInjectionDone=function(){o=true;m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:Cb,millis:(new Date).getTime(),type:V});z()};A();var I;var J;if(y()){if(k.external&&(k.external.initModule&&k.external.initModule(N))){k.location.reload();return}J=Db;I=M}B();m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:Eb});if(!y()){try{E([zb],Fb);E([Ab],Gb);E([tb],Hb);E([xb],Ib);E([yb],Jb);E([vb],Kb);I=v[F(sb)];J=I+Lb}catch(a){return}}var K;function L(){if(!q){q=true;if(!__gwt_stylesLoaded[Mb]){var a=l.createElement(Nb);__gwt_stylesLoaded[Mb]=a;a.setAttribute(Ob,Pb);a.setAttribute(Qb,r+Mb);l.getElementsByTagName(Rb)[0].appendChild(a)}z();if(l.removeEventListener){l.removeEventListener(Sb,L,false)}if(K){clearInterval(K)}}} -if(l.addEventListener){l.addEventListener(Sb,function(){H();L()},false)}var K=setInterval(function(){if(/loaded|complete/.test(l.readyState)){H();L()}},50);m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:V});m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:Cb,millis:(new Date).getTime(),type:Q});l.write(Tb)} +function rplogtool(){var O='',vb='" for "gwt:onLoadErrorFn"',tb='" for "gwt:onPropertyErrorFn"',hb='"><\/script>',Y='#',Vb='.cache.html',$='/',Ob='1063E4AE926A882D6B2316C19AA5F320',Pb='5E7BF65D97C8F973548CF648DBED8DAB',Qb='69FC716D40F08013DA87ADC175D06F55',Rb='7CE2971070F8358D341EFDF2FED4EB2D',Sb='977A32E762FE62CB297849AC94828E72',Ub=':',nb='::',bc='<script defer="defer">rplogtool.onInjectionDone(\'rplogtool\')<\/script>',gb='<script id="',qb='=',Z='?',sb='Bad handler "',ac='DOMContentLoaded',Tb='E68EF2586BC6CB5B7A5EE4847F8E8418',ib='SCRIPT',fb='__gwt_marker_rplogtool',jb='base',bb='baseUrl',S='begin',R='bootstrap',ab='clear.cache.gif',pb='content',X='end',Ib='gecko',Jb='gecko1_8',T='gwt.codesvr=',U='gwt.hosted=',V='gwt.hybrid',Wb='gwt/standard/standard.css',ub='gwt:onLoadErrorFn',rb='gwt:onPropertyErrorFn',ob='gwt:property',_b='head',Mb='hosted.html?rplogtool',$b='href',Hb='ie6',Gb='ie8',Fb='ie9',wb='iframe',_='img',xb="javascript:''",Xb='link',Lb='loadExternalRefs',kb='meta',zb='moduleRequested',W='moduleStartup',Eb='msie',lb='name',Bb='opera',yb='position:absolute;width:0;height:0;border:none',Yb='rel',P='rplogtool',db='rplogtool.nocache.js',mb='rplogtool::',Db='safari',cb='script',Nb='selectingPermutation',Q='startup',Zb='stylesheet',eb='undefined',Kb='unknown',Ab='user.agent',Cb='webkit';var l=window,m=document,n=l.__gwtStatsEvent?function(a){return l.__gwtStatsEvent(a)}:null,o=l.__gwtStatsSessionId?l.__gwtStatsSessionId:null,p,q,r,s=O,t={},u=[],v=[],w=[],x=0,y,z;n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:S});if(!l.__gwt_stylesLoaded){l.__gwt_stylesLoaded={}}if(!l.__gwt_scriptsLoaded){l.__gwt_scriptsLoaded={}}function A(){var b=false;try{var c=l.location.search;return (c.indexOf(T)!=-1||(c.indexOf(U)!=-1||l.external&&l.external.gwtOnLoad))&&c.indexOf(V)==-1}catch(a){}A=function(){return b};return b} +function B(){if(p&&q){var b=m.getElementById(P);var c=b.contentWindow;if(A()){c.__gwt_getProperty=function(a){return G(a)}}rplogtool=null;c.gwtOnLoad(y,P,s,x);n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:W,millis:(new Date).getTime(),type:X})}} +function C(){function e(a){var b=a.lastIndexOf(Y);if(b==-1){b=a.length}var c=a.indexOf(Z);if(c==-1){c=a.length}var d=a.lastIndexOf($,Math.min(c,b));return d>=0?a.substring(0,d+1):O} +function f(a){if(a.match(/^\w+:\/\//)){}else{var b=m.createElement(_);b.src=a+ab;a=e(b.src)}return a} +function g(){var a=E(bb);if(a!=null){return a}return O} +function h(){var a=m.getElementsByTagName(cb);for(var b=0;b<a.length;++b){if(a[b].src.indexOf(db)!=-1){return e(a[b].src)}}return O} +function i(){var a;if(typeof isBodyLoaded==eb||!isBodyLoaded()){var b=fb;var c;m.write(gb+b+hb);c=m.getElementById(b);a=c&&c.previousSibling;while(a&&a.tagName!=ib){a=a.previousSibling}if(c){c.parentNode.removeChild(c)}if(a&&a.src){return e(a.src)}}return O} +function j(){var a=m.getElementsByTagName(jb);if(a.length>0){return a[a.length-1].href}return O} +var k=g();if(k==O){k=h()}if(k==O){k=i()}if(k==O){k=j()}if(k==O){k=e(m.location.href)}k=f(k);s=k;return k} +function D(){var b=document.getElementsByTagName(kb);for(var c=0,d=b.length;c<d;++c){var e=b[c],f=e.getAttribute(lb),g;if(f){f=f.replace(mb,O);if(f.indexOf(nb)>=0){continue}if(f==ob){g=e.getAttribute(pb);if(g){var h,i=g.indexOf(qb);if(i>=0){f=g.substring(0,i);h=g.substring(i+1)}else{f=g;h=O}t[f]=h}}else if(f==rb){g=e.getAttribute(pb);if(g){try{z=eval(g)}catch(a){alert(sb+g+tb)}}}else if(f==ub){g=e.getAttribute(pb);if(g){try{y=eval(g)}catch(a){alert(sb+g+vb)}}}}}} +function E(a){var b=t[a];return b==null?null:b} +function F(a,b){var c=w;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b} +function G(a){var b=v[a](),c=u[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(z){z(a,d,b)}throw null} +var H;function I(){if(!H){H=true;var a=m.createElement(wb);a.src=xb;a.id=P;a.style.cssText=yb;a.tabIndex=-1;m.body.appendChild(a);n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:W,millis:(new Date).getTime(),type:zb});a.contentWindow.location.replace(s+K)}} +v[Ab]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(function(){return b.indexOf(Bb)!=-1}())return Bb;if(function(){return b.indexOf(Cb)!=-1}())return Db;if(function(){return b.indexOf(Eb)!=-1&&m.documentMode>=9}())return Fb;if(function(){return b.indexOf(Eb)!=-1&&m.documentMode>=8}())return Gb;if(function(){var a=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(a&&a.length==3)return c(a)>=6000}())return Hb;if(function(){return b.indexOf(Ib)!=-1}())return Jb;return Kb};u[Ab]={gecko1_8:0,ie6:1,ie8:2,ie9:3,opera:4,safari:5};rplogtool.onScriptLoad=function(){if(H){q=true;B()}};rplogtool.onInjectionDone=function(){p=true;n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:Lb,millis:(new Date).getTime(),type:X});B()};D();C();var J;var K;if(A()){if(l.external&&(l.external.initModule&&l.external.initModule(P))){l.location.reload();return}K=Mb;J=O}n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:Nb});if(!A()){try{F([Gb],Ob);F([Fb],Pb);F([Bb],Qb);F([Hb],Rb);F([Db],Sb);F([Jb],Tb);J=w[G(Ab)];var L=J.indexOf(Ub);if(L!=-1){x=Number(J.substring(L+1));J=J.substring(0,L)}K=J+Vb}catch(a){return}}var M;function N(){if(!r){r=true;if(!__gwt_stylesLoaded[Wb]){var a=m.createElement(Xb);__gwt_stylesLoaded[Wb]=a;a.setAttribute(Yb,Zb);a.setAttribute($b,s+Wb);m.getElementsByTagName(_b)[0].appendChild(a)}B();if(m.removeEventListener){m.removeEventListener(ac,N,false)}if(M){clearInterval(M)}}} +if(m.addEventListener){m.addEventListener(ac,function(){I();N()},false)}var M=setInterval(function(){if(/loaded|complete/.test(m.readyState)){I();N()}},50);n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:R,millis:(new Date).getTime(),type:X});n&&n({moduleName:P,sessionId:o,subSystem:Q,evtGroup:Lb,millis:(new Date).getTime(),type:S});m.write(bc)} rplogtool(); \ No newline at end of file
balp/RPLogTool
bff95c7a1be66efbcbe954db1596dd40fea4cbea
Added optoins to expand /me and remove all CCS text
diff --git a/src/se/arnholm/rplogtool/client/GreetingService.java b/src/se/arnholm/rplogtool/client/GreetingService.java index 04e3087..448be07 100644 --- a/src/se/arnholm/rplogtool/client/GreetingService.java +++ b/src/se/arnholm/rplogtool/client/GreetingService.java @@ -1,12 +1,12 @@ package se.arnholm.rplogtool.client; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; /** * The client side stub for the RPC service. */ @RemoteServiceRelativePath("greet") public interface GreetingService extends RemoteService { - String greetServer(String input, String template) throws IllegalArgumentException; + String greetServer(String input, String template, Boolean expandMe, Boolean removeCCS); } diff --git a/src/se/arnholm/rplogtool/client/GreetingServiceAsync.java b/src/se/arnholm/rplogtool/client/GreetingServiceAsync.java index bb41269..3959429 100644 --- a/src/se/arnholm/rplogtool/client/GreetingServiceAsync.java +++ b/src/se/arnholm/rplogtool/client/GreetingServiceAsync.java @@ -1,11 +1,12 @@ package se.arnholm.rplogtool.client; import com.google.gwt.user.client.rpc.AsyncCallback; /** * The async counterpart of <code>GreetingService</code>. */ public interface GreetingServiceAsync { - void greetServer(String input, String template, AsyncCallback<String> callback) + void greetServer(String input, String template, Boolean expandMe, Boolean removeCCS, AsyncCallback<String> callback) throws IllegalArgumentException; } + \ No newline at end of file diff --git a/src/se/arnholm/rplogtool/client/RPLogTool.java b/src/se/arnholm/rplogtool/client/RPLogTool.java index f077dab..91ddda9 100644 --- a/src/se/arnholm/rplogtool/client/RPLogTool.java +++ b/src/se/arnholm/rplogtool/client/RPLogTool.java @@ -1,187 +1,199 @@ package se.arnholm.rplogtool.client; import se.arnholm.rplogtool.shared.FieldVerifier; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Button; +import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.DialogBox; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.ListBox; import com.google.gwt.user.client.ui.RootPanel; +import com.google.gwt.user.client.ui.SimpleCheckBox; import com.google.gwt.user.client.ui.TextArea; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.VerticalPanel; /** * Entry point classes define <code>onModuleLoad()</code>. */ public class RPLogTool implements EntryPoint { private static final int LINESSMALLWINDOW = 18; private static final int LINESBIGWINDOW = 18; /** * The message displayed to the user when the server cannot be reached or * returns an error. */ private static final String SERVER_ERROR = "An error occurred while " + "attempting to contact the server. Please check your network " + "connection and try again."; /** * Create a remote service proxy to talk to the server-side Greeting service. */ private final GreetingServiceAsync greetingService = GWT .create(GreetingService.class); /** * This is the entry point method. */ public void onModuleLoad() { final Button sendButton = new Button("Send"); final TextArea logArea = new TextArea(); logArea.setText("Second Life Log...."); logArea.setVisibleLines(LINESBIGWINDOW); logArea.setCharacterWidth(80); final TextArea rpLog = new TextArea(); rpLog.setText(""); rpLog.setVisibleLines(LINESSMALLWINDOW); rpLog.setCharacterWidth(80); final ListBox template = new ListBox(); template.addItem("Malka Style"); template.addItem("Crossroads Style"); template.setVisibleItemCount(1); + final CheckBox expandMe = new CheckBox(); + expandMe.setName("Expand /me"); + expandMe.setText("Expand /me"); + + final CheckBox removeCCS = new CheckBox(); + removeCCS.setName("Remove CCS"); + removeCCS.setText("Remove CCS"); + final Label errorLabel = new Label(); // We can add style names to widgets sendButton.addStyleName("sendButton"); // Add the nameField and sendButton to the RootPanel // Use RootPanel.get() to get the entire body element RootPanel.get("logAreaContainer").add(logArea); RootPanel.get("sendButtonContainer").add(sendButton); RootPanel.get("templateContainer").add(template); + RootPanel.get("optionsContainer").add(expandMe); + RootPanel.get("optionsContainer").add(removeCCS); RootPanel.get("rpLogContainer").add(rpLog); RootPanel.get("errorLabelContainer").add(errorLabel); // Focus the cursor on the name field when the app loads logArea.setFocus(true); logArea.selectAll(); // Create the popup dialog box final DialogBox dialogBox = new DialogBox(); dialogBox.setText("Information"); // dialogBox.setWidth("90em"); dialogBox.setAnimationEnabled(true); final Button closeButton = new Button("Close"); // We can set the id of a widget by accessing its Element closeButton.getElement().setId("closeButton"); final Label textToServerLabel = new Label(); final HTML serverResponseLabel = new HTML(); VerticalPanel dialogVPanel = new VerticalPanel(); dialogVPanel.addStyleName("dialogVPanel"); // dialogVPanel.setWidth("80em"); // dialogVPanel.add(new HTML("<b>Sending name to the server:</b>")); // dialogVPanel.add(textToServerLabel); // dialogVPanel.add(new HTML("<br><b>Modfified log:</b>")); dialogVPanel.add(serverResponseLabel); dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT); dialogVPanel.add(closeButton); dialogBox.setWidget(dialogVPanel); // Add a handler to close the DialogBox closeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialogBox.hide(); sendButton.setEnabled(true); sendButton.setFocus(true); } }); class CloseHandler implements ClickHandler { @Override public void onClick(ClickEvent event) { logArea.setVisibleLines(LINESBIGWINDOW); rpLog.setVisibleLines(LINESSMALLWINDOW); } } // Create a handler for the sendButton and nameField class MyHandler implements ClickHandler, KeyUpHandler { /** * Fired when the user clicks on the sendButton. */ public void onClick(ClickEvent event) { - sendNameToServer(); + sendLogToServer(); } /** * Fired when the user types in the nameField. */ public void onKeyUp(KeyUpEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { - sendNameToServer(); + sendLogToServer(); } } /** * Send the name from the nameField to the server and wait for a response. */ - private void sendNameToServer() { + private void sendLogToServer() { // First, we validate the input. errorLabel.setText(""); String textToServer = logArea.getText(); if (!FieldVerifier.isValidName(textToServer)) { errorLabel.setText("Please enter at least four characters"); return; } // Then, we send the input to the server. sendButton.setEnabled(false); textToServerLabel.setText(textToServer); serverResponseLabel.setText(""); String templateName = template.getValue(template.getSelectedIndex()); greetingService.greetServer(textToServer, - templateName , new AsyncCallback<String>() { + templateName , expandMe.getValue(), removeCCS.getValue(), new AsyncCallback<String>() { public void onFailure(Throwable caught) { // Show the RPC error message to the user dialogBox .setText("Remote Procedure Call - Failure"); serverResponseLabel .addStyleName("serverResponseLabelError"); serverResponseLabel.setHTML(SERVER_ERROR); dialogBox.center(); closeButton.setFocus(true); } public void onSuccess(String result) { dialogBox.setText("Roleplay log"); serverResponseLabel .removeStyleName("serverResponseLabelError"); serverResponseLabel.setHTML("Translated OK.<br>"); rpLog.setText(result); rpLog.setVisibleLines(LINESBIGWINDOW); logArea.setVisibleLines(LINESSMALLWINDOW); dialogBox.center(); // dialogBox.setWidth("750px"); closeButton.setFocus(true); CloseHandler closeHandler = new CloseHandler(); closeButton.addClickHandler(closeHandler ); } }); } } // Add a handler to send the name to the server MyHandler handler = new MyHandler(); sendButton.addClickHandler(handler); logArea.addKeyUpHandler(handler); } } diff --git a/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java b/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java index cc9974a..4ccefe5 100644 --- a/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java +++ b/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java @@ -1,125 +1,125 @@ package se.arnholm.rplogtool.server; import java.util.Set; import se.arnholm.rplogtool.client.GreetingService; import com.google.gwt.user.server.rpc.RemoteServiceServlet; /** * The server side implementation of the RPC service. */ @SuppressWarnings("serial") public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService { interface AnswerNote { public String formatString(String serverInfo, String log, LogCleaner cleaner); } class MalkaStyle implements AnswerNote { public String formatString(String serverInfo, String log, LogCleaner cleaner) { String result = "----------------------------------------------------------------\n" +"Title:\n" +"Date:\n" +"Place:\n"; result += "Start Time:" + cleaner.getStartTime() +"\n"; result += "End Time:" + cleaner.getEndTime() +"\n"; result += "Roleplay duration: " + LogCleaner.formatTime(cleaner.getDuration()) +"\n"; result += "----------------------------------------------------------------\n" +"Major Players:\n"; Set<String> players = cleaner.getPartisipants(); for(String player: players) { PlayerInfo info = cleaner.getPlayerInfo(player); result += player + ": " + LogCleaner.formatTime(info.getDuration()) +"\n"; // result += player + ": " +"<br>\n"; } result += "----------------------------------------------------------------\n" +"Other Players (move players down here that have a smaller role):\n" +"----------------------------------------------------------------\n"; result += log; result += "----------------------------------------------------------------\n"; result += "RPLogTool ©2010 Balp Allen: " + serverInfo + ".\n"; result += "http://rplogtool.appspot.com/"; return result; } } class CrossRoadsStyle implements AnswerNote { public String formatString(String serverInfo, String log, LogCleaner cleaner) { String result = "----------------------------------------------------------------\n" +"TITLE:\n" +"<< Roleplay Title Here >> << Date Here >>\n" +"\n" +"SUMMARY:\n" +"<< Type a brief summary of the Roleplay here >>\n" +"\n" +"PARTICIPANTS:\n" +"MAIN:\n" +"<< List all the primary character players here, e.g. sort out minor players>>\n"; // result += "Start Time:" + cleaner.getStartTime() +"\n"; // result += "End Time:" + cleaner.getEndTime() +"\n"; // result += "----------------------------------------------------------------\n" // +"Major Players:\n"; Set<String> players = cleaner.getPartisipants(); for(String player: players) { PlayerInfo info = cleaner.getPlayerInfo(player); result += player + ": " + LogCleaner.formatTime(info.getDuration()) +"\n"; // result += player + ": " +"<br>\n"; } result += "MINOR:\n" +"<< List all the minor character players here >>\n" +"<< Other Players (move players down here that have a smaller role):\n" +"\n"; result += "DURATION:\n" + LogCleaner.formatTime(cleaner.getDuration()) +"\n"; result += "---------- ROLEPLAY LOG (paste the roleplay under this line ----------\n"; result += log; result += "----------------------------------------------------------------\n"; result += "RPLogTool ©2010 Balp Allen: " + serverInfo + ".\n"; result += "http://rplogtool.appspot.com/"; return result; } } @Override - public String greetServer(String input, String template) + public String greetServer(String input, String template, Boolean expandMe, Boolean removeCCS) throws IllegalArgumentException { // Verify that the input is valid. AnswerNote style; if(template.equals("Crossroads Style")) { style = new CrossRoadsStyle(); } else { style = new MalkaStyle(); } String serverInfo = getServletContext().getServerInfo(); String userAgent = getThreadLocalRequest().getHeader("User-Agent"); // Escape data from the client to avoid cross-site script vulnerabilities. String log = escapeHtml(input); userAgent = escapeHtml(userAgent); - LogCleaner cleaner = new LogCleaner(log); + LogCleaner cleaner = new LogCleaner(log, expandMe, removeCCS); log = cleaner.getClean(); // log = log.replaceAll("\n", "<br>\n"); String result = style.formatString(serverInfo, log, cleaner); // log = log.replaceAll("\n", "<br>\n"); return result; } /** * Escape an html string. Escaping data received from the client helps to * prevent cross-site script vulnerabilities. * * @param html the html string to escape * @return the escaped string */ private String escapeHtml(String html) { if (html == null) { return null; } return html.replaceAll("&", "&amp;").replaceAll("<", "&lt;") .replaceAll(">", "&gt;"); } } diff --git a/src/se/arnholm/rplogtool/server/LogCleaner.java b/src/se/arnholm/rplogtool/server/LogCleaner.java index 728e3bc..3e5b01c 100644 --- a/src/se/arnholm/rplogtool/server/LogCleaner.java +++ b/src/se/arnholm/rplogtool/server/LogCleaner.java @@ -1,245 +1,256 @@ package se.arnholm.rplogtool.server; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Vector; import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.joda.time.Duration; public class LogCleaner { private String text; private String cleanString; private Vector<String> lines; private Map<String,PlayerInfo> players; + private Boolean expandMe; + private Boolean removeCCS; private static final Pattern LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+(\\w+\\s+\\w+)([\\s+':].+)$"); private static final Pattern LONGNAME_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+([^:]+):\\s*(.+)$"); - private static final Pattern CCS_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+CCS - MTR - 1.0.2:\\s+((\\w+\\s+\\w+)([\\s+':].+))$"); + private static final Pattern CCS_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+CCS - MTR - 1.\\d+.\\d+:\\s+((\\w+\\s+\\w+)([\\s+':].+))$"); private static final Pattern TIME_SECONDS = Pattern.compile("(\\d+):(\\d+):(\\d+)"); private static final Pattern TIME_MINUTES = Pattern.compile("(\\d+):(\\d+)"); - public LogCleaner(String text) + public LogCleaner(String text, Boolean expandMe, Boolean removeCCS) { lines = new Vector<String>(); this.text = text; + this.expandMe = expandMe; + this.removeCCS = removeCCS; players = new HashMap<String,PlayerInfo>(); cleanString = process(); } private String process() { String result = new String(); BufferedReader reader = new BufferedReader( new StringReader(text)); String str; try { while((str = reader.readLine()) != null) { RpLogLine line = splitLine(str); if(null == line) { continue; } final String action = line.getAction(); // if(line.isCCS()) { // System.out.println("In:\"" + str+ "\""); // System.out.println("action:\"" + action+ "\""); // } if(action.equals(" is Online")) { continue; } if(action.equals(" is Offline")) { continue; } if(line.isCCS()) { if(line.getCCSText().startsWith("CCS SYSTEM MESSAGE:")) { continue; } if(line.getCCSText().endsWith("to continue playing")) { continue; } } + if(removeCCS && line.isCCS()) { + continue; + } if(line.getAction().startsWith("((") && line.getAction().endsWith("))")) { continue; } if(line.getAction().startsWith(" declined your inventory offer.")) { continue; } if(line.getAction().startsWith(" accepted your inventory offer.")) { continue; } // System.out.println("..."); String who = line.getName(); if(who.startsWith("(empty)")) { continue; } if(who.startsWith("You have")) { continue; } if(who.startsWith("Second Life")) { continue; } if(who.equals("Draw distance set to")) { continue; } if(who != null) { PlayerInfo freq = players.get(who); if(null == freq) { freq = new PlayerInfo(who); } freq.addLine(str); players.put(who, freq); } + if(expandMe && line.getAction().startsWith("/me ")) { + // Remove ": /me" from str + str = str.replaceFirst(": /me", ""); + } // System.out.println("Adding:" + who + ":" + str); lines.add(str); result += str + "\n"; } } catch (IOException e) { e.printStackTrace(); } return result; } public static String getPlayerName(String str) { RpLogLine values = splitLine(str); if(null != values) { return values.getName(); } return null; } public String getClean() { return cleanString; } public Duration getDuration() { long start = getTime(lines.firstElement()); long end = getTime(lines.lastElement()); if(end < start) { end += 24*60*60*1000; } //System.out.println("Duration between: " +start +":"+ lines.firstElement()); //System.out.println(" and: " + end +":"+ lines.lastElement()); return new Duration(start, end); } public static long getTime(String logLine) { RpLogLine values = splitLine(logLine); if(null != values) { String time = values.getTime(); Matcher matchSeconds = TIME_SECONDS.matcher(time); if(matchSeconds.find()) { long hour = Long.parseLong(matchSeconds.group(1)); long minutes = Long.parseLong(matchSeconds.group(2)); long seconds = Long.parseLong(matchSeconds.group(3)); return (((hour * 60 * 60) + (minutes*60) + seconds) * 1000); } Matcher matchMinutes = TIME_MINUTES.matcher(time); if(matchMinutes.find()) { long hour = Long.parseLong(matchMinutes.group(1)); long minutes = Long.parseLong(matchMinutes.group(2)); return (((hour * 60 * 60) + (minutes*60) + 0) * 1000); } } return 0; } public Set<String> getPartisipants() { return players.keySet(); } public List<PlayerInfo> entries() { List<Entry<String,PlayerInfo>> list = new LinkedList<Entry<String,PlayerInfo>>(players.entrySet()); List<PlayerInfo> resultList = new LinkedList<PlayerInfo>(); Collections.sort(list, new Comparator<Entry<String,PlayerInfo>>() { public int compare(Entry<String,PlayerInfo> o1, Entry<String,PlayerInfo> o2) { Comparable<PlayerInfo> comparable = o1.getValue(); return comparable.compareTo(((Map.Entry<String,PlayerInfo>) (o2)).getValue()); } }); return resultList; } public PlayerInfo getPlayerInfo(String name) { return players.get(name); } public static String formatTime(org.joda.time.Duration duration) { return String.format("%d:%02d", duration.toPeriod().getHours(), duration.toPeriod().getMinutes()); } public static String formatTime(long time) { return String.format("%d:%02d", (int)time/60, (int)time%60); } public static RpLogLine splitLine(String line) { { Matcher matcher = CCS_LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(3), matcher.group(4), matcher.group(2)); return res; } } { Matcher matcher = LONGNAME_LINE_SPLIT.matcher(line); if (matcher.find()) { // System.out.println(":" + matcher.group(1) + ":" + matcher.group(2) + ":" + matcher.group(3) + ":"); RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } { Matcher matcher = LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } // System.out.println("Not Matches line:" + line); return null; } public String getStartTime() { RpLogLine values = splitLine(lines.firstElement()); if(null != values) { return values.getTime(); } return ""; } public String getEndTime() { RpLogLine values = splitLine(lines.lastElement()); if(null != values) { return values.getTime(); } return ""; } } diff --git a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java index 1aa5c39..3a471e6 100644 --- a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java +++ b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java @@ -1,450 +1,502 @@ package se.arnholm.rplogtool.shared; import static org.junit.Assert.*; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.List; import java.util.Set; import java.util.Vector; import org.junit.Test; import se.arnholm.rplogtool.server.LogCleaner; import se.arnholm.rplogtool.server.PlayerInfo; import se.arnholm.rplogtool.server.RpLogLine; import org.joda.time.Duration; public class LogCleanerTest { private String testLog = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + - "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + - "[03:07:53] Silver Opaque: why of course\n" + - "[03:07:53] Xerxis Rodenberger chuckles\n" + - "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + - "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + - "[03:08:55] Ricard Collas is Online\n" + - "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + - "[03:09:57] Silver Opaque smiles evily\n" + - "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + - "[03:10:07] Ricard Collas is Offline\n" + - "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + - "[03:10:25] Ranith Strazytski is Offline\n" + - "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + - "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + - "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + - "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + - "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + - "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + - "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + - "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + - "[03:10:48] Nadine Nozaki does as orderd..\n" + - "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + - "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + - "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + - "[03:11:24] Monfang Snowpaw stands beck up.\n" + - "[03:11:25] Lensi Hax is Offline\n" + - "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + - "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + - "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + - "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + - "[03:12:19] Nadine Nozaki: (( just follow please))\n" + - "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + - "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + - "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + - "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + - "[03:13:03] Ricard Collas is Online\n" + - "[03:13:25] Rin Tae is Offline\n" + - "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + - "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + - "[03:13:51] Nadine Nozaki: Sorry about that\n" + - "[03:13:58] Wolfbringer Sixpack is Online\n" + - "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + - "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + - "[03:14:32] Silver Opaque: crazy wolf talking\n" + - "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + - "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + - "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + + "[03:07:53] Silver Opaque: why of course\n" + + "[03:07:53] Xerxis Rodenberger chuckles\n" + + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + + "[03:08:55] Ricard Collas is Online\n" + + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + + "[03:09:57] Silver Opaque smiles evily\n" + + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + + "[03:10:07] Ricard Collas is Offline\n" + + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + + "[03:10:25] Ranith Strazytski is Offline\n" + + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + + "[03:10:48] Nadine Nozaki does as orderd..\n" + + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + + "[03:11:24] Monfang Snowpaw stands beck up.\n" + + "[03:11:25] Lensi Hax is Offline\n" + + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + + "[03:12:19] Nadine Nozaki: (( just follow please))\n" + + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + + "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + + "[03:13:03] Ricard Collas is Online\n" + + "[03:13:25] Rin Tae is Offline\n" + + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + + "[03:13:51] Nadine Nozaki: Sorry about that\n" + + "[03:13:58] Wolfbringer Sixpack is Online\n" + + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + + "[03:14:32] Silver Opaque: crazy wolf talking\n" + + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; + private String newStyleLogText = "[2011/08/08 11:51:31] Nadine Nozaki: /me smiles and ndos, waves to the people, \"Greetings.\"\n" + + "[2011/08/08 11:51:54] Second Life: Starphilly Flannery is offline.\n" + + "[2011/08/08 11:52:26] Second Life: ZZR1101 Skall is online.\n" + + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + + "[2011/08/08 11:53:22] bishop Haiku: /me grins at gwaed.... it would be my pleasure\n" + + "[2011/08/08 11:53:38] Nadine Nozaki: /me giggles at ali, \"We are always sane why do you ask ali?\"\n" + + "[2011/08/08 11:54:10] Nadine Nozaki: /me smiels \"a magician, i love to see those cute bunnies:\"\n" + + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + + "[2011/08/08 11:54:27] Cinox: /me looks betweent he both of them, getting curious to what they were planning.\n" + + "[2011/08/08 11:54:47] Second Life: Chalice Yao is offline.\n" + + "[2011/08/08 11:54:52] Second Life: Tour Spoonhammer is online.\n" + + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + + "[2011/08/08 11:55:07] Nadine Nozaki: /me giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + + "[2011/08/08 11:55:10] Second Life: Rondevous Giano is online.\n" + + "[2011/08/08 11:55:40] Nadine Nozaki: (( I see my meter xerx is afk, sure it aint Exoctics you see as mine?\" ))\n" + + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n" + + "[2011/08/08 11:56:07] Second Life: Chalice Yao is online.\n" + + "[2011/08/08 11:56:24] CCS - MTR - 1.0.4: Nadine Nozaki has entered a non-combative state\n" + + "[2011/08/08 11:56:26] CCS - MTR - 1.0.4: Nadine Nozaki has entered a combative state\n" + + "[2011/08/08 11:57:47] CCS - MTR - 1.0.4: Exoticqt4you Resident has entered a combative state\n"; @Test public void testCleanLog() { - + String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + - "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + - "[03:07:53] Silver Opaque: why of course\n" + - "[03:07:53] Xerxis Rodenberger chuckles\n" + - "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + - "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + - "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + - "[03:09:57] Silver Opaque smiles evily\n" + - "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + - "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + - "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + - "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + - "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + - "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + - "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + - "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + - "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + - "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + - "[03:10:48] Nadine Nozaki does as orderd..\n" + - "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + - "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + - "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + - "[03:11:24] Monfang Snowpaw stands beck up.\n" + - "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + - "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + - "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + - "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + - "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + - "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + - "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + - "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + - "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + - "[03:13:51] Nadine Nozaki: Sorry about that\n" + - "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + - "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + - "[03:14:32] Silver Opaque: crazy wolf talking\n" + - "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + - "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + - "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; - LogCleaner log = new LogCleaner(testLog); + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + + "[03:07:53] Silver Opaque: why of course\n" + + "[03:07:53] Xerxis Rodenberger chuckles\n" + + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + + "[03:09:57] Silver Opaque smiles evily\n" + + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + + "[03:10:48] Nadine Nozaki does as orderd..\n" + + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + + "[03:11:24] Monfang Snowpaw stands beck up.\n" + + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + + "[03:13:51] Nadine Nozaki: Sorry about that\n" + + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + + "[03:14:32] Silver Opaque: crazy wolf talking\n" + + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; + LogCleaner log = new LogCleaner(testLog, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testNewStyle() { - String logText = "[2011/08/08 11:51:31] Nadine Nozaki: /me smiles and ndos, waves to the people, \"Greetings.\"\n" + - "[2011/08/08 11:51:54] Second Life: Starphilly Flannery is offline.\n" + - "[2011/08/08 11:52:26] Second Life: ZZR1101 Skall is online.\n" + + String expected = "[2011/08/08 11:51:31] Nadine Nozaki: /me smiles and ndos, waves to the people, \"Greetings.\"\n" + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + "[2011/08/08 11:53:22] bishop Haiku: /me grins at gwaed.... it would be my pleasure\n" + "[2011/08/08 11:53:38] Nadine Nozaki: /me giggles at ali, \"We are always sane why do you ask ali?\"\n" + "[2011/08/08 11:54:10] Nadine Nozaki: /me smiels \"a magician, i love to see those cute bunnies:\"\n" + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + "[2011/08/08 11:54:27] Cinox: /me looks betweent he both of them, getting curious to what they were planning.\n" + - "[2011/08/08 11:54:47] Second Life: Chalice Yao is offline.\n" + - "[2011/08/08 11:54:52] Second Life: Tour Spoonhammer is online.\n" + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + "[2011/08/08 11:55:07] Nadine Nozaki: /me giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + - "[2011/08/08 11:55:10] Second Life: Rondevous Giano is online.\n" + - "[2011/08/08 11:55:40] Nadine Nozaki: (( I see my meter xerx is afk, sure it aint Exoctics you see as mine?\" ))\n" + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n" + - "[2011/08/08 11:56:07] Second Life: Chalice Yao is online.\n" + "[2011/08/08 11:56:24] CCS - MTR - 1.0.4: Nadine Nozaki has entered a non-combative state\n" + "[2011/08/08 11:56:26] CCS - MTR - 1.0.4: Nadine Nozaki has entered a combative state\n" + "[2011/08/08 11:57:47] CCS - MTR - 1.0.4: Exoticqt4you Resident has entered a combative state\n"; - String expected = "[2011/08/08 11:51:31] Nadine Nozaki: /me smiles and ndos, waves to the people, \"Greetings.\"\n" + + LogCleaner log = new LogCleaner(newStyleLogText, false, false); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } + @Test + public void testNewStyleExpandMe() + { + String expected = "[2011/08/08 11:51:31] Nadine Nozaki smiles and ndos, waves to the people, \"Greetings.\"\n" + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + - "[2011/08/08 11:53:22] bishop Haiku: /me grins at gwaed.... it would be my pleasure\n" + - "[2011/08/08 11:53:38] Nadine Nozaki: /me giggles at ali, \"We are always sane why do you ask ali?\"\n" + - "[2011/08/08 11:54:10] Nadine Nozaki: /me smiels \"a magician, i love to see those cute bunnies:\"\n" + + "[2011/08/08 11:53:22] bishop Haiku grins at gwaed.... it would be my pleasure\n" + + "[2011/08/08 11:53:38] Nadine Nozaki giggles at ali, \"We are always sane why do you ask ali?\"\n" + + "[2011/08/08 11:54:10] Nadine Nozaki smiels \"a magician, i love to see those cute bunnies:\"\n" + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + - "[2011/08/08 11:54:27] Cinox: /me looks betweent he both of them, getting curious to what they were planning.\n" + + "[2011/08/08 11:54:27] Cinox looks betweent he both of them, getting curious to what they were planning.\n" + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + - "[2011/08/08 11:55:07] Nadine Nozaki: /me giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + + "[2011/08/08 11:55:07] Nadine Nozaki giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n" + "[2011/08/08 11:56:24] CCS - MTR - 1.0.4: Nadine Nozaki has entered a non-combative state\n" + "[2011/08/08 11:56:26] CCS - MTR - 1.0.4: Nadine Nozaki has entered a combative state\n" + "[2011/08/08 11:57:47] CCS - MTR - 1.0.4: Exoticqt4you Resident has entered a combative state\n"; - LogCleaner log = new LogCleaner(logText); + LogCleaner log = new LogCleaner(newStyleLogText, true, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } + @Test + public void testNewStyleNoCCS() + { + String expected = "[2011/08/08 11:51:31] Nadine Nozaki smiles and ndos, waves to the people, \"Greetings.\"\n" + + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + + "[2011/08/08 11:53:22] bishop Haiku grins at gwaed.... it would be my pleasure\n" + + "[2011/08/08 11:53:38] Nadine Nozaki giggles at ali, \"We are always sane why do you ask ali?\"\n" + + "[2011/08/08 11:54:10] Nadine Nozaki smiels \"a magician, i love to see those cute bunnies:\"\n" + + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + + "[2011/08/08 11:54:27] Cinox looks betweent he both of them, getting curious to what they were planning.\n" + + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + + "[2011/08/08 11:55:07] Nadine Nozaki giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n"; + LogCleaner log = new LogCleaner(newStyleLogText, true, true); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } + @Test public void testCleanLog2() { String text = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + - "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + - "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; - LogCleaner log = new LogCleaner(text); + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; + LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } - + @Test public void testClean3() { String text = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ - "[2010-10-02 11:27:33] (empty) Ravenal Ashby(en>>sv): \"BRB))\"\n"+ - "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"+ - "[2010-10-02 11:27:46] (empty) charlie75 Arcana(en>>sv): \"/ Me Mutters förmodligen elvies\"\n"; + "[2010-10-02 11:27:33] (empty) Ravenal Ashby(en>>sv): \"BRB))\"\n"+ + "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"+ + "[2010-10-02 11:27:46] (empty) charlie75 Arcana(en>>sv): \"/ Me Mutters förmodligen elvies\"\n"; String expected = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ - "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"; - LogCleaner log = new LogCleaner(text); + "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"; + LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean4() { String text = "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"+ - "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ - "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ - "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ - "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; + "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ + "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ + "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ + "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; + String expected = "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; + LogCleaner log = new LogCleaner(text, false, false); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } + @Test + public void testClean4_1() { + String text = "[2010-10-02 1:41:05] CCS - MTR - 1.0.4: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"+ + "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ + "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ + "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ + "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; String expected = "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; - LogCleaner log = new LogCleaner(text); + LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean5() { String text = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n" + "[2010-10-02 12:02:45] Taylor Renegade is Offline\n" + "[2010-10-02 12:02:48] Xerxis Rodenberger: (( mine are all outdated))\n" + "[2010-10-02 12:03:00] Varthaer Darkmatter declined your inventory offer.\n"; String expected = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n"; - LogCleaner log = new LogCleaner(text); + LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } - + @Test public void testClean6AndTime() { String text = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + - "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + - "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + - "[2010-09-26 13:54:21] Sev Laval is Offline\n" + - "[2010-09-26 13:54:34] Sev Laval is Online\n" + - "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + - "[2010-09-26 13:55:17] charlie75 Arcana me?\n" + - "[2010-09-26 13:55:28] Abal Azambuja is Offline\n" + - "[2010-09-26 13:55:35] charlie75 Arcana accepted your inventory offer.\n"; - - String expected = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + - "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + - "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + - "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + - "[2010-09-26 13:55:17] charlie75 Arcana me?\n"; - LogCleaner log = new LogCleaner(text); + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + + "[2010-09-26 13:54:21] Sev Laval is Offline\n" + + "[2010-09-26 13:54:34] Sev Laval is Online\n" + + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + + "[2010-09-26 13:55:17] charlie75 Arcana me?\n" + + "[2010-09-26 13:55:28] Abal Azambuja is Offline\n" + + "[2010-09-26 13:55:35] charlie75 Arcana accepted your inventory offer.\n"; + + String expected = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + + "[2010-09-26 13:55:17] charlie75 Arcana me?\n"; + LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean7() { String text = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ - "[2010-10-02 12:07:18] CCS - MTR - 1.0.2: Press 434 to continue playing\n"+ - "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; + "[2010-10-02 12:07:18] CCS - MTR - 1.0.2: Press 434 to continue playing\n"+ + "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; String expected = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ - "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; - LogCleaner log = new LogCleaner(text); + "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; + LogCleaner log = new LogCleaner(text, false, false); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testDuration() { - LogCleaner log = new LogCleaner(testLog); + LogCleaner log = new LogCleaner(testLog, false, false); Duration expected = new Duration(431000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testDuration2() { - LogCleaner log = new LogCleaner(log2); + LogCleaner log = new LogCleaner(log2, false, false); Duration expected = new Duration(1828000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } - + String log3 = "[23:10] Moon Falconer-Lectar (moon.falconer): hey what's happening?\n" + - "[23:11] Krager Megadon: levels his gun at the thing that just attacked him.. it had stpped moving.. he didn't know why.. ' I don;t know.. it leaped out of the assylum.. I jsut glanced inside and Nubs is on the ground.... it attacked Me I dunno wtf it is!~'\n" + - "[00:16] Krager Megadon: nudges Moon.. ' ok.. we nee to let her be for now.. until we get the needed Naturalistic Healers present.. for now theres nothing we can do.. unless you want to sit here and guard / watch her?..'\n" + - "[00:17] Moon Falconer-Lectar (moon.falconer) stares at krager for a second and then grins\"Well, vamps and demons are like cousins so that's not surprising but i like to know why things work, not just say some words\"watches the blood drip and sighs\"Okay no, i'll wait outside, and wait for the creature. maybe if i can catch her alive, we can make her remove the spell\"\n"; - + "[23:11] Krager Megadon: levels his gun at the thing that just attacked him.. it had stpped moving.. he didn't know why.. ' I don;t know.. it leaped out of the assylum.. I jsut glanced inside and Nubs is on the ground.... it attacked Me I dunno wtf it is!~'\n" + + "[00:16] Krager Megadon: nudges Moon.. ' ok.. we nee to let her be for now.. until we get the needed Naturalistic Healers present.. for now theres nothing we can do.. unless you want to sit here and guard / watch her?..'\n" + + "[00:17] Moon Falconer-Lectar (moon.falconer) stares at krager for a second and then grins\"Well, vamps and demons are like cousins so that's not surprising but i like to know why things work, not just say some words\"watches the blood drip and sighs\"Okay no, i'll wait outside, and wait for the creature. maybe if i can catch her alive, we can make her remove the spell\"\n"; + @Test public void testDurationOverMidnight() { - LogCleaner log = new LogCleaner(log3); + LogCleaner log = new LogCleaner(log3, false, false); Duration expected = new Duration(3960000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); Duration d = log.getPlayerInfo("Krager Megadon").getDuration(); assertEquals(3900000, d.getMillis()); } - + @Test public void testGetTime() { assertEquals(11220000, LogCleaner.getTime("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"")); assertEquals(83103000, LogCleaner.getTime("[2010-09-15 23:05:03] Xerxis Rodenberger: See you")); assertEquals(81275000, LogCleaner.getTime("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n")); } @Test public void testUserNames() { - LogCleaner log = new LogCleaner(log3); + LogCleaner log = new LogCleaner(log3, false, false); Set<String> who = log.getPartisipants(); System.out.println("Test:" + who); assertTrue("Krager Megadon should be in set", who.contains("Krager Megadon")); assertTrue("Moon Falconer-Lectar (moon.falconer) should be in set", who.contains("Moon Falconer-Lectar (moon.falconer)")); } @Test public void testPlayers() { - LogCleaner log = new LogCleaner(testLog); + LogCleaner log = new LogCleaner(testLog, false, false); Set<String> who = log.getPartisipants(); -// System.out.println("Test:" + who); + // System.out.println("Test:" + who); assertTrue("Nadine should be in set", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } - + @Test public void testPlayerList() { - LogCleaner log = new LogCleaner(testLog); + LogCleaner log = new LogCleaner(testLog, false, false); List<PlayerInfo> people = log.entries(); Set<String> who = log.getPartisipants(); System.out.println("Test:" + who); assertTrue("Nadine should be in list", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } - + @Test public void testTimeFormat() { - LogCleaner log = new LogCleaner(testLog); + LogCleaner log = new LogCleaner(testLog, false, false); assertEquals("0:06", LogCleaner.formatTime(log.getPlayerInfo("Nadine Nozaki").getDuration())); } - + @Test public void testGetPLayerName() { assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:01] Nadine Nozaki's smile leaves her fance.\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n")); } - + @Test public void testLineSplit() { helpTestLineSplit("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"", "03:07", "Nadine Nozaki", " ndos, \"Aint we all but Xerx human?\""); - + helpTestLineSplit("[2010-09-15 23:05:03] Xerxis Rodenberger: See you", "2010-09-15 23:05:03", "Xerxis Rodenberger", "See you"); - + helpTestLineSplit("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state", "2010-09-15 22:34:35", "Nadine Nozaki"," has entered a combative state"); helpTestLineSplit("[2010-10-02 11:27:25] (empty) Bunny Yakubu(en>>sv): \"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\"\n", "2010-10-02 11:27:25", "(empty) Bunny Yakubu(en>>sv)", "\"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\""); helpTestLineSplit("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", "2010-10-02 1:41:05", "CCS SYSTEM", " MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you."); - + helpTestLineSplit("[2010-10-02 11:41:37] Draw distance set to: 0m\n", "2010-10-02 11:41:37", "Draw distance set to", "0m"); - + helpTestLineSplit("[2010-10-02 12:06:59] Varthaer Darkmatter shouts: I CONFESS OF NOTHING.\n", "2010-10-02 12:06:59", "Varthaer Darkmatter", "I CONFESS OF NOTHING."); } - + @Test public void testCCSLine() { RpLogLine s1 = LogCleaner.splitLine("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"); assertNotNull("Unable to split: " + "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", s1); assertEquals("2010-10-02 1:41:05", s1.getTime()); assertEquals("CCS SYSTEM", s1.getName()); assertEquals(" MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getAction()); assertTrue(s1.isCCS()); assertEquals("CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getCCSText()); - + } private String readFile(String file) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = null; StringBuilder stringBuilder = new StringBuilder(); String ls = System.getProperty("line.separator"); while ((line = reader.readLine()) != null) { stringBuilder.append(line); stringBuilder.append(ls); } return stringBuilder.toString(); } - + @Test public void testMalkMeeting() { try { String curDir = System.getProperty("user.dir"); String logText = readFile("malk-meeting.txt"); - LogCleaner log = new LogCleaner(logText); + LogCleaner log = new LogCleaner(logText, false, false); Duration expected = new Duration(2452000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } catch (IOException e) { e.printStackTrace(); } - + } private void helpTestLineSplit(String line, String time, String name, String pose) { RpLogLine s1 = LogCleaner.splitLine(line); assertNotNull("Unable to split: " + line, s1); assertEquals(time, s1.getTime()); assertEquals(name, s1.getName()); assertEquals(pose, s1.getAction()); } - + String log2 = - "[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + -"[2010-09-15 22:34:40] CCS - MTR - 1.0.2: Nadine Nozaki has entered a non-combative state\n" + -"[2010-09-15 22:34:57] BeoWulf Foxtrot is Offline\n" + -"[2010-09-15 22:35:15] Selene Weatherwax is Offline\n" + -"[2010-09-15 22:35:24] Jo Soosung is Offline\n" + -"[2010-09-15 22:36:05] Rondevous Giano is Offline\n" + -"[2010-09-15 22:37:21] BeoWulf Foxtrot is Online\n" + -"[2010-09-15 22:39:31] Kommandant Epin is Offline\n" + -"[2010-09-15 22:39:33] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + -"[2010-09-15 22:39:41] Nadine Nozaki steals a wet kiss\n" + -"[2010-09-15 22:39:52] Erosid Dryke is Online\n" + -"[2010-09-15 22:40:13] Selene Weatherwax is Online\n" + -"[2010-09-15 22:42:17] BeoWulf Foxtrot is Offline\n" + -"[2010-09-15 22:45:30] BeoWulf Foxtrot is Online\n" + -"[2010-09-15 22:47:20] MoonGypsy Writer is Offline\n" + -"[2010-09-15 22:48:50] Skye Hanfoi is Offline\n" + -"[2010-09-15 22:49:15] KittyDarling Zelnik is Offline\n" + -"[2010-09-15 22:49:24] Traven Sachs is Offline\n" + -"[2010-09-15 22:49:49] McCabe Maxsted is Offline\n" + -"[2010-09-15 22:50:08] Valmont1985 Radek is Offline\n" + -"[2010-09-15 22:50:26] Xerxis Rodenberger kisses back passionately\n" + -"[2010-09-15 22:50:34] Skye Hanfoi is Online\n" + -"[2010-09-15 22:50:40] Voodoo Halostar is Offline\n" + -"[2010-09-15 22:51:10] Voodoo Halostar is Online\n" + -"[2010-09-15 22:53:57] Imogen Aeon is Offline\n" + -"[2010-09-15 22:54:29] Pethonia Baxton is Offline\n" + -"[2010-09-15 22:57:26] Nadine Nozaki: OMG OMG\n" + -"[2010-09-15 22:57:33] Nadine Nozaki: Drama?\n" + -"[2010-09-15 22:57:33] Nadine Nozaki: OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG!\n" + -"[2010-09-15 22:57:56] Xerxis Rodenberger: Whats wrong?\n" + -"[2010-09-15 22:58:01] Nadine Nozaki: RUN TIME\n" + -"[2010-09-15 22:58:05] Xerxis Rodenberger: *cries*\n" + -"[2010-09-15 22:58:06] Nadine Nozaki: Serius wrong imho\n" + -"[2010-09-15 22:58:28] Sparklin Indigo is Online\n" + -"[2010-09-15 22:58:44] Xerxis Rodenberger: mmhmm\n" + -"[2010-09-15 22:59:02] Wezab Ember is Online\n" + -"[2010-09-15 23:00:08] Alix Lectar is Offline\n" + -"[2010-09-15 23:01:08] Nadine Nozaki: Love you my girl,\n" + -"[2010-09-15 23:01:24] Xerxis Rodenberger: Love you Mistress. Have a great day\n" + -"[2010-09-15 23:01:41] Nadine Nozaki: u 2 :D\n" + -"[2010-09-15 23:02:06] Xerxis Rodenberger kisses and snuggles\n" + -"[2010-09-15 23:02:17] Gaea Singh is Offline\n" + -"[2010-09-15 23:03:22] Gino Byron is Online\n" + -"[2010-09-15 23:04:47] Nadine Nozaki: See you tonight love\n" + -"[2010-09-15 23:04:53] Nadine Nozaki: I hgave to get going...\n" + -"[2010-09-15 23:05:03] Xerxis Rodenberger: See you\n"; + "[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + + "[2010-09-15 22:34:40] CCS - MTR - 1.0.2: Nadine Nozaki has entered a non-combative state\n" + + "[2010-09-15 22:34:57] BeoWulf Foxtrot is Offline\n" + + "[2010-09-15 22:35:15] Selene Weatherwax is Offline\n" + + "[2010-09-15 22:35:24] Jo Soosung is Offline\n" + + "[2010-09-15 22:36:05] Rondevous Giano is Offline\n" + + "[2010-09-15 22:37:21] BeoWulf Foxtrot is Online\n" + + "[2010-09-15 22:39:31] Kommandant Epin is Offline\n" + + "[2010-09-15 22:39:33] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + + "[2010-09-15 22:39:41] Nadine Nozaki steals a wet kiss\n" + + "[2010-09-15 22:39:52] Erosid Dryke is Online\n" + + "[2010-09-15 22:40:13] Selene Weatherwax is Online\n" + + "[2010-09-15 22:42:17] BeoWulf Foxtrot is Offline\n" + + "[2010-09-15 22:45:30] BeoWulf Foxtrot is Online\n" + + "[2010-09-15 22:47:20] MoonGypsy Writer is Offline\n" + + "[2010-09-15 22:48:50] Skye Hanfoi is Offline\n" + + "[2010-09-15 22:49:15] KittyDarling Zelnik is Offline\n" + + "[2010-09-15 22:49:24] Traven Sachs is Offline\n" + + "[2010-09-15 22:49:49] McCabe Maxsted is Offline\n" + + "[2010-09-15 22:50:08] Valmont1985 Radek is Offline\n" + + "[2010-09-15 22:50:26] Xerxis Rodenberger kisses back passionately\n" + + "[2010-09-15 22:50:34] Skye Hanfoi is Online\n" + + "[2010-09-15 22:50:40] Voodoo Halostar is Offline\n" + + "[2010-09-15 22:51:10] Voodoo Halostar is Online\n" + + "[2010-09-15 22:53:57] Imogen Aeon is Offline\n" + + "[2010-09-15 22:54:29] Pethonia Baxton is Offline\n" + + "[2010-09-15 22:57:26] Nadine Nozaki: OMG OMG\n" + + "[2010-09-15 22:57:33] Nadine Nozaki: Drama?\n" + + "[2010-09-15 22:57:33] Nadine Nozaki: OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG!\n" + + "[2010-09-15 22:57:56] Xerxis Rodenberger: Whats wrong?\n" + + "[2010-09-15 22:58:01] Nadine Nozaki: RUN TIME\n" + + "[2010-09-15 22:58:05] Xerxis Rodenberger: *cries*\n" + + "[2010-09-15 22:58:06] Nadine Nozaki: Serius wrong imho\n" + + "[2010-09-15 22:58:28] Sparklin Indigo is Online\n" + + "[2010-09-15 22:58:44] Xerxis Rodenberger: mmhmm\n" + + "[2010-09-15 22:59:02] Wezab Ember is Online\n" + + "[2010-09-15 23:00:08] Alix Lectar is Offline\n" + + "[2010-09-15 23:01:08] Nadine Nozaki: Love you my girl,\n" + + "[2010-09-15 23:01:24] Xerxis Rodenberger: Love you Mistress. Have a great day\n" + + "[2010-09-15 23:01:41] Nadine Nozaki: u 2 :D\n" + + "[2010-09-15 23:02:06] Xerxis Rodenberger kisses and snuggles\n" + + "[2010-09-15 23:02:17] Gaea Singh is Offline\n" + + "[2010-09-15 23:03:22] Gino Byron is Online\n" + + "[2010-09-15 23:04:47] Nadine Nozaki: See you tonight love\n" + + "[2010-09-15 23:04:53] Nadine Nozaki: I hgave to get going...\n" + + "[2010-09-15 23:05:03] Xerxis Rodenberger: See you\n"; } diff --git a/war/RPLogTool.html b/war/RPLogTool.html index 2b7b917..bd13a61 100644 --- a/war/RPLogTool.html +++ b/war/RPLogTool.html @@ -1,72 +1,73 @@ <!doctype html> <!-- The DOCTYPE declaration above will set the --> <!-- browser's rendering engine into --> <!-- "Standards Mode". Replacing this declaration --> <!-- with a "Quirks Mode" doctype may lead to some --> <!-- differences in layout. --> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!-- --> <!-- Consider inlining CSS to reduce the number of requested files --> <!-- --> <link type="text/css" rel="stylesheet" href="RPLogTool.css"> <!-- --> <!-- Any title is fine --> <!-- --> <title>RPLogCleaner</title> <!-- --> <!-- This script loads your compiled module. --> <!-- If you add any GWT meta tags, they must --> <!-- be added before this line. --> <!-- --> <script type="text/javascript" language="javascript" src="rplogtool/rplogtool.nocache.js"></script> </head> <!-- --> <!-- The body can have arbitrary html, or --> <!-- you can leave the body empty if you want --> <!-- to create a completely dynamic UI. --> <!-- --> <body> <!-- OPTIONAL: include this if you want history support --> <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> <!-- RECOMMENDED if your web app will not function without JavaScript enabled --> <noscript> <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> Your web browser must have JavaScript enabled in order for this application to display correctly. </div> </noscript> <h1>RPLogCleaner</h1> <table align="center"> <tr> - <td colspan="2" style="font-weight:bold;">Add the log below:</td> + <td colspan="3" style="font-weight:bold;">Add the log below:</td> </tr> <tr> - <td colspan="2" id="logAreaContainer"></td> + <td colspan="3" id="logAreaContainer"></td> </tr> <tr> <td id="sendButtonContainer"></td> <td id="templateContainer"></td> + <td id="optionsContainer"></td> </tr> <tr> - <td colspan="2" id="rpLogContainer"></td> + <td colspan="3" id="rpLogContainer"></td> </tr> <tr> - <td colspan="2" style="color:red;" id="errorLabelContainer"></td> + <td colspan="3" style="color:red;" id="errorLabelContainer"></td> </tr> <tr> - <td colspan="2">©2010 Anders Arnholm/Balp Allen <a href="http://github.com/balp/RPLogTool/issues">Bug Reports and suggestions.</a></td> + <td colspan="2">©2010-2011 Anders Arnholm/Balp Allen <a href="http://github.com/balp/RPLogTool/issues">Bug Reports and suggestions.</a></td> </tr> </table> </body> </html> diff --git a/war/rplogtool/gwt/standard/standard.css b/war/rplogtool/gwt/standard/standard.css index d09ff36..095549a 100644 --- a/war/rplogtool/gwt/standard/standard.css +++ b/war/rplogtool/gwt/standard/standard.css @@ -1,1138 +1,1151 @@ /** * The file contains styles for GWT widgets in the standard theme. * * In order to maintain cross-browser compatibility, the following syntax is * used to create IE6 specific style rules: * .gwt-Widget { * property: rule applies to all browsers * -property: rule applies only to IE6 (overrides previous rule) * } * * html .gwt-Widget { * property: rule applies to all versions of IE * } */ body, table td, select { font-family: Arial Unicode MS, Arial, sans-serif; font-size: small; } pre { font-family: "courier new", courier; font-size: small; } body { color: black; margin: 0px; border: 0px; padding: 0px; background: #fff; direction: ltr; } a, a:visited, a:hover { color: #0000AA; } /** * The reference theme can be used to determine when this style sheet has * loaded. Create a hidden div element with absolute position, assign the style * name below, and attach it to the DOM. Use a timer to detect when the * element's height and width are set to 5px. */ .gwt-Reference-standard { height: 5px; width: 5px; zoom: 1; } .gwt-Button { margin: 0; padding: 3px 5px; text-decoration: none; font-size: small; cursor: pointer; cursor: hand; background: url("images/hborder.png") repeat-x 0px -27px; border: 1px outset #ccc; } .gwt-Button:active { border: 1px inset #ccc; } .gwt-Button:hover { border-color: #9cf #69e #69e #7af; } .gwt-Button[disabled] { cursor: default; color: #888; } .gwt-Button[disabled]:hover { border: 1px outset #ccc; } .gwt-CheckBox { } .gwt-CheckBox-disabled { color: #888; } .gwt-DecoratorPanel { } .gwt-DecoratorPanel .topCenter, .gwt-DecoratorPanel .bottomCenter { background: url(images/hborder.png) repeat-x; } .gwt-DecoratorPanel .middleLeft, .gwt-DecoratorPanel .middleRight { background: url(images/vborder.png) repeat-y; } .gwt-DecoratorPanel .topLeftInner, .gwt-DecoratorPanel .topRightInner, .gwt-DecoratorPanel .bottomLeftInner, .gwt-DecoratorPanel .bottomRightInner { width: 5px; height: 5px; zoom: 1; } .gwt-DecoratorPanel .topLeft { background: url(images/corner.png) no-repeat 0px 0px; -background: url(images/corner_ie6.png) no-repeat 0px 0px; } .gwt-DecoratorPanel .topRight { background: url(images/corner.png) no-repeat -5px 0px; -background: url(images/corner_ie6.png) no-repeat -5px 0px; } .gwt-DecoratorPanel .bottomLeft { background: url(images/corner.png) no-repeat 0px -5px; -background: url(images/corner_ie6.png) no-repeat 0px -5px; } .gwt-DecoratorPanel .bottomRight { background: url(images/corner.png) no-repeat -5px -5px; -background: url(images/corner_ie6.png) no-repeat -5px -5px; } * html .gwt-DecoratorPanel .topLeftInner, * html .gwt-DecoratorPanel .topRightInner, * html .gwt-DecoratorPanel .bottomLeftInner, * html .gwt-DecoratorPanel .bottomRightInner { width: 5px; height: 5px; overflow: hidden; } .gwt-DialogBox .Caption { background: #e3e8f3 url(images/hborder.png) repeat-x 0px -2003px; padding: 4px 4px 4px 8px; cursor: default; border-bottom: 1px solid #bbbbbb; border-top: 5px solid #d0e4f6; } .gwt-DialogBox .dialogContent { } .gwt-DialogBox .dialogMiddleCenter { padding: 3px; background: white; } .gwt-DialogBox .dialogBottomCenter { background: url(images/hborder.png) repeat-x 0px -4px; -background: url(images/hborder_ie6.png) repeat-x 0px -4px; } .gwt-DialogBox .dialogMiddleLeft { background: url(images/vborder.png) repeat-y; } .gwt-DialogBox .dialogMiddleRight { background: url(images/vborder.png) repeat-y -4px 0px; -background: url(images/vborder_ie6.png) repeat-y -4px 0px; } .gwt-DialogBox .dialogTopLeftInner { width: 5px; zoom: 1; } .gwt-DialogBox .dialogTopRightInner { width: 8px; zoom: 1; } .gwt-DialogBox .dialogBottomLeftInner { width: 5px; height: 8px; zoom: 1; } .gwt-DialogBox .dialogBottomRightInner { width: 5px; height: 8px; zoom: 1; } .gwt-DialogBox .dialogTopLeft { background: url(images/corner.png) no-repeat -13px 0px; -background: url(images/corner_ie6.png) no-repeat -13px 0px; } .gwt-DialogBox .dialogTopRight { background: url(images/corner.png) no-repeat -18px 0px; -background: url(images/corner_ie6.png) no-repeat -18px 0px; } .gwt-DialogBox .dialogBottomLeft { background: url(images/corner.png) no-repeat 0px -15px; -background: url(images/corner_ie6.png) no-repeat 0px -15px; } .gwt-DialogBox .dialogBottomRight { background: url(images/corner.png) no-repeat -5px -15px; -background: url(images/corner_ie6.png) no-repeat -5px -15px; } * html .gwt-DialogBox .dialogTopLeftInner { width: 5px; overflow: hidden; } * html .gwt-DialogBox .dialogTopRightInner { width: 8px; overflow: hidden; } * html .gwt-DialogBox .dialogBottomLeftInner { width: 5px; height: 8px; overflow: hidden; } * html .gwt-DialogBox .dialogBottomRightInner { width: 8px; height: 8px; overflow: hidden; } .gwt-DisclosurePanel { } .gwt-DisclosurePanel-open { } .gwt-DisclosurePanel-closed { } .gwt-DisclosurePanel .header, .gwt-DisclosurePanel .header a, .gwt-DisclosurePanel .header td { text-decoration: none; /* Remove underline from header */ color: black; cursor: pointer; cursor: hand; } .gwt-DisclosurePanel .content { border-left: 3px solid #e8eef7; padding: 4px 0px 4px 8px; margin-left: 6px; } .gwt-FileUpload { } .gwt-Frame { border-top: 2px solid #666; border-left: 2px solid #666; border-right: 2px solid #bbb; border-bottom: 2px solid #bbb; } .gwt-HorizontalSplitPanel { } .gwt-HorizontalSplitPanel .hsplitter { cursor: move; border: 0px; background: #91c0ef url(images/vborder.png) repeat-y; + line-height: 0px; } .gwt-VerticalSplitPanel { } .gwt-VerticalSplitPanel .vsplitter { cursor: move; border: 0px; background: #91c0ef url(images/hborder.png) repeat-x; + line-height: 0px; } .gwt-HTML { } .gwt-Hyperlink { } .gwt-Image { } .gwt-Label { } .gwt-ListBox { } .gwt-MenuBar { cursor: default; } .gwt-MenuBar .gwt-MenuItem { cursor: default; } .gwt-MenuBar .gwt-MenuItem-selected { background: #E0EDFE; } +.gwt-MenuBar .gwt-MenuItem-disabled { + color: #c0c0c0; +} .gwt-MenuBar-horizontal { background: #e3e8f3 url(images/hborder.png) repeat-x 0px -2003px; border: 1px solid #BBBBBB; } .gwt-MenuBar-horizontal .gwt-MenuItem { padding: 0px 10px; vertical-align: bottom; color: #666666; font-weight: bold; } .gwt-MenuBar-horizontal .gwt-MenuItemSeparator { width: 1px; padding: 0px; margin: 0px; border: 0px; border-left: 1px solid #888888; background: white; } .gwt-MenuBar-horizontal .gwt-MenuItemSeparator .menuSeparatorInner { width: 1px; height: 1px; background: white; } .gwt-MenuBar-vertical { margin-top: 0px; margin-left: 0px; background: white; } .gwt-MenuBar-vertical table { border-collapse: collapse; } .gwt-MenuBar-vertical .gwt-MenuItem { padding: 4px 14px 4px 1px; } .gwt-MenuBar-vertical .gwt-MenuItemSeparator { padding: 2px 0px; } .gwt-MenuBar-vertical .gwt-MenuItemSeparator .menuSeparatorInner { height: 1px; padding: 0px; border: 0px; border-top: 1px solid #777777; background: #ddddee; overflow: hidden; } .gwt-MenuBar-vertical .subMenuIcon { padding-right: 4px; } .gwt-MenuBar-vertical .subMenuIcon-selected { background: #E0EDFE; } .gwt-MenuBarPopup { margin: 0px 0px 0px 3px; } .gwt-MenuBarPopup .menuPopupTopCenter { background: url(images/hborder.png) 0px -12px repeat-x; } .gwt-MenuBarPopup .menuPopupBottomCenter { background: url(images/hborder.png) 0px -13px repeat-x; -background: url(images/hborder_ie6.png) 0px -13px repeat-x; } .gwt-MenuBarPopup .menuPopupMiddleLeft { background: url(images/vborder.png) -12px 0px repeat-y; -background: url(images/vborder_ie6.png) -12px 0px repeat-y; } .gwt-MenuBarPopup .menuPopupMiddleRight { background: url(images/vborder.png) -13px 0px repeat-y; -background: url(images/vborder_ie6.png) -13px 0px repeat-y; } .gwt-MenuBarPopup .menuPopupTopLeftInner { width: 5px; height: 5px; zoom: 1; } .gwt-MenuBarPopup .menuPopupTopRightInner { width: 8px; height: 5px; zoom: 1; } .gwt-MenuBarPopup .menuPopupBottomLeftInner { width: 5px; height: 8px; zoom: 1; } .gwt-MenuBarPopup .menuPopupBottomRightInner { width: 8px; height: 8px; zoom: 1; } .gwt-MenuBarPopup .menuPopupTopLeft { background: url(images/corner.png) no-repeat 0px -36px; -background: url(images/corner_ie6.png) no-repeat 0px -36px; } .gwt-MenuBarPopup .menuPopupTopRight { background: url(images/corner.png) no-repeat -5px -36px; -background: url(images/corner_ie6.png) no-repeat -5px -36px; } .gwt-MenuBarPopup .menuPopupBottomLeft { background: url(images/corner.png) no-repeat 0px -41px; -background: url(images/corner_ie6.png) no-repeat 0px -41px; } .gwt-MenuBarPopup .menuPopupBottomRight { background: url(images/corner.png) no-repeat -5px -41px; -background: url(images/corner_ie6.png) no-repeat -5px -41px; } * html .gwt-MenuBarPopup .menuPopupTopLeftInner { width: 5px; height: 5px; overflow: hidden; } * html .gwt-MenuBarPopup .menuPopupTopRightInner { width: 8px; height: 5px; overflow: hidden; } * html .gwt-MenuBarPopup .menuPopupBottomLeftInner { width: 5px; height: 8px; overflow: hidden; } * html .gwt-MenuBarPopup .menuPopupBottomRightInner { width: 8px; height: 8px; overflow: hidden; } .gwt-PasswordTextBox { padding: 2px; } .gwt-PasswordTextBox-readonly { color: #888; } .gwt-PopupPanel { border: 3px solid #C3D9FF; padding: 3px; background: white; } .gwt-DecoratedPopupPanel .popupContent { } .gwt-DecoratedPopupPanel .popupMiddleCenter { padding: 3px; background: #d0e4f6; } .gwt-DecoratedPopupPanel .popupTopCenter { background: url(images/hborder.png) repeat-x; } .gwt-DecoratedPopupPanel .popupBottomCenter { background: url(images/hborder.png) repeat-x 0px -4px; -background: url(images/hborder_ie6.png) repeat-x 0px -4px; } .gwt-DecoratedPopupPanel .popupMiddleLeft { background: url(images/vborder.png) repeat-y; } .gwt-DecoratedPopupPanel .popupMiddleRight { background: url(images/vborder.png) repeat-y -4px 0px; -background: url(images/vborder_ie6.png) repeat-y -4px 0px; } .gwt-DecoratedPopupPanel .popupTopLeftInner { width: 5px; height: 5px; zoom: 1; } .gwt-DecoratedPopupPanel .popupTopRightInner { width: 8px; height: 5px; zoom: 1; } .gwt-DecoratedPopupPanel .popupBottomLeftInner { width: 5px; height: 8px; zoom: 1; } .gwt-DecoratedPopupPanel .popupBottomRightInner { width: 8px; height: 8px; zoom: 1; } .gwt-DecoratedPopupPanel .popupTopLeft { background: url(images/corner.png) no-repeat 0px -10px; -background: url(images/corner_ie6.png) no-repeat 0px -10px; } .gwt-DecoratedPopupPanel .popupTopRight { background: url(images/corner.png) no-repeat -5px -10px; -background: url(images/corner_ie6.png) no-repeat -5px -10px; } .gwt-DecoratedPopupPanel .popupBottomLeft { background: url(images/corner.png) no-repeat 0px -15px; -background: url(images/corner_ie6.png) no-repeat 0px -15px; } .gwt-DecoratedPopupPanel .popupBottomRight { background: url(images/corner.png) no-repeat -5px -15px; -background: url(images/corner_ie6.png) no-repeat -5px -15px; } * html .gwt-DecoratedPopupPanel .popupTopLeftInner { width: 5px; height: 5px; overflow: hidden; } * html .gwt-DecoratedPopupPanel .popupTopRightInner { width: 8px; height: 5px; overflow: hidden; } * html .gwt-DecoratedPopupPanel .popupBottomLeftInner { width: 5px; height: 8px; overflow: hidden; } * html .gwt-DecoratedPopupPanel .popupBottomRightInner { width: 8px; height: 8px; overflow: hidden; } .gwt-PopupPanelGlass { background-color: #000; opacity: 0.3; filter: alpha(opacity=30); } .gwt-PushButton-up, .gwt-PushButton-up-hovering, .gwt-PushButton-up-disabled, .gwt-PushButton-down, .gwt-PushButton-down-hovering, .gwt-PushButton-down-disabled { margin: 0; text-decoration: none; background: url("images/hborder.png") repeat-x 0px -27px; } .gwt-PushButton-up, .gwt-PushButton-up-hovering, .gwt-PushButton-up-disabled { padding: 3px 5px 3px 5px; } .gwt-PushButton-up { border: 1px outset #ccc; cursor: pointer; cursor: hand; } .gwt-PushButton-up-hovering { border: 1px outset; border-color: #9cf #69e #69e #7af; cursor: pointer; cursor: hand; } .gwt-PushButton-up-disabled { border: 1px outset #ccc; cursor: default; opacity: .5; filter: alpha(opacity=40); zoom: 1; } .gwt-PushButton-down, .gwt-PushButton-down-hovering, .gwt-PushButton-down-disabled { padding: 4px 4px 2px 6px; } .gwt-PushButton-down { border: 1px inset #666; cursor: pointer; cursor: hand; } .gwt-PushButton-down-hovering { border: 1px inset; border-color: #9cf #69e #69e #7af; cursor: pointer; cursor: hand; } .gwt-PushButton-down-disabled { border: 1px outset #ccc; cursor: default; opacity: 0.5; filter: alpha(opacity=40); zoom: 1; } .gwt-RadioButton { } .gwt-RadioButton-disabled { color: #888; } .gwt-RichTextArea { } .hasRichTextToolbar { border: 0px; } .gwt-RichTextToolbar { background: #e3e8f3 url(images/hborder.png) repeat-x 0px -2003px; border-bottom: 1px solid #BBBBBB; padding: 3px; margin: 0px; } .gwt-RichTextToolbar .gwt-PushButton-up { padding: 0px 1px 0px 0px; margin-right: 4px; margin-bottom: 4px; border-width: 1px; } .gwt-RichTextToolbar .gwt-PushButton-up-hovering { margin-right: 4px; margin-bottom: 4px; padding: 0px 1px 0px 0px; border-width: 1px; } .gwt-RichTextToolbar .gwt-PushButton-down { margin-right: 4px; margin-bottom: 4px; padding: 0px 0px 0px 1px; border-width: 1px; } .gwt-RichTextToolbar .gwt-PushButton-down-hovering { margin-right: 4px; margin-bottom: 4px; padding: 0px 0px 0px 1px; border-width: 1px; } .gwt-RichTextToolbar .gwt-ToggleButton-up { margin-right: 4px; margin-bottom: 4px; padding: 0px 1px 0px 0px; border-width: 1px; } .gwt-RichTextToolbar .gwt-ToggleButton-up-hovering { margin-right: 4px; margin-bottom: 4px; padding: 0px 1px 0px 0px; border-width: 1px; } .gwt-RichTextToolbar .gwt-ToggleButton-down { margin-right: 4px; margin-bottom: 4px; padding: 0px 0px 0px 1px; border-width: 1px; } .gwt-RichTextToolbar .gwt-ToggleButton-down-hovering { margin-right: 4px; margin-bottom: 4px; padding: 0px 0px 0px 1px; border-width: 1px; } .gwt-StackPanel { border-bottom: 1px solid #bbbbbb; } .gwt-StackPanel .gwt-StackPanelItem { cursor: pointer; cursor: hand; font-weight: bold; font-size: 1.3em; padding: 3px; border: 1px solid #bbbbbb; border-bottom: 0px; background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; } .gwt-StackPanel .gwt-StackPanelContent { border: 1px solid #bbbbbb; border-bottom: 0px; background: white; padding: 2px 2px 10px 5px; } .gwt-DecoratedStackPanel { border-bottom: 1px solid #bbbbbb; } .gwt-DecoratedStackPanel .gwt-StackPanelContent { border: 1px solid #bbbbbb; border-bottom: 0px; background: white; padding: 2px 2px 10px 5px; } .gwt-DecoratedStackPanel .gwt-StackPanelItem { cursor: pointer; cursor: hand; } .gwt-DecoratedStackPanel .stackItemTopLeft, .gwt-DecoratedStackPanel .stackItemTopRight { height: 6px; width: 6px; zoom: 1; } .gwt-DecoratedStackPanel .stackItemTopLeft { border-left: 1px solid #bbbbbb; background: #d3def6 url(images/corner.png) no-repeat 0px -49px; -background: #d3def6 url(images/corner_ie6.png) no-repeat 0px -49px; } .gwt-DecoratedStackPanel .stackItemTopRight { border-right: 1px solid #bbbbbb; background: #d3def6 url(images/corner.png) no-repeat -6px -49px; -background: #d3def6 url(images/corner_ie6.png) no-repeat -6px -49px; } .gwt-DecoratedStackPanel .stackItemTopLeftInner, .gwt-DecoratedStackPanel .stackItemTopRightInner { width: 1px; height: 1px; } * html .gwt-DecoratedStackPanel .stackItemTopLeftInner, * html .gwt-DecoratedStackPanel .stackItemTopRightInner { width: 6px; height: 6px; overflow: hidden; } .gwt-DecoratedStackPanel .stackItemTopCenter { background: url(images/hborder.png) 0px -21px repeat-x; } .gwt-DecoratedStackPanel .stackItemMiddleLeft { background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; border-left: 1px solid #bbbbbb; } .gwt-DecoratedStackPanel .stackItemMiddleLeftInner, .gwt-DecoratedStackPanel .stackItemMiddleRightInner { width: 1px; height: 1px; } .gwt-DecoratedStackPanel .stackItemMiddleRight { background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; border-right: 1px solid #bbbbbb; } .gwt-DecoratedStackPanel .stackItemMiddleCenter { font-weight: bold; font-size: 1.3em; background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; } .gwt-DecoratedStackPanel .gwt-StackPanelItem-first .stackItemTopRight, .gwt-DecoratedStackPanel .gwt-StackPanelItem-first .stackItemTopLeft { border: 0px; background-color: white; } .gwt-DecoratedStackPanel .gwt-StackPanelItem-below-selected .stackItemTopLeft, .gwt-DecoratedStackPanel .gwt-StackPanelItem-below-selected .stackItemTopRight { background-color: white; } .gwt-SuggestBox { padding: 2px; } .gwt-SuggestBoxPopup { margin-left: 3px; } .gwt-SuggestBoxPopup .item { padding: 2px 6px; color: #424242; cursor: default; } .gwt-SuggestBoxPopup .item-selected { background: #b7d6f6; } .gwt-SuggestBoxPopup .suggestPopupContent { background: white; } .gwt-SuggestBoxPopup .suggestPopupTopCenter { background: url(images/hborder.png) repeat-x; } .gwt-SuggestBoxPopup .suggestPopupBottomCenter { background: url(images/hborder.png) repeat-x 0px -4px; -background: url(images/hborder_ie6.png) repeat-x 0px -4px; } .gwt-SuggestBoxPopup .suggestPopupMiddleLeft { background: url(images/vborder.png) repeat-y; } .gwt-SuggestBoxPopup .suggestPopupMiddleRight { background: url(images/vborder.png) repeat-y -4px 0px; -background: url(images/vborder_ie6.png) repeat-y -4px 0px; } .gwt-SuggestBoxPopup .suggestPopupTopLeftInner { width: 5px; height: 5px; zoom: 1; } .gwt-SuggestBoxPopup .suggestPopupTopRightInner { width: 8px; height: 5px; zoom: 1; } .gwt-SuggestBoxPopup .suggestPopupBottomLeftInner { width: 5px; height: 8px; zoom: 1; } .gwt-SuggestBoxPopup .suggestPopupBottomRightInner { width: 8px; height: 8px; zoom: 1; } .gwt-SuggestBoxPopup .suggestPopupTopLeft { background: url(images/corner.png) no-repeat 0px -23px; -background: url(images/corner_ie6.png) no-repeat 0px -23px; } .gwt-SuggestBoxPopup .suggestPopupTopRight { background: url(images/corner.png) no-repeat -5px -23px; -background: url(images/corner_ie6.png) no-repeat -5px -23px; } .gwt-SuggestBoxPopup .suggestPopupBottomLeft { background: url(images/corner.png) no-repeat 0px -28px; -background: url(images/corner_ie6.png) no-repeat 0px -28px; } .gwt-SuggestBoxPopup .suggestPopupBottomRight { background: url(images/corner.png) no-repeat -5px -28px; -background: url(images/corner_ie6.png) no-repeat -5px -28px; } * html .gwt-SuggestBoxPopup .suggestPopupTopLeftInner { width: 5px; height: 5px; overflow: hidden; } * html .gwt-SuggestBoxPopup .suggestPopupTopRightInner { width: 8px; height: 5px; overflow: hidden; } * html .gwt-SuggestBoxPopup .suggestPopupBottomLeftInner { width: 5px; height: 8px; overflow: hidden; } * html .gwt-SuggestBoxPopup .suggestPopupBottomRightInner { width: 8px; height: 8px; overflow: hidden; } .gwt-TabBar { } .gwt-TabBar .gwt-TabBarFirst { width: 5px; /* first tab distance from the left */ } .gwt-TabBar .gwt-TabBarRest { } .gwt-TabBar .gwt-TabBarItem { margin-left: 6px; padding: 3px 6px 3px 6px; cursor: pointer; cursor: hand; color: black; font-weight: bold; text-align: center; background: #d0e4f6; } .gwt-TabBar .gwt-TabBarItem-selected { cursor: default; background: #92c1f0; } .gwt-TabBar .gwt-TabBarItem-disabled { cursor: default; color: #999999; } .gwt-TabPanel { } .gwt-TabPanelBottom { border-color: #92c1f0; border-style: solid; border-width: 3px 2px 2px; overflow: hidden; padding: 6px; } .gwt-DecoratedTabBar { } .gwt-DecoratedTabBar .gwt-TabBarFirst { width: 5px; /* first tab distance from the left */ } .gwt-DecoratedTabBar .gwt-TabBarRest { } .gwt-DecoratedTabBar .gwt-TabBarItem { border-collapse: collapse; margin-left: 6px; } .gwt-DecoratedTabBar .tabTopCenter { padding: 0px; background: #d0e4f6; } .gwt-DecoratedTabBar .tabTopLeft, .gwt-DecoratedTabBar .tabTopRight { padding: 0px; zoom: 1; } .gwt-DecoratedTabBar .tabTopLeftInner, .gwt-DecoratedTabBar .tabTopRightInner { width: 6px; height: 6px; } .gwt-DecoratedTabBar .tabTopLeft { background: url(images/corner.png) no-repeat 0px -55px; -background: url(images/corner_ie6.png) no-repeat 0px -55px; } .gwt-DecoratedTabBar .tabTopRight { background: url(images/corner.png) no-repeat -6px -55px; -background: url(images/corner_ie6.png) no-repeat -6px -55px; } * html .gwt-DecoratedTabBar .tabTopLeftInner, * html .gwt-DecoratedTabBar .tabTopRightInner { width: 6px; height: 6px; overflow: hidden; } .gwt-DecoratedTabBar .tabMiddleLeft, .gwt-DecoratedTabBar .tabMiddleRight { width: 6px; padding: 0px; background: #d0e4f6; } .gwt-DecoratedTabBar .tabMiddleLeftInner, .gwt-DecoratedTabBar .tabMiddleRightInner { width: 1px; height: 1px; } .gwt-DecoratedTabBar .tabMiddleCenter { padding: 0px 4px 2px 4px; cursor: pointer; cursor: hand; color: black; font-weight: bold; text-align: center; background: #d0e4f6; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopCenter { background: #92c1f0; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopLeft { background-position: 0px -61px; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopRight { background-position: -6px -61px; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleLeft, .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleRight { background: #92c1f0; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleCenter { cursor: default; background: #92c1f0; } .gwt-DecoratedTabBar .gwt-TabBarItem-disabled .tabMiddleCenter { cursor: default; color: #999999; } .gwt-TextArea { padding: 2px; } .gwt-TextArea-readonly { color: #888; } .gwt-TextBox { padding: 2px; } .gwt-TextBox-readonly { color: #888; } .gwt-ToggleButton-up, .gwt-ToggleButton-up-hovering, .gwt-ToggleButton-up-disabled, .gwt-ToggleButton-down, .gwt-ToggleButton-down-hovering, .gwt-ToggleButton-down-disabled { margin: 0; text-decoration: none; background: url("images/hborder.png") repeat-x 0px -27px; } .gwt-ToggleButton-up, .gwt-ToggleButton-up-hovering, .gwt-ToggleButton-up-disabled { padding: 3px 5px 3px 5px; } .gwt-ToggleButton-up { border: 1px outset #ccc; cursor: pointer; cursor: hand; } .gwt-ToggleButton-up-hovering { border: 1px outset; border-color: #9cf #69e #69e #7af; cursor: pointer; cursor: hand; } .gwt-ToggleButton-up-disabled { border: 1px outset #ccc; cursor: default; opacity: .5; zoom: 1; filter: alpha(opacity=40); } .gwt-ToggleButton-down, .gwt-ToggleButton-down-hovering, .gwt-ToggleButton-down-disabled { padding: 4px 4px 2px 6px; } .gwt-ToggleButton-down { background-position: 0 -513px; border: 1px inset #ccc; cursor: pointer; cursor: hand; } .gwt-ToggleButton-down-hovering { background-position: 0 -513px; border: 1px inset; border-color: #9cf #69e #69e #7af; cursor: pointer; cursor: hand; } .gwt-ToggleButton-down-disabled { background-position: 0 -513px; border: 1px inset #ccc; cursor: default; opacity: .5; zoom: 1; filter: alpha(opacity=40); } .gwt-Tree .gwt-TreeItem { padding: 1px 0px; margin: 0px; white-space: nowrap; cursor: hand; cursor: pointer; } .gwt-Tree .gwt-TreeItem-selected { background: #93c2f1 url(images/hborder.png) repeat-x 0px -1463px; } .gwt-TreeItem .gwt-RadioButton input, .gwt-TreeItem .gwt-CheckBox input { margin-left: 0px; } * html .gwt-TreeItem .gwt-RadioButton input, * html .gwt-TreeItem .gwt-CheckBox input { margin-left: -4px; } .gwt-DateBox input { width: 8em; } .dateBoxFormatError { background: #ffcccc; } .dateBoxPopup { } .gwt-DatePicker { border: 1px solid #A2BBDD; cursor: default; } .gwt-DatePicker td, .datePickerMonthSelector td:focus { outline: none } .datePickerDays { width: 100%; background: white; } .datePickerDay, .datePickerWeekdayLabel, .datePickerWeekendLabel { font-size: 75%; text-align: center; padding: 4px; outline: none; } .datePickerWeekdayLabel, .datePickerWeekendLabel { background: #C3D9FF; padding: 0px 4px 2px; cursor: default; } .datePickerDay { padding: 4px; cursor: hand; cursor: pointer; } .datePickerDayIsToday { border: 1px solid black; padding: 3px; } .datePickerDayIsWeekend { background: #EEEEEE; } .datePickerDayIsFiller { color: #888888; } .datePickerDayIsValue { background: #aaccee; } .datePickerDayIsDisabled { color: #AAAAAA; font-style: italic; } .datePickerDayIsHighlighted { background: #F0E68C; } .datePickerDayIsValueAndHighlighted { background: #bbddd9; } .datePickerMonthSelector { background: #C3D9FF; width: 100%; } td.datePickerMonth { text-align: center; vertical-align: center; white-space: nowrap; font-size: 70%; font-weight: bold; color: blue; } .datePickerPreviousButton, .datePickerNextButton { font-size: 120%; line-height: 1em; color: blue; cursor: hand; cursor: pointer; padding: 0px 4px; } .gwt-StackLayoutPanel { border-bottom: 1px solid #bbbbbb; } .gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader { cursor: pointer; cursor: hand; font-weight: bold; font-size: 1.3em; padding: 3px; border: 1px solid #bbbbbb; border-bottom: 0px; background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; } +.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader-hovering { + background: #d3def6 url(images/hborder.png) repeat-x 0px -1464px; +} .gwt-StackLayoutPanel .gwt-StackLayoutPanelContent { border: 1px solid #bbbbbb; border-bottom: 0px; background: white; padding: 2px 2px 10px 5px; } .gwt-TabLayoutPanel { } .gwt-TabLayoutPanel .gwt-TabLayoutPanelTabs { } +.gwt-TabLayoutPanelContentContainer { + border-color: #92c1f0; + border-style: solid; + border-width: 2px 1px 1px; +} .gwt-TabLayoutPanel .gwt-TabLayoutPanelContent { border-color: #92c1f0; border-style: solid; - border-width: 3px 2px 2px; + border-width: 1px; overflow: hidden; padding: 6px; } .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab { margin-left: 6px; padding: 3px 6px 3px 6px; cursor: pointer; cursor: hand; color: black; font-weight: bold; text-align: center; background: #d0e4f6; } .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab-selected { cursor: default; background: #92c1f0; } .gwt-SplitLayoutPanel-HDragger { background: #d0e4f6 url(images/splitPanelThumb.png) center center no-repeat; cursor: col-resize; } .gwt-SplitLayoutPanel-VDragger { background: #d0e4f6 url(images/splitPanelThumb.png) center center no-repeat; cursor: row-resize; } diff --git a/war/rplogtool/gwt/standard/standard_rtl.css b/war/rplogtool/gwt/standard/standard_rtl.css index 5f29934..62c5fac 100644 --- a/war/rplogtool/gwt/standard/standard_rtl.css +++ b/war/rplogtool/gwt/standard/standard_rtl.css @@ -1,1139 +1,1152 @@ /** * The file contains styles for GWT widgets in the standard theme, in RTL mode. * * In order to maintain cross-browser compatibility, the following syntax is * used to create IE6 specific style rules: * .gwt-Widget { * property: rule applies to all browsers * -property: rule applies only to IE6 (overrides previous rule) * } * * html .gwt-Widget { * property: rule applies to all versions of IE * } */ body, table td, select { font-family: Arial Unicode MS, Arial, sans-serif; font-size: small; } pre { font-family: "courier new", courier; font-size: small; } body { color: black; margin: 0px; border: 0px; padding: 0px; background: #fff; direction: rtl; } a, a:visited, a:hover { color: #0000AA; } /** * The reference theme can be used to determine when this style sheet has * loaded. Create a hidden div element with absolute position, assign the style * name below, and attach it to the DOM. Use a timer to detect when the * element's height and width are set to 5px. */ .gwt-Reference-standard-rtl { height: 5px; width: 5px; zoom: 1; } .gwt-Button { margin: 0; padding: 3px 5px; text-decoration: none; font-size: small; cursor: pointer; cursor: hand; background: url("images/hborder.png") repeat-x 0px -27px; border: 1px outset #ccc; } .gwt-Button:active { border: 1px inset #ccc; } .gwt-Button:hover { border-color: #9cf #69e #69e #7af; } .gwt-Button[disabled] { cursor: default; color: #888; } .gwt-Button[disabled]:hover { border: 1px outset #ccc; } .gwt-CheckBox { } .gwt-CheckBox-disabled { color: #888; } .gwt-DecoratorPanel { } .gwt-DecoratorPanel .topCenter, .gwt-DecoratorPanel .bottomCenter { background: url(images/hborder.png) repeat-x; } .gwt-DecoratorPanel .middleLeft, .gwt-DecoratorPanel .middleRight { background: url(images/vborder.png) repeat-y; } .gwt-DecoratorPanel .topLeftInner, .gwt-DecoratorPanel .topRightInner, .gwt-DecoratorPanel .bottomLeftInner, .gwt-DecoratorPanel .bottomRightInner { width: 5px; height: 5px; zoom: 1; } .gwt-DecoratorPanel .topLeft { background: url(images/corner.png) no-repeat 0px 0px; -background: url(images/corner_ie6.png) no-repeat 0px 0px; } .gwt-DecoratorPanel .topRight { background: url(images/corner.png) no-repeat -5px 0px; -background: url(images/corner_ie6.png) no-repeat -5px 0px; } .gwt-DecoratorPanel .bottomLeft { background: url(images/corner.png) no-repeat 0px -5px; -background: url(images/corner_ie6.png) no-repeat 0px -5px; } .gwt-DecoratorPanel .bottomRight { background: url(images/corner.png) no-repeat -5px -5px; -background: url(images/corner_ie6.png) no-repeat -5px -5px; } * html .gwt-DecoratorPanel .topLeftInner, * html .gwt-DecoratorPanel .topRightInner, * html .gwt-DecoratorPanel .bottomLeftInner, * html .gwt-DecoratorPanel .bottomRightInner { width: 5px; height: 5px; overflow: hidden; } .gwt-DialogBox .Caption { background: #e3e8f3 url(images/hborder.png) repeat-x 0px -2003px; padding: 4px 8px 4px 4px; cursor: default; border-bottom: 1px solid #bbbbbb; border-top: 5px solid #d0e4f6; } .gwt-DialogBox .dialogContent { } .gwt-DialogBox .dialogMiddleCenter { padding: 3px; background: white; } .gwt-DialogBox .dialogBottomCenter { background: url(images/hborder.png) repeat-x 0px -4px; -background: url(images/hborder_ie6.png) repeat-x 0px -4px; } .gwt-DialogBox .dialogMiddleLeft { background: url(images/vborder.png) repeat-y; } .gwt-DialogBox .dialogMiddleRight { background: url(images/vborder.png) repeat-y -4px 0px; -background: url(images/vborder_ie6.png) repeat-y -4px 0px; } .gwt-DialogBox .dialogTopLeftInner { width: 5px; zoom: 1; } .gwt-DialogBox .dialogTopRightInner { width: 8px; zoom: 1; } .gwt-DialogBox .dialogBottomLeftInner { width: 5px; height: 8px; zoom: 1; } .gwt-DialogBox .dialogBottomRightInner { width: 5px; height: 8px; zoom: 1; } .gwt-DialogBox .dialogTopLeft { background: url(images/corner.png) no-repeat -13px 0px; -background: url(images/corner_ie6.png) no-repeat -13px 0px; } .gwt-DialogBox .dialogTopRight { background: url(images/corner.png) no-repeat -18px 0px; -background: url(images/corner_ie6.png) no-repeat -18px 0px; } .gwt-DialogBox .dialogBottomLeft { background: url(images/corner.png) no-repeat 0px -15px; -background: url(images/corner_ie6.png) no-repeat 0px -15px; } .gwt-DialogBox .dialogBottomRight { background: url(images/corner.png) no-repeat -5px -15px; -background: url(images/corner_ie6.png) no-repeat -5px -15px; } * html .gwt-DialogBox .dialogTopLeftInner { width: 5px; overflow: hidden; } * html .gwt-DialogBox .dialogTopRightInner { width: 8px; overflow: hidden; } * html .gwt-DialogBox .dialogBottomLeftInner { width: 5px; height: 8px; overflow: hidden; } * html .gwt-DialogBox .dialogBottomRightInner { width: 8px; height: 8px; overflow: hidden; } .gwt-DisclosurePanel { } .gwt-DisclosurePanel-open { } .gwt-DisclosurePanel-closed { } .gwt-DisclosurePanel .header, .gwt-DisclosurePanel .header a, .gwt-DisclosurePanel .header td { text-decoration: none; /* Remove underline from header */ color: black; cursor: pointer; cursor: hand; } .gwt-DisclosurePanel .content { border-right: 3px solid #e8eef7; padding: 4px 8px 4px 0px; margin-right: 6px; } .gwt-FileUpload { } .gwt-Frame { border-top: 2px solid #666; border-left: 2px solid #666; border-right: 2px solid #bbb; border-bottom: 2px solid #bbb; } .gwt-HorizontalSplitPanel { } .gwt-HorizontalSplitPanel .hsplitter { cursor: move; border: 0px; background: #91c0ef url(images/vborder.png) repeat-y; + line-height: 0px; } .gwt-VerticalSplitPanel { } .gwt-VerticalSplitPanel .vsplitter { cursor: move; border: 0px; background: #91c0ef url(images/hborder.png) repeat-x; + line-height: 0px; } .gwt-HTML { } .gwt-Hyperlink { } .gwt-Image { } .gwt-Label { } .gwt-ListBox { } .gwt-MenuBar { cursor: default; } .gwt-MenuBar .gwt-MenuItem { cursor: default; } .gwt-MenuBar .gwt-MenuItem-selected { background: #E0EDFE; } +.gwt-MenuBar .gwt-MenuItem-disabled { + color: #c0c0c0; +} .gwt-MenuBar-horizontal { background: #e3e8f3 url(images/hborder.png) repeat-x 0px -2003px; border: 1px solid #BBBBBB; } .gwt-MenuBar-horizontal .gwt-MenuItem { padding: 0px 10px; vertical-align: bottom; color: #666666; font-weight: bold; } .gwt-MenuBar-horizontal .gwt-MenuItemSeparator { width: 1px; padding: 0px; margin: 0px; border: 0px; border-right: 1px solid #888888; background: white; } .gwt-MenuBar-horizontal .gwt-MenuItemSeparator .menuSeparatorInner { width: 1px; height: 1px; background: white; } .gwt-MenuBar-vertical { margin-top: 0px; margin-right: 0px; background: white; } .gwt-MenuBar-vertical table { border-collapse: collapse; } .gwt-MenuBar-vertical .gwt-MenuItem { padding: 4px 1px 4px 14px; } .gwt-MenuBar-vertical .gwt-MenuItemSeparator { padding: 2px 0px; } .gwt-MenuBar-vertical .gwt-MenuItemSeparator .menuSeparatorInner { height: 1px; padding: 0px; border: 0px; border-top: 1px solid #777777; background: #ddddee; overflow: hidden; } .gwt-MenuBar-vertical .subMenuIcon { padding-left: 4px; } .gwt-MenuBar-vertical .subMenuIcon-selected { background: #E0EDFE; } .gwt-MenuBarPopup { margin: 0px 3px 0px 0px; } .gwt-MenuBarPopup .menuPopupTopCenter { background: url(images/hborder.png) 0px -12px repeat-x; } .gwt-MenuBarPopup .menuPopupBottomCenter { background: url(images/hborder.png) 0px -13px repeat-x; -background: url(images/hborder_ie6.png) 0px -13px repeat-x; } .gwt-MenuBarPopup .menuPopupMiddleLeft { background: url(images/vborder.png) -12px 0px repeat-y; -background: url(images/vborder_ie6.png) -12px 0px repeat-y; } .gwt-MenuBarPopup .menuPopupMiddleRight { background: url(images/vborder.png) -13px 0px repeat-y; -background: url(images/vborder_ie6.png) -13px 0px repeat-y; } .gwt-MenuBarPopup .menuPopupTopLeftInner { width: 5px; height: 5px; zoom: 1; } .gwt-MenuBarPopup .menuPopupTopRightInner { width: 8px; height: 5px; zoom: 1; } .gwt-MenuBarPopup .menuPopupBottomLeftInner { width: 5px; height: 8px; zoom: 1; } .gwt-MenuBarPopup .menuPopupBottomRightInner { width: 8px; height: 8px; zoom: 1; } .gwt-MenuBarPopup .menuPopupTopLeft { background: url(images/corner.png) no-repeat 0px -36px; -background: url(images/corner_ie6.png) no-repeat 0px -36px; } .gwt-MenuBarPopup .menuPopupTopRight { background: url(images/corner.png) no-repeat -5px -36px; -background: url(images/corner_ie6.png) no-repeat -5px -36px; } .gwt-MenuBarPopup .menuPopupBottomLeft { background: url(images/corner.png) no-repeat 0px -41px; -background: url(images/corner_ie6.png) no-repeat 0px -41px; } .gwt-MenuBarPopup .menuPopupBottomRight { background: url(images/corner.png) no-repeat -5px -41px; -background: url(images/corner_ie6.png) no-repeat -5px -41px; } * html .gwt-MenuBarPopup .menuPopupTopLeftInner { width: 5px; height: 5px; overflow: hidden; } * html .gwt-MenuBarPopup .menuPopupTopRightInner { width: 8px; height: 5px; overflow: hidden; } * html .gwt-MenuBarPopup .menuPopupBottomLeftInner { width: 5px; height: 8px; overflow: hidden; } * html .gwt-MenuBarPopup .menuPopupBottomRightInner { width: 8px; height: 8px; overflow: hidden; } .gwt-PasswordTextBox { padding: 2px; } .gwt-PasswordTextBox-readonly { color: #888; } .gwt-PopupPanel { border: 3px solid #C3D9FF; padding: 3px; background: white; } .gwt-DecoratedPopupPanel .popupContent { } .gwt-DecoratedPopupPanel .popupMiddleCenter { padding: 3px; background: #d0e4f6; } .gwt-DecoratedPopupPanel .popupTopCenter { background: url(images/hborder.png) repeat-x; } .gwt-DecoratedPopupPanel .popupBottomCenter { background: url(images/hborder.png) repeat-x 0px -4px; -background: url(images/hborder_ie6.png) repeat-x 0px -4px; } .gwt-DecoratedPopupPanel .popupMiddleLeft { background: url(images/vborder.png) repeat-y; } .gwt-DecoratedPopupPanel .popupMiddleRight { background: url(images/vborder.png) repeat-y -4px 0px; -background: url(images/vborder_ie6.png) repeat-y -4px 0px; } .gwt-DecoratedPopupPanel .popupTopLeftInner { width: 5px; height: 5px; zoom: 1; } .gwt-DecoratedPopupPanel .popupTopRightInner { width: 8px; height: 5px; zoom: 1; } .gwt-DecoratedPopupPanel .popupBottomLeftInner { width: 5px; height: 8px; zoom: 1; } .gwt-DecoratedPopupPanel .popupBottomRightInner { width: 8px; height: 8px; zoom: 1; } .gwt-DecoratedPopupPanel .popupTopLeft { background: url(images/corner.png) no-repeat 0px -10px; -background: url(images/corner_ie6.png) no-repeat 0px -10px; } .gwt-DecoratedPopupPanel .popupTopRight { background: url(images/corner.png) no-repeat -5px -10px; -background: url(images/corner_ie6.png) no-repeat -5px -10px; } .gwt-DecoratedPopupPanel .popupBottomLeft { background: url(images/corner.png) no-repeat 0px -15px; -background: url(images/corner_ie6.png) no-repeat 0px -15px; } .gwt-DecoratedPopupPanel .popupBottomRight { background: url(images/corner.png) no-repeat -5px -15px; -background: url(images/corner_ie6.png) no-repeat -5px -15px; } * html .gwt-DecoratedPopupPanel .popupTopLeftInner { width: 5px; height: 5px; overflow: hidden; } * html .gwt-DecoratedPopupPanel .popupTopRightInner { width: 8px; height: 5px; overflow: hidden; } * html .gwt-DecoratedPopupPanel .popupBottomLeftInner { width: 5px; height: 8px; overflow: hidden; } * html .gwt-DecoratedPopupPanel .popupBottomRightInner { width: 8px; height: 8px; overflow: hidden; } .gwt-PopupPanelGlass { background-color: #000; opacity: 0.3; filter: alpha(opacity=30); } .gwt-PushButton-up, .gwt-PushButton-up-hovering, .gwt-PushButton-up-disabled, .gwt-PushButton-down, .gwt-PushButton-down-hovering, .gwt-PushButton-down-disabled { margin: 0; text-decoration: none; background: url("images/hborder.png") repeat-x 0px -27px; } .gwt-PushButton-up, .gwt-PushButton-up-hovering, .gwt-PushButton-up-disabled { padding: 3px 5px 3px 5px; } .gwt-PushButton-up { border: 1px outset #ccc; cursor: pointer; cursor: hand; } .gwt-PushButton-up-hovering { border: 1px outset; border-color: #9cf #69e #69e #7af; cursor: pointer; cursor: hand; } .gwt-PushButton-up-disabled { border: 1px outset #ccc; cursor: default; opacity: .5; filter: alpha(opacity=40); zoom: 1; } .gwt-PushButton-down, .gwt-PushButton-down-hovering, .gwt-PushButton-down-disabled { padding: 4px 4px 2px 6px; } .gwt-PushButton-down { border: 1px inset #666; cursor: pointer; cursor: hand; } .gwt-PushButton-down-hovering { border: 1px inset; border-color: #9cf #69e #69e #7af; cursor: pointer; cursor: hand; } .gwt-PushButton-down-disabled { border: 1px outset #ccc; cursor: default; opacity: 0.5; filter: alpha(opacity=40); zoom: 1; } .gwt-RadioButton { } .gwt-RadioButton-disabled { color: #888; } .gwt-RichTextArea { } .hasRichTextToolbar { border: 0px; } .gwt-RichTextToolbar { background: #e3e8f3 url(images/hborder.png) repeat-x 0px -2003px; border-bottom: 1px solid #BBBBBB; padding: 3px; margin: 0px; } .gwt-RichTextToolbar .gwt-PushButton-up { padding: 0px 0px 0px 1px; margin-left: 4px; margin-bottom: 4px; border-width: 1px; } .gwt-RichTextToolbar .gwt-PushButton-up-hovering { margin-left: 4px; margin-bottom: 4px; padding: 0px 0px 0px 1px; border-width: 1px; } .gwt-RichTextToolbar .gwt-PushButton-down { margin-left: 4px; margin-bottom: 4px; padding: 0px 1px 0px 0px; border-width: 1px; } .gwt-RichTextToolbar .gwt-PushButton-down-hovering { margin-left: 4px; margin-bottom: 4px; padding: 0px 1px 0px 0px; border-width: 1px; } .gwt-RichTextToolbar .gwt-ToggleButton-up { margin-left: 4px; margin-bottom: 4px; padding: 0px 0px 0px 1px; border-width: 1px; } .gwt-RichTextToolbar .gwt-ToggleButton-up-hovering { margin-left: 4px; margin-bottom: 4px; padding: 0px 0px 0px 1px; border-width: 1px; } .gwt-RichTextToolbar .gwt-ToggleButton-down { margin-left: 4px; margin-bottom: 4px; padding: 0px 1px 0px 0px; border-width: 1px; } .gwt-RichTextToolbar .gwt-ToggleButton-down-hovering { margin-left: 4px; margin-bottom: 4px; padding: 0px 1px 0px 0px; border-width: 1px; } .gwt-StackPanel { border-bottom: 1px solid #bbbbbb; } .gwt-StackPanel .gwt-StackPanelItem { cursor: pointer; cursor: hand; font-weight: bold; font-size: 1.3em; padding: 3px; border: 1px solid #bbbbbb; border-bottom: 0px; background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; } .gwt-StackPanel .gwt-StackPanelContent { border: 1px solid #bbbbbb; border-bottom: 0px; background: white; padding: 2px 2px 10px 5px; } .gwt-DecoratedStackPanel { border-bottom: 1px solid #bbbbbb; } .gwt-DecoratedStackPanel .gwt-StackPanelContent { border: 1px solid #bbbbbb; border-bottom: 0px; background: white; padding: 2px 5px 10px 2px; } .gwt-DecoratedStackPanel .gwt-StackPanelItem { cursor: pointer; cursor: hand; } .gwt-DecoratedStackPanel .stackItemTopLeft, .gwt-DecoratedStackPanel .stackItemTopRight { height: 6px; width: 6px; zoom: 1; } .gwt-DecoratedStackPanel .stackItemTopLeft { border-left: 1px solid #bbbbbb; background: #d3def6 url(images/corner.png) no-repeat 0px -49px; -background: #d3def6 url(images/corner_ie6.png) no-repeat 0px -49px; } .gwt-DecoratedStackPanel .stackItemTopRight { border-right: 1px solid #bbbbbb; background: #d3def6 url(images/corner.png) no-repeat -6px -49px; -background: #d3def6 url(images/corner_ie6.png) no-repeat -6px -49px; } .gwt-DecoratedStackPanel .stackItemTopLeftInner, .gwt-DecoratedStackPanel .stackItemTopRightInner { width: 1px; height: 1px; } * html .gwt-DecoratedStackPanel .stackItemTopLeftInner, * html .gwt-DecoratedStackPanel .stackItemTopRightInner { width: 6px; height: 6px; overflow: hidden; } .gwt-DecoratedStackPanel .stackItemTopCenter { background: url(images/hborder.png) 0px -21px repeat-x; } .gwt-DecoratedStackPanel .stackItemMiddleLeft { background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; border-left: 1px solid #bbbbbb; } .gwt-DecoratedStackPanel .stackItemMiddleLeftInner, .gwt-DecoratedStackPanel .stackItemMiddleRightInner { width: 1px; height: 1px; } .gwt-DecoratedStackPanel .stackItemMiddleRight { background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; border-right: 1px solid #bbbbbb; } .gwt-DecoratedStackPanel .stackItemMiddleCenter { font-weight: bold; font-size: 1.3em; background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; } .gwt-DecoratedStackPanel .gwt-StackPanelItem-first .stackItemTopRight, .gwt-DecoratedStackPanel .gwt-StackPanelItem-first .stackItemTopLeft { border: 0px; background-color: white; } .gwt-DecoratedStackPanel .gwt-StackPanelItem-below-selected .stackItemTopLeft, .gwt-DecoratedStackPanel .gwt-StackPanelItem-below-selected .stackItemTopRight { background-color: white; } .gwt-SuggestBox { padding: 2px; } .gwt-SuggestBoxPopup { margin-right: 3px; } .gwt-SuggestBoxPopup .item { padding: 2px 6px; color: #424242; cursor: default; } .gwt-SuggestBoxPopup .item-selected { background: #b7d6f6; } .gwt-SuggestBoxPopup .suggestPopupContent { background: white; } .gwt-SuggestBoxPopup .suggestPopupTopCenter { background: url(images/hborder.png) repeat-x; } .gwt-SuggestBoxPopup .suggestPopupBottomCenter { background: url(images/hborder.png) repeat-x 0px -4px; -background: url(images/hborder_ie6.png) repeat-x 0px -4px; } .gwt-SuggestBoxPopup .suggestPopupMiddleLeft { background: url(images/vborder.png) repeat-y; } .gwt-SuggestBoxPopup .suggestPopupMiddleRight { background: url(images/vborder.png) repeat-y -4px 0px; -background: url(images/vborder_ie6.png) repeat-y -4px 0px; } .gwt-SuggestBoxPopup .suggestPopupTopLeftInner { width: 5px; height: 5px; zoom: 1; } .gwt-SuggestBoxPopup .suggestPopupTopRightInner { width: 8px; height: 5px; zoom: 1; } .gwt-SuggestBoxPopup .suggestPopupBottomLeftInner { width: 5px; height: 8px; zoom: 1; } .gwt-SuggestBoxPopup .suggestPopupBottomRightInner { width: 8px; height: 8px; zoom: 1; } .gwt-SuggestBoxPopup .suggestPopupTopLeft { background: url(images/corner.png) no-repeat 0px -23px; -background: url(images/corner_ie6.png) no-repeat 0px -23px; } .gwt-SuggestBoxPopup .suggestPopupTopRight { background: url(images/corner.png) no-repeat -5px -23px; -background: url(images/corner_ie6.png) no-repeat -5px -23px; } .gwt-SuggestBoxPopup .suggestPopupBottomLeft { background: url(images/corner.png) no-repeat 0px -28px; -background: url(images/corner_ie6.png) no-repeat 0px -28px; } .gwt-SuggestBoxPopup .suggestPopupBottomRight { background: url(images/corner.png) no-repeat -5px -28px; -background: url(images/corner_ie6.png) no-repeat -5px -28px; } * html .gwt-SuggestBoxPopup .suggestPopupTopLeftInner { width: 5px; height: 5px; overflow: hidden; } * html .gwt-SuggestBoxPopup .suggestPopupTopRightInner { width: 8px; height: 5px; overflow: hidden; } * html .gwt-SuggestBoxPopup .suggestPopupBottomLeftInner { width: 5px; height: 8px; overflow: hidden; } * html .gwt-SuggestBoxPopup .suggestPopupBottomRightInner { width: 8px; height: 8px; overflow: hidden; } .gwt-TabBar { } .gwt-TabBar .gwt-TabBarFirst { width: 5px; /* first tab distance from the left */ } .gwt-TabBar .gwt-TabBarRest { } .gwt-TabBar .gwt-TabBarItem { margin-left: 6px; padding: 3px 6px 3px 6px; cursor: pointer; cursor: hand; color: black; font-weight: bold; text-align: center; background: #d0e4f6; } .gwt-TabBar .gwt-TabBarItem-selected { cursor: default; background: #92c1f0; } .gwt-TabBar .gwt-TabBarItem-disabled { cursor: default; color: #999999; } .gwt-TabPanel { } .gwt-TabPanelBottom { border-color: #92c1f0; border-style: solid; border-width: 3px 2px 2px; overflow: hidden; padding: 6px; } .gwt-DecoratedTabBar { } .gwt-DecoratedTabBar .gwt-TabBarFirst { width: 5px; /* first tab distance from the left */ } .gwt-DecoratedTabBar .gwt-TabBarRest { } .gwt-DecoratedTabBar .gwt-TabBarItem { border-collapse: collapse; margin-right: 6px; } .gwt-DecoratedTabBar .tabTopCenter { padding: 0px; background: #d0e4f6; } .gwt-DecoratedTabBar .tabTopLeft, .gwt-DecoratedTabBar .tabTopRight { padding: 0px; zoom: 1; } .gwt-DecoratedTabBar .tabTopLeftInner, .gwt-DecoratedTabBar .tabTopRightInner { width: 6px; height: 6px; } .gwt-DecoratedTabBar .tabTopLeft { background: url(images/corner.png) no-repeat 0px -55px; -background: url(images/corner_ie6.png) no-repeat 0px -55px; } .gwt-DecoratedTabBar .tabTopRight { background: url(images/corner.png) no-repeat -6px -55px; -background: url(images/corner_ie6.png) no-repeat -6px -55px; } * html .gwt-DecoratedTabBar .tabTopLeftInner, * html .gwt-DecoratedTabBar .tabTopRightInner { width: 6px; height: 6px; overflow: hidden; } .gwt-DecoratedTabBar .tabMiddleLeft, .gwt-DecoratedTabBar .tabMiddleRight { width: 6px; padding: 0px; background: #d0e4f6; } .gwt-DecoratedTabBar .tabMiddleLeftInner, .gwt-DecoratedTabBar .tabMiddleRightInner { width: 1px; height: 1px; } .gwt-DecoratedTabBar .tabMiddleCenter { padding: 0px 4px 2px 4px; cursor: pointer; cursor: hand; color: black; font-weight: bold; text-align: center; background: #d0e4f6; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopCenter { background: #92c1f0; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopLeft { background-position: 0px -61px; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabTopRight { background-position: -6px -61px; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleLeft, .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleRight { background: #92c1f0; } .gwt-DecoratedTabBar .gwt-TabBarItem-selected .tabMiddleCenter { cursor: default; background: #92c1f0; } .gwt-DecoratedTabBar .gwt-TabBarItem-disabled .tabMiddleCenter { cursor: default; color: #999999; } .gwt-TextArea { padding: 2px; } .gwt-TextArea-readonly { color: #888; } .gwt-TextBox { padding: 2px; } .gwt-TextBox-readonly { color: #888; } .gwt-ToggleButton-up, .gwt-ToggleButton-up-hovering, .gwt-ToggleButton-up-disabled, .gwt-ToggleButton-down, .gwt-ToggleButton-down-hovering, .gwt-ToggleButton-down-disabled { margin: 0; text-decoration: none; background: url("images/hborder.png") repeat-x 0px -27px; } .gwt-ToggleButton-up, .gwt-ToggleButton-up-hovering, .gwt-ToggleButton-up-disabled { padding: 3px 5px 3px 5px; } .gwt-ToggleButton-up { border: 1px outset #ccc; cursor: pointer; cursor: hand; } .gwt-ToggleButton-up-hovering { border: 1px outset; border-color: #9cf #69e #69e #7af; cursor: pointer; cursor: hand; } .gwt-ToggleButton-up-disabled { border: 1px outset #ccc; cursor: default; opacity: .5; zoom: 1; filter: alpha(opacity=40); } .gwt-ToggleButton-down, .gwt-ToggleButton-down-hovering, .gwt-ToggleButton-down-disabled { padding: 4px 4px 2px 6px; } .gwt-ToggleButton-down { background-position: 0 -513px; border: 1px inset #ccc; cursor: pointer; cursor: hand; } .gwt-ToggleButton-down-hovering { background-position: 0 -513px; border: 1px inset; border-color: #9cf #69e #69e #7af; cursor: pointer; cursor: hand; } .gwt-ToggleButton-down-disabled { background-position: 0 -513px; border: 1px inset #ccc; cursor: default; opacity: .5; zoom: 1; filter: alpha(opacity=40); } .gwt-Tree .gwt-TreeItem { padding: 1px 0px; margin: 0px; white-space: nowrap; cursor: hand; cursor: pointer; zoom: 1; } .gwt-Tree .gwt-TreeItem-selected { background: #93c2f1 url(images/hborder.png) repeat-x 0px -1463px; } .gwt-TreeItem .gwt-RadioButton input, .gwt-TreeItem .gwt-CheckBox input { margin-right: 0px; } * html .gwt-TreeItem .gwt-RadioButton input, * html .gwt-TreeItem .gwt-CheckBox input { margin-right: -4px; } .gwt-DateBox input { width: 8em; } .dateBoxFormatError { background: #ffcccc; } .dateBoxPopup { } .gwt-DatePicker { border: 1px solid #A2BBDD; cursor: default; } .gwt-DatePicker td, .datePickerMonthSelector td:focus { outline: none } .datePickerDays { width: 100%; background: white; } .datePickerDay, .datePickerWeekdayLabel, .datePickerWeekendLabel { font-size: 75%; text-align: center; padding: 4px; outline: none; } .datePickerWeekdayLabel, .datePickerWeekendLabel { background: #C3D9FF; padding: 0px 4px 2px; cursor: default; } .datePickerDay { padding: 4px; cursor: hand; cursor: pointer; } .datePickerDayIsToday { border: 1px solid black; padding: 3px; } .datePickerDayIsWeekend { background: #EEEEEE; } .datePickerDayIsFiller { color: #888888; } .datePickerDayIsValue { background: #aaccee; } .datePickerDayIsDisabled { color: #AAAAAA; font-style: italic; } .datePickerDayIsHighlighted { background: #F0E68C; } .datePickerDayIsValueAndHighlighted { background: #bbddd9; } .datePickerMonthSelector { background: #C3D9FF; width: 100%; } td.datePickerMonth { text-align: center; vertical-align: center; white-space: nowrap; font-size: 70%; font-weight: bold; color: blue; } .datePickerPreviousButton, .datePickerNextButton { font-size: 120%; line-height: 1em; color: blue; cursor: hand; cursor: pointer; padding: 0px 4px; } .gwt-StackLayoutPanel { border-bottom: 1px solid #bbbbbb; } .gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader { cursor: pointer; cursor: hand; font-weight: bold; font-size: 1.3em; padding: 3px; border: 1px solid #bbbbbb; border-bottom: 0px; background: #d3def6 url(images/hborder.png) repeat-x 0px -989px; } +.gwt-StackLayoutPanel .gwt-StackLayoutPanelHeader-hovering { + background: #d3def6 url(images/hborder.png) repeat-x 0px -1464px; +} .gwt-StackLayoutPanel .gwt-StackLayoutPanelContent { border: 1px solid #bbbbbb; border-bottom: 0px; background: white; padding: 2px 5px 10px 2px; } .gwt-TabLayoutPanel { } .gwt-TabLayoutPanel .gwt-TabLayoutPanelTabs { } +.gwt-TabLayoutPanelContentContainer { + border-color: #92c1f0; + border-style: solid; + border-width: 2px 1px 1px; +} .gwt-TabLayoutPanel .gwt-TabLayoutPanelContent { border-color: #92c1f0; border-style: solid; - border-width: 3px 2px 2px; + border-width: 1px; overflow: hidden; padding: 6px; } .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab { margin-left: 6px; padding: 3px 6px 3px 6px; cursor: pointer; cursor: hand; color: black; font-weight: bold; text-align: center; background: #d0e4f6; } .gwt-TabLayoutPanel .gwt-TabLayoutPanelTab-selected { cursor: default; background: #92c1f0; } .gwt-SplitLayoutPanel-HDragger { background: #d0e4f6 url(images/splitPanelThumb.png) center center no-repeat; cursor: col-resize; } .gwt-SplitLayoutPanel-VDragger { background: #d0e4f6 url(images/splitPanelThumb.png) center center no-repeat; cursor: row-resize; } diff --git a/war/rplogtool/hosted.html b/war/rplogtool/hosted.html index e8983af..86db1ad 100644 --- a/war/rplogtool/hosted.html +++ b/war/rplogtool/hosted.html @@ -1,333 +1,355 @@ <html> <head><script> var $wnd = parent; var $doc = $wnd.document; var $moduleName, $moduleBase, $entry ,$stats = $wnd.__gwtStatsEvent ? function(a) {return $wnd.__gwtStatsEvent(a);} : null ,$sessionId = $wnd.__gwtStatsSessionId ? $wnd.__gwtStatsSessionId : null; // Lightweight metrics if ($stats) { var moduleFuncName = location.search.substr(1); var moduleFunc = $wnd[moduleFuncName]; var moduleName = moduleFunc ? moduleFunc.moduleName : "unknown"; $stats({moduleName:moduleName,sessionId:$sessionId,subSystem:'startup',evtGroup:'moduleStartup',millis:(new Date()).getTime(),type:'moduleEvalStart'}); } -var $hostedHtmlVersion="2.0"; +var $hostedHtmlVersion="2.1"; var gwtOnLoad; var $hosted = "localhost:9997"; function loadIframe(url) { var topDoc = window.top.document; // create an iframe var iframeDiv = topDoc.createElement("div"); iframeDiv.innerHTML = "<iframe scrolling=no frameborder=0 src='" + url + "'>"; var iframe = iframeDiv.firstChild; // mess with the iframe style a little var iframeStyle = iframe.style; iframeStyle.position = "absolute"; iframeStyle.borderWidth = "0"; iframeStyle.left = "0"; iframeStyle.top = "0"; iframeStyle.width = "100%"; iframeStyle.backgroundColor = "#ffffff"; iframeStyle.zIndex = "1"; iframeStyle.height = "100%"; // update the top window's document's body's style var hostBodyStyle = window.top.document.body.style; hostBodyStyle.margin = "0"; hostBodyStyle.height = iframeStyle.height; hostBodyStyle.overflow = "hidden"; // insert the iframe topDoc.body.insertBefore(iframe, topDoc.body.firstChild); } var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("gecko") != -1) { // install eval wrapper on FF to avoid EvalError problem var __eval = window.eval; window.eval = function(s) { return __eval(s); } } if (ua.indexOf("chrome") != -1) { // work around __gwt_ObjectId appearing in JS objects var hop = Object.prototype.hasOwnProperty; Object.prototype.hasOwnProperty = function(prop) { return prop != "__gwt_ObjectId" && hop.call(this, prop); }; + // do the same in our parent as well -- see issue 4486 + // NOTE: this will have to be changed when we support non-iframe-based DevMode + var hop2 = parent.Object.prototype.hasOwnProperty; + parent.Object.prototype.hasOwnProperty = function(prop) { + return prop != "__gwt_ObjectId" && hop2.call(this, prop); + }; } // wrapper to call JS methods, which we need both to be able to supply a // different this for method lookup and to get the exception back function __gwt_jsInvoke(thisObj, methodName) { try { var args = Array.prototype.slice.call(arguments, 2); return [0, window[methodName].apply(thisObj, args)]; } catch (e) { return [1, e]; } } var __gwt_javaInvokes = []; function __gwt_makeJavaInvoke(argCount) { return __gwt_javaInvokes[argCount] || __gwt_doMakeJavaInvoke(argCount); } function __gwt_doMakeJavaInvoke(argCount) { // IE6 won't eval() anonymous functions except as r-values var argList = ""; for (var i = 0; i < argCount; i++) { argList += ",p" + i; } var argListNoComma = argList.substring(1); return eval( "__gwt_javaInvokes[" + argCount + "] =\n" + " function(thisObj, dispId" + argList + ") {\n" + " var result = __static(dispId, thisObj" + argList + ");\n" + " if (result[0]) {\n" + " throw result[1];\n" + " } else {\n" + " return result[1];\n" + " }\n" + " }\n" ); } /* * This is used to create tear-offs of Java methods. Each function corresponds * to exactly one dispId, and also embeds the argument count. We get the "this" * value from the context in which the function is being executed. * Function-object identity is preserved by caching in a sparse array. */ var __gwt_tearOffs = []; var __gwt_tearOffGenerators = []; function __gwt_makeTearOff(proxy, dispId, argCount) { return __gwt_tearOffs[dispId] || __gwt_doMakeTearOff(dispId, argCount); } function __gwt_doMakeTearOff(dispId, argCount) { return __gwt_tearOffs[dispId] = (__gwt_tearOffGenerators[argCount] || __gwt_doMakeTearOffGenerator(argCount))(dispId); } function __gwt_doMakeTearOffGenerator(argCount) { // IE6 won't eval() anonymous functions except as r-values var argList = ""; for (var i = 0; i < argCount; i++) { argList += ",p" + i; } var argListNoComma = argList.substring(1); return eval( "__gwt_tearOffGenerators[" + argCount + "] =\n" + " function(dispId) {\n" + " return function(" + argListNoComma + ") {\n" + " var result = __static(dispId, this" + argList + ");\n" + " if (result[0]) {\n" + " throw result[1];\n" + " } else {\n" + " return result[1];\n" + " }\n" + " }\n" + " }\n" ); } function __gwt_makeResult(isException, result) { return [isException, result]; } function __gwt_disconnected() { // Prevent double-invocation. window.__gwt_disconnected = new Function(); // Do it in a timeout so we can be sure we have a clean stack. window.setTimeout(__gwt_disconnected_impl, 1); } function __gwt_disconnected_impl() { + __gwt_displayGlassMessage('GWT Code Server Disconnected', + 'Most likely, you closed GWT Development Mode. Or, you might have lost ' + + 'network connectivity. To fix this, try restarting GWT Development Mode and ' + + '<a style="color: #FFFFFF; font-weight: bold;" href="javascript:location.reload()">' + + 'REFRESH</a> this page.'); +} + +// Keep track of z-index to allow layering of multiple glass messages +var __gwt_glassMessageZIndex = 2147483647; + +// Note this method is also used by ModuleSpace.java +function __gwt_displayGlassMessage(summary, details) { var topWin = window.top; var topDoc = topWin.document; var outer = topDoc.createElement("div"); // Do not insert whitespace or outer.firstChild will get a text node. outer.innerHTML = - '<div style="position:absolute;z-index:2147483646;left:0px;top:0px;right:0px;bottom:0px;filter:alpha(opacity=75);opacity:0.75;background-color:#000000;"></div>' + - '<div style="position:absolute;z-index:2147483647;left:50px;top:50px;width:600px;color:#FFFFFF;font-family:verdana;">' + - '<div style="font-size:30px;font-weight:bold;">GWT Code Server Disconnected</div>' + - '<p style="font-size:15px;"> Most likely, you closed GWT development mode. Or you might have lost network connectivity. To fix this, try restarting GWT Development Mode and <a style="color: #FFFFFF; font-weight: bold;" href="javascript:location.reload()">REFRESH</a> this page.</p>' + - '</div>' + '<div style="position:absolute;z-index:' + __gwt_glassMessageZIndex-- + + ';left:50px;top:50px;width:600px;color:#FFF;font-family:verdana;text-align:left;">' + + '<div style="font-size:30px;font-weight:bold;">' + summary + '</div>' + + '<div style="font-size:15px;">' + details + '</div>' + + '</div>' + + '<div style="position:absolute;z-index:' + __gwt_glassMessageZIndex-- + + ';left:0px;top:0px;right:0px;bottom:0px;filter:alpha(opacity=60);opacity:0.6;background-color:#000;"></div>' ; topDoc.body.appendChild(outer); var glass = outer.firstChild; var glassStyle = glass.style; // Scroll to the top and remove scrollbars. topWin.scrollTo(0, 0); if (topDoc.compatMode == "BackCompat") { topDoc.body.style["overflow"] = "hidden"; } else { topDoc.documentElement.style["overflow"] = "hidden"; } // Steal focus. glass.focus(); if ((navigator.userAgent.indexOf("MSIE") >= 0) && (topDoc.compatMode == "BackCompat")) { // IE quirks mode doesn't support right/bottom, but does support this. glassStyle.width = "125%"; glassStyle.height = "100%"; } else if (navigator.userAgent.indexOf("MSIE 6") >= 0) { // IE6 doesn't have a real standards mode, so we have to use hacks. glassStyle.width = "125%"; // Get past scroll bar area. // Nasty CSS; onresize would be better but the outer window won't let us add a listener IE. glassStyle.setExpression("height", "document.documentElement.clientHeight"); } + + $doc.title = summary + " [" + $doc.title + "]"; } function findPluginObject() { try { return document.getElementById('pluginObject'); } catch (e) { return null; } } function findPluginEmbed() { try { return document.getElementById('pluginEmbed') } catch (e) { return null; } } function findPluginXPCOM() { try { return __gwt_HostedModePlugin; } catch (e) { return null; } } gwtOnLoad = function(errFn, modName, modBase){ $moduleName = modName; $moduleBase = modBase; // Note that the order is important var pluginFinders = [ findPluginXPCOM, findPluginObject, findPluginEmbed, ]; var topWin = window.top; var url = topWin.location.href; if (!topWin.__gwt_SessionID) { var ASCII_EXCLAMATION = 33; var ASCII_TILDE = 126; var chars = []; for (var i = 0; i < 16; ++i) { chars.push(Math.floor(ASCII_EXCLAMATION + Math.random() * (ASCII_TILDE - ASCII_EXCLAMATION + 1))); } topWin.__gwt_SessionID = String.fromCharCode.apply(null, chars); } var plugin = null; for (var i = 0; i < pluginFinders.length; ++i) { try { var maybePlugin = pluginFinders[i](); if (maybePlugin != null && maybePlugin.init(window)) { plugin = maybePlugin; break; } } catch (e) { } } if (!plugin) { // try searching for a v1 plugin for backwards compatibility var found = false; for (var i = 0; i < pluginFinders.length; ++i) { try { plugin = pluginFinders[i](); if (plugin != null && plugin.connect($hosted, $moduleName, window)) { return; } } catch (e) { } } loadIframe("http://gwt.google.com/missing-plugin"); } else { if (plugin.connect(url, topWin.__gwt_SessionID, $hosted, $moduleName, $hostedHtmlVersion)) { window.onUnload = function() { try { // wrap in try/catch since plugins are not required to supply this plugin.disconnect(); } catch (e) { } }; } else { if (errFn) { errFn(modName); } else { - alert("Plugin failed to connect to hosted mode server at " + $hosted); + alert("Plugin failed to connect to Development Mode server at " + $hosted); loadIframe("http://code.google.com/p/google-web-toolkit/wiki/TroubleshootingOOPHM"); } } } } window.onunload = function() { }; // Lightweight metrics window.fireOnModuleLoadStart = function(className) { $stats && $stats({moduleName:$moduleName, sessionId:$sessionId, subSystem:'startup', evtGroup:'moduleStartup', millis:(new Date()).getTime(), type:'onModuleLoadStart', className:className}); }; window.__gwt_module_id = 0; </script></head> <body> -<font face='arial' size='-1'>This html file is for hosted mode support.</font> +<font face='arial' size='-1'>This html file is for Development Mode support.</font> <script><!-- // Lightweight metrics $stats && $stats({moduleName:$moduleName, sessionId:$sessionId, subSystem:'startup', evtGroup:'moduleStartup', millis:(new Date()).getTime(), type:'moduleEvalEnd'}); // OOPHM currently only supports IFrameLinker var query = parent.location.search; if (!findPluginXPCOM()) { document.write('<embed id="pluginEmbed" type="application/x-gwt-hosted-mode" width="10" height="10">'); document.write('</embed>'); document.write('<object id="pluginObject" CLASSID="CLSID:1D6156B6-002B-49E7-B5CA-C138FB843B4E">'); document.write('</object>'); } // look for the old query parameter if we don't find the new one var idx = query.indexOf("gwt.codesvr="); if (idx >= 0) { idx += 12; // "gwt.codesvr=".length() == 12 } else { idx = query.indexOf("gwt.hosted="); if (idx >= 0) { idx += 11; // "gwt.hosted=".length() == 11 } } if (idx >= 0) { var amp = query.indexOf("&", idx); if (amp >= 0) { $hosted = query.substring(idx, amp); } else { $hosted = query.substring(idx); } // According to RFC 3986, some of this component's characters (e.g., ':') // are reserved and *may* be escaped. $hosted = decodeURIComponent($hosted); } query = window.location.search.substring(1); if (query && $wnd[query]) setTimeout($wnd[query].onScriptLoad, 1); --></script></body></html>
balp/RPLogTool
1f5b4b743d7c65f1e9f299d652c26739f442a5db
Make new style, Firestorm logs be filters, off off oline and online messages.
diff --git a/.settings/com.google.gwt.eclipse.core.prefs b/.settings/com.google.gwt.eclipse.core.prefs index c75eeef..fe0bdc6 100644 --- a/.settings/com.google.gwt.eclipse.core.prefs +++ b/.settings/com.google.gwt.eclipse.core.prefs @@ -1,4 +1,5 @@ -#Thu Sep 16 19:16:29 CEST 2010 +#Tue Aug 09 21:22:58 CEST 2011 eclipse.preferences.version=1 entryPointModules= +filesCopiedToWebInfLib=gwt-servlet.jar gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBW11dPjwvZXh0cmEtYXJncz48dm0tYXJncz48IVtDREFUQVstWG14NTEybV1dPjwvdm0tYXJncz48L2d3dC1jb21waWxlLXNldHRpbmdzPg\=\= diff --git a/src/se/arnholm/rplogtool/server/LogCleaner.java b/src/se/arnholm/rplogtool/server/LogCleaner.java index 759b000..728e3bc 100644 --- a/src/se/arnholm/rplogtool/server/LogCleaner.java +++ b/src/se/arnholm/rplogtool/server/LogCleaner.java @@ -1,242 +1,245 @@ package se.arnholm.rplogtool.server; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Vector; import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.joda.time.Duration; public class LogCleaner { private String text; private String cleanString; private Vector<String> lines; private Map<String,PlayerInfo> players; private static final Pattern LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+(\\w+\\s+\\w+)([\\s+':].+)$"); private static final Pattern LONGNAME_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+([^:]+):\\s*(.+)$"); private static final Pattern CCS_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+CCS - MTR - 1.0.2:\\s+((\\w+\\s+\\w+)([\\s+':].+))$"); private static final Pattern TIME_SECONDS = Pattern.compile("(\\d+):(\\d+):(\\d+)"); private static final Pattern TIME_MINUTES = Pattern.compile("(\\d+):(\\d+)"); public LogCleaner(String text) { lines = new Vector<String>(); this.text = text; players = new HashMap<String,PlayerInfo>(); cleanString = process(); } private String process() { String result = new String(); BufferedReader reader = new BufferedReader( new StringReader(text)); String str; try { while((str = reader.readLine()) != null) { RpLogLine line = splitLine(str); if(null == line) { continue; } final String action = line.getAction(); // if(line.isCCS()) { // System.out.println("In:\"" + str+ "\""); // System.out.println("action:\"" + action+ "\""); // } if(action.equals(" is Online")) { continue; } if(action.equals(" is Offline")) { continue; } if(line.isCCS()) { if(line.getCCSText().startsWith("CCS SYSTEM MESSAGE:")) { continue; } if(line.getCCSText().endsWith("to continue playing")) { continue; } } if(line.getAction().startsWith("((") && line.getAction().endsWith("))")) { continue; } if(line.getAction().startsWith(" declined your inventory offer.")) { continue; } if(line.getAction().startsWith(" accepted your inventory offer.")) { continue; } // System.out.println("..."); String who = line.getName(); if(who.startsWith("(empty)")) { continue; } if(who.startsWith("You have")) { continue; } + if(who.startsWith("Second Life")) { + continue; + } if(who.equals("Draw distance set to")) { continue; } if(who != null) { PlayerInfo freq = players.get(who); if(null == freq) { freq = new PlayerInfo(who); } freq.addLine(str); players.put(who, freq); } // System.out.println("Adding:" + who + ":" + str); lines.add(str); result += str + "\n"; } } catch (IOException e) { e.printStackTrace(); } return result; } public static String getPlayerName(String str) { RpLogLine values = splitLine(str); if(null != values) { return values.getName(); } return null; } public String getClean() { return cleanString; } public Duration getDuration() { long start = getTime(lines.firstElement()); long end = getTime(lines.lastElement()); if(end < start) { end += 24*60*60*1000; } //System.out.println("Duration between: " +start +":"+ lines.firstElement()); //System.out.println(" and: " + end +":"+ lines.lastElement()); return new Duration(start, end); } public static long getTime(String logLine) { RpLogLine values = splitLine(logLine); if(null != values) { String time = values.getTime(); Matcher matchSeconds = TIME_SECONDS.matcher(time); if(matchSeconds.find()) { long hour = Long.parseLong(matchSeconds.group(1)); long minutes = Long.parseLong(matchSeconds.group(2)); long seconds = Long.parseLong(matchSeconds.group(3)); return (((hour * 60 * 60) + (minutes*60) + seconds) * 1000); } Matcher matchMinutes = TIME_MINUTES.matcher(time); if(matchMinutes.find()) { long hour = Long.parseLong(matchMinutes.group(1)); long minutes = Long.parseLong(matchMinutes.group(2)); return (((hour * 60 * 60) + (minutes*60) + 0) * 1000); } } return 0; } public Set<String> getPartisipants() { return players.keySet(); } public List<PlayerInfo> entries() { List<Entry<String,PlayerInfo>> list = new LinkedList<Entry<String,PlayerInfo>>(players.entrySet()); List<PlayerInfo> resultList = new LinkedList<PlayerInfo>(); Collections.sort(list, new Comparator<Entry<String,PlayerInfo>>() { public int compare(Entry<String,PlayerInfo> o1, Entry<String,PlayerInfo> o2) { Comparable<PlayerInfo> comparable = o1.getValue(); return comparable.compareTo(((Map.Entry<String,PlayerInfo>) (o2)).getValue()); } }); return resultList; } public PlayerInfo getPlayerInfo(String name) { return players.get(name); } public static String formatTime(org.joda.time.Duration duration) { return String.format("%d:%02d", duration.toPeriod().getHours(), duration.toPeriod().getMinutes()); } public static String formatTime(long time) { return String.format("%d:%02d", (int)time/60, (int)time%60); } public static RpLogLine splitLine(String line) { { Matcher matcher = CCS_LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(3), matcher.group(4), matcher.group(2)); return res; } } { Matcher matcher = LONGNAME_LINE_SPLIT.matcher(line); if (matcher.find()) { // System.out.println(":" + matcher.group(1) + ":" + matcher.group(2) + ":" + matcher.group(3) + ":"); RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } { Matcher matcher = LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } // System.out.println("Not Matches line:" + line); return null; } public String getStartTime() { RpLogLine values = splitLine(lines.firstElement()); if(null != values) { return values.getTime(); } return ""; } public String getEndTime() { RpLogLine values = splitLine(lines.lastElement()); if(null != values) { return values.getTime(); } return ""; } } diff --git a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java index 14e4ea5..1aa5c39 100644 --- a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java +++ b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java @@ -1,409 +1,450 @@ package se.arnholm.rplogtool.shared; import static org.junit.Assert.*; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.List; import java.util.Set; import java.util.Vector; import org.junit.Test; import se.arnholm.rplogtool.server.LogCleaner; import se.arnholm.rplogtool.server.PlayerInfo; import se.arnholm.rplogtool.server.RpLogLine; import org.joda.time.Duration; public class LogCleanerTest { private String testLog = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:08:55] Ricard Collas is Online\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:07] Ricard Collas is Offline\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:25] Ranith Strazytski is Offline\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:25] Lensi Hax is Offline\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:19] Nadine Nozaki: (( just follow please))\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:03] Ricard Collas is Online\n" + "[03:13:25] Rin Tae is Offline\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:13:58] Wolfbringer Sixpack is Online\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; @Test public void testCleanLog() { String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(testLog); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } - + @Test + public void testNewStyle() + { + String logText = "[2011/08/08 11:51:31] Nadine Nozaki: /me smiles and ndos, waves to the people, \"Greetings.\"\n" + + "[2011/08/08 11:51:54] Second Life: Starphilly Flannery is offline.\n" + + "[2011/08/08 11:52:26] Second Life: ZZR1101 Skall is online.\n" + + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + + "[2011/08/08 11:53:22] bishop Haiku: /me grins at gwaed.... it would be my pleasure\n" + + "[2011/08/08 11:53:38] Nadine Nozaki: /me giggles at ali, \"We are always sane why do you ask ali?\"\n" + + "[2011/08/08 11:54:10] Nadine Nozaki: /me smiels \"a magician, i love to see those cute bunnies:\"\n" + + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + + "[2011/08/08 11:54:27] Cinox: /me looks betweent he both of them, getting curious to what they were planning.\n" + + "[2011/08/08 11:54:47] Second Life: Chalice Yao is offline.\n" + + "[2011/08/08 11:54:52] Second Life: Tour Spoonhammer is online.\n" + + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + + "[2011/08/08 11:55:07] Nadine Nozaki: /me giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + + "[2011/08/08 11:55:10] Second Life: Rondevous Giano is online.\n" + + "[2011/08/08 11:55:40] Nadine Nozaki: (( I see my meter xerx is afk, sure it aint Exoctics you see as mine?\" ))\n" + + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n" + + "[2011/08/08 11:56:07] Second Life: Chalice Yao is online.\n" + + "[2011/08/08 11:56:24] CCS - MTR - 1.0.4: Nadine Nozaki has entered a non-combative state\n" + + "[2011/08/08 11:56:26] CCS - MTR - 1.0.4: Nadine Nozaki has entered a combative state\n" + + "[2011/08/08 11:57:47] CCS - MTR - 1.0.4: Exoticqt4you Resident has entered a combative state\n"; + String expected = "[2011/08/08 11:51:31] Nadine Nozaki: /me smiles and ndos, waves to the people, \"Greetings.\"\n" + + "[2011/08/08 11:52:31] Mr Gwaed (Gwaed): smiles and nods his head \"Lady nadine \" he perks a bit \"I am learning of this mans mystic powers, he is very good, but needs more time to develop\" he turns to Lord Bishop \"Perhaps you Lord could give the young man some encouragement in his mystic studies\"\n" + + "[2011/08/08 11:53:08] aliantha Brezoianu: Goodevening (non com) you two, are you sane or still insane?\"\n" + + "[2011/08/08 11:53:22] bishop Haiku: /me grins at gwaed.... it would be my pleasure\n" + + "[2011/08/08 11:53:38] Nadine Nozaki: /me giggles at ali, \"We are always sane why do you ask ali?\"\n" + + "[2011/08/08 11:54:10] Nadine Nozaki: /me smiels \"a magician, i love to see those cute bunnies:\"\n" + + "[2011/08/08 11:54:14] aliantha Brezoianu: \"Well the other day you were quite insane .. and were marrying for the first time and they eyar was um 1860\"\n" + + "[2011/08/08 11:54:27] Cinox: /me looks betweent he both of them, getting curious to what they were planning.\n" + + "[2011/08/08 11:55:03] aliantha Brezoianu: you both non com)\n" + + "[2011/08/08 11:55:07] Nadine Nozaki: /me giggles \"I can't help that 1860 and my marrige still fels like yeasterday, can I\n" + + "[2011/08/08 11:55:57] Honeygurl Starfall: :/\n" + + "[2011/08/08 11:56:24] CCS - MTR - 1.0.4: Nadine Nozaki has entered a non-combative state\n" + + "[2011/08/08 11:56:26] CCS - MTR - 1.0.4: Nadine Nozaki has entered a combative state\n" + + "[2011/08/08 11:57:47] CCS - MTR - 1.0.4: Exoticqt4you Resident has entered a combative state\n"; + LogCleaner log = new LogCleaner(logText); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } @Test public void testCleanLog2() { String text = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testClean3() { String text = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:33] (empty) Ravenal Ashby(en>>sv): \"BRB))\"\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"+ "[2010-10-02 11:27:46] (empty) charlie75 Arcana(en>>sv): \"/ Me Mutters förmodligen elvies\"\n"; String expected = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean4() { String text = "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"+ "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; String expected = "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean5() { String text = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n" + "[2010-10-02 12:02:45] Taylor Renegade is Offline\n" + "[2010-10-02 12:02:48] Xerxis Rodenberger: (( mine are all outdated))\n" + "[2010-10-02 12:03:00] Varthaer Darkmatter declined your inventory offer.\n"; String expected = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean6AndTime() { String text = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:21] Sev Laval is Offline\n" + "[2010-09-26 13:54:34] Sev Laval is Online\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n" + "[2010-09-26 13:55:28] Abal Azambuja is Offline\n" + "[2010-09-26 13:55:35] charlie75 Arcana accepted your inventory offer.\n"; String expected = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean7() { String text = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ "[2010-10-02 12:07:18] CCS - MTR - 1.0.2: Press 434 to continue playing\n"+ "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; String expected = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testDuration() { LogCleaner log = new LogCleaner(testLog); Duration expected = new Duration(431000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testDuration2() { LogCleaner log = new LogCleaner(log2); Duration expected = new Duration(1828000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } String log3 = "[23:10] Moon Falconer-Lectar (moon.falconer): hey what's happening?\n" + "[23:11] Krager Megadon: levels his gun at the thing that just attacked him.. it had stpped moving.. he didn't know why.. ' I don;t know.. it leaped out of the assylum.. I jsut glanced inside and Nubs is on the ground.... it attacked Me I dunno wtf it is!~'\n" + "[00:16] Krager Megadon: nudges Moon.. ' ok.. we nee to let her be for now.. until we get the needed Naturalistic Healers present.. for now theres nothing we can do.. unless you want to sit here and guard / watch her?..'\n" + "[00:17] Moon Falconer-Lectar (moon.falconer) stares at krager for a second and then grins\"Well, vamps and demons are like cousins so that's not surprising but i like to know why things work, not just say some words\"watches the blood drip and sighs\"Okay no, i'll wait outside, and wait for the creature. maybe if i can catch her alive, we can make her remove the spell\"\n"; @Test public void testDurationOverMidnight() { LogCleaner log = new LogCleaner(log3); Duration expected = new Duration(3960000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); Duration d = log.getPlayerInfo("Krager Megadon").getDuration(); assertEquals(3900000, d.getMillis()); } @Test public void testGetTime() { assertEquals(11220000, LogCleaner.getTime("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"")); assertEquals(83103000, LogCleaner.getTime("[2010-09-15 23:05:03] Xerxis Rodenberger: See you")); assertEquals(81275000, LogCleaner.getTime("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n")); } @Test public void testUserNames() { LogCleaner log = new LogCleaner(log3); Set<String> who = log.getPartisipants(); System.out.println("Test:" + who); assertTrue("Krager Megadon should be in set", who.contains("Krager Megadon")); assertTrue("Moon Falconer-Lectar (moon.falconer) should be in set", who.contains("Moon Falconer-Lectar (moon.falconer)")); } @Test public void testPlayers() { LogCleaner log = new LogCleaner(testLog); Set<String> who = log.getPartisipants(); // System.out.println("Test:" + who); assertTrue("Nadine should be in set", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } @Test public void testPlayerList() { LogCleaner log = new LogCleaner(testLog); List<PlayerInfo> people = log.entries(); Set<String> who = log.getPartisipants(); System.out.println("Test:" + who); assertTrue("Nadine should be in list", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } @Test public void testTimeFormat() { LogCleaner log = new LogCleaner(testLog); assertEquals("0:06", LogCleaner.formatTime(log.getPlayerInfo("Nadine Nozaki").getDuration())); } @Test public void testGetPLayerName() { assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:01] Nadine Nozaki's smile leaves her fance.\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n")); } @Test public void testLineSplit() { helpTestLineSplit("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"", "03:07", "Nadine Nozaki", " ndos, \"Aint we all but Xerx human?\""); helpTestLineSplit("[2010-09-15 23:05:03] Xerxis Rodenberger: See you", "2010-09-15 23:05:03", "Xerxis Rodenberger", "See you"); helpTestLineSplit("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state", "2010-09-15 22:34:35", "Nadine Nozaki"," has entered a combative state"); helpTestLineSplit("[2010-10-02 11:27:25] (empty) Bunny Yakubu(en>>sv): \"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\"\n", "2010-10-02 11:27:25", "(empty) Bunny Yakubu(en>>sv)", "\"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\""); helpTestLineSplit("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", "2010-10-02 1:41:05", "CCS SYSTEM", " MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you."); helpTestLineSplit("[2010-10-02 11:41:37] Draw distance set to: 0m\n", "2010-10-02 11:41:37", "Draw distance set to", "0m"); helpTestLineSplit("[2010-10-02 12:06:59] Varthaer Darkmatter shouts: I CONFESS OF NOTHING.\n", "2010-10-02 12:06:59", "Varthaer Darkmatter", "I CONFESS OF NOTHING."); } @Test public void testCCSLine() { RpLogLine s1 = LogCleaner.splitLine("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"); assertNotNull("Unable to split: " + "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", s1); assertEquals("2010-10-02 1:41:05", s1.getTime()); assertEquals("CCS SYSTEM", s1.getName()); assertEquals(" MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getAction()); assertTrue(s1.isCCS()); assertEquals("CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getCCSText()); } private String readFile(String file) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = null; StringBuilder stringBuilder = new StringBuilder(); String ls = System.getProperty("line.separator"); while ((line = reader.readLine()) != null) { stringBuilder.append(line); stringBuilder.append(ls); } return stringBuilder.toString(); } @Test public void testMalkMeeting() { try { String curDir = System.getProperty("user.dir"); String logText = readFile("malk-meeting.txt"); LogCleaner log = new LogCleaner(logText); Duration expected = new Duration(2452000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } catch (IOException e) { e.printStackTrace(); } } private void helpTestLineSplit(String line, String time, String name, String pose) { RpLogLine s1 = LogCleaner.splitLine(line); assertNotNull("Unable to split: " + line, s1); assertEquals(time, s1.getTime()); assertEquals(name, s1.getName()); assertEquals(pose, s1.getAction()); } String log2 = "[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:34:40] CCS - MTR - 1.0.2: Nadine Nozaki has entered a non-combative state\n" + "[2010-09-15 22:34:57] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:35:15] Selene Weatherwax is Offline\n" + "[2010-09-15 22:35:24] Jo Soosung is Offline\n" + "[2010-09-15 22:36:05] Rondevous Giano is Offline\n" + "[2010-09-15 22:37:21] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:39:31] Kommandant Epin is Offline\n" + "[2010-09-15 22:39:33] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:39:41] Nadine Nozaki steals a wet kiss\n" + "[2010-09-15 22:39:52] Erosid Dryke is Online\n" + "[2010-09-15 22:40:13] Selene Weatherwax is Online\n" + "[2010-09-15 22:42:17] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:45:30] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:47:20] MoonGypsy Writer is Offline\n" + "[2010-09-15 22:48:50] Skye Hanfoi is Offline\n" + "[2010-09-15 22:49:15] KittyDarling Zelnik is Offline\n" + "[2010-09-15 22:49:24] Traven Sachs is Offline\n" + "[2010-09-15 22:49:49] McCabe Maxsted is Offline\n" + "[2010-09-15 22:50:08] Valmont1985 Radek is Offline\n" + "[2010-09-15 22:50:26] Xerxis Rodenberger kisses back passionately\n" + "[2010-09-15 22:50:34] Skye Hanfoi is Online\n" + "[2010-09-15 22:50:40] Voodoo Halostar is Offline\n" + "[2010-09-15 22:51:10] Voodoo Halostar is Online\n" + "[2010-09-15 22:53:57] Imogen Aeon is Offline\n" + "[2010-09-15 22:54:29] Pethonia Baxton is Offline\n" + "[2010-09-15 22:57:26] Nadine Nozaki: OMG OMG\n" + "[2010-09-15 22:57:33] Nadine Nozaki: Drama?\n" + "[2010-09-15 22:57:33] Nadine Nozaki: OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG!\n" + "[2010-09-15 22:57:56] Xerxis Rodenberger: Whats wrong?\n" + "[2010-09-15 22:58:01] Nadine Nozaki: RUN TIME\n" + "[2010-09-15 22:58:05] Xerxis Rodenberger: *cries*\n" + "[2010-09-15 22:58:06] Nadine Nozaki: Serius wrong imho\n" + "[2010-09-15 22:58:28] Sparklin Indigo is Online\n" + "[2010-09-15 22:58:44] Xerxis Rodenberger: mmhmm\n" + "[2010-09-15 22:59:02] Wezab Ember is Online\n" + "[2010-09-15 23:00:08] Alix Lectar is Offline\n" + "[2010-09-15 23:01:08] Nadine Nozaki: Love you my girl,\n" + "[2010-09-15 23:01:24] Xerxis Rodenberger: Love you Mistress. Have a great day\n" + "[2010-09-15 23:01:41] Nadine Nozaki: u 2 :D\n" + "[2010-09-15 23:02:06] Xerxis Rodenberger kisses and snuggles\n" + "[2010-09-15 23:02:17] Gaea Singh is Offline\n" + "[2010-09-15 23:03:22] Gino Byron is Online\n" + "[2010-09-15 23:04:47] Nadine Nozaki: See you tonight love\n" + "[2010-09-15 23:04:53] Nadine Nozaki: I hgave to get going...\n" + "[2010-09-15 23:05:03] Xerxis Rodenberger: See you\n"; } diff --git a/war/WEB-INF/appengine-web.xml b/war/WEB-INF/appengine-web.xml index 7bd8dfb..7f78e39 100644 --- a/war/WEB-INF/appengine-web.xml +++ b/war/WEB-INF/appengine-web.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>rplogtool</application> - <version>8</version> + <version>9</version> <!-- Configure serving/caching of GWT files --> <static-files> <include path="**" /> <!-- The following line requires App Engine 1.3.2 SDK --> <include path="**.nocache.*" expiration="0s" /> <include path="**.cache.*" expiration="365d" /> <exclude path="**.gwt.rpc" /> </static-files> <!-- Configure java.util.logging --> <system-properties> <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> </system-properties> </appengine-web-app> \ No newline at end of file diff --git a/war/WEB-INF/lib/gwt-servlet.jar b/war/WEB-INF/lib/gwt-servlet.jar index 7403d78..c3b158c 100644 Binary files a/war/WEB-INF/lib/gwt-servlet.jar and b/war/WEB-INF/lib/gwt-servlet.jar differ diff --git a/war/rplogtool/rplogtool.nocache.js b/war/rplogtool/rplogtool.nocache.js index ad674ee..f49190e 100644 --- a/war/rplogtool/rplogtool.nocache.js +++ b/war/rplogtool/rplogtool.nocache.js @@ -1,11 +1,11 @@ -function rplogtool(){var M='',nb='" for "gwt:onLoadErrorFn"',lb='" for "gwt:onPropertyErrorFn"',Y='"><\/script>',$='#',Lb='.cache.html',ab='/',Fb='007B920D70D2082D538BA369D6E2C6DD',Gb='08891D15946D28351CE0A353872CFD20',Hb='1D24F678FFAF623D3B759532A25B0E4F',Ib='252E16F732DBD6F54DE14068B2EC321C',Jb='5F9510934EAC08124AF8CEA42E732417',Tb='<script defer="defer">rplogtool.onInjectionDone(\'rplogtool\')<\/script>',X='<script id="',ib='=',_='?',kb='Bad handler "',Kb='CADC8A2C3B31E5DA91AC033F661B5455',Sb='DOMContentLoaded',Z='SCRIPT',W='__gwt_marker_rplogtool',bb='base',Q='begin',P='bootstrap',db='clear.cache.gif',hb='content',V='end',zb='gecko',Ab='gecko1_8',R='gwt.codesvr=',S='gwt.hosted=',T='gwt.hybrid',Mb='gwt/standard/standard.css',mb='gwt:onLoadErrorFn',jb='gwt:onPropertyErrorFn',gb='gwt:property',Rb='head',Db='hosted.html?rplogtool',Qb='href',yb='ie6',xb='ie8',ob='iframe',cb='img',pb="javascript:''",Nb='link',Cb='loadExternalRefs',eb='meta',rb='moduleRequested',U='moduleStartup',wb='msie',fb='name',tb='opera',qb='position:absolute;width:0;height:0;border:none',Ob='rel',N='rplogtool',vb='safari',Eb='selectingPermutation',O='startup',Pb='stylesheet',Bb='unknown',sb='user.agent',ub='webkit';var k=window,l=document,m=k.__gwtStatsEvent?function(a){return k.__gwtStatsEvent(a)}:null,n=k.__gwtStatsSessionId?k.__gwtStatsSessionId:null,o,p,q,r=M,s={},t=[],u=[],v=[],w,x;m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:Q});if(!k.__gwt_stylesLoaded){k.__gwt_stylesLoaded={}}if(!k.__gwt_scriptsLoaded){k.__gwt_scriptsLoaded={}}function y(){var b=false;try{var c=k.location.search;return (c.indexOf(R)!=-1||(c.indexOf(S)!=-1||k.external&&k.external.gwtOnLoad))&&c.indexOf(T)==-1}catch(a){}y=function(){return b};return b} +function rplogtool(){var M='',nb='" for "gwt:onLoadErrorFn"',lb='" for "gwt:onPropertyErrorFn"',Y='"><\/script>',$='#',Lb='.cache.html',ab='/',Fb='150727C1518006C711207CB16024831E',Gb='591BE35F52ADF744E4431C9905018642',Hb='7F8A61C4F38EC46A02EB87B190B0BFD5',Ib='9195D0A7C03F74E35D6923F6E852B248',Jb='94B002215A686E5582B8CCBA9A875D90',Tb='<script defer="defer">rplogtool.onInjectionDone(\'rplogtool\')<\/script>',X='<script id="',ib='=',_='?',kb='Bad handler "',Sb='DOMContentLoaded',Kb='EF4CE234B40340C05A009EC94CFB5A75',Z='SCRIPT',W='__gwt_marker_rplogtool',bb='base',Q='begin',P='bootstrap',db='clear.cache.gif',hb='content',V='end',zb='gecko',Ab='gecko1_8',R='gwt.codesvr=',S='gwt.hosted=',T='gwt.hybrid',Mb='gwt/standard/standard.css',mb='gwt:onLoadErrorFn',jb='gwt:onPropertyErrorFn',gb='gwt:property',Rb='head',Db='hosted.html?rplogtool',Qb='href',yb='ie6',xb='ie8',ob='iframe',cb='img',pb="javascript:''",Nb='link',Cb='loadExternalRefs',eb='meta',rb='moduleRequested',U='moduleStartup',wb='msie',fb='name',tb='opera',qb='position:absolute;width:0;height:0;border:none',Ob='rel',N='rplogtool',vb='safari',Eb='selectingPermutation',O='startup',Pb='stylesheet',Bb='unknown',sb='user.agent',ub='webkit';var k=window,l=document,m=k.__gwtStatsEvent?function(a){return k.__gwtStatsEvent(a)}:null,n=k.__gwtStatsSessionId?k.__gwtStatsSessionId:null,o,p,q,r=M,s={},t=[],u=[],v=[],w,x;m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:Q});if(!k.__gwt_stylesLoaded){k.__gwt_stylesLoaded={}}if(!k.__gwt_scriptsLoaded){k.__gwt_scriptsLoaded={}}function y(){var b=false;try{var c=k.location.search;return (c.indexOf(R)!=-1||(c.indexOf(S)!=-1||k.external&&k.external.gwtOnLoad))&&c.indexOf(T)==-1}catch(a){}y=function(){return b};return b} function z(){if(o&&p){var b=l.getElementById(N);var c=b.contentWindow;if(y()){c.__gwt_getProperty=function(a){return F(a)}}rplogtool=null;c.gwtOnLoad(w,N,r);m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:U,millis:(new Date).getTime(),type:V})}} function A(){var e,f=W,g;l.write(X+f+Y);g=l.getElementById(f);e=g&&g.previousSibling;while(e&&e.tagName!=Z){e=e.previousSibling}function h(a){var b=a.lastIndexOf($);if(b==-1){b=a.length}var c=a.indexOf(_);if(c==-1){c=a.length}var d=a.lastIndexOf(ab,Math.min(c,b));return d>=0?a.substring(0,d+1):M} ;if(e&&e.src){r=h(e.src)}if(r==M){var i=l.getElementsByTagName(bb);if(i.length>0){r=i[i.length-1].href}else{r=h(l.location.href)}}else if(r.match(/^\w+:\/\//)){}else{var j=l.createElement(cb);j.src=r+db;r=h(j.src)}if(g){g.parentNode.removeChild(g)}} function B(){var b=document.getElementsByTagName(eb);for(var c=0,d=b.length;c<d;++c){var e=b[c],f=e.getAttribute(fb),g;if(f){if(f==gb){g=e.getAttribute(hb);if(g){var h,i=g.indexOf(ib);if(i>=0){f=g.substring(0,i);h=g.substring(i+1)}else{f=g;h=M}s[f]=h}}else if(f==jb){g=e.getAttribute(hb);if(g){try{x=eval(g)}catch(a){alert(kb+g+lb)}}}else if(f==mb){g=e.getAttribute(hb);if(g){try{w=eval(g)}catch(a){alert(kb+g+nb)}}}}}} function E(a,b){var c=v;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b} function F(a){var b=u[a](),c=t[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(x){x(a,d,b)}throw null} var G;function H(){if(!G){G=true;var a=l.createElement(ob);a.src=pb;a.id=N;a.style.cssText=qb;a.tabIndex=-1;l.body.appendChild(a);m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:U,millis:(new Date).getTime(),type:rb});a.contentWindow.location.replace(r+J)}} -u[sb]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(b.indexOf(tb)!=-1){return tb}else if(b.indexOf(ub)!=-1){return vb}else if(b.indexOf(wb)!=-1){if(document.documentMode>=8){return xb}else{var d=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(d&&d.length==3){var e=c(d);if(e>=6000){return yb}}}}else if(b.indexOf(zb)!=-1){var d=/rv:([0-9]+)\.([0-9]+)/.exec(b);if(d&&d.length==3){if(c(d)>=1008)return Ab}return zb}return Bb};t[sb]={gecko:0,gecko1_8:1,ie6:2,ie8:3,opera:4,safari:5};rplogtool.onScriptLoad=function(){if(G){p=true;z()}};rplogtool.onInjectionDone=function(){o=true;m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:Cb,millis:(new Date).getTime(),type:V});z()};A();var I;var J;if(y()){if(k.external&&(k.external.initModule&&k.external.initModule(N))){k.location.reload();return}J=Db;I=M}B();m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:Eb});if(!y()){try{E([vb],Fb);E([tb],Gb);E([xb],Hb);E([Ab],Ib);E([yb],Jb);E([zb],Kb);I=v[F(sb)];J=I+Lb}catch(a){return}}var K;function L(){if(!q){q=true;if(!__gwt_stylesLoaded[Mb]){var a=l.createElement(Nb);__gwt_stylesLoaded[Mb]=a;a.setAttribute(Ob,Pb);a.setAttribute(Qb,r+Mb);l.getElementsByTagName(Rb)[0].appendChild(a)}z();if(l.removeEventListener){l.removeEventListener(Sb,L,false)}if(K){clearInterval(K)}}} +u[sb]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(b.indexOf(tb)!=-1){return tb}else if(b.indexOf(ub)!=-1){return vb}else if(b.indexOf(wb)!=-1){if(document.documentMode>=8){return xb}else{var d=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(d&&d.length==3){var e=c(d);if(e>=6000){return yb}}}}else if(b.indexOf(zb)!=-1){var d=/rv:([0-9]+)\.([0-9]+)/.exec(b);if(d&&d.length==3){if(c(d)>=1008)return Ab}return zb}return Bb};t[sb]={gecko:0,gecko1_8:1,ie6:2,ie8:3,opera:4,safari:5};rplogtool.onScriptLoad=function(){if(G){p=true;z()}};rplogtool.onInjectionDone=function(){o=true;m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:Cb,millis:(new Date).getTime(),type:V});z()};A();var I;var J;if(y()){if(k.external&&(k.external.initModule&&k.external.initModule(N))){k.location.reload();return}J=Db;I=M}B();m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:Eb});if(!y()){try{E([zb],Fb);E([Ab],Gb);E([tb],Hb);E([xb],Ib);E([yb],Jb);E([vb],Kb);I=v[F(sb)];J=I+Lb}catch(a){return}}var K;function L(){if(!q){q=true;if(!__gwt_stylesLoaded[Mb]){var a=l.createElement(Nb);__gwt_stylesLoaded[Mb]=a;a.setAttribute(Ob,Pb);a.setAttribute(Qb,r+Mb);l.getElementsByTagName(Rb)[0].appendChild(a)}z();if(l.removeEventListener){l.removeEventListener(Sb,L,false)}if(K){clearInterval(K)}}} if(l.addEventListener){l.addEventListener(Sb,function(){H();L()},false)}var K=setInterval(function(){if(/loaded|complete/.test(l.readyState)){H();L()}},50);m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:P,millis:(new Date).getTime(),type:V});m&&m({moduleName:N,sessionId:n,subSystem:O,evtGroup:Cb,millis:(new Date).getTime(),type:Q});l.write(Tb)} rplogtool(); \ No newline at end of file
balp/RPLogTool
fdd965d8f368f5123e7f6947d7d0405fb29a6b2b
Added a CR Template style.
diff --git a/src/se/arnholm/rplogtool/client/GreetingService.java b/src/se/arnholm/rplogtool/client/GreetingService.java index 120d3d6..04e3087 100644 --- a/src/se/arnholm/rplogtool/client/GreetingService.java +++ b/src/se/arnholm/rplogtool/client/GreetingService.java @@ -1,12 +1,12 @@ package se.arnholm.rplogtool.client; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; /** * The client side stub for the RPC service. */ @RemoteServiceRelativePath("greet") public interface GreetingService extends RemoteService { - String greetServer(String name) throws IllegalArgumentException; + String greetServer(String input, String template) throws IllegalArgumentException; } diff --git a/src/se/arnholm/rplogtool/client/GreetingServiceAsync.java b/src/se/arnholm/rplogtool/client/GreetingServiceAsync.java index c747383..bb41269 100644 --- a/src/se/arnholm/rplogtool/client/GreetingServiceAsync.java +++ b/src/se/arnholm/rplogtool/client/GreetingServiceAsync.java @@ -1,11 +1,11 @@ package se.arnholm.rplogtool.client; import com.google.gwt.user.client.rpc.AsyncCallback; /** * The async counterpart of <code>GreetingService</code>. */ public interface GreetingServiceAsync { - void greetServer(String input, AsyncCallback<String> callback) + void greetServer(String input, String template, AsyncCallback<String> callback) throws IllegalArgumentException; } diff --git a/src/se/arnholm/rplogtool/client/RPLogTool.java b/src/se/arnholm/rplogtool/client/RPLogTool.java index 9cf14a1..f077dab 100644 --- a/src/se/arnholm/rplogtool/client/RPLogTool.java +++ b/src/se/arnholm/rplogtool/client/RPLogTool.java @@ -1,180 +1,187 @@ package se.arnholm.rplogtool.client; import se.arnholm.rplogtool.shared.FieldVerifier; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.DialogBox; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.ListBox; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.TextArea; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.VerticalPanel; /** * Entry point classes define <code>onModuleLoad()</code>. */ public class RPLogTool implements EntryPoint { private static final int LINESSMALLWINDOW = 18; private static final int LINESBIGWINDOW = 18; /** * The message displayed to the user when the server cannot be reached or * returns an error. */ private static final String SERVER_ERROR = "An error occurred while " + "attempting to contact the server. Please check your network " + "connection and try again."; /** * Create a remote service proxy to talk to the server-side Greeting service. */ private final GreetingServiceAsync greetingService = GWT .create(GreetingService.class); /** * This is the entry point method. */ public void onModuleLoad() { final Button sendButton = new Button("Send"); final TextArea logArea = new TextArea(); logArea.setText("Second Life Log...."); logArea.setVisibleLines(LINESBIGWINDOW); logArea.setCharacterWidth(80); final TextArea rpLog = new TextArea(); rpLog.setText(""); rpLog.setVisibleLines(LINESSMALLWINDOW); rpLog.setCharacterWidth(80); + final ListBox template = new ListBox(); + template.addItem("Malka Style"); + template.addItem("Crossroads Style"); + template.setVisibleItemCount(1); final Label errorLabel = new Label(); // We can add style names to widgets sendButton.addStyleName("sendButton"); // Add the nameField and sendButton to the RootPanel // Use RootPanel.get() to get the entire body element RootPanel.get("logAreaContainer").add(logArea); RootPanel.get("sendButtonContainer").add(sendButton); - RootPanel.get("rpLogContainer").add(sendButton); - RootPanel.get("errorLabelContainer").add(rpLog); + RootPanel.get("templateContainer").add(template); + RootPanel.get("rpLogContainer").add(rpLog); + RootPanel.get("errorLabelContainer").add(errorLabel); // Focus the cursor on the name field when the app loads logArea.setFocus(true); logArea.selectAll(); // Create the popup dialog box final DialogBox dialogBox = new DialogBox(); dialogBox.setText("Information"); // dialogBox.setWidth("90em"); dialogBox.setAnimationEnabled(true); final Button closeButton = new Button("Close"); // We can set the id of a widget by accessing its Element closeButton.getElement().setId("closeButton"); final Label textToServerLabel = new Label(); final HTML serverResponseLabel = new HTML(); VerticalPanel dialogVPanel = new VerticalPanel(); dialogVPanel.addStyleName("dialogVPanel"); // dialogVPanel.setWidth("80em"); // dialogVPanel.add(new HTML("<b>Sending name to the server:</b>")); // dialogVPanel.add(textToServerLabel); // dialogVPanel.add(new HTML("<br><b>Modfified log:</b>")); dialogVPanel.add(serverResponseLabel); dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT); dialogVPanel.add(closeButton); dialogBox.setWidget(dialogVPanel); // Add a handler to close the DialogBox closeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialogBox.hide(); sendButton.setEnabled(true); sendButton.setFocus(true); } }); class CloseHandler implements ClickHandler { @Override public void onClick(ClickEvent event) { logArea.setVisibleLines(LINESBIGWINDOW); rpLog.setVisibleLines(LINESSMALLWINDOW); } } // Create a handler for the sendButton and nameField class MyHandler implements ClickHandler, KeyUpHandler { /** * Fired when the user clicks on the sendButton. */ public void onClick(ClickEvent event) { sendNameToServer(); } /** * Fired when the user types in the nameField. */ public void onKeyUp(KeyUpEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { sendNameToServer(); } } /** * Send the name from the nameField to the server and wait for a response. */ private void sendNameToServer() { // First, we validate the input. errorLabel.setText(""); String textToServer = logArea.getText(); if (!FieldVerifier.isValidName(textToServer)) { errorLabel.setText("Please enter at least four characters"); return; } - + // Then, we send the input to the server. sendButton.setEnabled(false); textToServerLabel.setText(textToServer); serverResponseLabel.setText(""); + String templateName = template.getValue(template.getSelectedIndex()); greetingService.greetServer(textToServer, - new AsyncCallback<String>() { + templateName , new AsyncCallback<String>() { public void onFailure(Throwable caught) { // Show the RPC error message to the user dialogBox .setText("Remote Procedure Call - Failure"); serverResponseLabel .addStyleName("serverResponseLabelError"); serverResponseLabel.setHTML(SERVER_ERROR); dialogBox.center(); closeButton.setFocus(true); } public void onSuccess(String result) { dialogBox.setText("Roleplay log"); serverResponseLabel .removeStyleName("serverResponseLabelError"); serverResponseLabel.setHTML("Translated OK.<br>"); rpLog.setText(result); rpLog.setVisibleLines(LINESBIGWINDOW); logArea.setVisibleLines(LINESSMALLWINDOW); dialogBox.center(); // dialogBox.setWidth("750px"); closeButton.setFocus(true); CloseHandler closeHandler = new CloseHandler(); closeButton.addClickHandler(closeHandler ); } }); } } // Add a handler to send the name to the server MyHandler handler = new MyHandler(); sendButton.addClickHandler(handler); logArea.addKeyUpHandler(handler); } } diff --git a/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java b/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java index fa5c60b..cc9974a 100644 --- a/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java +++ b/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java @@ -1,71 +1,125 @@ package se.arnholm.rplogtool.server; import java.util.Set; import se.arnholm.rplogtool.client.GreetingService; import com.google.gwt.user.server.rpc.RemoteServiceServlet; /** * The server side implementation of the RPC service. */ @SuppressWarnings("serial") public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService { - public String greetServer(String input) throws IllegalArgumentException { - // Verify that the input is valid. + interface AnswerNote { + public String formatString(String serverInfo, String log, LogCleaner cleaner); + } + class MalkaStyle implements AnswerNote { + public String formatString(String serverInfo, String log, LogCleaner cleaner) { + String result = + "----------------------------------------------------------------\n" + +"Title:\n" + +"Date:\n" + +"Place:\n"; + result += "Start Time:" + cleaner.getStartTime() +"\n"; + result += "End Time:" + cleaner.getEndTime() +"\n"; + result += "Roleplay duration: " + LogCleaner.formatTime(cleaner.getDuration()) +"\n"; + result += "----------------------------------------------------------------\n" + +"Major Players:\n"; + Set<String> players = cleaner.getPartisipants(); + for(String player: players) { + PlayerInfo info = cleaner.getPlayerInfo(player); + result += player + ": " + LogCleaner.formatTime(info.getDuration()) +"\n"; + // result += player + ": " +"<br>\n"; + } + result += "----------------------------------------------------------------\n" + +"Other Players (move players down here that have a smaller role):\n" + +"----------------------------------------------------------------\n"; + result += log; + result += "----------------------------------------------------------------\n"; + result += "RPLogTool ©2010 Balp Allen: " + serverInfo + ".\n"; + result += "http://rplogtool.appspot.com/"; + return result; + } + } + class CrossRoadsStyle implements AnswerNote { + public String formatString(String serverInfo, String log, LogCleaner cleaner) { + String result = + "----------------------------------------------------------------\n" + +"TITLE:\n" + +"<< Roleplay Title Here >> << Date Here >>\n" + +"\n" + +"SUMMARY:\n" + +"<< Type a brief summary of the Roleplay here >>\n" + +"\n" + +"PARTICIPANTS:\n" + +"MAIN:\n" + +"<< List all the primary character players here, e.g. sort out minor players>>\n"; + +// result += "Start Time:" + cleaner.getStartTime() +"\n"; +// result += "End Time:" + cleaner.getEndTime() +"\n"; +// result += "----------------------------------------------------------------\n" +// +"Major Players:\n"; + Set<String> players = cleaner.getPartisipants(); + for(String player: players) { + PlayerInfo info = cleaner.getPlayerInfo(player); + result += player + ": " + LogCleaner.formatTime(info.getDuration()) +"\n"; + // result += player + ": " +"<br>\n"; + } + result += "MINOR:\n" + +"<< List all the minor character players here >>\n" + +"<< Other Players (move players down here that have a smaller role):\n" + +"\n"; + result += "DURATION:\n" + LogCleaner.formatTime(cleaner.getDuration()) +"\n"; + result += "---------- ROLEPLAY LOG (paste the roleplay under this line ----------\n"; + result += log; + result += "----------------------------------------------------------------\n"; + result += "RPLogTool ©2010 Balp Allen: " + serverInfo + ".\n"; + result += "http://rplogtool.appspot.com/"; + return result; + } - + } + + @Override + public String greetServer(String input, String template) + throws IllegalArgumentException { + // Verify that the input is valid. + AnswerNote style; + if(template.equals("Crossroads Style")) { + style = new CrossRoadsStyle(); + } else { + style = new MalkaStyle(); + } String serverInfo = getServletContext().getServerInfo(); String userAgent = getThreadLocalRequest().getHeader("User-Agent"); // Escape data from the client to avoid cross-site script vulnerabilities. String log = escapeHtml(input); userAgent = escapeHtml(userAgent); LogCleaner cleaner = new LogCleaner(log); log = cleaner.getClean(); // log = log.replaceAll("\n", "<br>\n"); - String result = - "----------------------------------------------------------------\n" - +"Title:\n" - +"Date:\n" - +"Place:\n"; - result += "Start Time:" + cleaner.getStartTime() +"\n"; - result += "End Time:" + cleaner.getEndTime() +"\n"; - result += "Roleplay duration: " + LogCleaner.formatTime(cleaner.getDuration()) +"\n"; - result += "----------------------------------------------------------------\n" - +"Major Players:\n"; - Set<String> players = cleaner.getPartisipants(); - for(String player: players) { - PlayerInfo info = cleaner.getPlayerInfo(player); - result += player + ": " + LogCleaner.formatTime(info.getDuration()) +"\n"; -// result += player + ": " +"<br>\n"; - } - result += "----------------------------------------------------------------\n" - +"Other Players (move players down here that have a smaller role):\n" - +"----------------------------------------------------------------\n"; - result += log; - result += "----------------------------------------------------------------\n"; - result += "RPLogTool ©2010 Balp Allen: " + serverInfo + ".\n"; - result += "http://rplogtool.appspot.com/"; + String result = style.formatString(serverInfo, log, cleaner); // log = log.replaceAll("\n", "<br>\n"); return result; } /** * Escape an html string. Escaping data received from the client helps to * prevent cross-site script vulnerabilities. * * @param html the html string to escape * @return the escaped string */ private String escapeHtml(String html) { if (html == null) { return null; } return html.replaceAll("&", "&amp;").replaceAll("<", "&lt;") .replaceAll(">", "&gt;"); } } diff --git a/war/RPLogTool.html b/war/RPLogTool.html index 9d9f280..2b7b917 100644 --- a/war/RPLogTool.html +++ b/war/RPLogTool.html @@ -1,71 +1,72 @@ <!doctype html> <!-- The DOCTYPE declaration above will set the --> <!-- browser's rendering engine into --> <!-- "Standards Mode". Replacing this declaration --> <!-- with a "Quirks Mode" doctype may lead to some --> <!-- differences in layout. --> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!-- --> <!-- Consider inlining CSS to reduce the number of requested files --> <!-- --> <link type="text/css" rel="stylesheet" href="RPLogTool.css"> <!-- --> <!-- Any title is fine --> <!-- --> <title>RPLogCleaner</title> <!-- --> <!-- This script loads your compiled module. --> <!-- If you add any GWT meta tags, they must --> <!-- be added before this line. --> <!-- --> <script type="text/javascript" language="javascript" src="rplogtool/rplogtool.nocache.js"></script> </head> <!-- --> <!-- The body can have arbitrary html, or --> <!-- you can leave the body empty if you want --> <!-- to create a completely dynamic UI. --> <!-- --> <body> <!-- OPTIONAL: include this if you want history support --> <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> <!-- RECOMMENDED if your web app will not function without JavaScript enabled --> <noscript> <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> Your web browser must have JavaScript enabled in order for this application to display correctly. </div> </noscript> <h1>RPLogCleaner</h1> <table align="center"> <tr> <td colspan="2" style="font-weight:bold;">Add the log below:</td> </tr> <tr> - <td id="logAreaContainer"></td> + <td colspan="2" id="logAreaContainer"></td> </tr> <tr> <td id="sendButtonContainer"></td> + <td id="templateContainer"></td> </tr> <tr> - <td id="rpLogContainer"></td> + <td colspan="2" id="rpLogContainer"></td> </tr> <tr> <td colspan="2" style="color:red;" id="errorLabelContainer"></td> </tr> <tr> <td colspan="2">©2010 Anders Arnholm/Balp Allen <a href="http://github.com/balp/RPLogTool/issues">Bug Reports and suggestions.</a></td> </tr> </table> </body> </html> diff --git a/war/WEB-INF/appengine-web.xml b/war/WEB-INF/appengine-web.xml index 754b814..7bd8dfb 100644 --- a/war/WEB-INF/appengine-web.xml +++ b/war/WEB-INF/appengine-web.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>rplogtool</application> - <version>7</version> + <version>8</version> <!-- Configure serving/caching of GWT files --> <static-files> <include path="**" /> <!-- The following line requires App Engine 1.3.2 SDK --> <include path="**.nocache.*" expiration="0s" /> <include path="**.cache.*" expiration="365d" /> <exclude path="**.gwt.rpc" /> </static-files> <!-- Configure java.util.logging --> <system-properties> <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> </system-properties> </appengine-web-app> \ No newline at end of file
balp/RPLogTool
57e3664361c30caded906c581ebf2671ed48b083
Fix some bugs with logs passing midnight and no date in logs
diff --git a/src/se/arnholm/rplogtool/server/LogCleaner.java b/src/se/arnholm/rplogtool/server/LogCleaner.java index 9fddc7a..759b000 100644 --- a/src/se/arnholm/rplogtool/server/LogCleaner.java +++ b/src/se/arnholm/rplogtool/server/LogCleaner.java @@ -1,240 +1,242 @@ package se.arnholm.rplogtool.server; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Vector; import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.joda.time.Duration; public class LogCleaner { private String text; private String cleanString; private Vector<String> lines; private Map<String,PlayerInfo> players; private static final Pattern LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+(\\w+\\s+\\w+)([\\s+':].+)$"); private static final Pattern LONGNAME_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+([^:]+):\\s*(.+)$"); private static final Pattern CCS_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+CCS - MTR - 1.0.2:\\s+((\\w+\\s+\\w+)([\\s+':].+))$"); private static final Pattern TIME_SECONDS = Pattern.compile("(\\d+):(\\d+):(\\d+)"); private static final Pattern TIME_MINUTES = Pattern.compile("(\\d+):(\\d+)"); public LogCleaner(String text) { lines = new Vector<String>(); this.text = text; players = new HashMap<String,PlayerInfo>(); cleanString = process(); } private String process() { String result = new String(); BufferedReader reader = new BufferedReader( new StringReader(text)); String str; try { while((str = reader.readLine()) != null) { RpLogLine line = splitLine(str); if(null == line) { continue; } final String action = line.getAction(); // if(line.isCCS()) { // System.out.println("In:\"" + str+ "\""); // System.out.println("action:\"" + action+ "\""); // } if(action.equals(" is Online")) { continue; } if(action.equals(" is Offline")) { continue; } if(line.isCCS()) { if(line.getCCSText().startsWith("CCS SYSTEM MESSAGE:")) { continue; } if(line.getCCSText().endsWith("to continue playing")) { continue; } } if(line.getAction().startsWith("((") && line.getAction().endsWith("))")) { continue; } if(line.getAction().startsWith(" declined your inventory offer.")) { continue; } if(line.getAction().startsWith(" accepted your inventory offer.")) { continue; } // System.out.println("..."); String who = line.getName(); if(who.startsWith("(empty)")) { continue; } if(who.startsWith("You have")) { continue; } if(who.equals("Draw distance set to")) { continue; } if(who != null) { PlayerInfo freq = players.get(who); if(null == freq) { freq = new PlayerInfo(who); } freq.addLine(str); players.put(who, freq); } // System.out.println("Adding:" + who + ":" + str); lines.add(str); result += str + "\n"; } } catch (IOException e) { e.printStackTrace(); } return result; } public static String getPlayerName(String str) { RpLogLine values = splitLine(str); if(null != values) { return values.getName(); } return null; } public String getClean() { return cleanString; } public Duration getDuration() { long start = getTime(lines.firstElement()); long end = getTime(lines.lastElement()); - -// System.out.println("Duration between: " +start +":"+ lines.firstElement()); -// System.out.println(" and: " + end +":"+ lines.lastElement()); + if(end < start) { + end += 24*60*60*1000; + } + //System.out.println("Duration between: " +start +":"+ lines.firstElement()); + //System.out.println(" and: " + end +":"+ lines.lastElement()); return new Duration(start, end); } public static long getTime(String logLine) { RpLogLine values = splitLine(logLine); if(null != values) { String time = values.getTime(); Matcher matchSeconds = TIME_SECONDS.matcher(time); if(matchSeconds.find()) { long hour = Long.parseLong(matchSeconds.group(1)); long minutes = Long.parseLong(matchSeconds.group(2)); long seconds = Long.parseLong(matchSeconds.group(3)); return (((hour * 60 * 60) + (minutes*60) + seconds) * 1000); } Matcher matchMinutes = TIME_MINUTES.matcher(time); if(matchMinutes.find()) { long hour = Long.parseLong(matchMinutes.group(1)); long minutes = Long.parseLong(matchMinutes.group(2)); return (((hour * 60 * 60) + (minutes*60) + 0) * 1000); } } return 0; } public Set<String> getPartisipants() { return players.keySet(); } public List<PlayerInfo> entries() { List<Entry<String,PlayerInfo>> list = new LinkedList<Entry<String,PlayerInfo>>(players.entrySet()); List<PlayerInfo> resultList = new LinkedList<PlayerInfo>(); Collections.sort(list, new Comparator<Entry<String,PlayerInfo>>() { public int compare(Entry<String,PlayerInfo> o1, Entry<String,PlayerInfo> o2) { Comparable<PlayerInfo> comparable = o1.getValue(); return comparable.compareTo(((Map.Entry<String,PlayerInfo>) (o2)).getValue()); } }); return resultList; } public PlayerInfo getPlayerInfo(String name) { return players.get(name); } public static String formatTime(org.joda.time.Duration duration) { return String.format("%d:%02d", duration.toPeriod().getHours(), duration.toPeriod().getMinutes()); } public static String formatTime(long time) { return String.format("%d:%02d", (int)time/60, (int)time%60); } public static RpLogLine splitLine(String line) { { Matcher matcher = CCS_LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(3), matcher.group(4), matcher.group(2)); return res; } } { Matcher matcher = LONGNAME_LINE_SPLIT.matcher(line); if (matcher.find()) { // System.out.println(":" + matcher.group(1) + ":" + matcher.group(2) + ":" + matcher.group(3) + ":"); RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } { Matcher matcher = LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } // System.out.println("Not Matches line:" + line); return null; } public String getStartTime() { RpLogLine values = splitLine(lines.firstElement()); if(null != values) { return values.getTime(); } return ""; } public String getEndTime() { RpLogLine values = splitLine(lines.lastElement()); if(null != values) { return values.getTime(); } return ""; } } diff --git a/src/se/arnholm/rplogtool/server/PlayerInfo.java b/src/se/arnholm/rplogtool/server/PlayerInfo.java index bf4e210..ce3a8bb 100644 --- a/src/se/arnholm/rplogtool/server/PlayerInfo.java +++ b/src/se/arnholm/rplogtool/server/PlayerInfo.java @@ -1,65 +1,73 @@ package se.arnholm.rplogtool.server; import java.util.LinkedList; import java.util.List; import org.joda.time.Duration; public class PlayerInfo implements Comparable<PlayerInfo> { private List<String> lines; private long first; private long last; private String player; public PlayerInfo(String who) { lines = new LinkedList<String>(); last = Long.MIN_VALUE; - first = Long.MAX_VALUE; + first = Long.MIN_VALUE; player = who; } public void addLine(String line) { lines.add(line); long time = LogCleaner.getTime(line); - if(time < first) { + if(first == Long.MIN_VALUE) { // System.out.println("addLine("+ line +"): first = " + time); first = time; } + if( time < first) { + time += 24*60*60*1000; + } if(time > last) { // System.out.println("addLine("+ line +"): last = " + time); last = time; } } public String getPlayerName() { return player; } public long getFirstTime() { return first; } public long getLastTime() { return last; } public Duration getDuration() { - return new Duration(getFirstTime(), getLastTime()); + long firstTime = getFirstTime(); + long lastTime = getLastTime(); + if(lastTime < firstTime) { + lastTime += 24*60*60*1000; + } + return new Duration(firstTime, lastTime); } public int getNumberOfLines() { return lines.size(); } public List<String> getLines() { return lines; } @Override public int compareTo(PlayerInfo o) { return getDuration().compareTo(o.getDuration()); } } diff --git a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java index 5368f49..14e4ea5 100644 --- a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java +++ b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java @@ -1,387 +1,409 @@ package se.arnholm.rplogtool.shared; import static org.junit.Assert.*; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.List; import java.util.Set; import java.util.Vector; import org.junit.Test; import se.arnholm.rplogtool.server.LogCleaner; import se.arnholm.rplogtool.server.PlayerInfo; import se.arnholm.rplogtool.server.RpLogLine; import org.joda.time.Duration; public class LogCleanerTest { private String testLog = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:08:55] Ricard Collas is Online\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:07] Ricard Collas is Offline\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:25] Ranith Strazytski is Offline\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:25] Lensi Hax is Offline\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:19] Nadine Nozaki: (( just follow please))\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:03] Ricard Collas is Online\n" + "[03:13:25] Rin Tae is Offline\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:13:58] Wolfbringer Sixpack is Online\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; @Test public void testCleanLog() { String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(testLog); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testCleanLog2() { String text = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testClean3() { String text = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:33] (empty) Ravenal Ashby(en>>sv): \"BRB))\"\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"+ "[2010-10-02 11:27:46] (empty) charlie75 Arcana(en>>sv): \"/ Me Mutters förmodligen elvies\"\n"; String expected = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean4() { String text = "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"+ "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; String expected = "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean5() { String text = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n" + "[2010-10-02 12:02:45] Taylor Renegade is Offline\n" + "[2010-10-02 12:02:48] Xerxis Rodenberger: (( mine are all outdated))\n" + "[2010-10-02 12:03:00] Varthaer Darkmatter declined your inventory offer.\n"; String expected = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean6AndTime() { String text = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:21] Sev Laval is Offline\n" + "[2010-09-26 13:54:34] Sev Laval is Online\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n" + "[2010-09-26 13:55:28] Abal Azambuja is Offline\n" + "[2010-09-26 13:55:35] charlie75 Arcana accepted your inventory offer.\n"; String expected = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean7() { String text = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ "[2010-10-02 12:07:18] CCS - MTR - 1.0.2: Press 434 to continue playing\n"+ "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; String expected = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testDuration() { LogCleaner log = new LogCleaner(testLog); Duration expected = new Duration(431000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testDuration2() { LogCleaner log = new LogCleaner(log2); Duration expected = new Duration(1828000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); + } + + String log3 = "[23:10] Moon Falconer-Lectar (moon.falconer): hey what's happening?\n" + + "[23:11] Krager Megadon: levels his gun at the thing that just attacked him.. it had stpped moving.. he didn't know why.. ' I don;t know.. it leaped out of the assylum.. I jsut glanced inside and Nubs is on the ground.... it attacked Me I dunno wtf it is!~'\n" + + "[00:16] Krager Megadon: nudges Moon.. ' ok.. we nee to let her be for now.. until we get the needed Naturalistic Healers present.. for now theres nothing we can do.. unless you want to sit here and guard / watch her?..'\n" + + "[00:17] Moon Falconer-Lectar (moon.falconer) stares at krager for a second and then grins\"Well, vamps and demons are like cousins so that's not surprising but i like to know why things work, not just say some words\"watches the blood drip and sighs\"Okay no, i'll wait outside, and wait for the creature. maybe if i can catch her alive, we can make her remove the spell\"\n"; + + @Test + public void testDurationOverMidnight() { + LogCleaner log = new LogCleaner(log3); + Duration expected = new Duration(3960000); + assertEquals(expected.getMillis(), log.getDuration().getMillis()); + Duration d = log.getPlayerInfo("Krager Megadon").getDuration(); + assertEquals(3900000, d.getMillis()); } + @Test public void testGetTime() { assertEquals(11220000, LogCleaner.getTime("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"")); assertEquals(83103000, LogCleaner.getTime("[2010-09-15 23:05:03] Xerxis Rodenberger: See you")); assertEquals(81275000, LogCleaner.getTime("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n")); } - + @Test + public void testUserNames() { + LogCleaner log = new LogCleaner(log3); + Set<String> who = log.getPartisipants(); + System.out.println("Test:" + who); + assertTrue("Krager Megadon should be in set", who.contains("Krager Megadon")); + assertTrue("Moon Falconer-Lectar (moon.falconer) should be in set", who.contains("Moon Falconer-Lectar (moon.falconer)")); + } @Test public void testPlayers() { LogCleaner log = new LogCleaner(testLog); Set<String> who = log.getPartisipants(); // System.out.println("Test:" + who); assertTrue("Nadine should be in set", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } @Test public void testPlayerList() { LogCleaner log = new LogCleaner(testLog); List<PlayerInfo> people = log.entries(); Set<String> who = log.getPartisipants(); -// System.out.println("Test:" + who); - assertTrue("Nadine should be in list", people.contains("Nadine Nozaki")); + System.out.println("Test:" + who); + assertTrue("Nadine should be in list", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } @Test public void testTimeFormat() { LogCleaner log = new LogCleaner(testLog); assertEquals("0:06", LogCleaner.formatTime(log.getPlayerInfo("Nadine Nozaki").getDuration())); } @Test public void testGetPLayerName() { assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:01] Nadine Nozaki's smile leaves her fance.\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n")); } @Test public void testLineSplit() { helpTestLineSplit("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"", "03:07", "Nadine Nozaki", " ndos, \"Aint we all but Xerx human?\""); helpTestLineSplit("[2010-09-15 23:05:03] Xerxis Rodenberger: See you", "2010-09-15 23:05:03", "Xerxis Rodenberger", "See you"); helpTestLineSplit("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state", "2010-09-15 22:34:35", "Nadine Nozaki"," has entered a combative state"); helpTestLineSplit("[2010-10-02 11:27:25] (empty) Bunny Yakubu(en>>sv): \"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\"\n", "2010-10-02 11:27:25", "(empty) Bunny Yakubu(en>>sv)", "\"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\""); helpTestLineSplit("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", "2010-10-02 1:41:05", "CCS SYSTEM", " MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you."); helpTestLineSplit("[2010-10-02 11:41:37] Draw distance set to: 0m\n", "2010-10-02 11:41:37", "Draw distance set to", "0m"); helpTestLineSplit("[2010-10-02 12:06:59] Varthaer Darkmatter shouts: I CONFESS OF NOTHING.\n", "2010-10-02 12:06:59", "Varthaer Darkmatter", "I CONFESS OF NOTHING."); } @Test public void testCCSLine() { RpLogLine s1 = LogCleaner.splitLine("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"); assertNotNull("Unable to split: " + "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", s1); assertEquals("2010-10-02 1:41:05", s1.getTime()); assertEquals("CCS SYSTEM", s1.getName()); assertEquals(" MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getAction()); assertTrue(s1.isCCS()); assertEquals("CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getCCSText()); } private String readFile(String file) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(file)); String line = null; StringBuilder stringBuilder = new StringBuilder(); String ls = System.getProperty("line.separator"); while ((line = reader.readLine()) != null) { stringBuilder.append(line); stringBuilder.append(ls); } return stringBuilder.toString(); } @Test public void testMalkMeeting() { try { String curDir = System.getProperty("user.dir"); String logText = readFile("malk-meeting.txt"); LogCleaner log = new LogCleaner(logText); Duration expected = new Duration(2452000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } catch (IOException e) { e.printStackTrace(); } } private void helpTestLineSplit(String line, String time, String name, String pose) { RpLogLine s1 = LogCleaner.splitLine(line); assertNotNull("Unable to split: " + line, s1); assertEquals(time, s1.getTime()); assertEquals(name, s1.getName()); assertEquals(pose, s1.getAction()); } String log2 = "[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:34:40] CCS - MTR - 1.0.2: Nadine Nozaki has entered a non-combative state\n" + "[2010-09-15 22:34:57] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:35:15] Selene Weatherwax is Offline\n" + "[2010-09-15 22:35:24] Jo Soosung is Offline\n" + "[2010-09-15 22:36:05] Rondevous Giano is Offline\n" + "[2010-09-15 22:37:21] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:39:31] Kommandant Epin is Offline\n" + "[2010-09-15 22:39:33] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:39:41] Nadine Nozaki steals a wet kiss\n" + "[2010-09-15 22:39:52] Erosid Dryke is Online\n" + "[2010-09-15 22:40:13] Selene Weatherwax is Online\n" + "[2010-09-15 22:42:17] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:45:30] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:47:20] MoonGypsy Writer is Offline\n" + "[2010-09-15 22:48:50] Skye Hanfoi is Offline\n" + "[2010-09-15 22:49:15] KittyDarling Zelnik is Offline\n" + "[2010-09-15 22:49:24] Traven Sachs is Offline\n" + "[2010-09-15 22:49:49] McCabe Maxsted is Offline\n" + "[2010-09-15 22:50:08] Valmont1985 Radek is Offline\n" + "[2010-09-15 22:50:26] Xerxis Rodenberger kisses back passionately\n" + "[2010-09-15 22:50:34] Skye Hanfoi is Online\n" + "[2010-09-15 22:50:40] Voodoo Halostar is Offline\n" + "[2010-09-15 22:51:10] Voodoo Halostar is Online\n" + "[2010-09-15 22:53:57] Imogen Aeon is Offline\n" + "[2010-09-15 22:54:29] Pethonia Baxton is Offline\n" + "[2010-09-15 22:57:26] Nadine Nozaki: OMG OMG\n" + "[2010-09-15 22:57:33] Nadine Nozaki: Drama?\n" + "[2010-09-15 22:57:33] Nadine Nozaki: OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG!\n" + "[2010-09-15 22:57:56] Xerxis Rodenberger: Whats wrong?\n" + "[2010-09-15 22:58:01] Nadine Nozaki: RUN TIME\n" + "[2010-09-15 22:58:05] Xerxis Rodenberger: *cries*\n" + "[2010-09-15 22:58:06] Nadine Nozaki: Serius wrong imho\n" + "[2010-09-15 22:58:28] Sparklin Indigo is Online\n" + "[2010-09-15 22:58:44] Xerxis Rodenberger: mmhmm\n" + "[2010-09-15 22:59:02] Wezab Ember is Online\n" + "[2010-09-15 23:00:08] Alix Lectar is Offline\n" + "[2010-09-15 23:01:08] Nadine Nozaki: Love you my girl,\n" + "[2010-09-15 23:01:24] Xerxis Rodenberger: Love you Mistress. Have a great day\n" + "[2010-09-15 23:01:41] Nadine Nozaki: u 2 :D\n" + "[2010-09-15 23:02:06] Xerxis Rodenberger kisses and snuggles\n" + "[2010-09-15 23:02:17] Gaea Singh is Offline\n" + "[2010-09-15 23:03:22] Gino Byron is Online\n" + "[2010-09-15 23:04:47] Nadine Nozaki: See you tonight love\n" + "[2010-09-15 23:04:53] Nadine Nozaki: I hgave to get going...\n" + "[2010-09-15 23:05:03] Xerxis Rodenberger: See you\n"; }
balp/RPLogTool
15436ff25348f68d91a0eed51f832015df253ada
added a .gitignore for autogenerated google code stuff
diff --git a/war/.gitignore b/war/.gitignore new file mode 100644 index 0000000..7ae9b01 --- /dev/null +++ b/war/.gitignore @@ -0,0 +1 @@ +/rplogtool
balp/RPLogTool
28bdeccf022a8295fdefd7751c70a0344aaae3e2
Fix a bug, with nullpointer for unpased log lines
diff --git a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java index 506789c..a1c7a53 100644 --- a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java +++ b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java @@ -1,338 +1,368 @@ package se.arnholm.rplogtool.shared; import static org.junit.Assert.*; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; import java.util.Set; import java.util.Vector; import org.junit.Test; import se.arnholm.rplogtool.server.LogCleaner; import se.arnholm.rplogtool.server.RpLogLine; import org.joda.time.Duration; public class LogCleanerTest { private String testLog = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:08:55] Ricard Collas is Online\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:07] Ricard Collas is Offline\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:25] Ranith Strazytski is Offline\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:25] Lensi Hax is Offline\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:19] Nadine Nozaki: (( just follow please))\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:03] Ricard Collas is Online\n" + "[03:13:25] Rin Tae is Offline\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:13:58] Wolfbringer Sixpack is Online\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; @Test public void testCleanLog() { String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(testLog); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testCleanLog2() { String text = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testClean3() { String text = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:33] (empty) Ravenal Ashby(en>>sv): \"BRB))\"\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"+ "[2010-10-02 11:27:46] (empty) charlie75 Arcana(en>>sv): \"/ Me Mutters förmodligen elvies\"\n"; String expected = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean4() { String text = "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"+ "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; String expected = "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean5() { String text = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n" + "[2010-10-02 12:02:45] Taylor Renegade is Offline\n" + "[2010-10-02 12:02:48] Xerxis Rodenberger: (( mine are all outdated))\n" + "[2010-10-02 12:03:00] Varthaer Darkmatter declined your inventory offer.\n"; String expected = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean6AndTime() { String text = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:21] Sev Laval is Offline\n" + "[2010-09-26 13:54:34] Sev Laval is Online\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n" + "[2010-09-26 13:55:28] Abal Azambuja is Offline\n" + "[2010-09-26 13:55:35] charlie75 Arcana accepted your inventory offer.\n"; String expected = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean7() { String text = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ "[2010-10-02 12:07:18] CCS - MTR - 1.0.2: Press 434 to continue playing\n"+ "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; String expected = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testDuration() { LogCleaner log = new LogCleaner(testLog); Duration expected = new Duration(431000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testDuration2() { LogCleaner log = new LogCleaner(log2); Duration expected = new Duration(1828000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testGetTime() { assertEquals(11220000, LogCleaner.getTime("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"")); assertEquals(83103000, LogCleaner.getTime("[2010-09-15 23:05:03] Xerxis Rodenberger: See you")); assertEquals(81275000, LogCleaner.getTime("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n")); } @Test public void testPlayers() { LogCleaner log = new LogCleaner(testLog); Set<String> who = log.getPartisipants(); // System.out.println("Test:" + who); assertTrue("Nadine should be in set", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } @Test public void testTimeFormat() { LogCleaner log = new LogCleaner(testLog); assertEquals("0:06", LogCleaner.formatTime(log.getPlayerInfo("Nadine Nozaki").getDuration())); } @Test public void testGetPLayerName() { assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:01] Nadine Nozaki's smile leaves her fance.\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n")); } @Test public void testLineSplit() { helpTestLineSplit("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"", "03:07", "Nadine Nozaki", " ndos, \"Aint we all but Xerx human?\""); helpTestLineSplit("[2010-09-15 23:05:03] Xerxis Rodenberger: See you", "2010-09-15 23:05:03", "Xerxis Rodenberger", "See you"); helpTestLineSplit("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state", "2010-09-15 22:34:35", "Nadine Nozaki"," has entered a combative state"); helpTestLineSplit("[2010-10-02 11:27:25] (empty) Bunny Yakubu(en>>sv): \"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\"\n", "2010-10-02 11:27:25", "(empty) Bunny Yakubu(en>>sv)", "\"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\""); helpTestLineSplit("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", "2010-10-02 1:41:05", "CCS SYSTEM", " MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you."); helpTestLineSplit("[2010-10-02 11:41:37] Draw distance set to: 0m\n", "2010-10-02 11:41:37", "Draw distance set to", "0m"); helpTestLineSplit("[2010-10-02 12:06:59] Varthaer Darkmatter shouts: I CONFESS OF NOTHING.\n", "2010-10-02 12:06:59", "Varthaer Darkmatter", "I CONFESS OF NOTHING."); } @Test public void testCCSLine() { RpLogLine s1 = LogCleaner.splitLine("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"); assertNotNull("Unable to split: " + "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", s1); assertEquals("2010-10-02 1:41:05", s1.getTime()); assertEquals("CCS SYSTEM", s1.getName()); assertEquals(" MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getAction()); assertTrue(s1.isCCS()); assertEquals("CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getCCSText()); } + private String readFile(String file) throws IOException { + BufferedReader reader = new BufferedReader(new FileReader(file)); + String line = null; + StringBuilder stringBuilder = new StringBuilder(); + String ls = System.getProperty("line.separator"); + while ((line = reader.readLine()) != null) { + stringBuilder.append(line); + stringBuilder.append(ls); + } + return stringBuilder.toString(); + } + + + @Test + public void testMalkMeeting() { + try { + String curDir = System.getProperty("user.dir"); + String logText = readFile("malk-meeting.txt"); + LogCleaner log = new LogCleaner(logText); + Duration expected = new Duration(2452000); + assertEquals(expected.getMillis(), log.getDuration().getMillis()); + } catch (IOException e) { + e.printStackTrace(); + } + + } + private void helpTestLineSplit(String line, String time, String name, String pose) { RpLogLine s1 = LogCleaner.splitLine(line); assertNotNull("Unable to split: " + line, s1); assertEquals(time, s1.getTime()); assertEquals(name, s1.getName()); assertEquals(pose, s1.getAction()); } String log2 = "[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:34:40] CCS - MTR - 1.0.2: Nadine Nozaki has entered a non-combative state\n" + "[2010-09-15 22:34:57] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:35:15] Selene Weatherwax is Offline\n" + "[2010-09-15 22:35:24] Jo Soosung is Offline\n" + "[2010-09-15 22:36:05] Rondevous Giano is Offline\n" + "[2010-09-15 22:37:21] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:39:31] Kommandant Epin is Offline\n" + "[2010-09-15 22:39:33] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:39:41] Nadine Nozaki steals a wet kiss\n" + "[2010-09-15 22:39:52] Erosid Dryke is Online\n" + "[2010-09-15 22:40:13] Selene Weatherwax is Online\n" + "[2010-09-15 22:42:17] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:45:30] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:47:20] MoonGypsy Writer is Offline\n" + "[2010-09-15 22:48:50] Skye Hanfoi is Offline\n" + "[2010-09-15 22:49:15] KittyDarling Zelnik is Offline\n" + "[2010-09-15 22:49:24] Traven Sachs is Offline\n" + "[2010-09-15 22:49:49] McCabe Maxsted is Offline\n" + "[2010-09-15 22:50:08] Valmont1985 Radek is Offline\n" + "[2010-09-15 22:50:26] Xerxis Rodenberger kisses back passionately\n" + "[2010-09-15 22:50:34] Skye Hanfoi is Online\n" + "[2010-09-15 22:50:40] Voodoo Halostar is Offline\n" + "[2010-09-15 22:51:10] Voodoo Halostar is Online\n" + "[2010-09-15 22:53:57] Imogen Aeon is Offline\n" + "[2010-09-15 22:54:29] Pethonia Baxton is Offline\n" + "[2010-09-15 22:57:26] Nadine Nozaki: OMG OMG\n" + "[2010-09-15 22:57:33] Nadine Nozaki: Drama?\n" + "[2010-09-15 22:57:33] Nadine Nozaki: OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG!\n" + "[2010-09-15 22:57:56] Xerxis Rodenberger: Whats wrong?\n" + "[2010-09-15 22:58:01] Nadine Nozaki: RUN TIME\n" + "[2010-09-15 22:58:05] Xerxis Rodenberger: *cries*\n" + "[2010-09-15 22:58:06] Nadine Nozaki: Serius wrong imho\n" + "[2010-09-15 22:58:28] Sparklin Indigo is Online\n" + "[2010-09-15 22:58:44] Xerxis Rodenberger: mmhmm\n" + "[2010-09-15 22:59:02] Wezab Ember is Online\n" + "[2010-09-15 23:00:08] Alix Lectar is Offline\n" + "[2010-09-15 23:01:08] Nadine Nozaki: Love you my girl,\n" + "[2010-09-15 23:01:24] Xerxis Rodenberger: Love you Mistress. Have a great day\n" + "[2010-09-15 23:01:41] Nadine Nozaki: u 2 :D\n" + "[2010-09-15 23:02:06] Xerxis Rodenberger kisses and snuggles\n" + "[2010-09-15 23:02:17] Gaea Singh is Offline\n" + "[2010-09-15 23:03:22] Gino Byron is Online\n" + "[2010-09-15 23:04:47] Nadine Nozaki: See you tonight love\n" + "[2010-09-15 23:04:53] Nadine Nozaki: I hgave to get going...\n" + "[2010-09-15 23:05:03] Xerxis Rodenberger: See you\n"; }
balp/RPLogTool
8c0bce41fe6281c315255a2cfc3af80a10ad4e0d
New interface easier to comy from
diff --git a/src/se/arnholm/rplogtool/client/RPLogTool.java b/src/se/arnholm/rplogtool/client/RPLogTool.java index 8e1f8c4..9cf14a1 100644 --- a/src/se/arnholm/rplogtool/client/RPLogTool.java +++ b/src/se/arnholm/rplogtool/client/RPLogTool.java @@ -1,159 +1,180 @@ package se.arnholm.rplogtool.client; import se.arnholm.rplogtool.shared.FieldVerifier; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.DialogBox; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.TextArea; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.VerticalPanel; /** * Entry point classes define <code>onModuleLoad()</code>. */ public class RPLogTool implements EntryPoint { + private static final int LINESSMALLWINDOW = 18; + private static final int LINESBIGWINDOW = 18; + /** * The message displayed to the user when the server cannot be reached or * returns an error. */ private static final String SERVER_ERROR = "An error occurred while " + "attempting to contact the server. Please check your network " + "connection and try again."; /** * Create a remote service proxy to talk to the server-side Greeting service. */ private final GreetingServiceAsync greetingService = GWT .create(GreetingService.class); /** * This is the entry point method. */ public void onModuleLoad() { final Button sendButton = new Button("Send"); final TextArea logArea = new TextArea(); logArea.setText("Second Life Log...."); - logArea.setVisibleLines(30); + logArea.setVisibleLines(LINESBIGWINDOW); logArea.setCharacterWidth(80); + final TextArea rpLog = new TextArea(); + rpLog.setText(""); + rpLog.setVisibleLines(LINESSMALLWINDOW); + rpLog.setCharacterWidth(80); + final Label errorLabel = new Label(); // We can add style names to widgets sendButton.addStyleName("sendButton"); // Add the nameField and sendButton to the RootPanel // Use RootPanel.get() to get the entire body element RootPanel.get("logAreaContainer").add(logArea); RootPanel.get("sendButtonContainer").add(sendButton); - RootPanel.get("errorLabelContainer").add(errorLabel); - + RootPanel.get("rpLogContainer").add(sendButton); + RootPanel.get("errorLabelContainer").add(rpLog); // Focus the cursor on the name field when the app loads logArea.setFocus(true); logArea.selectAll(); // Create the popup dialog box final DialogBox dialogBox = new DialogBox(); - dialogBox.setText("Remote Procedure Call"); + dialogBox.setText("Information"); // dialogBox.setWidth("90em"); dialogBox.setAnimationEnabled(true); final Button closeButton = new Button("Close"); // We can set the id of a widget by accessing its Element closeButton.getElement().setId("closeButton"); final Label textToServerLabel = new Label(); final HTML serverResponseLabel = new HTML(); VerticalPanel dialogVPanel = new VerticalPanel(); dialogVPanel.addStyleName("dialogVPanel"); // dialogVPanel.setWidth("80em"); // dialogVPanel.add(new HTML("<b>Sending name to the server:</b>")); // dialogVPanel.add(textToServerLabel); - dialogVPanel.add(new HTML("<br><b>Modfified log:</b>")); +// dialogVPanel.add(new HTML("<br><b>Modfified log:</b>")); dialogVPanel.add(serverResponseLabel); dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT); dialogVPanel.add(closeButton); dialogBox.setWidget(dialogVPanel); // Add a handler to close the DialogBox closeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialogBox.hide(); sendButton.setEnabled(true); sendButton.setFocus(true); } }); + class CloseHandler implements ClickHandler { + @Override + public void onClick(ClickEvent event) { + logArea.setVisibleLines(LINESBIGWINDOW); + rpLog.setVisibleLines(LINESSMALLWINDOW); + } + + } // Create a handler for the sendButton and nameField class MyHandler implements ClickHandler, KeyUpHandler { /** * Fired when the user clicks on the sendButton. */ public void onClick(ClickEvent event) { sendNameToServer(); } /** * Fired when the user types in the nameField. */ public void onKeyUp(KeyUpEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { sendNameToServer(); } } /** * Send the name from the nameField to the server and wait for a response. */ private void sendNameToServer() { // First, we validate the input. errorLabel.setText(""); String textToServer = logArea.getText(); if (!FieldVerifier.isValidName(textToServer)) { errorLabel.setText("Please enter at least four characters"); return; } // Then, we send the input to the server. sendButton.setEnabled(false); textToServerLabel.setText(textToServer); serverResponseLabel.setText(""); greetingService.greetServer(textToServer, new AsyncCallback<String>() { public void onFailure(Throwable caught) { // Show the RPC error message to the user dialogBox .setText("Remote Procedure Call - Failure"); serverResponseLabel .addStyleName("serverResponseLabelError"); serverResponseLabel.setHTML(SERVER_ERROR); dialogBox.center(); closeButton.setFocus(true); } public void onSuccess(String result) { dialogBox.setText("Roleplay log"); serverResponseLabel .removeStyleName("serverResponseLabelError"); - serverResponseLabel.setHTML(result); + serverResponseLabel.setHTML("Translated OK.<br>"); + rpLog.setText(result); + rpLog.setVisibleLines(LINESBIGWINDOW); + logArea.setVisibleLines(LINESSMALLWINDOW); dialogBox.center(); - dialogBox.setWidth("750px"); +// dialogBox.setWidth("750px"); closeButton.setFocus(true); + CloseHandler closeHandler = new CloseHandler(); + closeButton.addClickHandler(closeHandler ); } }); } } // Add a handler to send the name to the server MyHandler handler = new MyHandler(); sendButton.addClickHandler(handler); logArea.addKeyUpHandler(handler); } } diff --git a/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java b/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java index 3e54498..b85f8f4 100644 --- a/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java +++ b/src/se/arnholm/rplogtool/server/GreetingServiceImpl.java @@ -1,60 +1,61 @@ package se.arnholm.rplogtool.server; import java.util.Set; import se.arnholm.rplogtool.client.GreetingService; import com.google.gwt.user.server.rpc.RemoteServiceServlet; /** * The server side implementation of the RPC service. */ @SuppressWarnings("serial") public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService { public String greetServer(String input) throws IllegalArgumentException { // Verify that the input is valid. String serverInfo = getServletContext().getServerInfo(); String userAgent = getThreadLocalRequest().getHeader("User-Agent"); // Escape data from the client to avoid cross-site script vulnerabilities. String log = escapeHtml(input); userAgent = escapeHtml(userAgent); LogCleaner cleaner = new LogCleaner(log); log = cleaner.getClean(); - log = log.replaceAll("\n", "<br>\n"); +// log = log.replaceAll("\n", "<br>\n"); - String result = "Roleplay Log:<br>"; - result += "----------------------------------------------------------------<br>\n"; - result += "Roleplay duration: " + LogCleaner.formatTime(cleaner.getDuration()) +"<br>\n"; + String result = "Roleplay Log:\n"; + result += "----------------------------------------------------------------\n"; + result += "Roleplay duration: " + LogCleaner.formatTime(cleaner.getDuration()) +"\n"; Set<String> players = cleaner.getPartisipants(); for(String player: players) { PlayerInfo info = cleaner.getPlayerInfo(player); - result += player + ": " + LogCleaner.formatTime(info.getDuration()) +"<br>\n"; + result += player + ": " + LogCleaner.formatTime(info.getDuration()) +"\n"; // result += player + ": " +"<br>\n"; } - result += "----------------------------------------------------------------<br>\n"; + result += "----------------------------------------------------------------\n"; result += log; - result += "----------------------------------------------------------------<br>\n"; - result += "<strong>RPLogTool ©2010 Balp Allen</strong><br>" + serverInfo + ".<br>"; + result += "----------------------------------------------------------------\n"; + result += "RPLogTool ©2010 Balp Allen: " + serverInfo + ".\n"; +// log = log.replaceAll("\n", "<br>\n"); return result; } /** * Escape an html string. Escaping data received from the client helps to * prevent cross-site script vulnerabilities. * * @param html the html string to escape * @return the escaped string */ private String escapeHtml(String html) { if (html == null) { return null; } return html.replaceAll("&", "&amp;").replaceAll("<", "&lt;") .replaceAll(">", "&gt;"); } } diff --git a/src/se/arnholm/rplogtool/server/LogCleaner.java b/src/se/arnholm/rplogtool/server/LogCleaner.java index 873a539..c452e25 100644 --- a/src/se/arnholm/rplogtool/server/LogCleaner.java +++ b/src/se/arnholm/rplogtool/server/LogCleaner.java @@ -1,191 +1,197 @@ package se.arnholm.rplogtool.server; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.Vector; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.joda.time.Duration; public class LogCleaner { private String text; private String cleanString; private Vector<String> lines; private Map<String,PlayerInfo> players; private static final Pattern LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+(\\w+\\s+\\w+)([\\s+':].+)$"); private static final Pattern LONGNAME_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+([^:]+):\\s*(.+)$"); private static final Pattern CCS_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+CCS - MTR - 1.0.2:\\s+((\\w+\\s+\\w+)([\\s+':].+))$"); private static final Pattern TIME_SECONDS = Pattern.compile("(\\d+):(\\d+):(\\d+)"); private static final Pattern TIME_MINUTES = Pattern.compile("(\\d+):(\\d+)"); public LogCleaner(String text) { lines = new Vector<String>(); this.text = text; players = new HashMap<String,PlayerInfo>(); cleanString = process(); } private String process() { String result = new String(); BufferedReader reader = new BufferedReader( new StringReader(text)); String str; try { while((str = reader.readLine()) != null) { RpLogLine line = splitLine(str); final String action = line.getAction(); // if(line.isCCS()) { // System.out.println("In:\"" + str+ "\""); // System.out.println("action:\"" + action+ "\""); // } if(action.equals(" is Online")) { continue; } if(action.equals(" is Offline")) { continue; } if(line.isCCS()) { if(line.getCCSText().startsWith("CCS SYSTEM MESSAGE:")) { continue; } + if(line.getCCSText().endsWith("to continue playing")) { + continue; + } } if(line.getAction().startsWith("((") && line.getAction().endsWith("))")) { continue; } if(line.getAction().startsWith(" declined your inventory offer.")) { continue; } if(line.getAction().startsWith(" accepted your inventory offer.")) { continue; } // System.out.println("..."); String who = line.getName(); if(who.startsWith("(empty)")) { continue; } + if(who.startsWith("You have")) { + continue; + } if(who.equals("Draw distance set to")) { continue; } if(who != null) { PlayerInfo freq = players.get(who); if(null == freq) { freq = new PlayerInfo(who); } freq.addLine(str); players.put(who, freq); } // System.out.println("Adding:" + who + ":" + str); lines.add(str); result += str + "\n"; } } catch (IOException e) { e.printStackTrace(); } return result; } public static String getPlayerName(String str) { RpLogLine values = splitLine(str); if(null != values) { return values.getName(); } return null; } public String getClean() { return cleanString; } public Duration getDuration() { long start = getTime(lines.firstElement()); long end = getTime(lines.lastElement()); System.out.println("Duration between: " +start +":"+ lines.firstElement()); System.out.println(" and: " + end +":"+ lines.lastElement()); return new Duration(start, end); } public static long getTime(String logLine) { RpLogLine values = splitLine(logLine); if(null != values) { String time = values.getTime(); Matcher matchSeconds = TIME_SECONDS.matcher(time); if(matchSeconds.find()) { long hour = Long.parseLong(matchSeconds.group(1)); long minutes = Long.parseLong(matchSeconds.group(2)); long seconds = Long.parseLong(matchSeconds.group(3)); return (((hour * 60 * 60) + (minutes*60) + seconds) * 1000); } Matcher matchMinutes = TIME_MINUTES.matcher(time); if(matchMinutes.find()) { long hour = Long.parseLong(matchMinutes.group(1)); long minutes = Long.parseLong(matchMinutes.group(2)); return (((hour * 60 * 60) + (minutes*60) + 0) * 1000); } } return 0; } public Set<String> getPartisipants() { return players.keySet(); } public PlayerInfo getPlayerInfo(String name) { return players.get(name); } public static String formatTime(org.joda.time.Duration duration) { return String.format("%d:%02d", duration.toPeriod().getHours(), duration.toPeriod().getMinutes()); } public static RpLogLine splitLine(String line) { { Matcher matcher = CCS_LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(3), matcher.group(4), matcher.group(2)); return res; } } { Matcher matcher = LONGNAME_LINE_SPLIT.matcher(line); if (matcher.find()) { // System.out.println(":" + matcher.group(1) + ":" + matcher.group(2) + ":" + matcher.group(3) + ":"); RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } { Matcher matcher = LINE_SPLIT.matcher(line); if (matcher.find()) { RpLogLine res = new RpLogLine(matcher.group(1), matcher .group(2), matcher.group(3), false); return res; } } System.out.println("Not Matches line:" + line); return null; } } diff --git a/src/se/arnholm/rplogtool/server/RpLogLine.java b/src/se/arnholm/rplogtool/server/RpLogLine.java index 67f8338..96d8950 100644 --- a/src/se/arnholm/rplogtool/server/RpLogLine.java +++ b/src/se/arnholm/rplogtool/server/RpLogLine.java @@ -1,55 +1,71 @@ /** * */ package se.arnholm.rplogtool.server; /** * @author balp * */ public class RpLogLine { private String name; private String time; private boolean ccsLine; private String action; private String ccsText; public RpLogLine(String time, String name, String action, boolean ccsLine) { this.time = time; - this.name = name; + setName(name); this.action = action; this.ccsLine = ccsLine; this.ccsText = ""; } + /** + * @param name + */ + private void setName(String name) { + + if(name.endsWith(" shouts")) { + this.name = name.substring(0, name.lastIndexOf(" shouts")); + } else if(name.endsWith(" whispers")) { + this.name = name.substring(0, name.lastIndexOf(" whispers")); + } else { + this.name = name; + } + + + } + public RpLogLine(String time, String name, String action, String ccsText) { this.time = time; - this.name = name; + setName(name); this.action = action; this.ccsLine = true; this.ccsText = ccsText; } public String getName() { return name; } public String getTime() { return time; } public boolean isCCS() { return ccsLine; } public String getAction() { return action; } public String getCCSText() { return ccsText; } } diff --git a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java index 3552a2e..506789c 100644 --- a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java +++ b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java @@ -1,326 +1,338 @@ package se.arnholm.rplogtool.shared; import static org.junit.Assert.*; import java.util.Set; import java.util.Vector; import org.junit.Test; import se.arnholm.rplogtool.server.LogCleaner; import se.arnholm.rplogtool.server.RpLogLine; import org.joda.time.Duration; public class LogCleanerTest { private String testLog = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:08:55] Ricard Collas is Online\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:07] Ricard Collas is Offline\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:25] Ranith Strazytski is Offline\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:25] Lensi Hax is Offline\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:19] Nadine Nozaki: (( just follow please))\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:03] Ricard Collas is Online\n" + "[03:13:25] Rin Tae is Offline\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:13:58] Wolfbringer Sixpack is Online\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; @Test public void testCleanLog() { String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + - "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(testLog); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testCleanLog2() { String text = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } @Test public void testClean3() { String text = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:33] (empty) Ravenal Ashby(en>>sv): \"BRB))\"\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"+ "[2010-10-02 11:27:46] (empty) charlie75 Arcana(en>>sv): \"/ Me Mutters förmodligen elvies\"\n"; String expected = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean4() { String text = "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"+ "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; String expected = "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean5() { String text = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n" + "[2010-10-02 12:02:45] Taylor Renegade is Offline\n" + "[2010-10-02 12:02:48] Xerxis Rodenberger: (( mine are all outdated))\n" + "[2010-10-02 12:03:00] Varthaer Darkmatter declined your inventory offer.\n"; String expected = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } @Test public void testClean6AndTime() { String text = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:21] Sev Laval is Offline\n" + "[2010-09-26 13:54:34] Sev Laval is Online\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n" + "[2010-09-26 13:55:28] Abal Azambuja is Offline\n" + "[2010-09-26 13:55:35] charlie75 Arcana accepted your inventory offer.\n"; String expected = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + "[2010-09-26 13:55:17] charlie75 Arcana me?\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); } - + @Test + public void testClean7() { + String text = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ + "[2010-10-02 12:07:18] CCS - MTR - 1.0.2: Press 434 to continue playing\n"+ + "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; + String expected = "[2010-10-02 12:07:17] Xerxis Rodenberger: What you mean?\n"+ + "[2010-10-02 12:07:23] Nadine Nozaki nods, Taking the connfession, You will be put on trial, charge of murder\n"; + LogCleaner log = new LogCleaner(text); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } @Test public void testDuration() { LogCleaner log = new LogCleaner(testLog); Duration expected = new Duration(431000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testDuration2() { LogCleaner log = new LogCleaner(log2); Duration expected = new Duration(1828000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testGetTime() { assertEquals(11220000, LogCleaner.getTime("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"")); assertEquals(83103000, LogCleaner.getTime("[2010-09-15 23:05:03] Xerxis Rodenberger: See you")); assertEquals(81275000, LogCleaner.getTime("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n")); } @Test public void testPlayers() { LogCleaner log = new LogCleaner(testLog); Set<String> who = log.getPartisipants(); // System.out.println("Test:" + who); assertTrue("Nadine should be in set", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } @Test public void testTimeFormat() { LogCleaner log = new LogCleaner(testLog); assertEquals("0:06", LogCleaner.formatTime(log.getPlayerInfo("Nadine Nozaki").getDuration())); } @Test public void testGetPLayerName() { assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:01] Nadine Nozaki's smile leaves her fance.\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n")); } @Test public void testLineSplit() { helpTestLineSplit("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"", "03:07", "Nadine Nozaki", " ndos, \"Aint we all but Xerx human?\""); helpTestLineSplit("[2010-09-15 23:05:03] Xerxis Rodenberger: See you", "2010-09-15 23:05:03", "Xerxis Rodenberger", "See you"); helpTestLineSplit("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state", "2010-09-15 22:34:35", "Nadine Nozaki"," has entered a combative state"); helpTestLineSplit("[2010-10-02 11:27:25] (empty) Bunny Yakubu(en>>sv): \"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\"\n", "2010-10-02 11:27:25", "(empty) Bunny Yakubu(en>>sv)", "\"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\""); helpTestLineSplit("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", "2010-10-02 1:41:05", "CCS SYSTEM", " MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you."); helpTestLineSplit("[2010-10-02 11:41:37] Draw distance set to: 0m\n", "2010-10-02 11:41:37", "Draw distance set to", "0m"); + + helpTestLineSplit("[2010-10-02 12:06:59] Varthaer Darkmatter shouts: I CONFESS OF NOTHING.\n", + "2010-10-02 12:06:59", "Varthaer Darkmatter", "I CONFESS OF NOTHING."); } @Test public void testCCSLine() { RpLogLine s1 = LogCleaner.splitLine("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"); assertNotNull("Unable to split: " + "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", s1); assertEquals("2010-10-02 1:41:05", s1.getTime()); assertEquals("CCS SYSTEM", s1.getName()); assertEquals(" MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getAction()); assertTrue(s1.isCCS()); assertEquals("CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getCCSText()); } private void helpTestLineSplit(String line, String time, String name, String pose) { RpLogLine s1 = LogCleaner.splitLine(line); assertNotNull("Unable to split: " + line, s1); assertEquals(time, s1.getTime()); assertEquals(name, s1.getName()); assertEquals(pose, s1.getAction()); } String log2 = "[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:34:40] CCS - MTR - 1.0.2: Nadine Nozaki has entered a non-combative state\n" + "[2010-09-15 22:34:57] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:35:15] Selene Weatherwax is Offline\n" + "[2010-09-15 22:35:24] Jo Soosung is Offline\n" + "[2010-09-15 22:36:05] Rondevous Giano is Offline\n" + "[2010-09-15 22:37:21] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:39:31] Kommandant Epin is Offline\n" + "[2010-09-15 22:39:33] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:39:41] Nadine Nozaki steals a wet kiss\n" + "[2010-09-15 22:39:52] Erosid Dryke is Online\n" + "[2010-09-15 22:40:13] Selene Weatherwax is Online\n" + "[2010-09-15 22:42:17] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:45:30] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:47:20] MoonGypsy Writer is Offline\n" + "[2010-09-15 22:48:50] Skye Hanfoi is Offline\n" + "[2010-09-15 22:49:15] KittyDarling Zelnik is Offline\n" + "[2010-09-15 22:49:24] Traven Sachs is Offline\n" + "[2010-09-15 22:49:49] McCabe Maxsted is Offline\n" + "[2010-09-15 22:50:08] Valmont1985 Radek is Offline\n" + "[2010-09-15 22:50:26] Xerxis Rodenberger kisses back passionately\n" + "[2010-09-15 22:50:34] Skye Hanfoi is Online\n" + "[2010-09-15 22:50:40] Voodoo Halostar is Offline\n" + "[2010-09-15 22:51:10] Voodoo Halostar is Online\n" + "[2010-09-15 22:53:57] Imogen Aeon is Offline\n" + "[2010-09-15 22:54:29] Pethonia Baxton is Offline\n" + "[2010-09-15 22:57:26] Nadine Nozaki: OMG OMG\n" + "[2010-09-15 22:57:33] Nadine Nozaki: Drama?\n" + "[2010-09-15 22:57:33] Nadine Nozaki: OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG!\n" + "[2010-09-15 22:57:56] Xerxis Rodenberger: Whats wrong?\n" + "[2010-09-15 22:58:01] Nadine Nozaki: RUN TIME\n" + "[2010-09-15 22:58:05] Xerxis Rodenberger: *cries*\n" + "[2010-09-15 22:58:06] Nadine Nozaki: Serius wrong imho\n" + "[2010-09-15 22:58:28] Sparklin Indigo is Online\n" + "[2010-09-15 22:58:44] Xerxis Rodenberger: mmhmm\n" + "[2010-09-15 22:59:02] Wezab Ember is Online\n" + "[2010-09-15 23:00:08] Alix Lectar is Offline\n" + "[2010-09-15 23:01:08] Nadine Nozaki: Love you my girl,\n" + "[2010-09-15 23:01:24] Xerxis Rodenberger: Love you Mistress. Have a great day\n" + "[2010-09-15 23:01:41] Nadine Nozaki: u 2 :D\n" + "[2010-09-15 23:02:06] Xerxis Rodenberger kisses and snuggles\n" + "[2010-09-15 23:02:17] Gaea Singh is Offline\n" + "[2010-09-15 23:03:22] Gino Byron is Online\n" + "[2010-09-15 23:04:47] Nadine Nozaki: See you tonight love\n" + "[2010-09-15 23:04:53] Nadine Nozaki: I hgave to get going...\n" + "[2010-09-15 23:05:03] Xerxis Rodenberger: See you\n"; } diff --git a/war/RPLogTool.css b/war/RPLogTool.css index 3f7b140..27fc3c6 100644 --- a/war/RPLogTool.css +++ b/war/RPLogTool.css @@ -1,34 +1,34 @@ /** Add css rules here for your application. */ /** Example rules used by the template application (remove for your app) */ h1 { font-size: 2em; font-weight: bold; color: #777777; - margin: 40px 0px 70px; + margin: 30px 0px 10px; text-align: center; } .sendButton { display: block; font-size: 16pt; } /** Most GWT widgets already have a style name defined */ .gwt-DialogBox { - width: 800px; + width: 750px; } .dialogVPanel { margin: 5px; } .serverResponseLabelError { color: red; } /** Set ids using widget.getElement().setId("idOfElement") */ #closeButton { margin: 15px 6px 6px; } diff --git a/war/RPLogTool.html b/war/RPLogTool.html index fcdd740..99a7e00 100644 --- a/war/RPLogTool.html +++ b/war/RPLogTool.html @@ -1,65 +1,68 @@ <!doctype html> <!-- The DOCTYPE declaration above will set the --> <!-- browser's rendering engine into --> <!-- "Standards Mode". Replacing this declaration --> <!-- with a "Quirks Mode" doctype may lead to some --> <!-- differences in layout. --> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!-- --> <!-- Consider inlining CSS to reduce the number of requested files --> <!-- --> <link type="text/css" rel="stylesheet" href="RPLogTool.css"> <!-- --> <!-- Any title is fine --> <!-- --> <title>RPLogCleaner</title> <!-- --> <!-- This script loads your compiled module. --> <!-- If you add any GWT meta tags, they must --> <!-- be added before this line. --> <!-- --> <script type="text/javascript" language="javascript" src="rplogtool/rplogtool.nocache.js"></script> </head> <!-- --> <!-- The body can have arbitrary html, or --> <!-- you can leave the body empty if you want --> <!-- to create a completely dynamic UI. --> <!-- --> <body> <!-- OPTIONAL: include this if you want history support --> <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> <!-- RECOMMENDED if your web app will not function without JavaScript enabled --> <noscript> <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> Your web browser must have JavaScript enabled in order for this application to display correctly. </div> </noscript> <h1>RPLogCleaner</h1> <table align="center"> <tr> <td colspan="2" style="font-weight:bold;">Add the log below:</td> </tr> <tr> <td id="logAreaContainer"></td> </tr> <tr> <td id="sendButtonContainer"></td> </tr> + <tr> + <td id="rpLogContainer"></td> + </tr> <tr> <td colspan="2" style="color:red;" id="errorLabelContainer"></td> </tr> </table> </body> </html> diff --git a/war/WEB-INF/appengine-web.xml b/war/WEB-INF/appengine-web.xml index a8fa4b3..d740ceb 100644 --- a/war/WEB-INF/appengine-web.xml +++ b/war/WEB-INF/appengine-web.xml @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="utf-8"?> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> <application>rplogtool</application> - <version>3</version> + <version>4</version> <!-- Configure serving/caching of GWT files --> <static-files> <include path="**" /> <!-- The following line requires App Engine 1.3.2 SDK --> <include path="**.nocache.*" expiration="0s" /> <include path="**.cache.*" expiration="365d" /> <exclude path="**.gwt.rpc" /> </static-files> <!-- Configure java.util.logging --> <system-properties> <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> </system-properties> </appengine-web-app> \ No newline at end of file
balp/RPLogTool
fd5d50d9232393fba544ba1e480ffb0e0db0f51e
Remove some OOC and other system messages
diff --git a/src/se/arnholm/rplogtool/server/LogCleaner.java b/src/se/arnholm/rplogtool/server/LogCleaner.java index 5d6b124..873a539 100644 --- a/src/se/arnholm/rplogtool/server/LogCleaner.java +++ b/src/se/arnholm/rplogtool/server/LogCleaner.java @@ -1,151 +1,191 @@ package se.arnholm.rplogtool.server; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.Vector; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.joda.time.Duration; public class LogCleaner { private String text; private String cleanString; private Vector<String> lines; private Map<String,PlayerInfo> players; - private static final Pattern LINE_SPLIT = Pattern.compile("^\\s*\\[(.+)\\]\\s+(\\w+\\s+\\w+)([\\s+':].+)$"); - private static final Pattern CCS_LINE_SPLIT = Pattern.compile("^\\s*\\[(.+)\\]\\s+CCS - MTR - 1.0.2:\\s+(\\w+\\s+\\w+)([\\s+':].+)$"); + private static final Pattern LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+(\\w+\\s+\\w+)([\\s+':].+)$"); + private static final Pattern LONGNAME_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+([^:]+):\\s*(.+)$"); + private static final Pattern CCS_LINE_SPLIT = Pattern.compile("^\\s*\\[([^\\]]+)\\]\\s+CCS - MTR - 1.0.2:\\s+((\\w+\\s+\\w+)([\\s+':].+))$"); private static final Pattern TIME_SECONDS = Pattern.compile("(\\d+):(\\d+):(\\d+)"); private static final Pattern TIME_MINUTES = Pattern.compile("(\\d+):(\\d+)"); public LogCleaner(String text) { lines = new Vector<String>(); this.text = text; players = new HashMap<String,PlayerInfo>(); cleanString = process(); } private String process() { String result = new String(); BufferedReader reader = new BufferedReader( new StringReader(text)); String str; try { while((str = reader.readLine()) != null) { RpLogLine line = splitLine(str); final String action = line.getAction(); - if(line.isCCS()) { - System.out.println("In:\"" + str+ "\""); - System.out.println("action:\"" + action+ "\""); - } +// if(line.isCCS()) { +// System.out.println("In:\"" + str+ "\""); +// System.out.println("action:\"" + action+ "\""); +// } if(action.equals(" is Online")) { continue; } if(action.equals(" is Offline")) { continue; } + if(line.isCCS()) { + if(line.getCCSText().startsWith("CCS SYSTEM MESSAGE:")) { + continue; + } + } + if(line.getAction().startsWith("((") && line.getAction().endsWith("))")) { + continue; + } + if(line.getAction().startsWith(" declined your inventory offer.")) { + continue; + } + if(line.getAction().startsWith(" accepted your inventory offer.")) { + continue; + } // System.out.println("..."); String who = line.getName(); + if(who.startsWith("(empty)")) { + continue; + } + if(who.equals("Draw distance set to")) { + continue; + } if(who != null) { PlayerInfo freq = players.get(who); if(null == freq) { freq = new PlayerInfo(who); } freq.addLine(str); players.put(who, freq); } // System.out.println("Adding:" + who + ":" + str); lines.add(str); result += str + "\n"; } } catch (IOException e) { e.printStackTrace(); } return result; } public static String getPlayerName(String str) { RpLogLine values = splitLine(str); if(null != values) { return values.getName(); } return null; } public String getClean() { return cleanString; } public Duration getDuration() { long start = getTime(lines.firstElement()); long end = getTime(lines.lastElement()); System.out.println("Duration between: " +start +":"+ lines.firstElement()); System.out.println(" and: " + end +":"+ lines.lastElement()); return new Duration(start, end); } public static long getTime(String logLine) { RpLogLine values = splitLine(logLine); if(null != values) { String time = values.getTime(); Matcher matchSeconds = TIME_SECONDS.matcher(time); if(matchSeconds.find()) { long hour = Long.parseLong(matchSeconds.group(1)); long minutes = Long.parseLong(matchSeconds.group(2)); long seconds = Long.parseLong(matchSeconds.group(3)); return (((hour * 60 * 60) + (minutes*60) + seconds) * 1000); } Matcher matchMinutes = TIME_MINUTES.matcher(time); if(matchMinutes.find()) { long hour = Long.parseLong(matchMinutes.group(1)); long minutes = Long.parseLong(matchMinutes.group(2)); return (((hour * 60 * 60) + (minutes*60) + 0) * 1000); } } return 0; } public Set<String> getPartisipants() { return players.keySet(); } public PlayerInfo getPlayerInfo(String name) { return players.get(name); } public static String formatTime(org.joda.time.Duration duration) { return String.format("%d:%02d", duration.toPeriod().getHours(), duration.toPeriod().getMinutes()); } public static RpLogLine splitLine(String line) { - Matcher ccs = CCS_LINE_SPLIT.matcher(line); - if(ccs.find()) { - RpLogLine res = new RpLogLine(ccs.group(1), ccs.group(2), ccs.group(3), true); - return res; - + { + Matcher matcher = CCS_LINE_SPLIT.matcher(line); + if (matcher.find()) { + RpLogLine res = new RpLogLine(matcher.group(1), matcher + .group(3), matcher.group(4), matcher.group(2)); + return res; + + } } - Matcher matcher = LINE_SPLIT.matcher(line); - if(matcher.find()) { - RpLogLine res = new RpLogLine(matcher.group(1), matcher.group(2), - matcher.group(3), false); - return res; + { + Matcher matcher = LONGNAME_LINE_SPLIT.matcher(line); + + if (matcher.find()) { +// System.out.println(":" + matcher.group(1) + ":" + matcher.group(2) + ":" + matcher.group(3) + ":"); + RpLogLine res = new RpLogLine(matcher.group(1), matcher + .group(2), matcher.group(3), false); + return res; + } } + { + Matcher matcher = LINE_SPLIT.matcher(line); + if (matcher.find()) { + RpLogLine res = new RpLogLine(matcher.group(1), matcher + .group(2), matcher.group(3), false); + return res; + } + } + + System.out.println("Not Matches line:" + line); + + return null; } } diff --git a/src/se/arnholm/rplogtool/server/RpLogLine.java b/src/se/arnholm/rplogtool/server/RpLogLine.java index 934ddea..67f8338 100644 --- a/src/se/arnholm/rplogtool/server/RpLogLine.java +++ b/src/se/arnholm/rplogtool/server/RpLogLine.java @@ -1,41 +1,55 @@ /** * */ package se.arnholm.rplogtool.server; /** * @author balp * */ public class RpLogLine { private String name; private String time; private boolean ccsLine; private String action; + private String ccsText; public RpLogLine(String time, String name, String action, boolean ccsLine) { this.time = time; this.name = name; this.action = action; this.ccsLine = ccsLine; + this.ccsText = ""; + } + + public RpLogLine(String time, String name, String action, String ccsText) { + this.time = time; + this.name = name; + this.action = action; + this.ccsLine = true; + this.ccsText = ccsText; } public String getName() { return name; } public String getTime() { return time; } public boolean isCCS() { return ccsLine; } public String getAction() { return action; } + public String getCCSText() { + return ccsText; + } + } diff --git a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java index ae13ab4..3552a2e 100644 --- a/test/se/arnholm/rplogtool/shared/LogCleanerTest.java +++ b/test/se/arnholm/rplogtool/shared/LogCleanerTest.java @@ -1,244 +1,326 @@ package se.arnholm.rplogtool.shared; import static org.junit.Assert.*; import java.util.Set; import java.util.Vector; import org.junit.Test; import se.arnholm.rplogtool.server.LogCleaner; import se.arnholm.rplogtool.server.RpLogLine; import org.joda.time.Duration; public class LogCleanerTest { private String testLog = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:08:55] Ricard Collas is Online\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:07] Ricard Collas is Offline\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:25] Ranith Strazytski is Offline\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:25] Lensi Hax is Offline\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + "[03:12:19] Nadine Nozaki: (( just follow please))\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:03] Ricard Collas is Online\n" + "[03:13:25] Rin Tae is Offline\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:13:58] Wolfbringer Sixpack is Online\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; @Test public void testCleanLog() { String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:07:50] Xerxis Rodenberger: Rizo's self esteem often exceeds his height\n" + "[03:07:53] Silver Opaque: why of course\n" + "[03:07:53] Xerxis Rodenberger chuckles\n" + "[03:08:09] Silver Opaque: but some more so than other *glances around the bar*\n" + "[03:08:14] serendipity Savira stays silent taking another sip from her glass\n" + "[03:09:55] Monfang Snowpaw sleans agains t the bar. \"I thought Rizo banned you, Silver.\"\n" + "[03:09:57] Silver Opaque smiles evily\n" + "[03:10:01] Nadine Nozaki's smile leaves her fance.\n" + "[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n" + "[03:10:29] Monfang Snowpaw rolls his eyes and looks a tNadina. \"Look, shut up. If you want to kill me, then do it already.\"\n" + "[03:10:31] CCS - MTR - 1.0.2: Silver Opaque has detached their meter\n" + "[03:10:35] Samantha Linnaeus smiles, \"Hello Seren\"\n" + "[03:10:36] serendipity Savira looks up and smiles \"hello Sam\"\n" + "[03:10:39] CCS - MTR - 1.0.2: Nadine Nozaki uses Rupture-6 on Monfang Snowpaw\n" + "[03:10:39] CCS - MTR - 1.0.2: Monfang Snowpaw has been damaged!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw loses life!\n" + "[03:10:40] CCS - MTR - 1.0.2: Monfang Snowpaw has been defeated by Nadine Nozaki!\n" + "[03:10:48] Nadine Nozaki does as orderd..\n" + "[03:10:54] CCS - MTR - 1.0.2: You can use offensive skills again\n" + "[03:11:17] serendipity Savira looks in shock as Nadine attacks Mon\n" + "[03:11:18] Xerxis Rodenberger: Sh. Mistress. Drag him out before anyone notices\n" + "[03:11:24] Monfang Snowpaw stands beck up.\n" + "[03:11:28] Nadine Nozaki grabs the tails of the wolf\n" + "[03:11:37] Samantha Linnaeus sees the sudden attack out of the corner of her eye, \"Goodness!\"\n" + "[03:11:41] Monfang Snowpaw shakes his head. \"Really, you have to do better than that.\"\n" + "[03:11:49] Nadine Nozaki stats pulling the wolf form the bar.\n" + - "[03:12:19] Nadine Nozaki: (( just follow please))\n" + "[03:12:38] serendipity Savira pats the bar stool next to her and whispers to Sam, \"Come and sit\"\n" + "[03:12:47] Samantha Linnaeus' eyes are wide, \"How have you been Seren?\"\n" + "[03:12:57] CCS - MTR - 1.0.2: You have called for GM assistance\n" + "[03:12:59] Silver Opaque turns and looks at samantha, \"hello there\" a twinkle plays in my eyes\n" + "[03:13:28] Nadine Nozaki takes teh weposn form the wolf and tosses the body into the river\n" + "[03:13:42] Xerxis Rodenberger nods excusingly to Sam:\"I'm sorry. Its usually not that violent here\"\n" + "[03:13:51] Nadine Nozaki: Sorry about that\n" + "[03:14:18] Monfang Snowpaw reterns. \"Sam. Run. This tavern is full of vampires!\"\n" + "[03:14:20] Samantha Linnaeus smiles a nervous smile and replies, \"Yes, I understand\"\n" + "[03:14:32] Silver Opaque: crazy wolf talking\n" + "[03:14:34] Samantha Linnaeus: \"Vampires?\"\n" + "[03:14:53] serendipity Savira nods at sam , hoping the others didnt notice\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(testLog); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } + @Test public void testCleanLog2() { String text = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; String expected = "[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n" + "[03:14:53] Samantha Linnaeus looks around the room in some confusion...\"\n"; LogCleaner log = new LogCleaner(text); String cleaned = log.getClean(); assertEquals(expected, cleaned); // fail("Not yet implemented"); } + @Test + public void testClean3() { + String text = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ + "[2010-10-02 11:27:33] (empty) Ravenal Ashby(en>>sv): \"BRB))\"\n"+ + "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"+ + "[2010-10-02 11:27:46] (empty) charlie75 Arcana(en>>sv): \"/ Me Mutters förmodligen elvies\"\n"; + String expected = "[2010-10-02 11:27:33] charlie75 Arcana mutters probably elvies\n"+ + "[2010-10-02 11:27:38] Nadine Nozaki: Me looks arouns Carefull there is a sniper out\n"; + LogCleaner log = new LogCleaner(text); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } + @Test + public void testClean4() { + String text = "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"+ + "[2010-10-02 11:41:37] Draw distance set to: 0m\n"+ + "[2010-10-02 11:41:38] Draw distance set to: 10m\n"+ + "[2010-10-02 11:41:42] Draw distance set to: 20m\n"+ + "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; + String expected = "[2010-10-02 11:41:54] Xerxis Rodenberger: Oh here you are. I lost you\n"; + LogCleaner log = new LogCleaner(text); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } + @Test + public void testClean5() { + String text = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n" + + "[2010-10-02 12:02:45] Taylor Renegade is Offline\n" + + "[2010-10-02 12:02:48] Xerxis Rodenberger: (( mine are all outdated))\n" + + "[2010-10-02 12:03:00] Varthaer Darkmatter declined your inventory offer.\n"; + String expected = "[2010-10-02 12:02:43] Nadine Nozaki bends down picking up a nail, and the hammer, \"So you confess of attepted murder,\"\n"; + LogCleaner log = new LogCleaner(text); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } + + @Test + public void testClean6AndTime() { + String text = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + + "[2010-09-26 13:54:21] Sev Laval is Offline\n" + + "[2010-09-26 13:54:34] Sev Laval is Online\n" + + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + + "[2010-09-26 13:55:17] charlie75 Arcana me?\n" + + "[2010-09-26 13:55:28] Abal Azambuja is Offline\n" + + "[2010-09-26 13:55:35] charlie75 Arcana accepted your inventory offer.\n"; + + String expected = "[2010-09-26 13:54:09] Xerxis Rodenberger: I'm right a tiny bit sleepy already, Mistress\n" + + "[2010-09-26 13:54:16] charlie75 Arcana hello\n" + + "[2010-09-26 13:54:18] Xerxis Rodenberger: Oh Hai\n" + + "[2010-09-26 13:54:57] Nadine Nozaki smiles, \"How do you feel...\"\n" + + "[2010-09-26 13:55:17] charlie75 Arcana me?\n"; + LogCleaner log = new LogCleaner(text); + String cleaned = log.getClean(); + assertEquals(expected, cleaned); + } + @Test public void testDuration() { LogCleaner log = new LogCleaner(testLog); Duration expected = new Duration(431000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testDuration2() { LogCleaner log = new LogCleaner(log2); Duration expected = new Duration(1828000); assertEquals(expected.getMillis(), log.getDuration().getMillis()); } @Test public void testGetTime() { assertEquals(11220000, LogCleaner.getTime("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"")); assertEquals(83103000, LogCleaner.getTime("[2010-09-15 23:05:03] Xerxis Rodenberger: See you")); assertEquals(81275000, LogCleaner.getTime("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n")); } @Test public void testPlayers() { LogCleaner log = new LogCleaner(testLog); Set<String> who = log.getPartisipants(); // System.out.println("Test:" + who); assertTrue("Nadine should be in set", who.contains("Nadine Nozaki")); assertEquals(11262000, log.getPlayerInfo("Nadine Nozaki").getFirstTime()); assertEquals(11631000, log.getPlayerInfo("Nadine Nozaki").getLastTime()); Duration d = log.getPlayerInfo("Nadine Nozaki").getDuration(); assertEquals(369000, d.getMillis()); System.out.println("Nads: " + d.toPeriod().getHours() + ":" + d.toPeriod().getMinutes() + " " + log.getPlayerInfo("Nadine Nozaki").getLines()); - assertEquals(10, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); + assertEquals(9, log.getPlayerInfo("Nadine Nozaki").getNumberOfLines()); } @Test public void testTimeFormat() { LogCleaner log = new LogCleaner(testLog); assertEquals("0:06", LogCleaner.formatTime(log.getPlayerInfo("Nadine Nozaki").getDuration())); } @Test public void testGetPLayerName() { assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:07:42] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:01] Nadine Nozaki's smile leaves her fance.\n")); assertEquals("Nadine Nozaki", LogCleaner.getPlayerName("[03:10:13] Nadine Nozaki: I thoulg you was going to excuse..\n")); } @Test public void testLineSplit() { helpTestLineSplit("[03:07] Nadine Nozaki ndos, \"Aint we all but Xerx human?\"", "03:07", "Nadine Nozaki", " ndos, \"Aint we all but Xerx human?\""); + helpTestLineSplit("[2010-09-15 23:05:03] Xerxis Rodenberger: See you", - "2010-09-15 23:05:03", "Xerxis Rodenberger", ": See you"); + "2010-09-15 23:05:03", "Xerxis Rodenberger", "See you"); helpTestLineSplit("[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state", "2010-09-15 22:34:35", "Nadine Nozaki"," has entered a combative state"); + + helpTestLineSplit("[2010-10-02 11:27:25] (empty) Bunny Yakubu(en>>sv): \"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\"\n", + "2010-10-02 11:27:25", "(empty) Bunny Yakubu(en>>sv)", + "\"/ Me flinar \"ohhh jag älskar ormar\" Hon fnittrar som en orm ringlar bedriver synes runt henne\""); + + helpTestLineSplit("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", + "2010-10-02 1:41:05", "CCS SYSTEM", + " MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you."); + + helpTestLineSplit("[2010-10-02 11:41:37] Draw distance set to: 0m\n", + "2010-10-02 11:41:37", "Draw distance set to", "0m"); + } + + @Test + public void testCCSLine() { + RpLogLine s1 = LogCleaner.splitLine("[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n"); + assertNotNull("Unable to split: " + "[2010-10-02 1:41:05] CCS - MTR - 1.0.2: CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.\n", s1); + assertEquals("2010-10-02 1:41:05", s1.getTime()); + assertEquals("CCS SYSTEM", s1.getName()); + assertEquals(" MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getAction()); + assertTrue(s1.isCCS()); + assertEquals("CCS SYSTEM MESSAGE: Respec on Demand Feature: Should become available on your player profile today or at latest tommorrow, there are some kinks in the Secure XP Transfer System we are still working out and that may take a few days longer. Thank you for your patience and understanding as we get these free features developed for you.", s1.getCCSText()); + } private void helpTestLineSplit(String line, String time, String name, String pose) { RpLogLine s1 = LogCleaner.splitLine(line); assertNotNull("Unable to split: " + line, s1); assertEquals(time, s1.getTime()); assertEquals(name, s1.getName()); -// assertEquals(pose, s1.elementAt(2)); + assertEquals(pose, s1.getAction()); } String log2 = "[2010-09-15 22:34:35] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:34:40] CCS - MTR - 1.0.2: Nadine Nozaki has entered a non-combative state\n" + "[2010-09-15 22:34:57] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:35:15] Selene Weatherwax is Offline\n" + "[2010-09-15 22:35:24] Jo Soosung is Offline\n" + "[2010-09-15 22:36:05] Rondevous Giano is Offline\n" + "[2010-09-15 22:37:21] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:39:31] Kommandant Epin is Offline\n" + "[2010-09-15 22:39:33] CCS - MTR - 1.0.2: Nadine Nozaki has entered a combative state\n" + "[2010-09-15 22:39:41] Nadine Nozaki steals a wet kiss\n" + "[2010-09-15 22:39:52] Erosid Dryke is Online\n" + "[2010-09-15 22:40:13] Selene Weatherwax is Online\n" + "[2010-09-15 22:42:17] BeoWulf Foxtrot is Offline\n" + "[2010-09-15 22:45:30] BeoWulf Foxtrot is Online\n" + "[2010-09-15 22:47:20] MoonGypsy Writer is Offline\n" + "[2010-09-15 22:48:50] Skye Hanfoi is Offline\n" + "[2010-09-15 22:49:15] KittyDarling Zelnik is Offline\n" + "[2010-09-15 22:49:24] Traven Sachs is Offline\n" + "[2010-09-15 22:49:49] McCabe Maxsted is Offline\n" + "[2010-09-15 22:50:08] Valmont1985 Radek is Offline\n" + "[2010-09-15 22:50:26] Xerxis Rodenberger kisses back passionately\n" + "[2010-09-15 22:50:34] Skye Hanfoi is Online\n" + "[2010-09-15 22:50:40] Voodoo Halostar is Offline\n" + "[2010-09-15 22:51:10] Voodoo Halostar is Online\n" + "[2010-09-15 22:53:57] Imogen Aeon is Offline\n" + "[2010-09-15 22:54:29] Pethonia Baxton is Offline\n" + "[2010-09-15 22:57:26] Nadine Nozaki: OMG OMG\n" + "[2010-09-15 22:57:33] Nadine Nozaki: Drama?\n" + "[2010-09-15 22:57:33] Nadine Nozaki: OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG! OMG!\n" + "[2010-09-15 22:57:56] Xerxis Rodenberger: Whats wrong?\n" + "[2010-09-15 22:58:01] Nadine Nozaki: RUN TIME\n" + "[2010-09-15 22:58:05] Xerxis Rodenberger: *cries*\n" + "[2010-09-15 22:58:06] Nadine Nozaki: Serius wrong imho\n" + "[2010-09-15 22:58:28] Sparklin Indigo is Online\n" + "[2010-09-15 22:58:44] Xerxis Rodenberger: mmhmm\n" + "[2010-09-15 22:59:02] Wezab Ember is Online\n" + "[2010-09-15 23:00:08] Alix Lectar is Offline\n" + "[2010-09-15 23:01:08] Nadine Nozaki: Love you my girl,\n" + "[2010-09-15 23:01:24] Xerxis Rodenberger: Love you Mistress. Have a great day\n" + "[2010-09-15 23:01:41] Nadine Nozaki: u 2 :D\n" + "[2010-09-15 23:02:06] Xerxis Rodenberger kisses and snuggles\n" + "[2010-09-15 23:02:17] Gaea Singh is Offline\n" + "[2010-09-15 23:03:22] Gino Byron is Online\n" + "[2010-09-15 23:04:47] Nadine Nozaki: See you tonight love\n" + "[2010-09-15 23:04:53] Nadine Nozaki: I hgave to get going...\n" + "[2010-09-15 23:05:03] Xerxis Rodenberger: See you\n"; }