/// <summary> /// Handles the Click event of the gCompileTheme control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RowEventArgs"/> instance containing the event data.</param> protected void gCompileTheme_Click(object sender, RowEventArgs e) { var theme = new RockTheme(e.RowKeyValue.ToString()); string messages = string.Empty; bool lessCompileSuccess = theme.Compile(out messages); bool sassCompileSuccess = theme.CompileSass(out messages); if (lessCompileSuccess && sassCompileSuccess) { mdThemeCompile.Show("Theme was successfully compiled.", ModalAlertType.Information); } else { nbMessages.NotificationBoxType = NotificationBoxType.Danger; nbMessages.Text = string.Format("An error occurred while compiling the {0} them. Message: {1}", theme.Name, messages); } }
/// <summary> /// Handles the Click event of the btnCompileTheme control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void btnCompileTheme_Click(object sender, EventArgs e) { var rockContext = new RockContext(); SiteService siteService = new SiteService(rockContext); Site site = siteService.Get(hfSiteId.Value.AsInteger()); string messages = string.Empty; var theme = new RockTheme(site.Theme); bool lessSuccess = theme.Compile(out messages); bool sassSuccess = theme.CompileSass(out messages); if (lessSuccess && sassSuccess) { mdThemeCompile.Show("Theme was successfully compiled.", ModalAlertType.Information); } else { mdThemeCompile.Show(string.Format("An error occurred compiling the theme {0}. Message: {1}.", site.Theme, messages), ModalAlertType.Warning); } }