Jump to content


Click here to lend your support to: Traq and make a donation at pledgie.com !
Photo

Need help with own theme

theme bootstrap input admincp form

  • Please log in to reply
32 replies to this topic

#1 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 31 July 2014 - 12:14 AM

Hello can somebody help me,

 

I started making my own theme for Traq based on Bootstrap.

Everything is fine but i cant find a way to add a class to an input tag:

Form::text('settings[title]', array('value' => settings('title')));

need to get:

class="form-control"

and where can i find the id's of these input tags

 

Oh and btw you can find my theme on github: https://github.com/p...aster/bootstrap


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#2 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 31 July 2014 - 07:14 AM

Adding a class ID to or change the ID of any Form or HTML helper created element can be done like so:

<?php echo Form::text('name', array('value' => $user->name, 'class' => "form-control", 'id' => "users_name")); ?>

Most, if not all, HTML and Form helper methods can have classes added to them this way. For example, the "Form::text(...)" method is a shortcut to the "Form::input(...)" method just like most of the other form helper methods, so it's exactly the same as the above.

 

Documentation for classes and functions for Traq 3.x and its framework is, well, complete crap. This however will be changing with Traq 4.0. Until then, hopefully the docblocks and code comments will be able to help, even if only a little.



#3 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 31 July 2014 - 10:09 AM

Thank you very much it worked :D


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#4 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 31 July 2014 - 01:21 PM

Can you take a look, I want to know if you like it already :D

 

 

Attached Files


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#5 timoline

timoline

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 31 July 2014 - 02:32 PM

I Like it !

#6 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 31 July 2014 - 03:21 PM

Thnx :D


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#7 timoline

timoline

    Newbie

  • Members
  • Pip
  • 9 posts

Posted 31 July 2014 - 04:02 PM

I'm new here and try to read as many as possible, but how to install this theme after downloading it from github?

 

edit: aha found it...copy to views folder and select theme in admincp :)



#8 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 02 August 2014 - 03:34 AM

Ey timoline, I updated allot things including your idea please download the new one and tell me what you think about it already

On the Roles and Users page are all functions working already


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#9 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 02 August 2014 - 03:41 AM

You can also try it at http://bugs.alphasloth.tk and login with username: demo and password: demo


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#10 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 02 August 2014 - 01:07 PM

Hello is there anybody who can help me with the folowing:
Im trying to show the users name into the navbar but the folowing code will only work if I load the usercp page, else it will not show anything but if i logout i will say "Not logged in" so that part is working.
This is the code:

<?php if (LOGGEDIN) { echo ($user->name); } else { echo ('Not logged in'); } ?>

Full _meta_nav.phtml code:

<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php if (LOGGEDIN) { echo ($user->name); } else { echo ('Not logged in'); } ?><i class="fa fa-user fa-lg"></i><span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<?php FishHook::run('template:layouts/_meta_nav/user_nav'); ?>
<?php if (LOGGEDIN) { ?>
<li<?php echo iif(active_nav(current_user()->href()), ' class="active"')?>><?php echo HTML::link(l('profile'), current_user()->href()) ?></li>
<li<?php echo iif(active_nav('/usercp'), ' class="active"')?>><?php echo HTML::link(l('usercp'), '/usercp'); ?></li>
<?php if ($current_user->group->is_admin) { ?>
<li<?php echo iif(active_nav('/admin(.*)'), ' class="active"')?>><?php echo HTML::link(l('admincp'), '/admin'); ?></li>
<?php } ?>
<li class="divider"></li>
<li><?php echo HTML::link(l('logout'), '/logout'); ?></li>
<?php } else { ?>
<li<?php echo iif(active_nav('/login'), ' class="active"')?>><?php echo HTML::link(l('login'), '/login'); ?></li>
<?php if (settings('allow_registration')) { ?>
<li<?php echo iif(active_nav('/register'), ' class="active"')?>><?php echo HTML::link(l('register'), '/register'); ?></li>
<?php } ?>
<?php } ?>
</ul>
</li>

Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#11 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 02 August 2014 - 01:35 PM

 

Hello is there anybody who can help me with the folowing:
Im trying to show the users name into the navbar but the folowing code will only work if I load the usercp page, else it will not show anything but if i logout i will say "Not logged in" so that part is working.

 

Try "$current_user", which is available on all pages when a user is logged in. The "$user" variable is only used when on the UserCP and New/Edit User pages in the AdminCP.



#12 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 03 August 2014 - 11:09 PM

Thank you very very very much. The AdminCP is almost done. But one last question timoline is helping me now but we cant find a way to use the modal from bootstrap for edit forms in the AdminCP


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#13 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 04 August 2014 - 02:46 AM

 use the modal from bootstrap for edit forms

 

This is the part that is going to require a bit more work.

 

Could try taking a look at the remote-content for the Bootstrap modal, or one of the 3rd party libraries that add some extra remote-modal functionality.



#14 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 04 August 2014 - 10:59 PM

Okay I will try to find something but do you like it already?


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#15 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 04 August 2014 - 11:27 PM

Alright there is already a simple way to do this now i only need to test it and inplent it


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#16 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 04 August 2014 - 11:39 PM

Alright you really need to help me because this should work:

<?php echo HTML::link(l('new_user'), '/admin/users/new', array('class' => 'btn btn-primary', 'data-toggle' => 'modal', 'data-target' => '#myModal')) ; ?>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 <h4 class="modal-title">Modal title</h4>

</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->

But it does give me a view error: Attached File  error.png   9.86KB   0 downloads


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#17 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 05 August 2014 - 12:21 AM

Alright i found a way :D

edit: please come and try it out: http://bugs.thealpha....tk/admin/roles and login with username: demo password: demo

oh and users is working to :D


Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#18 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 05 August 2014 - 12:48 AM

Looking good.

 

If it's trying to load views as a JavaScript file you may need to add "?overlay=true" to the end of the URL. 



#19 paulhobbel

paulhobbel

    Member

  • Members
  • PipPip
  • 28 posts

Posted 05 August 2014 - 05:31 AM

How do you mean did i forget something because when im adding ?overlay=true then it will just give me the default page not the overlay one

Bootstrap Theme for Traq here | Dutch Translation for Traq here | Theme demo here


#20 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 05 August 2014 - 01:03 PM

The way the default theme fetches overlay views is via JavaScript with the added "overlay=true", but it appears you have it all working after taking a look at the demo site you have setup.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users