Skip to content

Commit

Permalink
Merge pull request #87 from bmlt-enabled/2.x
Browse files Browse the repository at this point in the history
2.x
  • Loading branch information
dgershman authored Jul 5, 2019
2 parents 8e86fc1 + 2e43b27 commit 00d26a1
Show file tree
Hide file tree
Showing 17 changed files with 892 additions and 329 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.idea
logs
mpdf/vendor
.vscode/*
904 changes: 649 additions & 255 deletions bmlt-meeting-list.php

Large diffs are not rendered by default.

57 changes: 45 additions & 12 deletions css/admin.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
.wpbody-content {
margin-top: 0;
margin-left: 0;
margin-right: 0;
height: 100%;
width: 100%;
}

#tallyBannerContainer {
background-image: url('images/banner_rails.png');
background-repeat: repeat-x;
background-size: 15% 100%;
display: block;
height: 15%;
width: auto;
}

img#tallyBannerImage {
display: block;
margin: auto;
height: 100%;
width: auto;
}

/* Portrait */
@media only screen
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: portrait) {
#tallyBannerContainer {
background-size: 12% 100%;
height: 12%;
}
}

.ui-accordion .ui-accordion-icons {
padding-left: 2.2em !important;
}
Expand Down Expand Up @@ -82,7 +118,7 @@ div#meeting-list-tabs-wrapper li {
#meeting-list-tabs h3 {
font-size: 16px;
font-weight: 500;
color: #9E2121;
color: #0A61AD;
}
#meeting-list-tabs .icon-forward {
margin-top: 1px;
Expand Down Expand Up @@ -225,7 +261,7 @@ background: rgba(0, 0, 0, 0);
color: #222 !important;
}
#meeting-list-tabs input[class=mlg]:checked+label {
color: #863B3B !important;
color: #0A61AD !important;
font-weight: bold !important;
}
/* #meeting-list-tabs input:checked + span > label {
Expand All @@ -250,7 +286,7 @@ color: #999;
color: #000;
}
input:checked ~ td > label {
color: #863B3B !important;
color: #0A61AD !important;
font-weight: bold !important;
}
#meeting-list-tabs h2 {
Expand All @@ -272,7 +308,7 @@ font-size: 22px;
}
.tooltipster-default
{
background: #4c4c4c;
background: #888888;
border: 2px solid #111;
border-radius: 5px;
color: #fff;
Expand All @@ -291,7 +327,7 @@ font-size: 22px;
.tooltipster-icon {
cursor: help;
margin-left: 10px;
background: url("images/help-image.png") no-repeat;
background: url("images/help-image2.png") no-repeat;
color: rgba(0, 0, 0, 0);
padding-right: 5px;
}
Expand Down Expand Up @@ -607,15 +643,14 @@ color: #222;
}
#meeting-list-tabs.ui-tabs.ui-tabs-vertical .ui-tabs-nav li a:hover {
cursor: pointer;
background-color: #7AD03A;
background-color: #0A8ADD;
color: #555;
}
#meeting-list-tabs.ui-tabs.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active {
margin-bottom: 0.2em;
padding-bottom: 0;
border-right: 1px solid #FFF;
background: #7AD03A;
background-color: #7AD03A;
background-color: #0A8ADD;
}
#meeting-list-tabs.ui-tabs.ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active a {
color: #000;
Expand All @@ -636,15 +671,13 @@ padding: 6px 3px !important;
}
#meeting-list-tabs.ui-state-default, #meeting-list-tabs.ui-widget-content .ui-state-default, #meeting-list-tabs.ui-widget-header .ui-state-default {
border: 1px solid #E5E5E5;
background: #495b4a;
background-color: #495b4a;
background: #0A61AD;
font-weight: normal;
color: #FFF;
}
#meeting-list-tabs .ui-accordion .ui-accordion-content {
border: 1px solid #E5E5E5 !important;
background-color: #FFF !important;
background: #FFF !important;
border-bottom-width: 0;
}
#meeting-list-tabs hr {
Expand Down Expand Up @@ -698,7 +731,7 @@ width: 4em !important;
color: #FFF !important;
}
h3.help-accordian { background-color: #F5F5F5 !important; color: #000 !important; font-weight: 400 !important; border: 1px solid #E5E5E5 !important;}
.help-accordian .ui-icon { background-color: #B80000; }
.help-accordian .ui-icon { background-color: #0A8ADD; }
.videocontent {
width:100%;
max-width: 100%;
Expand Down
Binary file added css/images/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added css/images/banner_rails.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed css/images/help-image.png
Binary file not shown.
Binary file added css/images/help-image2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 16 additions & 4 deletions js/bmlt_meeting_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,8 @@ var $ml = jQuery.noConflict
$ml("#container").removeClass('hide');
var meeting_sort_val = $ml("#meeting_sort").val();
if (meeting_sort_val === 'day' || meeting_sort_val === 'weekday_area' || meeting_sort_val === 'weekday_city' || meeting_sort_val === 'weekday_county') {
$ml('.weekday_language_div').show();
$ml('.weekday_start_div').show();
} else {
$ml('.weekday_language_div').hide();
$ml('.weekday_start_div').hide();
}
$ml('.borough_by_suffix').hide();
Expand All @@ -392,10 +390,8 @@ var $ml = jQuery.noConflict
$ml('.neighborhood_by_suffix').hide();
$ml('.city_by_suffix').hide();
if (meeting_sort_val === 'day' || meeting_sort_val === 'weekday_area' || meeting_sort_val === 'weekday_city' || meeting_sort_val === 'weekday_county') {
$ml('.weekday_language_div').show()
$ml('.weekday_start_div').show();
} else {
$ml('.weekday_language_div').hide();
$ml('.weekday_start_div').hide();
}
if (meeting_sort_val === 'borough_county') {
Expand Down Expand Up @@ -517,6 +513,7 @@ var $ml = jQuery.noConflict
$ml('#pagenodiv').hide();
$ml("#5inch, label[for=5inch]").hide();
$ml("#A5, label[for=A5]").hide();
$ml("#A6, label[for=A6]").hide();
$ml("#meeting-list-tabs ul li:eq(5)").hide();
$ml("#meeting-list-tabs ul li:eq(6)").show();
$ml('#meeting-list-tabs').tabs('disable', 5);
Expand All @@ -528,6 +525,7 @@ var $ml = jQuery.noConflict
} else {
$ml("#5inch, label[for=5inch]").hide();
$ml("#A5, label[for=A5]").hide();
$ml("#A6, label[for=A6]").hide();
$ml('#meeting-list-tabs').tabs('disable', 6);
$ml("#meeting-list-tabs ul li:eq(6)").hide();
}
Expand All @@ -545,6 +543,7 @@ var $ml = jQuery.noConflict
$ml('input[name=page_orientation]').val(['L']);
$ml("#5inch, label[for=5inch]").show();
$ml("#A5, label[for=A5]").show();
$ml("#A6, label[for=A6]").show();
$ml("#letter, label[for=letter]").hide();
$ml("#legal, label[for=legal]").hide();
$ml("#ledger, label[for=ledger]").hide();
Expand Down Expand Up @@ -596,6 +595,7 @@ var $ml = jQuery.noConflict
$ml('input[name=page_orientation]').val(['L']);
$ml("#5inch, label[for=5inch]").hide();
$ml("#A5, label[for=A5]").hide();
$ml("#A6, label[for=A6]").hide();
$ml("#letter, label[for=letter]").show();
$ml("#legal, label[for=legal]").show();
$ml("#ledger, label[for=ledger]").show();
Expand Down Expand Up @@ -699,6 +699,18 @@ var $ml = jQuery.noConflict
$ml('#extra_meetings').on('chosen:hiding_dropdown', function(evt, params) {
$ml(".ctrl_key").hide();
});
$ml("#author_chosen").chosen({
no_results_text: "Oops, nothing found!",
width: "100%",
placeholder_text_multiple: "Select authors",
search_contains: true
});
$ml('#author_chosen').on('chosen:showing_dropdown', function(evt, params) {
$ml(".ctrl_key").show();
});
$ml('#author_chosen').on('chosen:hiding_dropdown', function(evt, params) {
$ml(".ctrl_key").hide();
});
/*
$ml("#extra_meetings").select2({
//tags: "true",
Expand Down
52 changes: 46 additions & 6 deletions partials/_backup_restore_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,53 @@
<div id="postbox-container" class="postbox-container">
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
<div id="exportdiv" class="postbox">
<h3 class="hndle">Export Meeting List Settings</h3>
<h3 class="hndle">Configuration Manager</h3>
<div class="inside">
<p><?php _e( 'bread can support meeting lists. Each meeting list has an integer ID and a text description that help the user to identify ' ); ?>
<?php _e( 'the configuration (or \'settings\') that will be used to generate the meeting list. The ID of the configuration is used in the link ' );?>
<?php _e( 'that generates the meeting list (eg, ?current-meeting-list=2 generates the meeting list with ID 2.')?></p>
<h4>Current Meeting List</h4>
<form method="post">
<p>Meeting List ID: <?php echo $this->loaded_setting?>
<input type="hidden" name="pwsix_action" value="rename_setting" /><input type="hidden" name="current-meeting-list" value="<?php echo $this->loaded_setting?>" /></p>
<?php wp_nonce_field( 'pwsix_rename_nonce', 'pwsix_rename_nonce' ); ?>
<br>Configuration Name: <input type="text" name="setting_descr" value="<?php echo $this->allSettings[$this->loaded_setting]?>" />
<?php submit_button( __( 'Save Configuration Name' ), 'button-primary', 'submit', false ); ?>
</form></p>
<?php if (count($this->allSettings)>1) {?>
<h4>Configuration Selection</h4>
<form method="post">
<label for="current_setting">Select Configuration: </label>
<select class="setting_select" id="setting_select" name="current-meeting-list">
<?php foreach($this->allSettings as $aKey=>$aDescr){ ?>
<option <?php echo (($aKey==$this->loaded_setting)?'selected':"") ?> value="<?php echo $aKey ?>"><?php echo $aKey.': '.$aDescr ?></option>
<?php } ?>
</select>
<?php wp_nonce_field( 'pwsix_load_nonce', 'pwsix_load_nonce' ); ?>
<?php submit_button( __( 'Load Configuration' ), 'button-primary', 'submit', false ); ?>
</form>
<?php }?>
<hr/>
<form method="post">
<p><input type="hidden" name="pwsix_action" value="settings_admin" /><input type="hidden" name="current-meeting-list" value="<?php echo $this->loaded_setting?>" /></p></p>
<?php wp_nonce_field( 'pwsix_settings_admin_nonce', 'pwsix_settings_admin_nonce' ); ?>
<?php submit_button( __( 'Duplicate Current Configuration' ), 'button-primary', 'duplicate', false ); ?>
<?php if (1 < $this->loaded_setting) {?>
<?php submit_button( __( 'Delete Current Configuration' ), 'button-primary', 'delete', false ); ?>
<?php } ?>
</form>
</div>
</div>
</div>
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
<div id="exportdiv" class="postbox">
<h3 class="hndle">Export Configuration</h3>
<div class="inside">
<p><?php _e( 'Export or backup meeting list settings.' ); ?></p>
<p><?php _e( 'This allows you to easily import meeting list settings into another site.' ); ?></p>
<p><?php _e( 'Also useful for backing up before making significant changes to the meeting list settings.' ); ?></p>
<form method="post">
<p><input type="hidden" name="pwsix_action" value="export_settings" /></p>
<p><input type="hidden" name="pwsix_action" value="export_settings" /><input type="hidden" name="current-meeting-list" value="<?php echo $this->loaded_setting?>" /></p>
<p>
<?php wp_nonce_field( 'pwsix_export_nonce', 'pwsix_export_nonce' ); ?>
<?php submit_button( __( 'Export' ), 'button-primary', 'submit', false ); ?>
Expand All @@ -21,14 +61,14 @@
</div>
</div>
<div style="margin-bottom: 0px;" id="exportdiv" class="postbox">
<h3 class="hndle">Import Meeting List Settings</h3>
<h3 class="hndle">Import Configuration</h3>
<div class="inside">
<p><?php _e( 'Import meeting list settings from a previously exported meeting list.' ); ?></p>
<form id="form_import_file" method="post" enctype="multipart/form-data">
<p><input type="file" required name="import_file"/></p>
<p>
<input type="hidden" name="pwsix_action" value="import_settings" />
<?php wp_nonce_field( 'pwsix_import_nonce', 'pwsix_import_nonce' ); ?>
<input type="hidden" name="pwsix_action" value="import_settings" /><input type="hidden" name="current-meeting-list" value="<?php echo $this->loaded_setting?>" />
<?php wp_nonce_field( 'pwsix_import_nonce', 'pwsix_import_nonce' ); ?>
<?php submit_button( __( 'Import' ), 'button-primary', 'submit_import_file', false, array( 'id' => 'submit_import_file' ) ); ?>
</p>
<div id="basicModal">
Expand All @@ -44,4 +84,4 @@
</div>
</div>
<br class="clear">
</div>
</div>
31 changes: 27 additions & 4 deletions partials/_bmlt_server_setup.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
<?php
if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
die('Sorry, but you cannot access this page directly.');
} ?>
}
$all_users = get_users();
$specific_users = array();

foreach($all_users as $user){

if($user->has_cap('manage_bread')){
$specific_users[] = $user;
}

}
?>
<div id="poststuff">
<div id="postbox-container" class="postbox-container">
<div id="normal-sortables" class="meta-box-sortables ui-sortable">
Expand Down Expand Up @@ -185,15 +196,25 @@
</select>
<p>Hint: Type a group name, weekday or area to narrow down your choices.</p>
<div>
<input type="checkbox" name="extra_meetings_enabled" value="1" <?php echo ($this->options['extra_meetings_enabled'] == 1 ? 'checked' : '') ?> /> Extra Meetings Enabled
<input type="checkbox" name="extra_meetings_enabled" value="1" <?php echo (isset($this->options['extra_meetings_enabled']) && $this->options['extra_meetings_enabled'] == 1 ? 'checked' : '') ?> /> Extra Meetings Enabled
</div>
</div>

</div>
<div id="currentmeetinglistlinkdiv" class="postbox">
<h3 class="hndle">Current Meeting List Link<span title='<p>Share the "Current Meeting List Link" on your website, email, etc to generate this meeting list.</p>' class="tooltip"></span></h3>
<div class="inside">
<p><a target="_blank" href='<?php echo home_url() ?>/?current-meeting-list=1'><?php echo home_url() ?>/?current-meeting-list=1</a></p>
<p><a target="_blank" href='<?php echo home_url() ?>/?current-meeting-list=<?php echo $this->loaded_setting ?>'><?php echo home_url() ?>/?current-meeting-list=<?php echo $this->loaded_setting ?></a></p>
</div>
</div>
<div id="currentmeetinglistauthordiv" class="postbox">
<h3 class="hndle">Meeting List Author(s)</h3>
<div class="inside">
<select id="author_chosen" name="authors_select[]" multiple>
<?php foreach($specific_users as $user) { ?>
<option value="<?php echo $user->ID ?>" <?php echo in_array($user->ID, $this->authors_safe) ? 'selected=' :'' ?>><?php echo $user->user_firstname ?> <?php echo $user->user_lastname ?> (<?php echo $user->user_login ?>) </option>
<?php } ?>
</select>
</div>
</div>
<div id="meetinglistcachediv" class="postbox">
Expand All @@ -213,8 +234,10 @@
</div>
</div>
</div>
<?php if ($this->current_user_can_modify()) echo '
<input type="submit" value="Save Changes" id="bmltmeetinglistsave1" name="bmltmeetinglistsave" class="button-primary" />
<?php echo '<p style="display: inline; margin-top:.5em;margin-bottom:1.0em;margin-left:.2em;"><a target="_blank" class="button-primary" href="'.home_url() . '/?current-meeting-list=1">Generate Meeting List</a></p>'; ?>
';?>
<?php echo '<p style="display: inline; margin-top:.5em;margin-bottom:1.0em;margin-left:.2em;"><a target="_blank" class="button-primary" href="'.home_url() . '/?current-meeting-list='.$this->loaded_setting.'">Generate Meeting List</a></p>'; ?>
<div style="display:inline;"><i>&nbsp;&nbsp;Save Changes before Generate Meeting List.</i></div>
<br class="clear">
</div>
Expand Down
6 changes: 4 additions & 2 deletions partials/_custom_section_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
</div>
</div>
</div>
<input type="submit" value="Save Changes" id="bmltmeetinglistsave5" name="bmltmeetinglistsave" class="button-primary" />
<?php echo '<p style="display: inline; margin-top:.5em;margin-bottom:1.0em;margin-left:.2em;"><a target="_blank" class="button-primary" href="'.home_url() . '/?current-meeting-list=1">Generate Meeting List</a></p>'; ?>
<?php if ($this->current_user_can_modify()) echo '
<input type="submit" value="Save Changes" id="bmltmeetinglistsave1" name="bmltmeetinglistsave" class="button-primary" />
';?>
<?php echo '<p style="display: inline; margin-top:.5em;margin-bottom:1.0em;margin-left:.2em;"><a target="_blank" class="button-primary" href="'.home_url() . '/?current-meeting-list='.$this->loaded_setting.'">Generate Meeting List</a></p>'; ?>
<div style="display:inline;"><i>&nbsp;&nbsp;Save Changes before Generate Meeting List.</i></div>
</div>
6 changes: 4 additions & 2 deletions partials/_front_page_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
</div>
</div>
</div>
<input type="submit" value="Save Changes" id="bmltmeetinglistsave3" name="bmltmeetinglistsave" class="button-primary" />
<?php echo '<p style="display: inline; margin-top:.5em;margin-bottom:1.0em;margin-left:.2em;"><a target="_blank" class="button-primary" href="'.home_url() . '/?current-meeting-list=1">Generate Meeting List</a></p>'; ?>
<?php if ($this->current_user_can_modify()) echo '
<input type="submit" value="Save Changes" id="bmltmeetinglistsave1" name="bmltmeetinglistsave" class="button-primary" />
';?>
<?php echo '<p style="display: inline; margin-top:.5em;margin-bottom:1.0em;margin-left:.2em;"><a target="_blank" class="button-primary" href="'.home_url() . '/?current-meeting-list='.$this->loaded_setting.'">Generate Meeting List</a></p>'; ?>
<div style="display:inline;"><i>&nbsp;&nbsp;Save Changes before Generate Meeting List.</i></div>
<br class="clear">
</div>
6 changes: 4 additions & 2 deletions partials/_last_page_setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
</div>
</div>
</div>
<input type="submit" value="Save Changes" id="bmltmeetinglistsave6" name="bmltmeetinglistsave" class="button-primary" />
<?php echo '<p style="display: inline; margin-top:.5em;margin-bottom:1.0em;margin-left:.2em;"><a target="_blank" class="button-primary" href="'.home_url() . '/?current-meeting-list=1">Generate Meeting List</a></p>'; ?>
<?php if ($this->current_user_can_modify()) echo '
<input type="submit" value="Save Changes" id="bmltmeetinglistsave1" name="bmltmeetinglistsave" class="button-primary" />
';?>
<?php echo '<p style="display: inline; margin-top:.5em;margin-bottom:1.0em;margin-left:.2em;"><a target="_blank" class="button-primary" href="'.home_url() . '/?current-meeting-list='.$this->loaded_setting.'">Generate Meeting List</a></p>'; ?>
<div style="display:inline;"><i>&nbsp;&nbsp;Save Changes before Generate Meeting List.</i></div>
<br class="clear">
</div>
Loading

0 comments on commit 00d26a1

Please sign in to comment.