').appendTo('body')
.css('width', '225px')
.css('height', '170px')
.css('text-align', 'center')
.css('padding', '0.5em')
.position({my : "center center", at : "center center", of : window})
.addClass('ui-dialog ui-widget ui-widget-content ui-corner-all ui-front')
.html('
Publishing...

Please wait, this may take a while to process...
');
var publish_date = $('input[type="text"][name="publish_date"]', $(this)).val();
var publish_time = $('input[type="text"][name="publish_time"]', $(this)).val();
var data = {
publish_date : publish_date,
publish_time : publish_time
};
// Submit the change
var jqxhr = $.ajax(
{
type : 'POST',
url : '{{ url('/today/articles/' . $info['article']->id . '/publish') }}',
data : data,
dataType : 'html'
})
.done(function (data)
{
console.log('Publish was successful.');
// Reload of refresh is specified
location.reload();
})
.fail(function (jqXHR, status, error)
{
var response = jqXHR.responseText;
var errorData = $.parseJSON(response);
//console.log(errorData);
alert ("There was an error publishing the article.\n\nThis page will be reloaded.");
location.reload();
});
}
},
{
text : "Cancel",
'class' : "float_right",
'data-autofocus' : "true",
icons : { primary : 'ui-icon-cancel'},
click : function()
{
// Close the dialog box
$(this).dialog("close");
}
}
],
open : function ()
{
var dialog_object = $(this);
dialog_object.html('
Are you sure you want to publish this article?
Publishing this article will trigger its listing in the news feed. The author will automatically be notified of their article\'s publication.
');
$('.ui-dialog-buttonpane').css('padding', '0 0.5em').css('font-size', '9pt');
$('.ui-dialog-buttonpane .ui-dialog-buttonset').css('width', '100%');
var hour_handle = $('[name="hour_slider_handle"]', dialog_object);
hour_handle.css({
'width' : '3em',
'height' : '1.6em',
'top' : '50%',
'margin-top' : '-.8em',
'text-align' : 'center',
'line-height' : '1.6em'
});
var minute_handle = $('[name="minute_slider_handle"]', dialog_object);
minute_handle.css({
'width' : '3em',
'height' : '1.6em',
'top' : '50%',
'margin-top' : '-.8em',
'text-align' : 'center',
'line-height' : '1.6em'
});
function refreshPublishTime()
{
var hour = $('[name="hour_slider"]', dialog_object).slider("value");
var minute = $('[name="minute_slider"]', dialog_object).slider("value");
var terminus = "AM";
if (hour >= 12)
{
terminus = "PM";
}
if (hour == 0)
{
hour = 12;
}
if (hour > 12)
{
hour -= 12;
}
$('input[type="text"][name="publish_time"]', dialog_object).val(hour + ':' + (minute.toString()).padStart(2, '0') + ' ' + terminus);
}
$('input[type="text"][name="publish_date"]', dialog_object).datepicker({minDate: 0});
$('[name="hour_slider"]', dialog_object)
.css({'width' : '350px', 'display' : 'inline-block', 'margin-left' : '10px', 'top' : '3px'})
.slider({
min : 0,
max : 23,
step : 1,
range : "min",
change : refreshPublishTime,
create : function() {
var value = parseInt($(this).slider("value"));
if (value == 0)
{
value = 12;
}
if (value > 12)
{
value -= 12;
}
hour_handle.text(value);
},
slide : function(event, ui) {
var value = parseInt(ui.value);
if (value == 0)
{
value = 12;
}
if (value > 12)
{
value -= 12;
}
hour_handle.text(value);
}
});
$('[name="minute_slider"]', dialog_object)
.css({'width' : '350px', 'display' : 'inline-block', 'margin-left' : '10px', 'top' : '3px'})
.slider({
min : 0,
max : 59,
step : 1,
range : "min",
change : refreshPublishTime,
create : function() {
var value = parseInt($(this).slider("value"));
minute_handle.text((value.toString()).padStart(2, '0'));
},
slide : function(event, ui) {
var value = parseInt(ui.value);
minute_handle.text((value.toString()).padStart(2, '0'));
}
});
$('[data-autofocus="true"]').focus();
},
close : function ()
{
var dialog_object = $(this);
$(dialog_object).remove();
}
});
});
@endif
{{-- Make the article read-only if the author is not a publisher and the article is submitted or retired --}}
@if (!$info['author']->is_publisher and (!is_null($info['article']->submitted_at) or $info['article']->is_retired))
// Restrict some fields if submitted or retired and the author is not a publisher
var restricted = [
'#publisher',
'#title',
'#sub_title',
'#tags',
'#photo',
'#photo_caption',
'[data-action="preview"]',
'[data-action="save"]',
'[data-action="upload_photo"]',
'[data-action="delete_photo"]',
'.preview_button',
'.save_button',
'.submit_button',
'[data-limited-field]'
];
$.each(restricted, function(index, value)
{
var item = $(value);
// Replace text inputs
if (item.is('input[type="text"]'))
{
var text = item.val();
var width = item.width();
var replace = $('
').text(text)
.css({'width' : width + 'px',
'border-bottom' : '1px solid #666666',
'display' : 'inline-block'});
item.unbind();
item.replaceWith(replace);
}
// Replace select inputs
if (item.is('select'))
{
var option = $('option:selected', item);
var text = option.text();
var width = item.width();
var replace = $('
').text(text)
.css({'width' : width + 'px',
'border-bottom' : '1px solid #666666',
'display' : 'inline-block'});
item.unbind();
item.replaceWith(replace);
}
// Replace text-areas
if (item.is('textarea'))
{
var text = item.val();
var width = item.width();
var height = item.height();
var replace = $('
').text(text)
.css({'width' : width + 'px',
'min-height' : height + 'px',
'display' : 'inline-block'});
item.unbind();
item.replaceWith(replace);
}
// Disable button widgets
if (item.is('.ui-button'))
{
item.button("disable");
}
// Remove toolbar buttons
if (item.is(':button'))
{
if (item.parent().is('.ql-formats'))
{
item.remove();
}
}
// Disable file inputs
if (item.is('input[type="file"]'))
{
item.attr('disabled', 'disabled');
}
// Remove spans with limited text field helpers
if (item.is('span[data-length]'))
{
item.remove();
}
});
@endif
{{-- Check for jump_to session data --}}
@if (Session::has('jump_to'))
var jump_target_name = "{{ Session::get('jump_to') }}";
var target = $('a[name="' + jump_target_name + '"]');
var offset = target.offset().top;
var change = 42;
offset = offset - change;
$('html, body').animate({
scrollTop: offset
}, 400);
@endif
@stop
@section('page_functions')
Submit
Save
Preview
Close
@stop
@section('main_content')
{{-- Success Bar --}}
@if (Session::has('success'))
{{ Session::get('success') }}
@endif
{{-- Errors --}}
@if (Session::has('errors'))
@foreach ($errors->all() as $error)
{{ $error }}
@endforeach
@endif
Required fields are indicated with a red asterisk, *.
{{ Form::open(array('url' => url('/today/articles') . '/' . $info['article']->id . '/save',
'files' => true,
'id' => 'edit-article',
'name' => 'edit-article',
'method' => 'post')) }}
{{ Form::hidden('article_id', $info['article']->id) }}
Instructions for Editing News Articles
Use this form to edit the information for your news article. Once you have reviewed your article, click the Submit button to submit your article to a publisher for review. Once submitted, only publishers will be able to edit this article.
Author: {{ $info['author']->getName() }} - {{ $info['author']->getRole() }}
Submitted:
@if (is_null($info['article']->submitted_at))
Not Submitted
@else
{{ date('n/j/Y g:ia', strtotime($info['article']->submitted_at)) }}
@endif
Published:
@if ($info['article']->is_retired)
@if (is_null($info['article']->published_at))
Not Published - Retired Article
@else
{{ date('n/j/Y g:ia', strtotime($info['article']->published_at)) }} - Retired Article
@endif
@else
@if (is_null($info['article']->published_at))
Not Published
@else
{{ date('n/j/Y g:ia', strtotime($info['article']->published_at)) }}
@endif
@endif
@if (!$info['author']->is_publisher and (!is_null($info['article']->submitted_at) or $info['article']->is_retired))
@if ($info['article']->is_retired)
This Article Has Been Retired
The article is not included on any listing and cannot be viewed by the public.
@else
@if (is_null($info['article']->published_at))
This Article Has Been Submitted
Awaiting {{ ((is_null($info['publisher'])) ? 'publisher' : $info['publisher']->getName()) }} review. You cannot edit this article.
@else
This Article Has Been Published
{{ $info['publisher']->getName() }} has published this article. You cannot edit this article.
@endif
@endif
@endif
@if ($info['author']->is_publisher)
You are logged in as a publisher.
Publisher Information
{{ Form::label('author', 'Author') }}
{{ Form::select('author',
$info['authors'],
$info['article']->author,
array('data-autosave' => true,
'data-field' => 'author',
'data-type' => 'INT',
'data-original' => $info['article']->author,
'data-required' => true,
'style' => '')) }}
This person will appear as the article's author with contact information
@if (!$info['article']->is_retired and is_null($info['article']->published_at))
@endif
@if (is_null($info['article']->submitted_at))
 }})
This article is not yet submitted. You can submit this article and publish it at the same time by
clicking the
Publish Article button on the right. You can also edit this article.
@elseif (is_null($info['article']->published_at))
 }})
This article was submitted, but it has not been published yet. You can publish this article at any time by
clicking the
Publish Article button on the right. You can also edit this article.
@else
 }})
This article has been published. As a publisher, you can edit this article's information and/or content. Any changes will be viewable for this article once those changes are saved.
{{ Form::label('published_at', 'Published At') }}
{{ Form::text('published_at',
$info['article']->published_at,
array('data-autosave' => true,
'data-field' => 'published_at',
'data-type' => 'DATE-TIME',
'data-original' => $info['article']->published_at,
'data-required' => true,
'data-reload' => true,
'style' => '')) }}
YYYY-MM-DD hh:mm:ss formatted date/time (24-hour) of article's publication, a change will reload this page
@endif
{{ Form::label('is_retired', 'Retire Article', array('style' => 'width: 160px;')) }}
{{ Form::checkbox('is_retired',
true,
$info['article']->is_retired,
array('data-autosave' => true,
'data-field' => 'is_retired',
'data-type' => 'BOOL',
'data-reload' => true,
'style' => 'vertical-align: middle; margin-right: 20px;')) }}
Check this box to mark the article as retired - retired articles are essentially deleted
@endif
Content
{{ Form::label('publisher', 'Publisher') }}
{{ Form::select('publisher',
$info['publishers'],
$info['article']->publisher,
array('data-autosave' => true,
'data-field' => 'publisher',
'data-type' => 'INT',
'data-original' => $info['article']->publisher,
'style' => '')) }}
The publisher who will review this article prior to its listing on the website
{{ Form::label('title', 'Article Title') }}
The article's headline, max length of 64 characters
{{ Form::text('title',
$info['article']->title,
array('data-autosave' => true,
'data-field' => 'title',
'data-type' => 'STRING',
'data-original' => $info['article']->title,
'data-required' => true,
'data-format' => 'limited-length',
'maxlength' => 64,
'style' => 'width: 650px;')) }}
{{ Form::label('sub_title', 'Sub-Title') }}
The article's optional byline/sub-heading, max length of 128 characters
{{ Form::text('sub_title',
$info['article']->sub_title,
array('data-autosave' => true,
'data-field' => 'sub_title',
'data-type' => 'STRING',
'data-original' => $info['article']->sub_title,
'data-format' => 'limited-length',
'maxlength' => 128,
'style' => 'width: 1016px;')) }}
{{ Form::label('tags', 'Tags') }}
A comma separated list of topics or categories that describe the content
{{ Form::text('tags',
$info['article']->tags,
array('data-autosave' => true,
'data-field' => 'tags',
'data-type' => 'STRING',
'data-original' => $info['article']->tags,
'maxlength' => 255,
'style' => 'width: 512px; margin-right: 40px;')) }}
Ex: Football, 6A, Bedrock High School, Rules
Body Content
The article's main content. Type in text or paste content from a word processor. Formatting options include justification, typographic emphasis (bold, italic, underscore, strike-through, color, sub-script, super-script), lists (bulleted or numbered), tabbing, HTML links, and block quotations. Cannot contain images, videos, or other multi-media content.
@if (!Helpers::strIsEmpty($info['article']->body))
{{ $info['article']->body }}
@endif
@if (Helpers::strIsEmpty($info['article']->photo_path))
No photo uploaded
![]()
@else
 }}?t={{ time() }})
@endif
{{ Form::label('photo', 'Article Photo') }}
@if (Helpers::strIsEmpty($info['article']->photo_path))
Max 1 image
@else
A photo has been uploaded and attached to this article
@endif
{{ Form::file('photo', array('name' => 'photo', 'id' => 'photo')) }}
{{ Form::label('photo_caption', 'Photo Caption') }}
If a photo is included with this article, this text captions the photo (photo credit), max length of 128 characters
{{ Form::text('photo_caption',
$info['article']->photo_caption,
array('data-autosave' => true,
'data-field' => 'photo_caption',
'data-type' => 'STRING',
'data-original' => $info['article']->photo_caption,
'data-format' => 'limited-length',
'maxlength' => 128,
'style' => 'width: 700px;')) }}
Image file specifications:
- Max file size:less than 4 MB
- Image file extensions:.jpg, .jpeg., .gif, or .png
- Preferred aspect radio:1.6 : 1 (W:H)
- Maximum dimensions:850px (W) x 533px (H)
- Minimum width:adjusted to 500px (W)
News articles can have one image attached that displays at the top of the article before the body content. Choose your file to upload and a preview will be displayed. Click the Upload button to save the image to this article. To replace an existing photo, upload a new image. To remove a photo, click the Delete Photo button.
Submit
Save
Preview
Close
{{ Form::close() }}
@stop