Skip to content

Commit

Permalink
Add information content to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
colinschoen committed Jun 6, 2016
1 parent 6d6244a commit c53925d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
4 changes: 3 additions & 1 deletion app/Http/Controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use App\User;
use App\Audit;
use App\Announcement;
use App\Setting;
use Illuminate\Routing\Controller;

class IndexController extends Controller {
Expand Down Expand Up @@ -176,7 +177,8 @@ public function post_registration()
}

public function get_information() {
return view("information");
$informationContent = Setting::getValue("information_content");
return view("information")->with(array("informationContent" => $informationContent));
}

}
7 changes: 5 additions & 2 deletions app/Http/Controllers/TAController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ public function get_console() {
}
}
}
//And one more setting
//Add some settings
$allowSectionSignups = Setting::getValue("allow_section_signups");
return view("ta.console")->with(["allowSectionSignups" => $allowSectionSignups, "yourLabAssistantsEmails" => $yourLabAssistantsEmails, "yourLabAssistantsNames" => $yourLabAssistantsNames, "double_booked" => $double_booked, "over_hours" => $over_hours, "under_hours" => $under_hours, "assigned_hours" => $assigned_hours,"sections" => $sections, "user_hours" => $user_hours, "checkins_unique_per_week" => $checkins_unique_per_week, "checkins_per_staff" => $checkins_per_staff,"checkins_per_week" => $checkins_per_week, "audits" => $audits, "announcements_ta" => $announcements, "gsis" => $gsis, "types" => $types, "checkins" => $checkins, "users" => $users, "password" => $password]);
$informationContent = Setting::getValue("information_content");
return view("ta.console")->with(["informationContent" => $informationContent, "allowSectionSignups" => $allowSectionSignups, "yourLabAssistantsEmails" => $yourLabAssistantsEmails, "yourLabAssistantsNames" => $yourLabAssistantsNames, "double_booked" => $double_booked, "over_hours" => $over_hours, "under_hours" => $under_hours, "assigned_hours" => $assigned_hours,"sections" => $sections, "user_hours" => $user_hours, "checkins_unique_per_week" => $checkins_unique_per_week, "checkins_per_staff" => $checkins_per_staff,"checkins_per_week" => $checkins_per_week, "audits" => $audits, "announcements_ta" => $announcements, "gsis" => $gsis, "types" => $types, "checkins" => $checkins, "users" => $users, "password" => $password]);
}

public function post_update_password() {
Expand Down Expand Up @@ -679,6 +680,8 @@ public function post_settings_save() {
else {
Setting::change("allow_section_signups", 0);
}
$informationContent = Request::input('inputInformationContent');
Setting::change("information_content", $informationContent);
return redirect()->route("taconsole")->with("message", "The settings were saved successfully.");
}

Expand Down
2 changes: 1 addition & 1 deletion app/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function getCreatedAtAttribute($value)
{
return Carbon::createFromTimestamp(strtotime($value))
->timezone('America/Los_Angeles')
->toDateTimeString();
->toDateTimeString();
}

public static function getValue($name)
Expand Down
1 change: 1 addition & 0 deletions resources/views/core/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<script src="/packages/pickadate/picker.js"></script>
<script src="/packages/pickadate/picker.date.js"></script>
<script src="/packages/pickadate/picker.time.js"></script>
<script src="/packages/ckeditor/ckeditor.js"></script>
<script>
$(function() {
@yield('js')
Expand Down
8 changes: 3 additions & 5 deletions resources/views/information.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
<div class="col-lg-12">
<div class="well">
<div class="alert alert-info">Welcome to the {{ trans("global.class") }} Lab Assistant Management Platform.</div>
<p>{{ trans("global.class") }} Lab Assistant Meeting Slides: <a href="{{ url("meeting/slides") }}"><strong>{{ url("meeting/slides") }}</strong></a></p>
<p>If you are a lab assistant please <a target="_blank" href="{{ route("registration") }}">register</a> an account prior to your first day assisting in
the labs. You will be required to check in <strong>(when you are physically lab assisting with a present GSI)</strong> using this system every time you assist in the labs, office hours and other course functions
in order to receive hours credit. Once you have registered an account you can <a target="_blank" href="{{ route("login") }}">login</a> and use the
<a target="_blank" href="{{ route("lacheckin") }}">check in</a> form as well as view your attendance history. Please direct any questions to <a target="_blank" href="https://piazza.com/class/i99jqe1hfat3nb">Piazza</a>.</p>
<div>
{!! $informationContent !!}
</div>
<hr />
<iframe src="https://ghbtns.com/github-btn.html?user=colinschoen&repo=Check-In&type=fork&count=true&size=large" frameborder="0" scrolling="0" width="158px" height="30px"></iframe>
<p><small>Developed by Colin Schoen</small></p>
Expand Down
5 changes: 5 additions & 0 deletions resources/views/ta/console.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@
<label>Allow Section Signups:</label>
<input type="checkbox" name="inputAllowSectionSignups" value="1" @if ($allowSectionSignups == 1) checked="checked" @endif />
</div>
<div class="form-group">
<label>Information Content:</label>
<textarea name="inputInformationContent" id="informationContentTextArea" rows="10">{!! $informationContent !!}</textarea>
</div>
<input type="submit" value="Save" class="btn btn-success" />
</form>
</div>
Expand Down Expand Up @@ -668,6 +672,7 @@
$('#editSectionInputEndTime').pickatime();

$('#auditLogTable').DataTable();
CKEDITOR.replace('informationContentTextArea');

$('#announcementNewBtn').on('click', function() {
$('#announcementNewForm').slideToggle();
Expand Down

0 comments on commit c53925d

Please sign in to comment.