region > homePage
6091
@Action(
            semantics = SemanticsOf.SAFE
    )
    @HomePage
    public FullCalendar2WicketToDoAppDashboard lookup() {
        return container.newViewModelInstance(FullCalendar2WicketToDoAppDashboard.class, ID);
    }
42495
def init():
    ""

    if not os.path.exists('site.cfg'):
        f = open('site.cfg', 'w')
        f.write(SITECFG)
        f.close()

    try:
        os.mkdir('queries')
    except OSError:
        pass

    try:
        os.mkdir('templates')
    except OSError:
        pass

    htmlfile = os.path.join('templates', 'homepage.html')
    if not os.path.exists(htmlfile):
        f = open(htmlfile, 'w')
        f.write("""
<!doctype html>
<html>
    <head>
        <title>Chill</title>
    </head>
    <body>
        <p>{{ homepage_content }}</p>
    </body>
</html>
        """)
        f.close()

    app = make_app(config='site.cfg', DEBUG=True)

    with app.app_context():
        app.logger.info("initializing database")
        init_db()

        homepage = insert_node(name='homepage', value=None)
        insert_route(path='/', node_id=homepage)
        insert_query(name='select_link_node_from_node.sql', node_id=homepage)

        add_template_for_node('homepage.html', homepage)

        homepage_content = insert_node(name='homepage_content', value="Cascading, Highly Irrelevant, Lost Llamas")
        insert_node_node(node_id=homepage, target_node_id=homepage_content)
543156
@Override
    public void addPages() {
        super.addPages();
        mainPage = new ExportWizardPage("Bug Counts Export", TITLE, DESCRIPTION, "icons/export_bugs.png");
        addPage(mainPage);
        setWindowTitle(mainPage.getName());
    }
541771
@Override
    public Page<UsageRecord> nextPage(final Page<UsageRecord> page, 
                                      final TwilioRestClient client) {
        Request request = new Request(
            HttpMethod.GET,
            page.getNextPageUrl(
                Domains.WIRELESS.toString(),
                client.getRegion()
            )
        );
        return pageForRequest(client, request);
    }
844016
@Override
    public Page<User> nextPage(final Page<User> page, 
                               final TwilioRestClient client) {
        Request request = new Request(
            HttpMethod.GET,
            page.getNextPageUrl(
                Domains.IPMESSAGING.toString(),
                client.getRegion()
            )
        );
        return pageForRequest(client, request);
    }
296231
function title(cb) {
    cb((params.sitemap && params.sitemap[page]) ?
      params.sitemap[page].title :
      '[error] page ' + page + ' does not have any sitemap title');
  }
63881
public function actionIndex()
	{
		$this->pageTitle = Yii::t('phrase', 'Main | Dora. - Coming Soon Page Template');
		$this->pageDescription = '';
		$this->pageMeta = '';
		$this->render('/dora/site/front_index');
	}
1364220
public function frontpage() {
        global $CFG, $SITE;

        $output = '';

        if (isloggedin() and !isguestuser() and isset($CFG->frontpageloggedin)) {
            $frontpagelayout = $CFG->frontpageloggedin;
        } else {
            $frontpagelayout = $CFG->frontpage;
        }

        foreach (explode(',', $frontpagelayout) as $v) {
            switch ($v) {
                // Display the main part of the front page.
                case FRONTPAGENEWS:
                    if ($SITE->newsitems) {
                        // Print forums only when needed.
                        require_once($CFG->dirroot .'/mod/forum/lib.php');
                        if (($newsforum = forum_get_course_forum($SITE->id, 'news')) &&
                                ($forumcontents = $this->frontpage_news($newsforum))) {
                            $newsforumcm = get_fast_modinfo($SITE)->instances['forum'][$newsforum->id];
                            $output .= $this->frontpage_part('skipsitenews', 'site-news-forum',
                                $newsforumcm->get_formatted_name(), $forumcontents);
                        }
                    }
                    break;

                case FRONTPAGEENROLLEDCOURSELIST:
                    $mycourseshtml = $this->frontpage_my_courses();
                    if (!empty($mycourseshtml)) {
                        $output .= $this->frontpage_part('skipmycourses', 'frontpage-course-list',
                            get_string('mycourses'), $mycourseshtml);
                    }
                    break;

                case FRONTPAGEALLCOURSELIST:
                    $availablecourseshtml = $this->frontpage_available_courses();
                    $output .= $this->frontpage_part('skipavailablecourses', 'frontpage-available-course-list',
                        get_string('availablecourses'), $availablecourseshtml);
                    break;

                case FRONTPAGECATEGORYNAMES:
                    $output .= $this->frontpage_part('skipcategories', 'frontpage-category-names',
                        get_string('categories'), $this->frontpage_categories_list());
                    break;

                case FRONTPAGECATEGORYCOMBO:
                    $output .= $this->frontpage_part('skipcourses', 'frontpage-category-combo',
                        get_string('courses'), $this->frontpage_combo_list());
                    break;

                case FRONTPAGECOURSESEARCH:
                    $output .= $this->box($this->course_search_form('', 'short'), 'mdl-align');
                    break;

            }
            $output .= '<br />';
        }

        return $output;
    }
129028
def homepage_view(request, message=None):
    '''  '''
    userProfile = UserProfile.objects.get(user=request.user)
    request_types = RequestType.objects.filter(enabled=True)
    # List of request types for which the user is a relevant manager
    manager_request_types = list()
    for request_type in request_types:
        for position in request_type.managers.filter(active=True):
            if userProfile == position.incumbent:
                manager_request_types.append(request_type)
                break
    # Pseudo-dictionary, list with items of form (request_type, (request,
    # [list_of_request_responses], response_form))
    requests_dict = list()
    # Generate a dict of open requests for each request_type for which the user
    # is a relevant manager:
    if manager_request_types:
        for request_type in manager_request_types:
            # Items of form (request, [list_of_request_responses],
            # response_form, upvote, vote_form)
            requests_list = list()
            # Select only open requests of type request_type:
            requests = Request.objects.filter(
                request_type=request_type, status=Request.OPEN,
                )
            for req in requests:
                response_form = ManagerResponseForm(
                    request.POST if "add_response-{0}".format(req.pk) in request.POST else None,
                    initial={'action': Response.NONE},
                    profile=userProfile,
                    request=req,
                    prefix="{}-response".format(req.pk),
                    )
                vote_form = VoteForm(
                    request.POST if "vote-{0}".format(req.pk) in request.POST else None,
                    profile=userProfile,
                    request=req,
                    prefix="vote",
                    )

                if response_form.is_valid():
                    response = response_form.save()
                    if response.request.closed:
                        messages.add_message(request, messages.SUCCESS,
                                             MESSAGES['REQ_CLOSED'])
                    if response.request.filled:
                        messages.add_message(request, messages.SUCCESS,
                                             MESSAGES['REQ_FILLED'])
                    return HttpResponseRedirect(reverse('homepage'))
                if vote_form.is_valid():
                    vote_form.save()
                    return HttpResponseRedirect(reverse('homepage'))

                response_list = Response.objects.filter(request=req)
                upvote = userProfile in req.upvotes.all()
                requests_list.append(
                    (req, response_list, response_form, upvote, vote_form)
                    )
            requests_dict.append((request_type, requests_list))

    ### Announcements
    # Pseudo-dictionary, list with items of form (announcement,
    # announcement_unpin_form)
    announcements_dict = list()

    # Oldest genesis of an unpinned announcement to be displayed.
    within_life = now() - timedelta(hours=settings.ANNOUNCEMENT_LIFE)
    announcements = \
      list(Announcement.objects.filter(pinned=True)) + \
      list(Announcement.objects.filter(pinned=False, post_date__gte=within_life))
    for a in announcements:
        pin_form = None
        if request.user.is_superuser or a.manager.incumbent == userProfile:
            pin_form = PinForm(
                request.POST if "pin-{0}".format(a.pk) in request.POST else None,
                instance=a,
                prefix="pin",
                )
            if pin_form.is_valid():
                pin_form.save()
                return HttpResponseRedirect(reverse('homepage'))
        announcements_dict.append((a, pin_form))

    if Manager.objects.filter(incumbent=userProfile, active=True).count():
        announcement_form = AnnouncementForm(
            request.POST if "post_announcement" in request.POST else None,
            profile=userProfile,
            prefix="announce",
            )
    else:
        announcement_form = None

    if announcement_form and announcement_form.is_valid():
        announcement_form.save(request)
        return HttpResponseRedirect(reverse('homepage'))

    ### Events
    week_from_now = now() + timedelta(days=7)
    # Get only next 7 days of events:
    events_list = Event.objects.exclude(
        start_time__gte=week_from_now
    ).exclude(
        end_time__lte=now(),
    )
    # Pseudo-dictionary, list with items of form (event, ongoing, rsvpd, rsvp_form)
    events_dict = list()
    for event in events_list:
        ongoing = ((event.start_time <= now()) and (event.end_time >= now()))
        rsvpd = (userProfile in event.rsvps.all())

        rsvp_form = RsvpForm(
            request.POST if "rsvp-{0}".format(event.pk) in request.POST else None,
            profile=userProfile,
            instance=event,
            prefix="rsvp",
            )

        if rsvp_form.is_valid():
            rsvpd = rsvp_form.save()
            if not rsvpd:
                message = MESSAGES['RSVP_REMOVE'].format(event=event.title)
                messages.add_message(request, messages.SUCCESS, message)
            else:
                message = MESSAGES['RSVP_ADD'].format(event=event.title)
                messages.add_message(request, messages.SUCCESS, message)
            return HttpResponseRedirect(reverse('homepage'))

        events_dict.append((event, ongoing, rsvpd, rsvp_form))

    ### Threads
    thread_form = ThreadForm(
        request.POST if "submit_thread_form" in request.POST else None,
        profile=userProfile,
        prefix="thread",
        )
    if thread_form.is_valid():
        thread_form.save()
        return HttpResponseRedirect(reverse('homepage'))

    # List of with items of form (thread, most_recent_message_in_thread)
    thread_set = []
    for thread in Thread.objects.all()[:settings.HOME_MAX_THREADS]:
        try:
            latest_message = Message.objects.filter(thread=thread).latest('post_date')
        except Message.DoesNotExist:
            latest_message = None
        thread_set.append((thread, latest_message))

    return render_to_response('homepage.html', {
        'page_name': "Home",
        'requests_dict': requests_dict,
        'announcements_dict': announcements_dict,
        'announcement_form': announcement_form,
        'events_dict': events_dict,
        'thread_set': thread_set,
        'thread_form': thread_form,
        }, context_instance=RequestContext(request))
361654
public function index()
    {
        error_reporting(0);
        header('Content-type: text/plain');
        set_time_limit(100);

        //get inputs
        $sessionId = $_REQUEST["sessionId"];
        $serviceCode = $_REQUEST["serviceCode"];
        $phoneNumber = $_REQUEST["phoneNumber"];
        $text = $_REQUEST["text"];   //


        $data = ['phone' => $phoneNumber, 'text' => $text, 'service_code' => $serviceCode, 'session_id' => $sessionId];
//        print_r($data);
//        exit;
        //log USSD request
        ussd_logs::create($data);

        //verify that the user exists
        $no = substr($phoneNumber, -9);

        $user = ussd_user::where('phone', "0" . $no)->orWhere('phone', "254" . $no)->first();

        if (!$user) {
            //if user phone doesn't exist, we check out if they have been registered to mifos
            $usr = array();
            $usr['phone'] = "0".$no;
            $usr['session'] = 0;
            $usr['progress'] = 0;
            $usr['confirm_from'] = 0;
            $usr['menu_item_id'] = 0;

            $user = ussd_user::create($usr);
        }

        if (self::user_is_starting($text)) {
            //lets get the home menu
            //reset user
            self::resetUser($user);
            //user authentication
            $message = '';

                $response = self::getMenuAndItems($user,1);
        
            //get the home menu
            self::sendResponse($response, 1, $user);
        } else {

            //message is the latest stuff
            $result = explode("*", $text);
            if (empty($result)) {
                $message = $text;
            } else {
                end($result);
                // move the internal pointer to the end of the array
                $message = current($result);
            }

            switch ($user->session) {

                case 0 :
                    //neutral user
                    break;
                case 1 :
                    $response = self::continueUssdMenuProcess($user, $message);
                    //echo "Main Menu";
                    break;
                case 2 :
                    //confirm USSD Process
                    $response = self::confirmUssdProcess($user, $message);
                    break;
                case 3 :
                    //Go back menu
                    $response = self::confirmGoBack($user, $message);
                    break;
                case 4 :
                    //Go back menu
                    $response = self::confirmGoBack($user, $message);
                    break;
                default:
                    break;
            }

            self::sendResponse($response, 1, $user);
        }

    }
229361
@Override
    public Page<AvailablePhoneNumberCountry> nextPage(final Page<AvailablePhoneNumberCountry> page, 
                                                      final TwilioRestClient client) {
        Request request = new Request(
            HttpMethod.GET,
            page.getNextPageUrl(
                Domains.API.toString(),
                client.getRegion()
            )
        );
        return pageForRequest(client, request);
    }
1071391
def home(request):
    """"""
    recent_uploads = Dataset.objects.order_by('-date_uploaded')[:11]

    email_list = [upload.uploaded_by.strip() for upload in recent_uploads]
    # print all_staff

    emails_names = grab_names_from_emails(email_list)
    # print emails_names

    for upload in recent_uploads:
        for item in emails_names:
            if upload.uploaded_by == item:
                upload.fullName = emails_names[item]

    for upload in recent_uploads:
        if not hasattr(upload, 'fullName'):
            upload.fullName = upload.uploaded_by

    return render(
        request,
        'datafreezer/home.html',
        {
            'recent_uploads': recent_uploads,
            'heading': 'Most Recent Uploads'
        }
    )
1322500
@Override
    public Page<ShortCode> previousPage(final Page<ShortCode> page, 
                                        final TwilioRestClient client) {
        Request request = new Request(
            HttpMethod.GET,
            page.getPreviousPageUrl(
                Domains.MESSAGING.toString(),
                client.getRegion()
            )
        );
        return pageForRequest(client, request);
    }
1242144
function Home() {
  // option hash values are set in the routes index.js module
  // and shared by all routing modules.
  this.options = {title: 'Default', randomQuote: false}; // Default value only.

  this.routeMe = function(req, res) {
    var fileName = req.params[0];
    res.render('home', { title: this.options.title });
    return;
  };
}
496204
public function home()
    {
        $this->loadModel('Content.Contents');
        $contents = $this->Contents
            ->find('all')
            ->where([
                'Contents.promote' => 1,
                'Contents.status >' => 0,
                'Contents.language IN' => ['', null, I18n::locale()]
            ])
            ->order(['Contents.sticky' => 'DESC', 'Contents.created' => 'DESC'])
            ->limit((int)option('site_contents_home'));

        $this->set('contents', $contents);
        $this->viewMode('teaser');
    }
1174857
public function index()
    {
        $this->loadModel('Menu.MenuLinks');
        $links = $this->MenuLinks
            ->find('threaded')
            ->where([
                'parent_id IN' => $this->MenuLinks
                    ->find()
                    ->select(['id'])
                    ->where(['url' => '/admin/system/structure'])
            ])
            ->all();

        $this->title(__d('system', 'Site’s Structure'));
        $this->set('links', $links);
        $this->Breadcrumb->push('/admin/system/structure');
    }
1020063
def index
      redirect_to home_path unless @group.member?(current_user)
      @reports = @group.reports.order(reported_at: :desc).page(params[:page]).per(10)
    end