Skip to content

Add basic support for sass/scss files to Template manager editing#9871

Closed
brianteeman wants to merge 11 commits intojoomla:stagingfrom
brianteeman:sass2
Closed

Add basic support for sass/scss files to Template manager editing#9871
brianteeman wants to merge 11 commits intojoomla:stagingfrom
brianteeman:sass2

Conversation

@brianteeman
Copy link
Copy Markdown
Contributor

@brianteeman brianteeman commented Apr 12, 2016

Summary of Changes

Add ability to see sass files in the list of available files in the tree
Add ability to create a new file of type sass/scss
Add ability to open, edit and save a sass/scss file

Testing Instructions

Install patch and go to template manager and select a template (not a style)
Select New File from the toolbar
Create a new file and select sass from the file type dropdown
Check that file can be seen in the folder tree and can be selected, edited, saved and deleted

@ghost
Copy link
Copy Markdown

ghost commented Apr 12, 2016

I have tested this item 🔴 unsuccessfully on cb02eb7

File cannot be seen, but it exist. Cause make a new File with same Name and Place in Folder got Error

"File with the same name already exists. Failed to create file."

Test on Joomla! 3.5.2-dev


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on cb02eb7

Works fine, but i need to many added 'sass' extension to templates "Options" to view the created file in the list os files.

After that i did:

  1. Selected css dir
  2. New file type 'sass' named 'template'
  3. Created and can view and edit it.
    This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

BTW you can also have scss file extensions? right?

SCSS is the new version of SASS, i think.
http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax

@brianteeman
Copy link
Copy Markdown
Contributor Author

@andrepereiradasilva yes you can but its not as common

I think I see the problem you both had and I dont know how to fix it. I am adding the file type sass in the options but its not seen until you open and save the options


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

@andrepereiradasilva yes you can but its not as common

Yes, but it seems in the new version, so if adding sass, shouldn't we also add scss?

I think I see the problem you both had and I dont know how to fix it. I am adding the file type sass in the options but its not seen until you open and save the options

i only see two ways: force updating the options parameters in the database on joomla update (IMO not B/C)... or adding a post install message to inform users of the change and what they need to do. I don't like neither. Most users don't even use this options. Is it worth it?

@brianteeman
Copy link
Copy Markdown
Contributor Author

We could add scss no problem

I think the database update is what has been done before but I am not sure.
Maybe someone else knows. I definitely wouldnt go with the post-install
message

On 12 April 2016 at 17:29, andrepereiradasilva notifications@github.com
wrote:

@andrepereiradasilva https://github.com/andrepereiradasilva yes you can
but its not as common

Yes, but it seems in the new version, so if adding sass, shouldn't we also
add scss?

I think I see the problem you both had and I dont know how to fix it. I am
adding the file type sass in the options but its not seen until you open
and save the options

i only see two ways: force updating the options parameters in the database
on joomla update (IMO not B/C)... or adding a post install message to
inform users of the change and what they need to do. I don't like neither.
Most users don't even use this options. Is it worth it?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#9871 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

We could add scss no problem

yes

@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @andrepereiradasilva, @franz-wohlkoenig


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @andrepereiradasilva, @franz-wohlkoenig


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@brianteeman
Copy link
Copy Markdown
Contributor Author

Updated to include scss files


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@brianteeman brianteeman changed the title Add basic support for sass files to Template manager editing Add basic support for sass/scss files to Template manager editing Apr 12, 2016
@andrepereiradasilva
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 5d83f8b


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented Apr 12, 2016

@brianteeman i don't think we should overrwrite it with a db update as this can ause problems if somone has add / cahnge this setting bevor the update. (e.g. removed some extensions) if we include the db update we revert all changes he made.

So this one will be only for new installs.

The other way arround could be to analyse this setting during the update (script.php) and only add this two values in (if not set bevor) but leave the other one allown.

But i think this is to mich code for a that simple change and if someone is come up and wantbto use it there can be a document page that explains the place to add the extensions.

Another way arround could be a messagebif someone try to create a file with a extesion that is not in the allowed extension setting amd told the user "please add the extension to the settings" or something like that.

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented Apr 12, 2016

The seccond option would also catch the case that somone manually removend some extensions form that list.

@brianteeman
Copy link
Copy Markdown
Contributor Author

I agree with your assessment - any idea how to do the second option?

On 12 April 2016 at 18:13, zero-24 notifications@github.com wrote:

The seccond option would also catch the case that somone manually removend
some extensions form that list.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9871 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented Apr 12, 2016

Please have a look at: brianteeman#9

zero-24 and others added 2 commits April 12, 2016 22:01
Add a message if the filetype is allowed but you are not allowed to show it in the backend
@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @andrepereiradasilva, @franz-wohlkoenig


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@joomla-cms-bot joomla-cms-bot added the Language Change This is for Translators label Apr 12, 2016
@brianteeman
Copy link
Copy Markdown
Contributor Author

I have merged the suggestion from @zero-24 please can you all test again


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

return false;
}

$explodeArray = explode('.', $fileName);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this for and why are we removing it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I'm pretty sure this is going to break the less stuff as $ext is no longer defined for the line below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was from @zero-24 commit to my repo. Didnt understand it but took him at his word

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks fine with the exception of the removal of these two lines. Was there a reason for it @zero-24 ? Or just a mistake?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wilsonge you are correct i have changed this part many times on coding but i miss the final code review see here: brianteeman#10

@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @andrepereiradasilva, @franz-wohlkoenig


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@brianteeman
Copy link
Copy Markdown
Contributor Author

I have merged @zero-24 latest correction

@ghost
Copy link
Copy Markdown

ghost commented Apr 13, 2016

I have tested this item ✅ successfully on 2516589

Tested to create sass/scss-Files on Beez3, Hathor, Isis and Protostar. Got now Message why Files aren't shown.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@brianteeman
Copy link
Copy Markdown
Contributor Author

And are they shown after you make the change from the message

On 13 April 2016 at 07:01, Franz Wohlkönig notifications@github.com wrote:

I have tested this item [image: ✅] successfully on
2516589
2516589

Tested to create sass/scss-Files on Beez3, Hathor, Isis and Protostar. Got

now Message why Files aren't shown.

This comment was created with the J!Tracker Application
https://github.com/joomla/jissues at issues.joomla.org/joomla-cms/9871
https://issues.joomla.org/tracker/joomla-cms/9871.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9871 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@ghost
Copy link
Copy Markdown

ghost commented Apr 13, 2016

I thought its enough to know why the Files don't show. I don't know so i have to search how to "append the new File-Extensions in the List of supported Formats at the Template-Options".

@brianteeman
Copy link
Copy Markdown
Contributor Author

On the main template manager screen select options from the toolbar in the top right.
Then add sass and scss to the list of Valid Source Formats
eg
txt,less,ini,xml,js,php,css,sass,scss

@ghost
Copy link
Copy Markdown

ghost commented Apr 13, 2016

Thanks @brianteeman Yes, they are now shown.

@brianteeman
Copy link
Copy Markdown
Contributor Author

Thanks for testing

On 13 April 2016 at 09:21, Franz Wohlkönig notifications@github.com wrote:

Thanks @brianteeman https://github.com/brianteeman Yes, they are now
shown.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#9871 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

so what's needed to test now ?

@brianteeman
Copy link
Copy Markdown
Contributor Author

@andrepereiradasilva as before but if after applying the patch you have not updated the list of allowed extensions in the options you will still be able to create a file but you cant see it and so a message will be displayed

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 2516589

I think what was left to test is the message when you don't have the filetype in the template config options.

If so, tested successfully.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

ok, just tested. :)

@brianteeman
Copy link
Copy Markdown
Contributor Author

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Apr 13, 2016
@brianteeman brianteeman added this to the Joomla! 3.6.0 milestone Apr 13, 2016
@rdeutz
Copy link
Copy Markdown
Contributor

rdeutz commented May 2, 2016

@brianteeman cloud you please check the merge conflicts, thanks

*
* @return boolean true if the extension is allowed false otherwise
*
* @since 3.5.3
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brianteeman can you fix than this since tag to 3.6 too?

# Conflicts:
#	plugins/editors/tinymce/tinymce.php
@joomla-cms-bot
Copy link
Copy Markdown

This PR has received new commits.

CC: @andrepereiradasilva, @franz-wohlkoenig


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9871.

@wojsmol
Copy link
Copy Markdown
Contributor

wojsmol commented May 2, 2016

@brianteeman Plese remove conficts markers

@brianteeman brianteeman removed the RTC This Pull Request is Ready To Commit label May 2, 2016
@brianteeman
Copy link
Copy Markdown
Contributor Author

Closed see #10186

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label May 2, 2016
@brianteeman brianteeman closed this May 2, 2016
@joomla-cms-bot joomla-cms-bot reopened this May 2, 2016
@brianteeman brianteeman removed the RTC This Pull Request is Ready To Commit label May 2, 2016
@brianteeman brianteeman closed this May 2, 2016
@rdeutz rdeutz removed this from the Joomla! 3.6.0 milestone May 2, 2016
@brianteeman brianteeman deleted the sass2 branch May 9, 2016 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants