Glchriste / Tutoring-Application

A web application that allows students to make appointments with tutors in the CCI tutoring center.
0 stars 1 forks source link

Doubt regarding displaying the availability #3

Open chinmai-padalkar opened 10 years ago

chinmai-padalkar commented 10 years ago

Hello Grace,

I am trying to use appointment dots for showing the availability of tutors.Can you please explain me the detailed flow to do it. (Basically I want to know how those blue dots appear for appointments)

Thank you.

Best, Chinmai

Glchriste commented 10 years ago

Hi Chinmai,

The blue dots are drawn in month-day.html (found in the folder static -> tmpls -> month-day.html.) The css class that makes the dots blue is called event-primary and the css class that makes the events green is called event-success. Depending on whether or not the user looking at the calendar is a tutor (blue-dots shown) or a student (green-dots shown), different events are shown. The code for this "dot filtering" is in month-day.html. The code that checks to see what type of user is logged in is in index.html and is as follows:

{% if user.is_authenticated %}
    Logged in as: {{ user.username }}
    {% if user.username == 'student' %}
        <script>
            window.student = true;
            window.tutor = false;
            window.filter = false;
            // console.log('Logged in as student');
        </script>
    {% elif user.username == 'admin' or user.username == 'tutor' %}
        <script>
            window.student = false;
            window.tutor = true;
            window.filter = false;
            // console.log('Logged in as tutor');
        </script>
    {% endif %}
{% else %}
    <script>
        window.student = false;
        window.tutor = false;
        window.filter = false;
    </script>
{% endif %}
richnguyen commented 10 years ago

Thanks Grace for helping Chinmai with this. Hope everything is going well for you!


N. Rich Nguyen | Student Career Manager College of Computing and Informatics | UNC Charlotte 207 Woodward Hall | Phone: 704 867 0304 N.Nguyen@uncc.edumailto:N.Nguyen@uncc.edu | cci.uncc.eduhttp://cci.uncc.edu

On Jun 29, 2014, at 8:11 PM, "Grace C" notifications@github.com<mailto:notifications@github.com> wrote:

Hi Chinmai,

The blue dots are drawn in 'month-day.html' (found in the folder 'static' -> 'tmpls' -> 'month-day.html'.) The css class that makes the dots blue is called "event-primary" and the css class that makes the events green is called "event-success". Depending on whether or not the user looking at the calendar is a tutor (blue-dots shown) or a student (green-dots shown), different events are shown. The code for this "dot filtering" is in month-day.html. The code that checks to see what type of user is logged in is in 'index.html' and is as follows:

{% if user.ishttp://user.is_authenticated %} Logged in as: {{ user.username }} {% if user.username == 'student' %}

{% elif user.username == 'admin' or user.username == 'tutor' %}
    <script>
        window.student = false;
        window.tutor = true;
        window.filter = false;
        // console.log('Logged in as tutor');
    </script>
{% endif %}

{% else %}

{% endif %}

Reply to this email directly or view it on GitHubhttps://github.com/Glchriste/Tutoring-Application/issues/3#issuecomment-47485236.

chinmai-padalkar commented 10 years ago

Thanks Grace. That was really helpful. Initially, I was able to figure out only the css file. I was missing out the month-day.html file. I will try using this logic for the search functionality.

Thanks again!